1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-09 23:45:36 +00:00

Bug fix to Example_Laplacian test

This commit is contained in:
Peter Boyle 2021-08-23 23:14:26 +01:00
parent 5b3c530aa7
commit 0d588b95f4
2 changed files with 11 additions and 4 deletions

View File

@ -39,6 +39,10 @@ Author: paboyle <paboyle@ph.ed.ac.uk>
#ifdef HAVE_MM_MALLOC_H
#include <mm_malloc.h>
#endif
#ifdef __APPLE__
// no memalign
inline void *memalign(size_t align, size_t bytes) { return malloc(bytes); }
#endif
NAMESPACE_BEGIN(Grid);
@ -419,6 +423,8 @@ inline void acceleratorMemSet(void *base,int value,size_t bytes) { hipMemset(bas
#undef GRID_SIMT
#define accelerator
#define accelerator_inline strong_inline
#define accelerator_for(iterator,num,nsimd, ... ) thread_for(iterator, num, { __VA_ARGS__ });

View File

@ -116,7 +116,6 @@ public:
///////////////////////////////////
// Arithmetic expressions
///////////////////////////////////
StencilEntry *SE;
// Views; device friendly/accessible pointers
auto st = Stencil.View(AcceleratorRead);
@ -129,10 +128,11 @@ public:
const int Nsimd = vobj::Nsimd();
const uint64_t NN = grid->oSites();
const int lane=acceleratorSIMTlane(Nsimd);
accelerator_for( ss, NN, Nsimd, {
StencilEntry *SE;
const int lane=acceleratorSIMTlane(Nsimd);
calcObj chi;
@ -202,7 +202,6 @@ public:
///////////////////////////////////
auto st = Stencil.View(AcceleratorRead);
auto buf = st.CommBuf();
StencilEntry *SE;
autoView( in , _in , AcceleratorRead);
autoView( out , _out , AcceleratorWrite);
@ -214,9 +213,11 @@ public:
const int Nsimd = vobj::Nsimd();
const uint64_t NN = grid->oSites();
const int lane=acceleratorSIMTlane(Nsimd);
accelerator_for( ss, NN, Nsimd, {
StencilEntry *SE;
const int lane=acceleratorSIMTlane(Nsimd);
calcObj chi;