Gromacs  2026.0-dev-20250113-1a1a8db
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Classes | Public Member Functions
gmx::DeviceStreamManager Class Reference

#include <gromacs/gpu_utils/device_stream_manager.h>

Description

Device stream and context manager.

Given information on which device to use and what to compute with it, objects of this class manage the lifetime of the GPU context and streams.

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.

Classes

class  Impl
 Impl class to manages the lifetime of the GPU context and streams. More...
 

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 device context.
 
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.

Activates the device described by deviceInfo

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

Member Function Documentation

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: