10#if !defined(GPUOffloadingOMP) and !defined(GPUOffloadingSYCL) and !defined(GPUOffloadingCPP)
11#define GPUOffloadingOff
20 #if defined(GPUOffloadingHIP)
21 #define GPUCallableMethod __host__ __device__
22 #elif defined(GPUOffloadingSYCL) or defined(SharedSYCL)
23 #define GPUCallableMethod SYCL_EXTERNAL
24 #elif defined(GPUOffloadingCPP) && defined(_NVHPC_STDPAR_GPU)
25 #define GPUCallableMethod __host__ __device__
27 #define GPUCallableMethod
30 #if defined(GPUOffloadingHIP)
31 #define GPUCallableInlineMethod __host__ __device__ __forceinline__
32 #elif defined(GPUOffloadingSYCL) or defined(SharedSYCL)
33 #define GPUCallableInlineMethod inline
34 #elif defined(GPUOffloadingCPP) && defined(_NVHPC_STDPAR_GPU)
35 #define GPUCallableInlineMethod __host__ __device__ __forceinline__
37 #define GPUCallableInlineMethod
46#if defined(GPUOffloadingOMP)
47#pragma omp declare target
49#pragma omp end declare target
50#elif defined(GPUOffloadingSYCL) or defined(SharedSYCL)
52#elif defined(GPUOffloadingCPP)
98 template <
class T =
double>
155 #if defined(GPUOffloadingOMP)
156 #pragma omp declare target
158 double*
memset(
double* dest,
double ch,
size_t byteCount);
159 #if defined(GPUOffloadingOMP)
160 #pragma omp end declare target
#define GPUCallableMethod
static constexpr int HostDevice
Accelerator devices (GPUs) are enumerated starting from 0.
void * allocateRawData(std::size_t size, MemoryLocation location, int device)
Have to include this header, as I need access to the SYCL_EXTERNAL keyword.
double * memset(double *dest, double ch, size_t byteCount)
Alternative GPU-ready version of memset.
void freeMemory(void *data, MemoryLocation location, int device=accelerator::Device::HostDevice)
Free memory.
void gpuAbort()
Delegates to std::abort() if no GPU offloading is active.
std::size_t padSizeToAlignment(std::size_t size, std::size_t alignment)
std::string toString(MemoryLocation value)
@ Heap
Create data on the heap of the local device.
@ ManagedSharedAcceleratorDeviceMemory
To be used on host only.
T * allocateMemory(std::size_t count, MemoryLocation location, int device=accelerator::Device::HostDevice)
Allocates memory on the specified memory location.