Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit 43e881e

Browse files
authored
Fix pdata calculation (#775)
* Read iontype for every instance because it might be different for different instances
1 parent 55c5e15 commit 43e881e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

coreneuron/mechanism/eion.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ ion_style("name_ion", [c_style, e_style, einit, eadvance, cinit])
233233
and models.
234234
*/
235235

236-
#define iontype ppd[0] /* how _AMBIGUOUS is to be handled */
236+
#define iontype ppd[_iml] /* how _AMBIGUOUS is to be handled */
237237
/*the bitmap is
238238
03 concentration unused, nrnocCONST, DEP, STATE
239239
04 initialize concentrations
@@ -265,6 +265,7 @@ void nrn_cur_ion(NrnThread* nt, Memb_list* ml, int type) {
265265
ppd = ml->pdata;
266266
// clang-format off
267267
nrn_pragma_acc(parallel loop present(pd[0:_cntml_padded * 5],
268+
ppd[0:_cntml_actual],
268269
nrn_ion_global_map[0:nrn_ion_global_map_size]
269270
[0:ion_global_map_member_size])
270271
if (nt->compute_gpu)
@@ -304,7 +305,7 @@ void nrn_init_ion(NrnThread* nt, Memb_list* ml, int type) {
304305
// needs to be like this.
305306
// clang-format off
306307
nrn_pragma_acc(parallel loop present(pd[0:_cntml_padded * 5],
307-
ppd[0:1],
308+
ppd[0:_cntml_actual],
308309
nrn_ion_global_map[0:nrn_ion_global_map_size]
309310
[0:ion_global_map_member_size])
310311
if (nt->compute_gpu))

0 commit comments

Comments
 (0)