1 #ifndef AMREX_GPU_TYPES_H_
2 #define AMREX_GPU_TYPES_H_
3 #include <AMReX_Config.H>
10 # include <sycl/sycl.hpp>
22 constexpr dim3 (
unsigned int x_,
unsigned int y_=1,
unsigned int z_=1) :
x(x_),y(y_),z(z_) {}
30 sycl::queue* queue =
nullptr;
43 #if defined(AMREX_USE_SYCL)
48 Handler (sycl::nd_item<1>
const* a_item =
nullptr,
void* a_local =
nullptr,
49 int a_n_active_threds = -1)
58 std::size_t globalIdx ()
const {
return item->get_global_linear_id(); }
59 std::size_t blockIdx ()
const {
return item->get_group_linear_id(); }
60 std::size_t threadIdx ()
const {
return item->get_local_linear_id(); }
62 std::size_t gridDim ()
const {
return item->get_group_range(0); }
63 std::size_t blockDim ()
const {
return item->get_local_range(0); }
66 std::size_t warpIdx ()
const {
return item->get_sub_group().get_group_id()[0]; }
68 std::size_t laneIdx ()
const {
return item->get_sub_group().get_local_id()[0]; }
70 std::size_t warpDim ()
const {
return item->get_sub_group().get_group_range()[0]; }
72 void* sharedMemory ()
const {
return local; }
74 void sharedBarrier ()
const { item->barrier(sycl::access::fence_space::local_space); }
75 void globalBarrier ()
const { item->barrier(sycl::access::fence_space::global_space); }
76 void syncThreads ()
const { item->barrier(sycl::access::fence_space::global_and_local); }
78 sycl::nd_item<1>
const* item;
83 #elif defined(AMREX_USE_GPU)
#define AMREX_FORCE_INLINE
Definition: AMReX_Extension.H:119
#define AMREX_GPU_HOST_DEVICE
Definition: AMReX_GpuQualifiers.H:20
Definition: AMReX_BaseFwd.H:52
Definition: AMReX_Amr.cpp:49
cudaStream_t gpuStream_t
Definition: AMReX_GpuControl.H:77
bool operator!=(A1 const &a1, A2 const &a2)
Definition: AMReX_GpuAllocators.H:211
bool operator==(A1 const &a1, A2 const &a2)
Definition: AMReX_GpuAllocators.H:203
Definition: AMReX_GpuTypes.H:86
int numActiveThreads
Definition: AMReX_GpuTypes.H:96
constexpr AMREX_GPU_HOST_DEVICE Handler(int n_active_threads=-1)
Definition: AMReX_GpuTypes.H:87
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool isFullBlock() const
Definition: AMReX_GpuTypes.H:91