Skip to content

Commit

Permalink
Remove AdaptiveCpp workaround in dpl_shim.h to allow for automatic pr…
Browse files Browse the repository at this point in the history
…efetch optimization (#177)
  • Loading branch information
illuhad committed Dec 4, 2023
1 parent 78ba4ff commit 06c3d53
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/dpl_shim.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,10 @@ static constexpr auto exe_policy = std::execution::par_unseq;
#endif

#ifdef USE_STD_PTR_ALLOC_DEALLOC

#if defined(__HIPSYCL__) || defined(__OPENSYCL__)
#include <CL/sycl.hpp>

// TODO We temporarily use malloc_shared/free here for hipSYCL stdpar because there's a linking issue if we let it hijack new/delete
// for this to work, we compile with --hipsycl-stdpar-system-usm so that hijacking is disabled
static cl::sycl::queue queue{cl::sycl::default_selector_v};
template <typename T> T *alloc_raw(size_t size) { return cl::sycl::malloc_shared<T>(size, queue); }
template <typename T> void dealloc_raw(T *ptr) { cl::sycl::free(ptr, queue); }

#else
template<typename T>
T *alloc_raw(size_t size) { return (T *) aligned_alloc(ALIGNMENT, sizeof(T) * size); }

template<typename T>
void dealloc_raw(T *ptr) { free(ptr); }
#endif

#endif

0 comments on commit 06c3d53

Please sign in to comment.