Collective Variables Module - Developer Documentation
Loading...
Searching...
No Matches
colvar_gpu_calc.h
1#ifndef COLVAR_GPU_CALC_H
2#define COLVAR_GPU_CALC_H
3
4#include "colvar_gpu_support.h"
5#include "colvarmodule.h"
6#include "colvar.h"
7
8namespace colvars_gpu {
9#if defined (COLVARS_CUDA) || defined (COLVARS_HIP)
11public:
12 colvarcomp_gpu_graph(colvar::cvc* cvc_in, colvarmodule* cvmodule_in): cvc(cvc_in), cvmodule(cvmodule_in) {}
13 virtual ~colvarcomp_gpu_graph() {}
14 int reset_graphs();
15 int calc_value_gpu(bool requires_lattice);
16 int calc_gradients_gpu(bool requires_lattice);
17 int calc_force_invgrads_gpu(bool requires_lattice);
18 int calc_Jacobian_derivative_gpu(bool requires_lattice);
19protected:
20 gpu_graph_t graph_total_force;
21 gpu_graph_t graph_calc_value;
22 gpu_graph_t graph_calc_gradients;
23 gpu_graph_t graph_calc_Jacobian_derivative;
24 colvar::cvc* cvc;
25 colvarmodule* cvmodule;
27 virtual int add_calc_value_node() { return COLVARS_NOT_IMPLEMENTED; }
28
31 virtual int add_calc_gradients_node() { return COLVARS_NOT_IMPLEMENTED; }
32
35 virtual int add_calc_force_invgrads_node() { return COLVARS_NOT_IMPLEMENTED; }
36
38 virtual int add_calc_Jacobian_derivative_node() { return COLVARS_NOT_IMPLEMENTED; }
39};
40#endif
41}
42
43#endif // COLVAR_GPU_CALC_H
Colvar component (base class for collective variables)
Definition: colvarcomp.h:71
Collective variables module (main class)
Definition: colvarmodule.h:71
Definition: colvar_gpu_calc.h:10
virtual int add_calc_force_invgrads_node()
Calculate the total force from the system using the inverse atomic gradients on GPU.
Definition: colvar_gpu_calc.h:35
virtual int add_calc_value_node()
Calculate the variable on GPU.
Definition: colvar_gpu_calc.h:27
virtual int add_calc_Jacobian_derivative_node()
Calculate the divergence of the inverse atomic gradients on GPU.
Definition: colvar_gpu_calc.h:38
virtual int add_calc_gradients_node()
Calculate the atomic gradients, to be reused later in order to apply forces on GPU.
Definition: colvar_gpu_calc.h:31
A struct for holding a CUDA graph and its execution object.
Definition: colvar_gpu_support.h:419
Collective variables main module.