1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 07:55:35 +00:00

Need to support any vector type template and run on accelerator

This commit is contained in:
paboyle 2018-03-04 15:52:14 +00:00
parent 03f8da8fbc
commit c92a3c6068

View File

@ -8,7 +8,7 @@ namespace Grid{
public:
template<class coor_t>
static inline void CoorFromIndex (coor_t& coor,int index,const coor_t &dims){
static accelerator_inline void CoorFromIndex (coor_t& coor,int index,const coor_t &dims){
int nd= dims.size();
coor.resize(nd);
for(int d=0;d<nd;d++){
@ -18,7 +18,7 @@ namespace Grid{
}
template<class coor_t>
static inline void IndexFromCoor (const coor_t& coor,int &index,const coor_t &dims){
static accelerator_inline void IndexFromCoor (const coor_t& coor,int &index,const coor_t &dims){
int nd=dims.size();
int stride=1;
index=0;
@ -29,7 +29,7 @@ namespace Grid{
}
template<class coor_t>
static inline void IndexFromCoorReversed (const coor_t& coor,int &index,const coor_t &dims){
static accelerator_inline void IndexFromCoorReversed (const coor_t& coor,int &index,const coor_t &dims){
int nd=dims.size();
int stride=1;
index=0;
@ -39,7 +39,7 @@ namespace Grid{
}
}
template<class coor_t>
static inline void CoorFromIndexReversed (coor_t& coor,int index,const coor_t &dims){
static accelerator_inline void CoorFromIndexReversed (coor_t& coor,int index,const coor_t &dims){
int nd= dims.size();
coor.resize(nd);
for(int d=nd-1;d>=0;d--){