mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01:00
Merge branch 'feature/cpu-threaded-smp' into develop
This commit is contained in:
commit
f99c3660d2
@ -481,9 +481,10 @@ inline void acceleratorCopySynchronise(void) { hipStreamSynchronize(copyStream);
|
|||||||
#define accelerator_for2d(iter1, num1, iter2, num2, nsimd, ... ) thread_for2d(iter1,num1,iter2,num2,{ __VA_ARGS__ });
|
#define accelerator_for2d(iter1, num1, iter2, num2, nsimd, ... ) thread_for2d(iter1,num1,iter2,num2,{ __VA_ARGS__ });
|
||||||
|
|
||||||
accelerator_inline int acceleratorSIMTlane(int Nsimd) { return 0; } // CUDA specific
|
accelerator_inline int acceleratorSIMTlane(int Nsimd) { return 0; } // CUDA specific
|
||||||
inline void acceleratorCopyToDevice(void *from,void *to,size_t bytes) { memcpy(to,from,bytes);}
|
|
||||||
inline void acceleratorCopyFromDevice(void *from,void *to,size_t bytes){ memcpy(to,from,bytes);}
|
inline void acceleratorCopyToDevice(void *from,void *to,size_t bytes) { thread_bcopy(from,to,bytes); }
|
||||||
inline void acceleratorCopyDeviceToDeviceAsynch(void *from,void *to,size_t bytes) { memcpy(to,from,bytes);}
|
inline void acceleratorCopyFromDevice(void *from,void *to,size_t bytes){ thread_bcopy(from,to,bytes);}
|
||||||
|
inline void acceleratorCopyDeviceToDeviceAsynch(void *from,void *to,size_t bytes) { thread_bcopy(from,to,bytes);}
|
||||||
inline void acceleratorCopySynchronise(void) {};
|
inline void acceleratorCopySynchronise(void) {};
|
||||||
|
|
||||||
inline int acceleratorIsCommunicable(void *ptr){ return 1; }
|
inline int acceleratorIsCommunicable(void *ptr){ return 1; }
|
||||||
|
@ -72,3 +72,20 @@ Author: paboyle <paboyle@ph.ed.ac.uk>
|
|||||||
#define thread_region DO_PRAGMA(omp parallel)
|
#define thread_region DO_PRAGMA(omp parallel)
|
||||||
#define thread_critical DO_PRAGMA(omp critical)
|
#define thread_critical DO_PRAGMA(omp critical)
|
||||||
|
|
||||||
|
#ifdef GRID_OMP
|
||||||
|
inline void thread_bcopy(void *from, void *to,size_t bytes)
|
||||||
|
{
|
||||||
|
uint64_t *ufrom = (uint64_t *)from;
|
||||||
|
uint64_t *uto = (uint64_t *)to;
|
||||||
|
assert(bytes%8==0);
|
||||||
|
uint64_t words=bytes/8;
|
||||||
|
thread_for(w,words,{
|
||||||
|
uto[w] = ufrom[w];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
inline void thread_bcopy(void *from, void *to,size_t bytes)
|
||||||
|
{
|
||||||
|
bcopy(from,to,bytes);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user