19 #define CNRN_FLAT_INDEX_IML_ROW(i) ((i) * (_cntml_padded) + (_iml))
42 #define global_conci(type) nrn_ion_global_map[type][0]
43 #define global_conco(type) nrn_ion_global_map[type][1]
44 #define global_charge(type) nrn_ion_global_map[type][2]
51 std::array<std::string, 7>
buf{};
52 #define VAL_SENTINAL -10000.
53 std::string name_str{
name};
54 buf[0] = name_str +
"_ion";
55 buf[1] =
"e" + name_str;
56 buf[2] = name_str +
"i";
57 buf[3] = name_str +
"o";
58 buf[5] =
"i" + name_str;
59 buf[6] =
"di" + name_str +
"_dv_";
60 std::array<
const char*,
63 for (
int i = 0;
i <
buf.size();
i++) {
64 mech[
i + 1] =
buf[
i].empty() ? nullptr :
buf[
i].c_str();
72 int size = mechtype + 1;
99 buf[0] = name_str +
"i0_" +
buf[0];
100 buf[1] = name_str +
"o0_" +
buf[0];
101 if (strcmp(
"na",
name) == 0) {
106 }
else if (strcmp(
"k",
name) == 0) {
111 }
else if (strcmp(
"ca",
name) == 0) {
125 "%s ion valence defined differently in\n\
126 two USEION statements (%g and %g)\n",
133 "%s ion valence must be defined in\n\
134 the USEION statement of any model using this ion\n",
143 #define erev pd[CNRN_FLAT_INDEX_IML_ROW(0)]
144 #define conci pd[CNRN_FLAT_INDEX_IML_ROW(1)]
145 #define conco pd[CNRN_FLAT_INDEX_IML_ROW(2)]
146 #define cur pd[CNRN_FLAT_INDEX_IML_ROW(3)]
147 #define dcurdv pd[CNRN_FLAT_INDEX_IML_ROW(4)]
164 #define iontype ppd[_iml]
175 #define charge global_charge(type)
176 #define conci0 global_conci(type)
177 #define conco0 global_conco(type)
191 int _cntml_padded = ml->_nodecount_padded;
196 ppd[0:_cntml_actual],
200 async(nt->stream_id))
202 nrn_pragma_omp(target teams distribute parallel
for simd
if(nt->compute_gpu))
203 for (
int _iml = 0; _iml < _cntml_actual; ++_iml) {
227 int _cntml_padded = ml->_nodecount_padded;
236 ppd[0:_cntml_actual],
239 if (nt->compute_gpu))
241 nrn_pragma_omp(target teams distribute parallel
for simd
if(nt->compute_gpu))
242 for (
int _iml = 0; _iml < _cntml_actual; ++_iml) {
261 double* _vec_rhs = _nt->_actual_rhs;
269 _cntml_padded = ml->_nodecount_padded;
272 ni [0:_cntml_actual],
273 _vec_rhs [0:_nt->
end])
if (_nt->compute_gpu)
274 async(_nt->stream_id))
275 nrn_pragma_omp(target teams distribute parallel
for simd
if(_nt->compute_gpu))
276 for (
int _iml = 0; _iml < _cntml_actual; ++_iml) {
277 cur += dcurdv * (_vec_rhs[ni[_iml]]);
#define global_conco(type)
#define global_charge(type)
#define global_conci(type)
nrn_pragma_acc(routine seq) nrn_pragma_omp(declare target) philox4x32_ctr_t coreneuron_random123_philox4x32_helper(coreneuron nrn_pragma_omp(end declare target) namespace coreneuron
Provide a helper function in global namespace that is declared target for OpenMP offloading to functi...
#define NB_MECH_VAR_CATEGORIES
THIS FILE IS AUTO GENERATED DONT MODIFY IT.
void nrn_init_ion(NrnThread *, Memb_list *, int)
void _nrn_layout_reg(int, int)
constexpr double nrn_nernst(double ci, double co, double z, double celsius)
void nrn_writes_conc(int, int)
double ** nrn_ion_global_map
void ion_reg(const char *, double)
void second_order_cur(NrnThread *_nt, int secondorder)
const int ion_global_map_member_size
void hoc_register_dparam_semantics(int type, int, const char *name)
void nrn_alloc_ion(double *data, Datum *pdata, int type)
void * erealloc(void *ptr, size_t size)
static void * emalloc(size_t size)
int nrn_get_mechtype(const char *name)
Get mechanism type by the mechanism name.
nrn_pragma_acc(routine seq) int vector_capacity(void *v)
void hoc_register_prop_size(int, int, int)
int register_mech(const char **m, mod_alloc_t alloc, mod_f_t cur, mod_f_t jacob, mod_f_t stat, mod_f_t initialize, mod_f_t private_constructor, mod_f_t private_destructor, int nrnpointerindex, int vectorized)
constexpr double ktf(double celsius)
int nrn_ion_global_map_size
void nrn_cur_ion(NrnThread *_nt, Memb_list *ml, int type)
int iontype(char *s1, char *s2)
double nrn_ion_charge(Symbol *sym)
double nrn_nernst_coef(int type)
A view into a set of mechanism instances.
std::vector< double * > data()
Get a vector of double* representing the model data.
Represent main neuron object computed by single thread.
Non-template stable handle to a generic value.