Tissue Forge C 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tfC_cuda.h File Reference
#include "tf_port_c.h"
#include "tfCBond.h"
Include dependency graph for tfC_cuda.h:

Go to the source code of this file.

Data Structures

struct  tfCudaEngineConfigHandle
 Handle to a cuda::EngineConfig instance. More...
 
struct  tfCudaBondConfigHandle
 Handle to a cuda::BondConfig instance. More...
 
struct  tfCudaAngleConfigHandle
 Handle to a cuda::AngleConfig instance. More...
 
struct  tfCudaSimulatorConfigHandle
 Handle to a cuda::SimulatorConfig instance. More...
 

Functions

HRESULT tfCudaEngineConfig_onDevice (struct tfCudaEngineConfigHandle *handle, bool *onDevice)
 Check whether the engine is currently on a device.
 
HRESULT tfCudaEngineConfig_getDevice (struct tfCudaEngineConfigHandle *handle, int *deviceId)
 Get the id of the device running the engine.
 
HRESULT tfCudaEngineConfig_setDevice (struct tfCudaEngineConfigHandle *handle, unsigned int deviceId)
 Set the id of the device for running the engine.
 
HRESULT tfCudaEngineConfig_clearDevice (struct tfCudaEngineConfigHandle *handle)
 Clear configured device for the engine.
 
HRESULT tfCudaEngineConfig_toDevice (struct tfCudaEngineConfigHandle *handle)
 Send engine to device. If engine is already on device, then the call is ignored.
 
HRESULT tfCudaEngineConfig_fromDevice (struct tfCudaEngineConfigHandle *handle)
 Pull engine from device. If engine is not on a device, then the call is ignored.
 
HRESULT tfCudaEngineConfig_setBlocks (struct tfCudaEngineConfigHandle *handle, unsigned int numBlocks)
 Set the number of blocks of the CUDA configuration for the current CUDA device.
 
HRESULT tfCudaEngineConfig_setThreads (struct tfCudaEngineConfigHandle *handle, unsigned int numThreads)
 Set the number of threads of the CUDA configuration for the current CUDA device.
 
HRESULT tfCudaEngineConfig_refreshPotentials (struct tfCudaEngineConfigHandle *handle)
 Update potentials on a CUDA device.
 
HRESULT tfCudaEngineConfig_refreshFluxes (struct tfCudaEngineConfigHandle *handle)
 Update fluxes on a CUDA device.
 
HRESULT tfCudaEngineConfig_refreshBoundaryConditions (struct tfCudaEngineConfigHandle *handle)
 Update boundary conditions on a CUDA device.
 
HRESULT tfCudaEngineConfig_refresh (struct tfCudaEngineConfigHandle *handle)
 Update the image of the engine on a CUDA device.
 
HRESULT tfCudaBondConfig_onDevice (struct tfCudaBondConfigHandle *handle, bool *onDevice)
 Check whether the bonds are currently on a device.
 
HRESULT tfCudaBondConfig_getDevice (struct tfCudaBondConfigHandle *handle, int *deviceId)
 Get the id of the device designated for running bonds.
 
HRESULT tfCudaBondConfig_setDevice (struct tfCudaBondConfigHandle *handle, unsigned int deviceId)
 Set the id of the device for running bonds.
 
HRESULT tfCudaBondConfig_toDevice (struct tfCudaBondConfigHandle *handle)
 Send bonds to device. If bonds are already on device, then the call is ignored.
 
HRESULT tfCudaBondConfig_fromDevice (struct tfCudaBondConfigHandle *handle)
 Pull engine from device. If engine is not on a device, then the call is ignored.
 
HRESULT tfCudaBondConfig_setBlocks (struct tfCudaBondConfigHandle *handle, unsigned int numBlocks)
 Set the number of blocks of the CUDA configuration for a CUDA device.
 
HRESULT tfCudaBondConfig_setThreads (struct tfCudaBondConfigHandle *handle, unsigned int numThreads)
 Set the number of threads of the CUDA configuration for a CUDA device.
 
HRESULT tfCudaBondConfig_refreshBond (struct tfCudaBondConfigHandle *handle, struct tfBondHandleHandle *bh)
 Update a bond on a CUDA device.
 
HRESULT tfCudaBondConfig_refreshBonds (struct tfCudaBondConfigHandle *handle, struct tfBondHandleHandle **bonds, unsigned int numBonds)
 Update bonds on a CUDA device.
 
HRESULT tfCudaBondConfig_refresh (struct tfCudaBondConfigHandle *handle)
 Update all bonds on a CUDA device.
 
HRESULT tfCudaAngleConfig_onDevice (struct tfCudaAngleConfigHandle *handle, bool *onDevice)
 Check whether the angles are currently on a device.
 
HRESULT tfCudaAngleConfig_getDevice (struct tfCudaAngleConfigHandle *handle, int *deviceId)
 Get the id of the device designated for running angles.
 
HRESULT tfCudaAngleConfig_toDevice (struct tfCudaAngleConfigHandle *handle)
 Send angles to device. If angles are already on device, then the call is ignored.
 
HRESULT tfCudaAngleConfig_fromDevice (struct tfCudaAngleConfigHandle *handle)
 Pull engine from device. If engine is not on a device, then the call is ignored.
 
HRESULT tfCudaAngleConfig_setBlocks (struct tfCudaAngleConfigHandle *handle, unsigned int numBlocks)
 Set the number of blocks of the CUDA configuration for a CUDA device.
 
HRESULT tfCudaAngleConfig_setThreads (struct tfCudaAngleConfigHandle *handle, unsigned int numThreads)
 Set the number of threads of the CUDA configuration for a CUDA device.
 
HRESULT tfCudaAngleConfig_refreshAngle (struct tfCudaAngleConfigHandle *handle, struct tfAngleHandleHandle *bh)
 Update a angle on a CUDA device.
 
HRESULT tfCudaAngleConfig_refreshAngles (struct tfCudaAngleConfigHandle *handle, struct tfAngleHandleHandle **angles, unsigned int numAngles)
 Update angles on a CUDA device.
 
HRESULT tfCudaAngleConfig_refresh (struct tfCudaAngleConfigHandle *handle)
 Update all angles on a CUDA device.
 
HRESULT tfSimulator_getCUDAConfig (struct tfCudaSimulatorConfigHandle *handle)
 Get simulator CUDA runtime interface.
 
HRESULT tfSimulatorCUDAConfig_getEngine (struct tfCudaSimulatorConfigHandle *handle, struct tfCudaEngineConfigHandle *itf)
 Get the engine CUDA runtime control interface.
 
HRESULT tfSimulatorCUDAConfig_getBonds (struct tfCudaSimulatorConfigHandle *handle, struct tfCudaBondConfigHandle *itf)
 Get the bond CUDA runtime control interface.
 
HRESULT tfSimulatorCUDAConfig_getAngles (struct tfCudaSimulatorConfigHandle *handle, struct tfCudaAngleConfigHandle *itf)
 Get the angle CUDA runtime control interface.
 
HRESULT tfCudaArchs (char **str, unsigned int *numChars)
 Get the supported CUDA architectures of this installation.
 

Function Documentation

◆ tfCudaAngleConfig_fromDevice()

HRESULT tfCudaAngleConfig_fromDevice ( struct tfCudaAngleConfigHandle * handle)

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

Parameters
handlepopulated handle
Returns
S_OK on success

◆ tfCudaAngleConfig_getDevice()

HRESULT tfCudaAngleConfig_getDevice ( struct tfCudaAngleConfigHandle * handle,
int * deviceId )

Get the id of the device designated for running angles.

Parameters
handlepopulated handle
deviceIddevice id; -1 if engine is not on a device
Returns
S_OK on success

◆ tfCudaAngleConfig_onDevice()

HRESULT tfCudaAngleConfig_onDevice ( struct tfCudaAngleConfigHandle * handle,
bool * onDevice )

Check whether the angles are currently on a device.

Parameters
handlepopulated handle
onDevicetrue if currently on a device
Returns
S_OK on success

◆ tfCudaAngleConfig_refresh()

HRESULT tfCudaAngleConfig_refresh ( struct tfCudaAngleConfigHandle * handle)

Update all angles on a CUDA device.

Useful for notifying the device that angles have changed.

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

Parameters
handlepopulated handle
Returns
S_OK on success

◆ tfCudaAngleConfig_refreshAngle()

HRESULT tfCudaAngleConfig_refreshAngle ( struct tfCudaAngleConfigHandle * handle,
struct tfAngleHandleHandle * bh )

Update a angle on a CUDA device.

Useful for notifying the device that a angle has changed.

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

Parameters
handlepopulated handle
bhangle to update
Returns
S_OK on success

◆ tfCudaAngleConfig_refreshAngles()

HRESULT tfCudaAngleConfig_refreshAngles ( struct tfCudaAngleConfigHandle * handle,
struct tfAngleHandleHandle ** angles,
unsigned int numAngles )

Update angles on a CUDA device.

Useful for notifying the device that angles have changed.

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

Parameters
handlepopulated handle
anglesangles to update
numAnglesnumber of bonds
Returns
S_OK on success

◆ tfCudaAngleConfig_setBlocks()

HRESULT tfCudaAngleConfig_setBlocks ( struct tfCudaAngleConfigHandle * handle,
unsigned int numBlocks )

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

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

Parameters
handlepopulated handle
numBlocksnumber of blocks
Returns
S_OK on success

◆ tfCudaAngleConfig_setThreads()

HRESULT tfCudaAngleConfig_setThreads ( struct tfCudaAngleConfigHandle * handle,
unsigned int numThreads )

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

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

Parameters
handlepopulated handle
numThreadsnumber of threads
Returns
S_OK on success

◆ tfCudaAngleConfig_toDevice()

HRESULT tfCudaAngleConfig_toDevice ( struct tfCudaAngleConfigHandle * handle)

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

Parameters
handlepopulated handle
Returns
S_OK on success

◆ tfCudaArchs()

HRESULT tfCudaArchs ( char ** str,
unsigned int * numChars )

Get the supported CUDA architectures of this installation.

Parameters
strarchitectures
numCharsnumber of characters
Returns
S_OK on success

◆ tfCudaBondConfig_fromDevice()

HRESULT tfCudaBondConfig_fromDevice ( struct tfCudaBondConfigHandle * handle)

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

Parameters
handlepopulated handle
Returns
S_OK on success

◆ tfCudaBondConfig_getDevice()

HRESULT tfCudaBondConfig_getDevice ( struct tfCudaBondConfigHandle * handle,
int * deviceId )

Get the id of the device designated for running bonds.

Parameters
handlepopulated handle
deviceIddevice id; -1 if engine is not on a device
Returns
S_OK on success

◆ tfCudaBondConfig_onDevice()

HRESULT tfCudaBondConfig_onDevice ( struct tfCudaBondConfigHandle * handle,
bool * onDevice )

Check whether the bonds are currently on a device.

Parameters
handlepopulated handle
onDevicetrue if currently on a device
Returns
S_OK on success

◆ tfCudaBondConfig_refresh()

HRESULT tfCudaBondConfig_refresh ( struct tfCudaBondConfigHandle * handle)

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.

Parameters
handlepopulated handle
Returns
S_OK on success

◆ tfCudaBondConfig_refreshBond()

HRESULT tfCudaBondConfig_refreshBond ( struct tfCudaBondConfigHandle * handle,
struct tfBondHandleHandle * bh )

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
handlepopulated handle
bhbond to update
Returns
S_OK on success

◆ tfCudaBondConfig_refreshBonds()

HRESULT tfCudaBondConfig_refreshBonds ( struct tfCudaBondConfigHandle * handle,
struct tfBondHandleHandle ** bonds,
unsigned int numBonds )

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
handlepopulated handle
bondsbonds to update
numBondsnumber of bonds
Returns
S_OK on success

◆ tfCudaBondConfig_setBlocks()

HRESULT tfCudaBondConfig_setBlocks ( struct tfCudaBondConfigHandle * handle,
unsigned int numBlocks )

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
handlepopulated handle
numBlocksnumber of blocks
Returns
S_OK on success

◆ tfCudaBondConfig_setDevice()

HRESULT tfCudaBondConfig_setDevice ( struct tfCudaBondConfigHandle * handle,
unsigned int deviceId )

Set the id of the device for running bonds.

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

Parameters
handlepopulated handle
deviceIddevice id
Returns
S_OK on success

◆ tfCudaBondConfig_setThreads()

HRESULT tfCudaBondConfig_setThreads ( struct tfCudaBondConfigHandle * handle,
unsigned int numThreads )

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
handlepopulated handle
numThreadsnumber of threads
Returns
S_OK on success

◆ tfCudaBondConfig_toDevice()

HRESULT tfCudaBondConfig_toDevice ( struct tfCudaBondConfigHandle * handle)

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

Parameters
handlepopulated handle
Returns
S_OK on success

◆ tfCudaEngineConfig_clearDevice()

HRESULT tfCudaEngineConfig_clearDevice ( struct tfCudaEngineConfigHandle * handle)

Clear configured device for the engine.

Fails if engine is currently on a device.

Parameters
handlepopulated handle
Returns
S_OK on success

◆ tfCudaEngineConfig_fromDevice()

HRESULT tfCudaEngineConfig_fromDevice ( struct tfCudaEngineConfigHandle * handle)

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

Parameters
handlepopulated handle
Returns
S_OK on success

◆ tfCudaEngineConfig_getDevice()

HRESULT tfCudaEngineConfig_getDevice ( struct tfCudaEngineConfigHandle * handle,
int * deviceId )

Get the id of the device running the engine.

Parameters
handlepopulated handle
deviceIddevice id; -1 if engine is not on a device
Returns
S_OK on success

◆ tfCudaEngineConfig_onDevice()

HRESULT tfCudaEngineConfig_onDevice ( struct tfCudaEngineConfigHandle * handle,
bool * onDevice )

Check whether the engine is currently on a device.

Parameters
handlepopulated handle
onDevicetrue if currently on a device
Returns
S_OK on success

◆ tfCudaEngineConfig_refresh()

HRESULT tfCudaEngineConfig_refresh ( struct tfCudaEngineConfigHandle * handle)

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.

Parameters
handlepopulated handle
Returns
S_OK on success

◆ tfCudaEngineConfig_refreshBoundaryConditions()

HRESULT tfCudaEngineConfig_refreshBoundaryConditions ( struct tfCudaEngineConfigHandle * handle)

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.

Parameters
handlepopulated handle
Returns
S_OK on success

◆ tfCudaEngineConfig_refreshFluxes()

HRESULT tfCudaEngineConfig_refreshFluxes ( struct tfCudaEngineConfigHandle * handle)

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.

Parameters
handlepopulated handle
Returns
S_OK on success

◆ tfCudaEngineConfig_refreshPotentials()

HRESULT tfCudaEngineConfig_refreshPotentials ( struct tfCudaEngineConfigHandle * handle)

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.

Parameters
handlepopulated handle
Returns
S_OK on success

◆ tfCudaEngineConfig_setBlocks()

HRESULT tfCudaEngineConfig_setBlocks ( struct tfCudaEngineConfigHandle * handle,
unsigned int numBlocks )

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

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

Parameters
handlepopulated handle
numBlocksnumber of blocks
Returns
S_OK on success

◆ tfCudaEngineConfig_setDevice()

HRESULT tfCudaEngineConfig_setDevice ( struct tfCudaEngineConfigHandle * handle,
unsigned int deviceId )

Set the id of the device for running the engine.

Fails if engine is currently on a device.

Parameters
handlepopulated handle
deviceIddevice id
Returns
S_OK on success

◆ tfCudaEngineConfig_setThreads()

HRESULT tfCudaEngineConfig_setThreads ( struct tfCudaEngineConfigHandle * handle,
unsigned int numThreads )

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

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

Parameters
handlepopulated handle
numThreadsnumber of threads
Returns
S_OK on success

◆ tfCudaEngineConfig_toDevice()

HRESULT tfCudaEngineConfig_toDevice ( struct tfCudaEngineConfigHandle * handle)

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

Parameters
handlepopulated handle
Returns
S_OK on success

◆ tfSimulator_getCUDAConfig()

HRESULT tfSimulator_getCUDAConfig ( struct tfCudaSimulatorConfigHandle * handle)

Get simulator CUDA runtime interface.

Parameters
handlehandle to populate
Returns
S_OK on success

◆ tfSimulatorCUDAConfig_getAngles()

HRESULT tfSimulatorCUDAConfig_getAngles ( struct tfCudaSimulatorConfigHandle * handle,
struct tfCudaAngleConfigHandle * itf )

Get the angle CUDA runtime control interface.

Parameters
handlepopulated handle
itfcontrol interface
Returns
S_OK on success

◆ tfSimulatorCUDAConfig_getBonds()

HRESULT tfSimulatorCUDAConfig_getBonds ( struct tfCudaSimulatorConfigHandle * handle,
struct tfCudaBondConfigHandle * itf )

Get the bond CUDA runtime control interface.

Parameters
handlepopulated handle
itfcontrol interface
Returns
S_OK on success

◆ tfSimulatorCUDAConfig_getEngine()

HRESULT tfSimulatorCUDAConfig_getEngine ( struct tfCudaSimulatorConfigHandle * handle,
struct tfCudaEngineConfigHandle * itf )

Get the engine CUDA runtime control interface.

Parameters
handlepopulated handle
itfcontrol interface
Returns
S_OK on success