From a00ae981e0e6e83caa70f5bed346242ef1eb0bf9 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Wed, 29 Mar 2023 15:00:40 -0400 Subject: [PATCH] Fence propagation from SYCL --- Grid/communicator/SharedMemoryMPI.cc | 3 +-- .../implementation/WilsonKernelsImplementation.h | 10 +++------- Grid/stencil/Stencil.h | 3 +++ 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Grid/communicator/SharedMemoryMPI.cc b/Grid/communicator/SharedMemoryMPI.cc index 792f8405..a4f5731e 100644 --- a/Grid/communicator/SharedMemoryMPI.cc +++ b/Grid/communicator/SharedMemoryMPI.cc @@ -37,9 +37,8 @@ Author: Christoph Lehner #include #endif #ifdef GRID_SYCL - -#endif #define GRID_SYCL_LEVEL_ZERO_IPC +#endif NAMESPACE_BEGIN(Grid); diff --git a/Grid/qcd/action/fermion/implementation/WilsonKernelsImplementation.h b/Grid/qcd/action/fermion/implementation/WilsonKernelsImplementation.h index 9f6960af..bbf9937c 100644 --- a/Grid/qcd/action/fermion/implementation/WilsonKernelsImplementation.h +++ b/Grid/qcd/action/fermion/implementation/WilsonKernelsImplementation.h @@ -459,11 +459,7 @@ void WilsonKernels::DhopKernel(int Opt,StencilImpl &st, DoubledGaugeField if( interior && exterior ) { if (Opt == WilsonKernelsStatic::OptGeneric ) { KERNEL_CALL(GenericDhopSite); return;} -#ifdef SYCL_HACK - if (Opt == WilsonKernelsStatic::OptHandUnroll ) { KERNEL_CALL_TMP(HandDhopSiteSycl); return; } -#else if (Opt == WilsonKernelsStatic::OptHandUnroll ) { KERNEL_CALL(HandDhopSite); return;} -#endif #ifndef GRID_CUDA if (Opt == WilsonKernelsStatic::OptInlineAsm ) { ASM_CALL(AsmDhopSite); return;} #endif @@ -474,6 +470,7 @@ void WilsonKernels::DhopKernel(int Opt,StencilImpl &st, DoubledGaugeField if (Opt == WilsonKernelsStatic::OptInlineAsm ) { ASM_CALL(AsmDhopSiteInt); return;} #endif } else if( exterior ) { + acceleratorFenceComputeStream(); if (Opt == WilsonKernelsStatic::OptGeneric ) { KERNEL_CALL(GenericDhopSiteExt); return;} if (Opt == WilsonKernelsStatic::OptHandUnroll ) { KERNEL_CALL(HandDhopSiteExt); return;} #ifndef GRID_CUDA @@ -498,10 +495,9 @@ void WilsonKernels::DhopKernel(int Opt,StencilImpl &st, DoubledGaugeField #ifndef GRID_CUDA if (Opt == WilsonKernelsStatic::OptInlineAsm ) { ASM_CALL(AsmDhopSiteDag); return;} #endif - acceleratorFenceComputeStream(); } else if( interior ) { - if (Opt == WilsonKernelsStatic::OptGeneric ) { KERNEL_CALL(GenericDhopSiteDagInt); return;} - if (Opt == WilsonKernelsStatic::OptHandUnroll ) { KERNEL_CALL(HandDhopSiteDagInt); return;} + if (Opt == WilsonKernelsStatic::OptGeneric ) { KERNEL_CALLNB(GenericDhopSiteDagInt); return;} + if (Opt == WilsonKernelsStatic::OptHandUnroll ) { KERNEL_CALLNB(HandDhopSiteDagInt); return;} #ifndef GRID_CUDA if (Opt == WilsonKernelsStatic::OptInlineAsm ) { ASM_CALL(AsmDhopSiteDagInt); return;} #endif diff --git a/Grid/stencil/Stencil.h b/Grid/stencil/Stencil.h index 6296df4e..0a1214a1 100644 --- a/Grid/stencil/Stencil.h +++ b/Grid/stencil/Stencil.h @@ -585,6 +585,7 @@ public: decompress.Exchange(mp,vp0,vp1,type,o); }); } + if ( mm.size() ) acceleratorFenceComputeStream(); mergetime+=usecond(); decompresstime-=usecond(); @@ -595,7 +596,9 @@ public: decompress.Decompress(kp,mp,o); }); } + if ( dd.size() ) acceleratorFenceComputeStream(); decompresstime+=usecond(); + } //////////////////////////////////////// // Set up routines