48 template <AddressSpace AdrSp>
54 if constexpr (AdrSp == Host) {
55 ptr = std::malloc(size);
56 }
else if constexpr (AdrSp == Device) {
74 template <AddressSpace AdrSp>
79 if constexpr (AdrSp == Host) {
Provides definitions and type traits involving the different memory address spaces supported by nda.
Provides GPU and non-GPU specific functionality.
static const auto check_adr_sp_valid
Check validity of a set of nda::mem::AddressSpace values.
static constexpr bool have_cuda
Constexpr variable that is true if the project is configured with CUDA support.
#define device_error_check(ARG1, ARG2)
Trigger a compilation error every time the nda::device_error_check function is called.
static constexpr bool have_device
Constexpr variable that is true if the project is configured with GPU support.
void * malloc(size_t size)
Call the correct malloc function based on the given address space.
void free(void *p)
Call the correct free function based on the given address space.