Gromacs
2025.0-dev-20241011-013a99c
|
#include <gromacs/gpu_utils/device_stream.h>
Declaration of platform-agnostic device stream/queue.
The command stream (or command queue) is a sequence of operations that are executed in they order they were issued. Several streams may co-exist to represent concurrency. This class declares the interfaces, that are exposed to platform-agnostic code and it should be implemented for each compute architecture.
Destruction of the DeviceStream
calls the destructor of the underlying low-level stream/queue, hence should only be called when the stream is no longer needed. To prevent accidental stream destruction, while copying or moving a DeviceStream
object, copy and move constructors and copy and move assignments are not allowed and the DeviceStream
object should be passed as a pointer or constant reference.
Public Member Functions | |
DeviceStream (const DeviceContext &deviceContext, DeviceStreamPriority priority, bool useTiming) | |
Construct and init. More... | |
~DeviceStream () | |
Destructor. | |
bool | isValid () const |
Check if the underlying stream is valid. More... | |
void | synchronize () const |
Synchronize the stream. | |
cl_command_queue | stream () const |
Getter. | |
DeviceStream::DeviceStream | ( | const DeviceContext & | deviceContext, |
DeviceStreamPriority | priority, | ||
bool | useTiming | ||
) |
Construct and init.
[in] | deviceContext | Device context. |
[in] | priority | Stream priority: high or normal (ignored in OpenCL). |
[in] | useTiming | If the timing should be enabled (ignored in CUDA). |
bool DeviceStream::isValid | ( | ) | const |
Check if the underlying stream is valid.