From c4b9f71357fc454c8709d2c190a1fd5b90bf116e Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Tue, 21 May 2024 02:22:32 +0100 Subject: [PATCH] CPU compile ordering is important --- Grid/threads/Accelerator.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Grid/threads/Accelerator.h b/Grid/threads/Accelerator.h index 48062b56..1cb56ddd 100644 --- a/Grid/threads/Accelerator.h +++ b/Grid/threads/Accelerator.h @@ -539,12 +539,6 @@ inline void acceleratorCopySynchronise(void) { auto discard=hipStreamSynchronize #endif -inline void acceleratorCopyDeviceToDevice(void *from,void *to,size_t bytes) -{ - acceleratorCopyDeviceToDeviceAsynch(from,to,bytes); - acceleratorCopySynchronise(); -} - ////////////////////////////////////////////// // CPU Target - No accelerator just thread instead ////////////////////////////////////////////// @@ -553,7 +547,6 @@ inline void acceleratorCopyDeviceToDevice(void *from,void *to,size_t bytes) #undef GRID_SIMT - inline void acceleratorMem(void) { /* @@ -656,6 +649,12 @@ accelerator_inline void acceleratorFence(void) return; } +inline void acceleratorCopyDeviceToDevice(void *from,void *to,size_t bytes) +{ + acceleratorCopyDeviceToDeviceAsynch(from,to,bytes); + acceleratorCopySynchronise(); +} + template void acceleratorPut(T& dev,T&host) { acceleratorCopyToDevice(&host,&dev,sizeof(T));