From 92279f330cf8589ddf4b5bad2ace6547980c3c9d Mon Sep 17 00:00:00 2001 From: Peter Thoman Date: Wed, 13 Dec 2023 12:03:17 +0100 Subject: [PATCH] Restore MSVC compat Also refactor ops --- CMakeLists.txt | 2 +- include/simsycl/detail/allocation.hh | 23 ++- .../simsycl/detail/group_operation_impl.hh | 2 +- include/simsycl/sycl/accessor.hh | 5 +- include/simsycl/sycl/binary_ops.hh | 138 +++++++++++++ include/simsycl/sycl/group_algorithms.hh | 2 +- include/simsycl/sycl/ops.hh | 184 ------------------ include/simsycl/sycl/reduction.hh | 2 +- include/simsycl/sycl/type_traits.hh | 16 +- include/simsycl/sycl/usm.hh | 73 +++---- 10 files changed, 216 insertions(+), 231 deletions(-) create mode 100644 include/simsycl/sycl/binary_ops.hh delete mode 100644 include/simsycl/sycl/ops.hh diff --git a/CMakeLists.txt b/CMakeLists.txt index 46acd0c..da92f38 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,7 +58,7 @@ add_library(simsycl include/simsycl/sycl/multi_ptr.hh include/simsycl/sycl/nd_item.hh include/simsycl/sycl/nd_range.hh - include/simsycl/sycl/ops.hh + include/simsycl/sycl/binary_ops.hh include/simsycl/sycl/platform.hh include/simsycl/sycl/property.hh include/simsycl/sycl/queue.hh diff --git a/include/simsycl/detail/allocation.hh b/include/simsycl/detail/allocation.hh index f0d1eb3..ef5210d 100644 --- a/include/simsycl/detail/allocation.hh +++ b/include/simsycl/detail/allocation.hh @@ -7,6 +7,25 @@ namespace simsycl::detail { +// aligned allocation wrapper for cross-platform support +// NOTE: returned pointers must be freed with aligned_free +inline void *aligned_alloc(size_t alignment, size_t size) { +#if defined(_MSC_VER) + return _aligned_malloc(size, alignment); +#else + return std::aligned_alloc(alignment, size); +#endif +} + +inline void aligned_free(void *ptr) { +#if defined(_MSC_VER) + _aligned_free(ptr); +#else + std::free(ptr); +#endif +} + + // floats and doubles filled with this pattern show up as "-nan" inline constexpr std::byte uninitialized_memory_pattern = std::byte(0xff); @@ -14,7 +33,7 @@ class allocation { public: allocation() = default; allocation(const size_t size_bytes, const size_t alignment_bytes) - : m_size(size_bytes), m_alignment(alignment_bytes), m_ptr(std::aligned_alloc(alignment_bytes, size_bytes)) { + : m_size(size_bytes), m_alignment(alignment_bytes), m_ptr(aligned_alloc(alignment_bytes, size_bytes)) { memset(m_ptr, static_cast(uninitialized_memory_pattern), size_bytes); } @@ -46,7 +65,7 @@ class allocation { void reset() { if(m_ptr != nullptr) { - free(m_ptr); + aligned_free(m_ptr); m_size = 0; m_alignment = 1; m_ptr = nullptr; diff --git a/include/simsycl/detail/group_operation_impl.hh b/include/simsycl/detail/group_operation_impl.hh index cef6a0f..23a486c 100644 --- a/include/simsycl/detail/group_operation_impl.hh +++ b/include/simsycl/detail/group_operation_impl.hh @@ -9,10 +9,10 @@ #include "simsycl/detail/allocation.hh" #include "simsycl/detail/check.hh" +#include "simsycl/sycl/binary_ops.hh" #include "simsycl/sycl/concepts.hh" #include "simsycl/sycl/enums.hh" #include "simsycl/sycl/group.hh" -#include "simsycl/sycl/ops.hh" #include "simsycl/sycl/sub_group.hh" namespace simsycl::detail { diff --git a/include/simsycl/sycl/accessor.hh b/include/simsycl/sycl/accessor.hh index c3dbafb..e09966e 100644 --- a/include/simsycl/sycl/accessor.hh +++ b/include/simsycl/sycl/accessor.hh @@ -97,7 +97,7 @@ template class accessor_iterator { public: using value_type = DataT; - using difference_type = ssize_t; + using difference_type = long int; using reference = value_type &; using pointer = value_type *; using iterator_category = std::forward_iterator_tag; @@ -589,7 +589,8 @@ class accessor : public simsy template class local_accessor final : public simsycl::detail::property_interface { private: - using property_compatibility = detail::property_compatibility_with, property::no_init>; + using property_compatibility + = detail::property_compatibility_with, property::no_init>; public: using value_type = DataT; diff --git a/include/simsycl/sycl/binary_ops.hh b/include/simsycl/sycl/binary_ops.hh new file mode 100644 index 0000000..491b9f7 --- /dev/null +++ b/include/simsycl/sycl/binary_ops.hh @@ -0,0 +1,138 @@ +#pragma once + +#include "concepts.hh" +#include "type_traits.hh" + +#include + +namespace simsycl::sycl { + +// arithmetic + +using std::plus; +template +struct has_known_identity, T> : std::bool_constant> {}; +template +struct known_identity, T> { + static constexpr std::remove_cv_t value = T{}; +}; + +using std::multiplies; +template +struct has_known_identity, T> : std::bool_constant> {}; +template +struct known_identity, T> { + static constexpr std::remove_cv_t value = T{1}; +}; + +// bitwise boolean logic + +using std::bit_and; +template +struct has_known_identity, T> : std::bool_constant> {}; +template +struct known_identity, T> { + static constexpr std::remove_cv_t value = ~T{}; +}; + +using std::bit_or; +template +struct has_known_identity, T> : std::bool_constant> {}; +template +struct known_identity, T> { + static constexpr std::remove_cv_t value = T{}; +}; + +using std::bit_xor; +template +struct has_known_identity, T> : std::bool_constant> {}; +template +struct known_identity, T> { + static constexpr std::remove_cv_t value = T{}; +}; + +// logic + +using std::logical_and; +template +struct has_known_identity, T> : std::bool_constant, bool>> {}; +template +struct known_identity, T> { + static constexpr std::remove_cv_t value = true; +}; + +using std::logical_or; +template +struct has_known_identity, T> : std::bool_constant, bool>> {}; +template +struct known_identity, T> { + static constexpr std::remove_cv_t value = false; +}; + +// min/max + +template +struct minimum { + T operator()(const T &x, const T &y) const { return x <= y ? x : y; } +}; +template <> +struct minimum { + template + decltype(auto) operator()(T &&x, U &&y) const { + return x < y ? std::forward(x) : std::forward(y); + } +}; +template +struct has_known_identity, T> : std::bool_constant> {}; +template +struct known_identity, T> { + static constexpr std::remove_cv_t value + = std::is_floating_point_v ? std::numeric_limits::infinity() : std::numeric_limits::max(); +}; + +template +struct maximum { + T operator()(const T &x, const T &y) const { return x >= y ? x : y; } +}; +template <> +struct maximum { + template + decltype(auto) operator()(T &&x, U &&y) const { + return x > y ? std::forward(x) : std::forward(y); + } +}; +template +struct has_known_identity, T> : std::bool_constant> {}; +template +struct known_identity, T> { + static constexpr std::remove_cv_t value + = std::is_floating_point_v ? -std::numeric_limits::infinity() : std::numeric_limits::lowest(); +}; + +} // namespace simsycl::sycl + +namespace simsycl::detail { + +template +struct is_function_object> : std::true_type {}; +template +struct is_function_object> : std::true_type {}; + +template +struct is_function_object> : std::true_type {}; +template +struct is_function_object> : std::true_type {}; +template +struct is_function_object> : std::true_type {}; + +template +struct is_function_object> : std::true_type {}; +template +struct is_function_object> : std::true_type {}; + +template +struct is_function_object> : std::true_type {}; +template +struct is_function_object> : std::true_type {}; + +} // namespace simsycl::detail diff --git a/include/simsycl/sycl/group_algorithms.hh b/include/simsycl/sycl/group_algorithms.hh index 5e7f49c..03a2028 100644 --- a/include/simsycl/sycl/group_algorithms.hh +++ b/include/simsycl/sycl/group_algorithms.hh @@ -1,9 +1,9 @@ #pragma once +#include "binary_ops.hh" #include "concepts.hh" #include "group.hh" #include "group_functions.hh" -#include "ops.hh" #include "sub_group.hh" #include "simsycl/detail/check.hh" diff --git a/include/simsycl/sycl/ops.hh b/include/simsycl/sycl/ops.hh deleted file mode 100644 index 89ce0b1..0000000 --- a/include/simsycl/sycl/ops.hh +++ /dev/null @@ -1,184 +0,0 @@ -#pragma once - -#include "type_traits.hh" - -#include - - -namespace simsycl::sycl { - -using std::bit_and; -using std::bit_or; -using std::bit_xor; -using std::logical_and; -using std::logical_or; -using std::multiplies; -using std::plus; - -template -struct minimum; - -template -struct minimum { - T operator()(const T &x, const T &y) const { return x < y ? x : y; } -}; - -template <> -struct minimum { - template - decltype(auto) operator()(T && x, U && y) const { - return x < y ? std::forward(x) : std::forward(y); - } -}; - -template -struct maximum; - -template -struct maximum { - T operator()(const T &x, const T &y) const { return x > y ? x : y; } -}; - -template <> -struct maximum { - template - decltype(auto) operator()(T && x, U && y) const { - return x > y ? std::forward(x) : std::forward(y); - } -}; - -} // namespace simsycl::sycl - -namespace simsycl::detail { - -template -struct known_identity { - static constexpr bool exists = false; -}; - -template - requires(std::is_arithmetic_v || std::is_same_v, sycl::half>) -struct known_identity, AccumulatorT> { - static constexpr bool exists = true; - static constexpr std::remove_cv_t value = AccumulatorT{}; -}; - -template - requires(std::is_arithmetic_v || std::is_same_v, sycl::half>) -struct known_identity, AccumulatorT> { - static constexpr bool exists = true; - static constexpr std::remove_cv_t value = AccumulatorT{1}; -}; - -template - requires(std::is_integral_v) -struct known_identity, AccumulatorT> { - static constexpr bool exists = true; - static constexpr std::remove_cv_t value = ~AccumulatorT{}; -}; - -template - requires(std::is_integral_v) -struct known_identity, AccumulatorT> { - static constexpr bool exists = true; - static constexpr std::remove_cv_t value = AccumulatorT{}; -}; - -template - requires(std::is_integral_v) -struct known_identity, AccumulatorT> { - static constexpr bool exists = true; - static constexpr std::remove_cv_t value = AccumulatorT{}; -}; - -template - requires(std::is_same_v, bool>) -struct known_identity, AccumulatorT> { - static constexpr bool exists = true; - static constexpr bool value = true; -}; - -template - requires(std::is_same_v, bool>) -struct known_identity, AccumulatorT> { - static constexpr bool exists = true; - static constexpr bool value = false; -}; - -template - requires(std::is_integral_v) -struct known_identity, AccumulatorT> { - static constexpr bool exists = true; - static constexpr std::remove_cv_t value = std::numeric_limits::max(); -}; - -template - requires(std::is_floating_point_v || std::is_same_v, sycl::half>) -struct known_identity, AccumulatorT> { - static constexpr bool exists = true; - static constexpr std::remove_cv_t value = std::numeric_limits::infinity(); -}; - -template - requires(std::is_integral_v) -struct known_identity, AccumulatorT> { - static constexpr bool exists = true; - static constexpr std::remove_cv_t value = std::numeric_limits::lowest(); -}; - -template - requires(std::is_floating_point_v || std::is_same_v, sycl::half>) -struct known_identity, AccumulatorT> { - static constexpr bool exists = true; - static constexpr std::remove_cv_t value = -std::numeric_limits::infinity(); -}; - -template -struct is_function_object> : std::true_type {}; - -template -struct is_function_object> : std::true_type {}; - -template -struct is_function_object> : std::true_type {}; - -template -struct is_function_object> : std::true_type {}; - -template -struct is_function_object> : std::true_type {}; - -template -struct is_function_object> : std::true_type {}; - -template -struct is_function_object> : std::true_type {}; - -template -struct is_function_object> : std::true_type {}; - -template -struct is_function_object> : std::true_type {}; - - -} // namespace simsycl::detail - -namespace simsycl::sycl { - -template -struct known_identity { - static constexpr AccumulatorT value = detail::known_identity::value; -}; - -template -inline constexpr AccumulatorT known_identity_v = known_identity::value; - -template -struct has_known_identity { - static constexpr bool value = detail::known_identity::exists; -}; - -template -inline constexpr bool has_known_identity_v = has_known_identity::value; - -} // namespace simsycl::sycl diff --git a/include/simsycl/sycl/reduction.hh b/include/simsycl/sycl/reduction.hh index 8eb5b6e..fee33c3 100644 --- a/include/simsycl/sycl/reduction.hh +++ b/include/simsycl/sycl/reduction.hh @@ -1,8 +1,8 @@ #pragma once +#include "binary_ops.hh" #include "forward.hh" #include "handler.hh" -#include "ops.hh" #include "property.hh" #include "../detail/check.hh" diff --git a/include/simsycl/sycl/type_traits.hh b/include/simsycl/sycl/type_traits.hh index 56317f5..f3f6ec5 100644 --- a/include/simsycl/sycl/type_traits.hh +++ b/include/simsycl/sycl/type_traits.hh @@ -9,7 +9,17 @@ struct is_group : std::false_type {}; template inline constexpr bool is_group_v = is_group::value; -} +template +struct known_identity {}; +template +inline constexpr AccumulatorT known_identity_v = known_identity::value; + +template +struct has_known_identity : std::false_type {}; +template +inline constexpr bool has_known_identity_v = has_known_identity::value; + +} // namespace simsycl::sycl namespace simsycl::detail { @@ -29,7 +39,7 @@ struct is_arithmetic : std::bool_constant> {}; template inline constexpr bool is_arithmetic_v = is_arithmetic::value; -template +template constexpr bool always_false = false; -} // namespace simsycl::sycl +} // namespace simsycl::detail diff --git a/include/simsycl/sycl/usm.hh b/include/simsycl/sycl/usm.hh index a2fc115..501faae 100644 --- a/include/simsycl/sycl/usm.hh +++ b/include/simsycl/sycl/usm.hh @@ -4,6 +4,7 @@ #include "forward.hh" #include "property.hh" +#include "simsycl/detail/allocation.hh" namespace simsycl::sycl { @@ -44,12 +45,12 @@ class usm_allocator { usm_allocator &operator=(usm_allocator &&) = default; /// Allocate memory - T *allocate(size_t count) { return static_cast(std::aligned_alloc(Alignment, count * sizeof(T))); } + T *allocate(size_t count) { return static_cast(detail::aligned_alloc(Alignment, count * sizeof(T))); } /// Deallocate memory void deallocate(T *ptr, size_t count) { (void)count; - std::free(ptr); + detail::aligned_free(ptr); } /// Equality Comparison @@ -72,7 +73,7 @@ inline void *malloc_device( (void)sycl_device; (void)sycl_context; (void)prop_list; - return std::malloc(num_bytes); + return detail::aligned_alloc(1, num_bytes); } template @@ -81,20 +82,20 @@ T *malloc_device( (void)sycl_device; (void)sycl_context; (void)prop_list; - return static_cast(std::aligned_alloc(alignof(T), count * sizeof(T))); + return static_cast(detail::aligned_alloc(alignof(T), count * sizeof(T))); } inline void *malloc_device(size_t num_bytes, const queue &sycl_queue, const property_list &prop_list = {}) { (void)sycl_queue; (void)prop_list; - return std::malloc(num_bytes); + return detail::aligned_alloc(1, num_bytes); } template T *malloc_device(size_t count, const queue &sycl_queue, const property_list &prop_list = {}) { (void)sycl_queue; (void)prop_list; - return static_cast(std::aligned_alloc(alignof(T), count * sizeof(T))); + return static_cast(detail::aligned_alloc(alignof(T), count * sizeof(T))); } inline void *aligned_alloc_device(size_t alignment, size_t num_bytes, const device &sycl_device, @@ -102,7 +103,7 @@ inline void *aligned_alloc_device(size_t alignment, size_t num_bytes, const devi (void)sycl_device; (void)sycl_context; (void)prop_list; - return std::aligned_alloc(alignment, num_bytes); + return detail::aligned_alloc(alignment, num_bytes); } template @@ -111,54 +112,54 @@ T *aligned_alloc_device(size_t alignment, size_t count, const device &sycl_devic (void)sycl_device; (void)sycl_context; (void)prop_list; - return static_cast(std::aligned_alloc(alignment, count * sizeof(T))); + return static_cast(detail::aligned_alloc(alignment, count * sizeof(T))); } inline void *aligned_alloc_device( size_t alignment, size_t num_bytes, const queue &sycl_queue, const property_list &prop_list = {}) { (void)sycl_queue; (void)prop_list; - return std::aligned_alloc(alignment, num_bytes); + return detail::aligned_alloc(alignment, num_bytes); } template T *aligned_alloc_device(size_t alignment, size_t count, const queue &sycl_queue, const property_list &prop_list = {}) { (void)sycl_queue; (void)prop_list; - return static_cast(std::aligned_alloc(alignment, count * sizeof(T))); + return static_cast(detail::aligned_alloc(alignment, count * sizeof(T))); }; inline void *malloc_host(size_t num_bytes, const context &sycl_context, const property_list &prop_list = {}) { (void)sycl_context; (void)prop_list; - return std::malloc(num_bytes); + return detail::aligned_alloc(1, num_bytes); } template T *malloc_host(size_t count, const context &sycl_context, const property_list &prop_list = {}) { (void)sycl_context; (void)prop_list; - return static_cast(std::aligned_alloc(alignof(T), count * sizeof(T))); + return static_cast(detail::aligned_alloc(alignof(T), count * sizeof(T))); } inline void *malloc_host(size_t num_bytes, const queue &sycl_queue, const property_list &prop_list = {}) { (void)sycl_queue; (void)prop_list; - return std::malloc(num_bytes); + return detail::aligned_alloc(1, num_bytes); } template T *malloc_host(size_t count, const queue &sycl_queue, const property_list &prop_list = {}) { (void)sycl_queue; (void)prop_list; - return static_cast(std::aligned_alloc(alignof(T), count * sizeof(T))); + return static_cast(detail::aligned_alloc(alignof(T), count * sizeof(T))); } inline void *aligned_alloc_host( size_t alignment, size_t num_bytes, const context &sycl_context, const property_list &prop_list = {}) { (void)sycl_context; (void)prop_list; - return std::aligned_alloc(alignment, num_bytes); + return detail::aligned_alloc(alignment, num_bytes); } template @@ -166,21 +167,21 @@ T *aligned_alloc_host( size_t alignment, size_t count, const context &sycl_context, const property_list &prop_list = {}) { (void)sycl_context; (void)prop_list; - return static_cast(std::aligned_alloc(alignment, count * sizeof(T))); + return static_cast(detail::aligned_alloc(alignment, count * sizeof(T))); } inline void *aligned_alloc_host( size_t alignment, size_t num_bytes, const queue &sycl_queue, const property_list &prop_list = {}) { (void)sycl_queue; (void)prop_list; - return std::aligned_alloc(alignment, num_bytes); + return detail::aligned_alloc(alignment, num_bytes); } template void *aligned_alloc_host(size_t alignment, size_t count, const queue &sycl_queue, const property_list &prop_list = {}) { (void)sycl_queue; (void)prop_list; - return static_cast(std::aligned_alloc(alignment, count * sizeof(T))); + return static_cast(detail::aligned_alloc(alignment, count * sizeof(T))); } inline void *malloc_shared( @@ -188,7 +189,7 @@ inline void *malloc_shared( (void)sycl_device; (void)sycl_context; (void)prop_list; - return std::malloc(num_bytes); + return detail::aligned_alloc(1, num_bytes); } template @@ -197,20 +198,20 @@ T *malloc_shared( (void)sycl_device; (void)sycl_context; (void)prop_list; - return static_cast(std::aligned_alloc(alignof(T), count * sizeof(T))); + return static_cast(detail::aligned_alloc(alignof(T), count * sizeof(T))); } inline void *malloc_shared(size_t num_bytes, const queue &sycl_queue, const property_list &prop_list = {}) { (void)sycl_queue; (void)prop_list; - return std::malloc(num_bytes); + return detail::aligned_alloc(1, num_bytes); } template T *malloc_shared(size_t count, const queue &sycl_queue, const property_list &prop_list = {}) { (void)sycl_queue; (void)prop_list; - return static_cast(std::aligned_alloc(alignof(T), count * sizeof(T))); + return static_cast(detail::aligned_alloc(alignof(T), count * sizeof(T))); } inline void *aligned_alloc_shared(size_t alignment, size_t num_bytes, const device &sycl_device, @@ -218,7 +219,7 @@ inline void *aligned_alloc_shared(size_t alignment, size_t num_bytes, const devi (void)sycl_device; (void)sycl_context; (void)prop_list; - return std::aligned_alloc(alignment, num_bytes); + return detail::aligned_alloc(alignment, num_bytes); } template @@ -227,21 +228,21 @@ T *aligned_alloc_shared(size_t alignment, size_t count, const device &sycl_devic (void)sycl_device; (void)sycl_context; (void)prop_list; - return static_cast(std::aligned_alloc(alignment, count * sizeof(T))); + return static_cast(detail::aligned_alloc(alignment, count * sizeof(T))); } inline void *aligned_alloc_shared( size_t alignment, size_t num_bytes, const queue &sycl_queue, const property_list &prop_list = {}) { (void)sycl_queue; (void)prop_list; - return std::aligned_alloc(alignment, num_bytes); + return detail::aligned_alloc(alignment, num_bytes); } template T *aligned_alloc_shared(size_t alignment, size_t count, const queue &sycl_queue, const property_list &prop_list = {}) { (void)sycl_queue; (void)prop_list; - return static_cast(std::aligned_alloc(alignment, count * sizeof(T))); + return static_cast(detail::aligned_alloc(alignment, count * sizeof(T))); } inline void *malloc(size_t num_bytes, const device &sycl_device, const context &sycl_context, usm::alloc kind, @@ -250,7 +251,7 @@ inline void *malloc(size_t num_bytes, const device &sycl_device, const context & (void)sycl_context; (void)kind; (void)prop_list; - return std::malloc(num_bytes); + return detail::aligned_alloc(1, num_bytes); } template @@ -260,14 +261,14 @@ T *malloc(size_t count, const device &sycl_device, const context &sycl_context, (void)sycl_context; (void)kind; (void)prop_list; - return static_cast(std::aligned_alloc(alignof(T), count * sizeof(T))); + return static_cast(detail::aligned_alloc(alignof(T), count * sizeof(T))); } inline void *malloc(size_t num_bytes, const queue &sycl_queue, usm::alloc kind, const property_list &prop_list = {}) { (void)sycl_queue; (void)kind; (void)prop_list; - return std::malloc(num_bytes); + return detail::aligned_alloc(1, num_bytes); } template @@ -275,7 +276,7 @@ T *malloc(size_t count, const queue &sycl_queue, usm::alloc kind, const property (void)sycl_queue; (void)kind; (void)prop_list; - return static_cast(std::aligned_alloc(alignof(T), count * sizeof(T))); + return static_cast(detail::aligned_alloc(alignof(T), count * sizeof(T))); } inline void *aligned_alloc(size_t alignment, size_t num_bytes, const device &sycl_device, const context &sycl_context, @@ -284,7 +285,7 @@ inline void *aligned_alloc(size_t alignment, size_t num_bytes, const device &syc (void)sycl_context; (void)kind; (void)prop_list; - return std::aligned_alloc(alignment, num_bytes); + return detail::aligned_alloc(alignment, num_bytes); } template @@ -294,7 +295,7 @@ T *aligned_alloc(size_t alignment, size_t count, const device &sycl_device, cons (void)sycl_context; (void)kind; (void)prop_list; - return static_cast(std::aligned_alloc(alignment, count * sizeof(T))); + return static_cast(detail::aligned_alloc(alignment, count * sizeof(T))); } inline void *aligned_alloc( @@ -302,7 +303,7 @@ inline void *aligned_alloc( (void)sycl_queue; (void)kind; (void)prop_list; - return std::aligned_alloc(alignment, num_bytes); + return detail::aligned_alloc(alignment, num_bytes); } template @@ -311,17 +312,17 @@ T *aligned_alloc( (void)sycl_queue; (void)kind; (void)prop_list; - return static_cast(std::aligned_alloc(alignment, count * sizeof(T))); + return static_cast(detail::aligned_alloc(alignment, count * sizeof(T))); } inline void free(void *ptr, const context &sycl_context) { (void)sycl_context; - std::free(ptr); + detail::aligned_free(ptr); } inline void free(void *ptr, const queue &sycl_queue) { (void)sycl_queue; - std::free(ptr); + detail::aligned_free(ptr); } usm::alloc get_pointer_type(const void *ptr, const context &sycl_context);