CoreNEURON
mem_layout_util.hpp
Go to the documentation of this file.
1 /*
2 # =============================================================================
3 # Copyright (c) 2016 - 2021 Blue Brain Project/EPFL
4 #
5 # See top-level LICENSE file for details.
6 # =============================================================================
7 */
8 
9 #pragma once
10 
13 
14 namespace coreneuron {
15 
16 #if !defined(NRN_SOA_PAD)
17 // for layout 0, every range variable array must have a size which
18 // is a multiple of NRN_SOA_PAD doubles
19 #define NRN_SOA_PAD 8
20 #endif
21 
22 /// return the new offset considering the byte aligment settings
23 size_t nrn_soa_byte_align(size_t i);
24 
25 /// This function return the index in a flat array of a matrix coordinate (icnt, isz).
26 /// The matrix size is (cnt, sz)
27 /// Depending of the layout some padding can be calculated
28 int nrn_i_layout(int icnt, int cnt, int isz, int sz, int layout);
29 
30 // file data is AoS. ie.
31 // organized as cnt array instances of mtype each of size sz.
32 // So input index i refers to i_instance*sz + i_item offset
33 // Return the corresponding SoA index -- taking into account the
34 // alignment requirements. Ie. i_instance + i_item*align_cnt.
35 
36 int nrn_param_layout(int i, int mtype, Memb_list* ml);
37 } // namespace coreneuron
coreneuron::nrn_soa_byte_align
size_t nrn_soa_byte_align(size_t size)
return the new offset considering the byte aligment settings
Definition: mem_layout_util.cpp:20
coreneuron.hpp
coreneuron
THIS FILE IS AUTO GENERATED DONT MODIFY IT.
Definition: corenrn_parameters.cpp:12
coreneuron::i
int i
Definition: cellorder.cpp:485
nrniv_decl.h
coreneuron::nrn_param_layout
int nrn_param_layout(int i, int mtype, Memb_list *ml)
Definition: mem_layout_util.cpp:52
cnt
#define cnt
Definition: tqueue.hpp:44
coreneuron::nrn_i_layout
int nrn_i_layout(int icnt, int cnt, int isz, int sz, int layout)
This function return the index in a flat array of a matrix coordinate (icnt, isz).
Definition: mem_layout_util.cpp:32