File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -55,10 +55,22 @@ static constexpr auto exe_policy = std::execution::par_unseq;
55
55
#endif
56
56
57
57
#ifdef USE_STD_PTR_ALLOC_DEALLOC
58
+
59
+ #if defined(__HIPSYCL__) || defined(__OPENSYCL__)
60
+ #include < CL/sycl.hpp>
61
+
62
+ // TODO We temporarily use malloc_shared/free here for hipSYCL stdpar because there's a linking issue if we let it hijack new/delete
63
+ // for this to work, we compile with --hipsycl-stdpar-system-usm so that hijacking is disabled
64
+ static cl::sycl::queue queue{cl::sycl::default_selector_v};
65
+ template <typename T> T *alloc_raw (size_t size) { return cl::sycl::malloc_shared<T>(size, queue); }
66
+ template <typename T> void dealloc_raw (T *ptr) { cl::sycl::free (ptr, queue); }
67
+
68
+ #else
58
69
template <typename T>
59
70
T *alloc_raw (size_t size) { return (T *) aligned_alloc (ALIGNMENT, sizeof (T) * size); }
60
71
61
72
template <typename T>
62
73
void dealloc_raw (T *ptr) { free (ptr); }
74
+ #endif
63
75
64
76
#endif
You can’t perform that action at this time.
0 commit comments