Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-02-14 03:16:44

0001 #ifndef HeterogeneousCore_AlpakaInterface_interface_warpsize_h
0002 #define HeterogeneousCore_AlpakaInterface_interface_warpsize_h
0003 
0004 namespace cms::alpakatools {
0005 
0006   // TODO implement constexpt warp size in alpaka, and replace this workaround with that functionality.
0007 #if defined(__SYCL_DEVICE_ONLY__)
0008 // the warp size is not defined at compile time for SYCL backend
0009 #error "The SYCL backend does not support compile-time warp size"
0010   inline constexpr int warpSize = 0;
0011 #elif defined(__CUDA_ARCH__)
0012   // CUDA always has a warp size of 32
0013   inline constexpr int warpSize = 32;
0014 #elif defined(__HIP_DEVICE_COMPILE__)
0015   // HIP/ROCm defines warpSize as a constant expression in device code, with value 32 or 64 depending on the target device
0016   inline constexpr int warpSize = ::warpSize;
0017 #else
0018   // CPU back-ends always have a warp size of 1
0019   inline constexpr int warpSize = 1;
0020 #endif
0021 
0022 }  // namespace cms::alpakatools
0023 
0024 #endif  // HeterogeneousCore_AlpakaInterface_interface_warpsize_h