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

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

#include <tfBondConfig.h>

Static Public Member Functions

static bool onDevice ()
 Check whether the bonds are currently on a device.
 
static int getDevice ()
 Get the id of the device designated for running bonds.
 
static HRESULT setDevice (int deviceId=0)
 Set the id of the device for running bonds.
 
static HRESULT toDevice ()
 Send bonds to device. If bonds are already on device, then the call is ignored.
 
static HRESULT fromDevice ()
 Pull engine from device. If engine is not on a device, then the call is ignored.
 
static HRESULT setBlocks (unsigned int numBlocks)
 Set the number of blocks of the CUDA configuration for a CUDA device.
 
static HRESULT setThreads (unsigned int numThreads)
 Set the number of threads of the CUDA configuration for a CUDA device.
 
static HRESULT refreshBond (BondHandle *bh)
 Update a bond on a CUDA device.
 
static HRESULT refreshBonds (std::vector< BondHandle * > bonds)
 Update bonds on a CUDA device.
 
static HRESULT refresh ()
 Update all bonds on a CUDA device.
 

Detailed Description

CUDA runtime control interface for Tissue Forge bonds.

This object provides control for configuring bond calculations on CUDA devices.

At any time during a simulation, supported bond 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 bond calculations to a CUDA device. Future Tissue Forge versions will support deployment on multiple devices.

Member Function Documentation

◆ fromDevice()

static HRESULT TissueForge::cuda::BondConfig::fromDevice ( )
static

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

Returns
HRESULT

◆ getDevice()

static int TissueForge::cuda::BondConfig::getDevice ( )
static

Get the id of the device designated for running bonds.

Returns
int

◆ onDevice()

static bool TissueForge::cuda::BondConfig::onDevice ( )
static

Check whether the bonds are currently on a device.

Returns
true
false

◆ refresh()

static HRESULT TissueForge::cuda::BondConfig::refresh ( )
static

Update all bonds on a CUDA device.

Useful for notifying the device that bonds have changed.

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

Returns
HRESULT

◆ refreshBond()

static HRESULT TissueForge::cuda::BondConfig::refreshBond ( BondHandle * bh)
static

Update a bond on a CUDA device.

Useful for notifying the device that a bond has changed.

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

Parameters
bhbond to update
Returns
HRESULT

◆ refreshBonds()

static HRESULT TissueForge::cuda::BondConfig::refreshBonds ( std::vector< BondHandle * > bonds)
static

Update bonds on a CUDA device.

Useful for notifying the device that bonds have changed.

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

Parameters
bondsbonds to update
Returns
HRESULT

◆ setBlocks()

static HRESULT TissueForge::cuda::BondConfig::setBlocks ( unsigned int numBlocks)
static

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

Throws an error if called when the bonds are already deployed to a CUDA device.

Parameters
numBlocksnumber of blocks
Returns
HRESULT

◆ setDevice()

static HRESULT TissueForge::cuda::BondConfig::setDevice ( int deviceId = 0)
static

Set the id of the device for running bonds.

Can be safely called while bonds are currently on a device.

Parameters
deviceId
Returns
HRESULT

◆ setThreads()

static HRESULT TissueForge::cuda::BondConfig::setThreads ( unsigned int numThreads)
static

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

Throws an error if called when bonds are already deployed to a CUDA device.

Parameters
numThreadsnumber of threads
Returns
HRESULT

◆ toDevice()

static HRESULT TissueForge::cuda::BondConfig::toDevice ( )
static

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

Returns
HRESULT

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