Gromacs  2024.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
DeviceStream Class Reference

#include <gromacs/gpu_utils/device_stream.h>

Description

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 (e.g. CUDA and OpenCL).

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.
 

Constructor & Destructor Documentation

DeviceStream::DeviceStream ( const DeviceContext &  deviceContext,
DeviceStreamPriority  priority,
bool  useTiming 
)

Construct and init.

Parameters
[in]deviceContextDevice context (only used in OpenCL and SYCL).
[in]priorityStream priority: high or normal (only used in CUDA).
[in]useTimingIf the timing should be enabled (only used in OpenCL and SYCL).

Member Function Documentation

bool DeviceStream::isValid ( ) const

Check if the underlying stream is valid.

Returns
Whether the stream is valid (false in CPU-only builds).

The documentation for this class was generated from the following files: