Tissue Forge C 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tfC_cuda.h
Go to the documentation of this file.
1/*******************************************************************************
2 * This file is part of Tissue Forge.
3 * Copyright (c) 2022-2024 T.J. Sego
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published
7 * by the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 ******************************************************************************/
19
24
25#ifndef _WRAPS_C_TFC_CUDA_H_
26#define _WRAPS_C_TFC_CUDA_H_
27
28#include "tf_port_c.h"
29
30#include "tfCBond.h"
31
32// Handles
33
38struct CAPI_EXPORT tfCudaEngineConfigHandle {
39 void *tfObj;
40};
41
46struct CAPI_EXPORT tfCudaBondConfigHandle {
47 void *tfObj;
48};
49
54struct CAPI_EXPORT tfCudaAngleConfigHandle {
55 void *tfObj;
56};
57
62struct CAPI_EXPORT tfCudaSimulatorConfigHandle {
63 void *tfObj;
64};
65
66
68// cuda::EngineConfig //
70
71
79CAPI_FUNC(HRESULT) tfCudaEngineConfig_onDevice(struct tfCudaEngineConfigHandle *handle, bool *onDevice);
80
88CAPI_FUNC(HRESULT) tfCudaEngineConfig_getDevice(struct tfCudaEngineConfigHandle *handle, int *deviceId);
89
99CAPI_FUNC(HRESULT) tfCudaEngineConfig_setDevice(struct tfCudaEngineConfigHandle *handle, unsigned int deviceId);
100
110
117CAPI_FUNC(HRESULT) tfCudaEngineConfig_toDevice(struct tfCudaEngineConfigHandle *handle);
118
126
136CAPI_FUNC(HRESULT) tfCudaEngineConfig_setBlocks(struct tfCudaEngineConfigHandle *handle, unsigned int numBlocks);
137
147CAPI_FUNC(HRESULT) tfCudaEngineConfig_setThreads(struct tfCudaEngineConfigHandle *handle, unsigned int numThreads);
148
160
172
184
198CAPI_FUNC(HRESULT) tfCudaEngineConfig_refresh(struct tfCudaEngineConfigHandle *handle);
199
200
202// cuda::BondConfig //
204
205
213CAPI_FUNC(HRESULT) tfCudaBondConfig_onDevice(struct tfCudaBondConfigHandle *handle, bool *onDevice);
214
222CAPI_FUNC(HRESULT) tfCudaBondConfig_getDevice(struct tfCudaBondConfigHandle *handle, int *deviceId);
223
233CAPI_FUNC(HRESULT) tfCudaBondConfig_setDevice(struct tfCudaBondConfigHandle *handle, unsigned int deviceId);
234
241CAPI_FUNC(HRESULT) tfCudaBondConfig_toDevice(struct tfCudaBondConfigHandle *handle);
242
249CAPI_FUNC(HRESULT) tfCudaBondConfig_fromDevice(struct tfCudaBondConfigHandle *handle);
250
260CAPI_FUNC(HRESULT) tfCudaBondConfig_setBlocks(struct tfCudaBondConfigHandle *handle, unsigned int numBlocks);
261
271CAPI_FUNC(HRESULT) tfCudaBondConfig_setThreads(struct tfCudaBondConfigHandle *handle, unsigned int numThreads);
272
284CAPI_FUNC(HRESULT) tfCudaBondConfig_refreshBond(struct tfCudaBondConfigHandle *handle, struct tfBondHandleHandle *bh);
285
298CAPI_FUNC(HRESULT) tfCudaBondConfig_refreshBonds(struct tfCudaBondConfigHandle *handle, struct tfBondHandleHandle **bonds, unsigned int numBonds);
299
310CAPI_FUNC(HRESULT) tfCudaBondConfig_refresh(struct tfCudaBondConfigHandle *handle);
311
312
314// cuda::AngleConfig //
316
317
325CAPI_FUNC(HRESULT) tfCudaAngleConfig_onDevice(struct tfCudaAngleConfigHandle *handle, bool *onDevice);
326
334CAPI_FUNC(HRESULT) tfCudaAngleConfig_getDevice(struct tfCudaAngleConfigHandle *handle, int *deviceId);
335
342CAPI_FUNC(HRESULT) tfCudaAngleConfig_toDevice(struct tfCudaAngleConfigHandle *handle);
343
350CAPI_FUNC(HRESULT) tfCudaAngleConfig_fromDevice(struct tfCudaAngleConfigHandle *handle);
351
361CAPI_FUNC(HRESULT) tfCudaAngleConfig_setBlocks(struct tfCudaAngleConfigHandle *handle, unsigned int numBlocks);
362
372CAPI_FUNC(HRESULT) tfCudaAngleConfig_setThreads(struct tfCudaAngleConfigHandle *handle, unsigned int numThreads);
373
386
399CAPI_FUNC(HRESULT) tfCudaAngleConfig_refreshAngles(struct tfCudaAngleConfigHandle *handle, struct tfAngleHandleHandle **angles, unsigned int numAngles);
400
411CAPI_FUNC(HRESULT) tfCudaAngleConfig_refresh(struct tfCudaAngleConfigHandle *handle);
412
413
415// cuda::SimulatorConfig //
417
418
426
435
444
453
454
456// Module functions //
458
459
467CAPI_FUNC(HRESULT) tfCudaArchs(char **str, unsigned int *numChars);
468
469
470#endif // _WRAPS_C_TFC_CUDA_H_
Handle to a AngleHandle instance.
Definition tfCBond.h:47
Handle to a BondHandle instance.
Definition tfCBond.h:39
Handle to a cuda::AngleConfig instance.
Definition tfC_cuda.h:54
Handle to a cuda::BondConfig instance.
Definition tfC_cuda.h:46
Handle to a cuda::EngineConfig instance.
Definition tfC_cuda.h:38
Handle to a cuda::SimulatorConfig instance.
Definition tfC_cuda.h:62
HRESULT tfCudaEngineConfig_refreshFluxes(struct tfCudaEngineConfigHandle *handle)
Update fluxes on a CUDA device.
HRESULT tfCudaAngleConfig_refresh(struct tfCudaAngleConfigHandle *handle)
Update all angles on a CUDA device.
HRESULT tfCudaEngineConfig_refreshBoundaryConditions(struct tfCudaEngineConfigHandle *handle)
Update boundary conditions on a CUDA device.
HRESULT tfCudaBondConfig_onDevice(struct tfCudaBondConfigHandle *handle, bool *onDevice)
Check whether the bonds are currently on a device.
HRESULT tfCudaEngineConfig_toDevice(struct tfCudaEngineConfigHandle *handle)
Send engine to device. If engine is already on device, then the call is ignored.
HRESULT tfCudaAngleConfig_onDevice(struct tfCudaAngleConfigHandle *handle, bool *onDevice)
Check whether the angles are currently on a device.
HRESULT tfCudaEngineConfig_refresh(struct tfCudaEngineConfigHandle *handle)
Update the image of the engine on a CUDA device.
HRESULT tfCudaBondConfig_getDevice(struct tfCudaBondConfigHandle *handle, int *deviceId)
Get the id of the device designated 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 tfCudaAngleConfig_toDevice(struct tfCudaAngleConfigHandle *handle)
Send angles to device. If angles 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 tfCudaEngineConfig_setDevice(struct tfCudaEngineConfigHandle *handle, unsigned int deviceId)
Set the id of the device for running the engine.
HRESULT tfCudaBondConfig_setThreads(struct tfCudaBondConfigHandle *handle, unsigned int numThreads)
Set the number of threads of the CUDA configuration for a CUDA device.
HRESULT tfCudaAngleConfig_fromDevice(struct tfCudaAngleConfigHandle *handle)
Pull engine from device. If engine is not on a 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_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_setThreads(struct tfCudaEngineConfigHandle *handle, unsigned int numThreads)
Set the number of threads of the CUDA configuration for the current CUDA device.
HRESULT tfCudaAngleConfig_refreshAngles(struct tfCudaAngleConfigHandle *handle, struct tfAngleHandleHandle **angles, unsigned int numAngles)
Update angles on a CUDA device.
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 tfSimulatorCUDAConfig_getEngine(struct tfCudaSimulatorConfigHandle *handle, struct tfCudaEngineConfigHandle *itf)
Get the engine CUDA runtime control interface.
HRESULT tfCudaBondConfig_setDevice(struct tfCudaBondConfigHandle *handle, unsigned int deviceId)
Set the id of the device for running bonds.
HRESULT tfSimulatorCUDAConfig_getBonds(struct tfCudaSimulatorConfigHandle *handle, struct tfCudaBondConfigHandle *itf)
Get the bond CUDA runtime control interface.
HRESULT tfCudaEngineConfig_refreshPotentials(struct tfCudaEngineConfigHandle *handle)
Update potentials on a CUDA device.
HRESULT tfCudaEngineConfig_clearDevice(struct tfCudaEngineConfigHandle *handle)
Clear configured device for the engine.
HRESULT tfCudaArchs(char **str, unsigned int *numChars)
Get the supported CUDA architectures of this installation.
HRESULT tfSimulatorCUDAConfig_getAngles(struct tfCudaSimulatorConfigHandle *handle, struct tfCudaAngleConfigHandle *itf)
Get the angle CUDA runtime control interface.
HRESULT tfCudaBondConfig_setBlocks(struct tfCudaBondConfigHandle *handle, unsigned int numBlocks)
Set the number of blocks of the CUDA configuration for a CUDA device.
HRESULT tfCudaAngleConfig_getDevice(struct tfCudaAngleConfigHandle *handle, int *deviceId)
Get the id of the device designated for running angles.
HRESULT tfCudaBondConfig_refreshBonds(struct tfCudaBondConfigHandle *handle, struct tfBondHandleHandle **bonds, unsigned int numBonds)
Update bonds on a CUDA device.
HRESULT tfSimulator_getCUDAConfig(struct tfCudaSimulatorConfigHandle *handle)
Get simulator CUDA runtime interface.
HRESULT tfCudaAngleConfig_refreshAngle(struct tfCudaAngleConfigHandle *handle, struct tfAngleHandleHandle *bh)
Update a angle on a CUDA device.
HRESULT tfCudaEngineConfig_setBlocks(struct tfCudaEngineConfigHandle *handle, unsigned int numBlocks)
Set the number of blocks of the CUDA configuration for the current CUDA device.
HRESULT tfCudaBondConfig_refresh(struct tfCudaBondConfigHandle *handle)
Update all bonds on a CUDA device.
HRESULT tfCudaBondConfig_refreshBond(struct tfCudaBondConfigHandle *handle, struct tfBondHandleHandle *bh)
Update a bond on a CUDA device.