Tissue Forge C++ 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tfFlux_cuda.h
1/*******************************************************************************
2 * This file is part of mdcore.
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
20#ifndef _MDCORE_SOURCE_TFFLUX_CUDA_H_
21#define _MDCORE_SOURCE_TFFLUX_CUDA_H_
22
23#include <cuda_runtime.h>
24
25#include <mdcore_config.h>
26#include <tfFlux.h>
27
28
29namespace TissueForge::cuda {
30
31
33 int16_t a;
34 int16_t b;
35
36 FluxTypeIdPair(TissueForge::TypeIdPair tip) : a{tip.a}, b{tip.b} {}
37 };
38
39
40 // A wrap of Flux
41 struct Flux {
42 int32_t size;
43 int8_t *kinds;
44 FluxTypeIdPair *type_ids;
45 int32_t *indices_a;
46 int32_t *indices_b;
47 float *coef;
48 float *decay_coef;
49 float *target;
50
51 __host__
53
54 __device__
55 void finalize();
56 };
57
58
59 // A wrap of Fluxes
60 struct Fluxes {
61 int32_t size;
62 Flux *fluxes;
63
64 __host__
66
67 __device__
68 void finalize();
69 };
70
71
72 __device__
73 void Flux_getFluxes(int **fxind_cuda, Fluxes **fluxes_cuda);
74
75 __device__
76 void Flux_getNrFluxes(unsigned int *nr_fluxes);
77
78 __device__
79 void Flux_getNrStates(unsigned int *nr_states);
80
81};
82
83#endif // _MDCORE_SOURCE_TFFLUX_CUDA_H_
Tissue Forge GPU acceleration on CUDA-supporting devices.
Definition tfAngleConfig.h:26
Definition tfFlux.h:53
A flux is defined between a pair of types, and acts on the state vector between a pair of instances.
Definition tfFlux.h:88
Definition tfFlux.h:48
Definition tfFlux_cuda.h:41
Definition tfFlux_cuda.h:32
Definition tfFlux_cuda.h:60