Tissue Forge C++ 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
TissueForge::cuda::EngineConfig Struct Reference

CUDA runtime control interface for Tissue Forge engine. More...

#include <tfEngineConfig.h>

Public Member Functions

bool onDevice ()
 Check whether the engine is currently on a device.
 
int getDevice ()
 Get the id of the device running the engine.
 
HRESULT setDevice (int deviceId=0)
 Set the id of the device for running the engine.
 
HRESULT clearDevice ()
 Clear configured device for the engine.
 
HRESULT toDevice ()
 Send engine to device. If engine is already on device, then the call is ignored.
 
HRESULT fromDevice ()
 Pull engine from device. If engine is not on a device, then the call is ignored.
 
HRESULT setBlocks (unsigned int numBlocks, int deviceId=-1)
 Set the number of blocks of the CUDA configuration for a CUDA device.
 
HRESULT setThreads (unsigned int numThreads, int deviceId=-1)
 Set the number of threads of the CUDA configuration for a CUDA device.
 
HRESULT refreshPotentials ()
 Update potentials on a CUDA device.
 
HRESULT refreshFluxes ()
 Update fluxes on a CUDA device.
 
HRESULT refreshBoundaryConditions ()
 Update boundary conditions on a CUDA device.
 
HRESULT refresh ()
 Update the image of the engine on a CUDA device.
 

Detailed Description

CUDA runtime control interface for Tissue Forge engine.

This object provides control for configuring engine calculations on CUDA devices. Associated calculations include nonbonded particle interactions and sorting, fluxes and space partitioning.

At any time during a simulation, supported engine calculations can be sent to a particular CUDA device, or brought back to the CPU when deployed on a CUDA device. CUDA dynamic parallelism can also be specified before deploying engine calculations to a CUDA device. Future Tissue Forge versions will support deployment on multiple devices.

Member Function Documentation

◆ clearDevice()

HRESULT TissueForge::cuda::EngineConfig::clearDevice ( )

Clear configured device for the engine.

Fails if engine is currently on a device.

Returns
HRESULT

◆ fromDevice()

HRESULT TissueForge::cuda::EngineConfig::fromDevice ( )

Pull engine from device. If engine is not on a device, then the call is ignored.

Returns
HRESULT

◆ getDevice()

int TissueForge::cuda::EngineConfig::getDevice ( )

Get the id of the device running the engine.

Returns -1 if engine is not on a device.

Returns
int

◆ onDevice()

bool TissueForge::cuda::EngineConfig::onDevice ( )

Check whether the engine is currently on a device.

Returns
true
false

◆ refresh()

HRESULT TissueForge::cuda::EngineConfig::refresh ( )

Update the image of the engine on a CUDA device.

Necessary to notify the device of changes to engine data that are not automatically handled by Tissue Forge. Refer to documentation of specific functions and members for which Tissue Forge automatically handles.

If engine is not on a device, then the call is ignored.

Returns
HRESULT

◆ refreshBoundaryConditions()

HRESULT TissueForge::cuda::EngineConfig::refreshBoundaryConditions ( )

Update boundary conditions on a CUDA device.

Useful for notifying the device that a boundary condition has changed.

If engine is not on a device, then the call is ignored.

Returns
HRESULT

◆ refreshFluxes()

HRESULT TissueForge::cuda::EngineConfig::refreshFluxes ( )

Update fluxes on a CUDA device.

Useful for notifying the device that a flux has changed.

If engine is not on a device, then the call is ignored.

Returns
HRESULT

◆ refreshPotentials()

HRESULT TissueForge::cuda::EngineConfig::refreshPotentials ( )

Update potentials on a CUDA device.

Useful for notifying the device that a potential has changed.

If engine is not on a device, then the call is ignored.

Returns
HRESULT

◆ setBlocks()

HRESULT TissueForge::cuda::EngineConfig::setBlocks ( unsigned int numBlocks,
int deviceId = -1 )

Set the number of blocks of the CUDA configuration for a CUDA device.

Throws an error if called when the engine is already deployed to a CUDA device.

Parameters
numBlocksnumber of blocks
deviceIddevice ID (optional)
Returns
HRESULT

◆ setDevice()

HRESULT TissueForge::cuda::EngineConfig::setDevice ( int deviceId = 0)

Set the id of the device for running the engine.

Fails if engine is currently on a device.

Parameters
deviceId
Returns
HRESULT

◆ setThreads()

HRESULT TissueForge::cuda::EngineConfig::setThreads ( unsigned int numThreads,
int deviceId = -1 )

Set the number of threads of the CUDA configuration for a CUDA device.

Throws an error if called when the engine is already deployed to a CUDA device.

Parameters
numThreadsnumber of threads
deviceIddevice ID (optional)
Returns
HRESULT

◆ toDevice()

HRESULT TissueForge::cuda::EngineConfig::toDevice ( )

Send engine to device. If engine is already on device, then the call is ignored.

Returns
HRESULT

The documentation for this struct was generated from the following file: