Gromacs  2023.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::DeviceStreamManager Class Reference

#include <gromacs/gpu_utils/device_stream_manager.h>

Description

Device stream and context manager.

Manages the lifetime of the GPU streams and their association with context and device information that is needed to use them.

If supported by the GPU API, the available runtime and the indicated device, some streams will be configured at high priority. Otherwise, all streams will share the default priority appropriate to the situation.

Public Member Functions

 DeviceStreamManager (const DeviceInformation &deviceInfo, SimulationWorkload simulationWork, bool useTiming)
 Constructor. More...
 
const DeviceInformationdeviceInfo () const
 Get the device information object of the associated device. More...
 
const DeviceContext & context () const
 Returns a handle to the GPU context. More...
 
const DeviceStreamstream (DeviceStreamType streamToGet) const
 Returns a handle to the requested GPU stream. More...
 
const DeviceStreambondedStream () const
 Returns a handle to the GPU stream to compute bonded forces in.
 
bool streamIsValid (DeviceStreamType streamToCheck) const
 Return whether the requested GPU stream is valid for use. More...
 

Constructor & Destructor Documentation

gmx::DeviceStreamManager::DeviceStreamManager ( const DeviceInformation deviceInfo,
SimulationWorkload  simulationWork,
bool  useTiming 
)

Constructor.

Exceptions
InternalErrorIf any of the required resources could not be initialized.

Member Function Documentation

const DeviceContext & gmx::DeviceStreamManager::context ( ) const

Returns a handle to the GPU context.

Todo:
This relies on the fact that only one unique device is described by nonbondedDeviceInfo and pmeDeviceInfo.
const DeviceInformation & gmx::DeviceStreamManager::deviceInfo ( ) const

Get the device information object of the associated device.

Returns
reference to device info.
const DeviceStream & gmx::DeviceStreamManager::stream ( DeviceStreamType  streamToGet) const

Returns a handle to the requested GPU stream.

Parameters
[in]streamToGetWhich stream to get.
bool gmx::DeviceStreamManager::streamIsValid ( DeviceStreamType  streamToCheck) const

Return whether the requested GPU stream is valid for use.

Parameters
[in]streamToCheckWhich stream to check.
Returns
Whether the stream was initialized.

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