(for coordinate and force buffers) directly on GPU memory spaces, without the staging of data through CPU
memory, where possible.
+``GMX_GPU_SYCL_NO_SYNCHRONIZE``
+ disable synchronizations between different GPU streams in SYCL build, instead relying on SYCL runtime to
+ do scheduling based on data dependencies. Experimental.
+
``GMX_CYCLE_ALL``
times all code during runs. Incompatible with threads.
{
public:
//! A constructor.
- GpuEventSynchronizer() = default;
+ GpuEventSynchronizer()
+ {
+ doNotSynchronizeBetweenStreams_ = (std::getenv("GMX_GPU_SYCL_NO_SYNCHRONIZE") != nullptr);
+ }
//! A constructor from an existing event.
GpuEventSynchronizer(const cl::sycl::event& event) : event_(event) {}
//! A destructor.
*/
inline void enqueueWaitEvent(const DeviceStream& deviceStream)
{
+ if (doNotSynchronizeBetweenStreams_)
+ {
+ event_.reset();
+ return;
+ }
# if GMX_SYCL_HIPSYCL
deviceStream.stream().wait_and_throw(); // SYCL-TODO: Use CUDA/HIP-specific solutions
# else
private:
std::optional<cl::sycl::event> event_ = std::nullopt;
+ /*! \brief Dev. setting to no-op enqueueWaitEvent
+ *
+ * In SYCL, dependencies between the GPU tasks are managed by the runtime, so manual
+ * synchronization between GPU streams should be redundant, but we keep it on by default.
+ *
+ * Setting this to \c true via \c GMX_GPU_SYCL_NO_SYNCHRONIZE environment variable will
+ * immediately return from \ref enqueueWaitEvent, without placing a barrier into the stream.
+ */
+ bool doNotSynchronizeBetweenStreams_;
};
#endif // !defined DOXYGEN