7#include <dr/mp/global.hpp>
9namespace dr::mp::__detail {
14 T *allocate(std::size_t sz) {
22#ifdef SYCL_LANGUAGE_VERSION
23 mem = sycl::malloc<T>(sz, sycl_queue(), sycl_mem_kind());
28 mem = std_allocator_.allocate(sz);
31 assert(mem !=
nullptr);
35 void deallocate(T *ptr, std::size_t sz) {
37 assert(ptr ==
nullptr);
40 assert(ptr !=
nullptr);
41#ifdef SYCL_LANGUAGE_VERSION
43 sycl::free(ptr, sycl_queue());
48 std_allocator_.deallocate(ptr, sz);
52 std::allocator<T> std_allocator_;
Definition: allocator.hpp:11