@@ -93,7 +93,7 @@ void permute(T* data, int cnt, int sz, int layout, int* p) {
9393 return ;
9494 }
9595
96- if (layout == 0 ) { // for SoA, n might be larger due to cnt padding
96+ if (layout == Layout::SoA ) { // for SoA, n might be larger due to cnt padding
9797 n = nrn_soa_padded_size (cnt, layout) * sz;
9898 }
9999
@@ -208,12 +208,12 @@ void update_pdata_values(Memb_list* ml, int type, NrnThread& nt) {
208208 int ix = *pd - edata0;
209209 // from ix determine i_ecnt and i_esz (need to permute i_ecnt)
210210 int i_ecnt, i_esz, padded_ecnt;
211- if (elayout == 1 ) { // AoS
211+ if (elayout == Layout::AoS ) {
212212 padded_ecnt = ecnt;
213213 i_ecnt = ix / esz;
214214 i_esz = ix % esz;
215215 } else { // SoA
216- assert (elayout == 0 );
216+ assert (elayout == Layout::SoA );
217217 padded_ecnt = nrn_soa_padded_size (ecnt, elayout);
218218 i_ecnt = ix % padded_ecnt;
219219 i_esz = ix / padded_ecnt;
@@ -258,13 +258,13 @@ int nrn_index_permute(int ix, int type, Memb_list* ml) {
258258 return ix;
259259 }
260260 int layout = corenrn.get_mech_data_layout ()[type];
261- if (layout == 1 ) {
261+ if (layout == Layout::AoS ) {
262262 int sz = corenrn.get_prop_param_size ()[type];
263263 int i_cnt = ix / sz;
264264 int i_sz = ix % sz;
265265 return p[i_cnt] * sz + i_sz;
266266 } else {
267- assert (layout == 0 );
267+ assert (layout == Layout::SoA );
268268 int padded_cnt = nrn_soa_padded_size (ml->nodecount , layout);
269269 int i_cnt = ix % padded_cnt;
270270 int i_sz = ix / padded_cnt;
0 commit comments