16#ifndef IJK_Field_local_template_TPP_H
17#define IJK_Field_local_template_TPP_H
19#include <Simd_template.h>
27template<
typename _TYPE_,
typename _TYPE_ARRAY_>
34 bool disable_memalign =
true;
35 if (ghosts > Ni || ghosts > Nj || ghosts > Nk)
37 Cerr <<
"Error in IJK_Field_local_template::allocate: ghostsize=" << ghosts <<
" is larger than the local mesh size " << Ni <<
" " << Nj <<
" " << Nk << finl;
46 if (!external_storage || disable_memalign)
57 if (!external_storage || disable_memalign)
63 const int CacheLineSizeBytes = 64;
64 sz += (int)(CacheLineSizeBytes/
sizeof(_TYPE_));
67 sz += (int)(CacheLineSizeBytes/
sizeof(_TYPE_));
71 char *cptr = (
char *) ptr;
72 long long iptr = (
long long) cptr;
73 long long decal = iptr & (CacheLineSizeBytes - 1);
74 offset_ += (int)((CacheLineSizeBytes - decal) /
sizeof(_TYPE_));
76 if (!external_storage)
77 data_.resize_array(sz);
83template<
typename _TYPE_,
typename _TYPE_ARRAY_>
98 Cerr <<
"Error: must implement ArrOfFloat::ref_array() and reset()" << finl;
119 data_.ref_array(src.
data_, i_first, i_last - i_first + 1);
void allocate(int ni, int nj, int nk, int ghosts, int additional_k_layers=0, int nb_compo=1, bool external_storage=false)
int linear_index(int i, int j, int k) const
TRUSTArray< _TYPE_ > data_
void shift_k_origin(int n)
void ref_ij(IJK_Field_local_template &src, int k_layer)
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.