From 97ed3863be4c44912b826d57b46482e2399682a8 Mon Sep 17 00:00:00 2001 From: "Hu, Peisen" Date: Tue, 16 Dec 2025 07:40:05 -0800 Subject: [PATCH 1/4] [SYCL] Implement sycl_ext_oneapi_usm_shortcuts Signed-off-by: Hu, Peisen --- sycl/include/sycl/usm.hpp | 47 +++++++++++++++ sycl/source/detail/usm/usm_impl.cpp | 88 +++++++++++++++++++++++++++++ 2 files changed, 135 insertions(+) diff --git a/sycl/include/sycl/usm.hpp b/sycl/include/sycl/usm.hpp index 43713f84f7092..f89ed157da2d8 100644 --- a/sycl/include/sycl/usm.hpp +++ b/sycl/include/sycl/usm.hpp @@ -349,6 +349,53 @@ __SYCL_EXPORT void release_from_device_copy(const void *Ptr, __SYCL_EXPORT void release_from_device_copy(const void *Ptr, const queue &Queue); +__SYCL_EXPORT void *malloc_device(size_t numBytes, const device &syclDevice, + const property_list &propList = {}); + +template +__SYCL_EXPORT T *malloc_device(size_t count, const device &syclDevice, + const property_list &propList = {}); + +__SYCL_EXPORT void *aligned_alloc_device(size_t alignment, size_t numBytes, + const device &syclDevice, + const property_list &propList = {}); + +template +__SYCL_EXPORT T *aligned_alloc_device(size_t alignment, size_t count, + const device &syclDevice, + const property_list &propList = {}); + +__SYCL_EXPORT void *malloc_shared(size_t numBytes, const device &syclDevice, + const property_list &propList = {}); + +template +__SYCL_EXPORT T *malloc_shared(size_t count, const device &syclDevice, + const property_list &propList = {}); + +__SYCL_EXPORT void *aligned_alloc_shared(size_t alignment, size_t numBytes, + const device &syclDevice, + const property_list &propList = {}); + +template +__SYCL_EXPORT T *aligned_alloc_shared(size_t alignment, size_t count, + const device &syclDevice, + const property_list &propList = {}); + +__SYCL_EXPORT void *malloc(size_t numBytes, const device &syclDevice, + usm::alloc kind, const property_list &propList = {}); + +template +__SYCL_EXPORT T *malloc(size_t count, const device &syclDevice, usm::alloc kind, + const property_list &propList = {}); + +__SYCL_EXPORT void *aligned_alloc(size_t alignment, size_t numBytes, + const device &syclDevice, usm::alloc kind, + const property_list &propList = {}); + +template +__SYCL_EXPORT T *aligned_alloc(size_t alignment, size_t count, + const device &syclDevice, usm::alloc kind, + const property_list &propList = {}); } // namespace ext::oneapi::experimental } // namespace _V1 diff --git a/sycl/source/detail/usm/usm_impl.cpp b/sycl/source/detail/usm/usm_impl.cpp index 486ee62bd9bc4..1a353ef3cf5e2 100644 --- a/sycl/source/detail/usm/usm_impl.cpp +++ b/sycl/source/detail/usm/usm_impl.cpp @@ -651,6 +651,94 @@ void release_from_device_copy(const void *Ptr, const context &Ctxt) { void release_from_device_copy(const void *Ptr, const queue &Queue) { release_from_usm_device_copy(Ptr, Queue.get_context()); } + +void *malloc_device(size_t numBytes, const device &syclDevice, + const property_list &propList) { + sycl::context ctxt = syclDevice.get_platform().khr_get_default_context(); + return sycl::malloc_device(numBytes, syclDevice, ctxt, propList); +} + +template +T *malloc_device(size_t count, const device &syclDevice, + const property_list &propList) { + sycl::context ctxt = syclDevice.get_platform().khr_get_default_context(); + return sycl::malloc_device(count, syclDevice, ctxt, propList); +} + +void *aligned_alloc_device(size_t alignment, size_t numBytes, + const device &syclDevice, + const property_list &propList) { + sycl::context ctxt = syclDevice.get_platform().khr_get_default_context(); + return sycl::aligned_alloc_device(alignment, numBytes, syclDevice, ctxt, + propList); +} + +template +T *aligned_alloc_device(size_t alignment, size_t count, + const device &syclDevice, + const property_list &propList) { + sycl::context ctxt = syclDevice.get_platform().khr_get_default_context(); + return sycl::aligned_alloc_device(alignment, count, syclDevice, ctxt, + propList); +} + +void *malloc_shared(size_t numBytes, const device &syclDevice, + const property_list &propList) { + sycl::context ctxt = syclDevice.get_platform().khr_get_default_context(); + return sycl::malloc_shared(numBytes, syclDevice, ctxt, propList); +} + +template +T *malloc_shared(size_t count, const device &syclDevice, + const property_list &propList) { + sycl::context ctxt = syclDevice.get_platform().khr_get_default_context(); + return sycl::malloc_shared(count, syclDevice, ctxt, propList); +} + +void *aligned_alloc_shared(size_t alignment, size_t numBytes, + const device &syclDevice, + const property_list &propList) { + sycl::context ctxt = syclDevice.get_platform().khr_get_default_context(); + return sycl::aligned_alloc_shared(alignment, numBytes, syclDevice, ctxt, + propList); +} + +template +T *aligned_alloc_shared(size_t alignment, size_t count, + const device &syclDevice, + const property_list &propList) { + sycl::context ctxt = syclDevice.get_platform().khr_get_default_context(); + return sycl::aligned_alloc_shared(alignment, count, syclDevice, ctxt, + propList); +} + +void *malloc(size_t numBytes, const device &syclDevice, usm::alloc kind, + const property_list &propList) { + sycl::context ctxt = syclDevice.get_platform().khr_get_default_context(); + return sycl::malloc(numBytes, syclDevice, ctxt, kind, propList); +} + +template +T *malloc(size_t count, const device &syclDevice, usm::alloc kind, + const property_list &propList) { + sycl::context ctxt = syclDevice.get_platform().khr_get_default_context(); + return sycl::malloc_shared(count, syclDevice, ctxt, kind, propList); +} + +void *aligned_alloc(size_t alignment, size_t numBytes, const device &syclDevice, + usm::alloc kind, const property_list &propList) { + sycl::context ctxt = syclDevice.get_platform().khr_get_default_context(); + return sycl::aligned_alloc(alignment, numBytes, syclDevice, ctxt, kind, + propList); +} + +template +T *aligned_alloc(size_t alignment, size_t count, const device &syclDevice, + usm::alloc kind, const property_list &propList) { + sycl::context ctxt = syclDevice.get_platform().khr_get_default_context(); + return sycl::aligned_alloc(alignment, count, syclDevice, ctxt, kind, + propList); +} } // namespace ext::oneapi::experimental __SYCL_EXPORT void verifyUSMAllocatorProperties(const property_list &PropList) { From 7d5f369bb1e4cbb0b84e82414e5800be72f1c024 Mon Sep 17 00:00:00 2001 From: "Hu, Peisen" Date: Tue, 16 Dec 2025 07:42:06 -0800 Subject: [PATCH 2/4] [SYCL] Add respective test Signed-off-by: Hu, Peisen --- sycl/test-e2e/USM/usm_shortcuts_utility.cpp | 99 +++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sycl/test-e2e/USM/usm_shortcuts_utility.cpp diff --git a/sycl/test-e2e/USM/usm_shortcuts_utility.cpp b/sycl/test-e2e/USM/usm_shortcuts_utility.cpp new file mode 100644 index 0000000000000..c3d6418f47ec7 --- /dev/null +++ b/sycl/test-e2e/USM/usm_shortcuts_utility.cpp @@ -0,0 +1,99 @@ +// RUN: %{build} -o %t.out +// RUN: %{run} %t.out + +//==------ usm_shortcuts_utility.cpp - USM malloc and aligned_alloc test +//-------==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include + +#include +#include + +#include + +using namespace sycl; +using namespace sycl::ext::oneapi::experimental; + +constexpr int N = 8; + +static void check_and_free(int *array, const device &dev, const context &ctxt, + usm::alloc expected_type) { + // host device treats all allocations as host allocations + assert((get_pointer_type(array, ctxt) == expected_type) && + "Allocation pointer has unexpected type."); + assert((get_pointer_device(array, ctxt) == dev) && + "Allocation pointer has unexpected device associated with it."); + free(array, ctxt); +} + +int main() { + queue q; + auto dev = q.get_device(); + auto ctxt = q.get_context(); + int *array; + + if (dev.get_info()) { + array = (int *)malloc(N * sizeof(int), dev, usm::alloc::host); + check_and_free(array, dev, ctxt, usm::alloc::host); + + array = + (int *)malloc(N * sizeof(int), dev, usm::alloc::host, property_list{}); + check_and_free(array, dev, ctxt, usm::alloc::host); + + array = (int *)aligned_alloc(alignof(long long), N * sizeof(int), dev, + usm::alloc::host); + check_and_free(array, dev, ctxt, usm::alloc::host); + + array = (int *)aligned_alloc(alignof(long long), N * sizeof(int), dev, + usm::alloc::host, property_list{}); + check_and_free(array, dev, ctxt, usm::alloc::host); + } + + if (dev.get_info()) { + array = (int *)malloc_shared(N * sizeof(int), dev); + check_and_free(array, dev, ctxt, usm::alloc::shared); + + array = (int *)malloc_shared( + N * sizeof(int), dev, + property_list{ + ext::intel::experimental::property::usm::buffer_location{2}}); + check_and_free(array, dev, ctxt, usm::alloc::shared); + + array = + (int *)aligned_alloc_shared(alignof(long long), N * sizeof(int), dev); + check_and_free(array, dev, ctxt, usm::alloc::shared); + + array = (int *)aligned_alloc_shared( + alignof(long long), N * sizeof(int), dev, + property_list{ + ext::intel::experimental::property::usm::buffer_location{2}}); + check_and_free(array, dev, ctxt, usm::alloc::shared); + } + + if (dev.get_info()) { + array = (int *)malloc_device(N * sizeof(int), dev); + check_and_free(array, dev, ctxt, usm::alloc::device); + + array = (int *)malloc_device( + N, dev, + property_list{ + ext::intel::experimental::property::usm::buffer_location(2)}); + check_and_free(array, dev, ctxt, usm::alloc::device); + + array = + (int *)aligned_alloc_device(alignof(long long), N * sizeof(int), dev); + check_and_free(array, dev, ctxt, usm::alloc::device); + + array = (int *)aligned_alloc_device(alignof(long long), N * sizeof(int), + dev, property_list{}); + check_and_free(array, dev, ctxt, usm::alloc::device); + } + + return 0; +} From 670f35621d46703e5dac0bbf361855bb1e367edc Mon Sep 17 00:00:00 2001 From: "Hu, Peisen" Date: Tue, 23 Dec 2025 02:02:54 -0800 Subject: [PATCH 3/4] [SYCL] Add respective test Signed-off-by: Hu, Peisen --- .../sycl_ext_oneapi_usm_shortcuts.asciidoc | 2 +- sycl/include/sycl/usm.hpp | 34 ++++++++++--- sycl/source/detail/usm/usm_impl.cpp | 47 ------------------ sycl/source/feature_test.hpp.in | 1 + sycl/test-e2e/USM/usm_shortcuts_utility.cpp | 49 +++++++++++++++++++ sycl/test/abi/sycl_symbols_linux.dump | 6 +++ .../sycl_khr_includes_reduction.hpp.cpp | 1 + .../sycl_khr_includes_usm.hpp.cpp | 1 + 8 files changed, 87 insertions(+), 54 deletions(-) diff --git a/sycl/doc/extensions/proposed/sycl_ext_oneapi_usm_shortcuts.asciidoc b/sycl/doc/extensions/proposed/sycl_ext_oneapi_usm_shortcuts.asciidoc index d76512a1c07fe..80d85e63a513b 100644 --- a/sycl/doc/extensions/proposed/sycl_ext_oneapi_usm_shortcuts.asciidoc +++ b/sycl/doc/extensions/proposed/sycl_ext_oneapi_usm_shortcuts.asciidoc @@ -322,7 +322,7 @@ _Effects_: Equivalent to: [source,c++,indent=2] ---- sycl::context ctxt = syclDevice.get_platform().khr_get_default_context(); -return sycl::malloc_shared(count, syclDevice, ctxt, kind, propList); +return sycl::malloc(count, syclDevice, ctxt, kind, propList); ---- ''' diff --git a/sycl/include/sycl/usm.hpp b/sycl/include/sycl/usm.hpp index f89ed157da2d8..4b7bb1529d75d 100644 --- a/sycl/include/sycl/usm.hpp +++ b/sycl/include/sycl/usm.hpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -354,7 +355,10 @@ __SYCL_EXPORT void *malloc_device(size_t numBytes, const device &syclDevice, template __SYCL_EXPORT T *malloc_device(size_t count, const device &syclDevice, - const property_list &propList = {}); + const property_list &propList = {}) { + sycl::context ctxt = syclDevice.get_platform().khr_get_default_context(); + return sycl::malloc_device(count, syclDevice, ctxt, propList); +} __SYCL_EXPORT void *aligned_alloc_device(size_t alignment, size_t numBytes, const device &syclDevice, @@ -363,14 +367,21 @@ __SYCL_EXPORT void *aligned_alloc_device(size_t alignment, size_t numBytes, template __SYCL_EXPORT T *aligned_alloc_device(size_t alignment, size_t count, const device &syclDevice, - const property_list &propList = {}); + const property_list &propList = {}) { + sycl::context ctxt = syclDevice.get_platform().khr_get_default_context(); + return sycl::aligned_alloc_device(alignment, count, syclDevice, ctxt, + propList); +} __SYCL_EXPORT void *malloc_shared(size_t numBytes, const device &syclDevice, const property_list &propList = {}); template __SYCL_EXPORT T *malloc_shared(size_t count, const device &syclDevice, - const property_list &propList = {}); + const property_list &propList = {}) { + sycl::context ctxt = syclDevice.get_platform().khr_get_default_context(); + return sycl::malloc_shared(count, syclDevice, ctxt, propList); +} __SYCL_EXPORT void *aligned_alloc_shared(size_t alignment, size_t numBytes, const device &syclDevice, @@ -379,14 +390,21 @@ __SYCL_EXPORT void *aligned_alloc_shared(size_t alignment, size_t numBytes, template __SYCL_EXPORT T *aligned_alloc_shared(size_t alignment, size_t count, const device &syclDevice, - const property_list &propList = {}); + const property_list &propList = {}) { + sycl::context ctxt = syclDevice.get_platform().khr_get_default_context(); + return sycl::aligned_alloc_shared(alignment, count, syclDevice, ctxt, + propList); +} __SYCL_EXPORT void *malloc(size_t numBytes, const device &syclDevice, usm::alloc kind, const property_list &propList = {}); template __SYCL_EXPORT T *malloc(size_t count, const device &syclDevice, usm::alloc kind, - const property_list &propList = {}); + const property_list &propList = {}) { + sycl::context ctxt = syclDevice.get_platform().khr_get_default_context(); + return sycl::malloc(count, syclDevice, ctxt, kind, propList); +} __SYCL_EXPORT void *aligned_alloc(size_t alignment, size_t numBytes, const device &syclDevice, usm::alloc kind, @@ -395,7 +413,11 @@ __SYCL_EXPORT void *aligned_alloc(size_t alignment, size_t numBytes, template __SYCL_EXPORT T *aligned_alloc(size_t alignment, size_t count, const device &syclDevice, usm::alloc kind, - const property_list &propList = {}); + const property_list &propList = {}) { + sycl::context ctxt = syclDevice.get_platform().khr_get_default_context(); + return sycl::aligned_alloc(alignment, count, syclDevice, ctxt, kind, + propList); +} } // namespace ext::oneapi::experimental } // namespace _V1 diff --git a/sycl/source/detail/usm/usm_impl.cpp b/sycl/source/detail/usm/usm_impl.cpp index 1a353ef3cf5e2..66066ec61cc8f 100644 --- a/sycl/source/detail/usm/usm_impl.cpp +++ b/sycl/source/detail/usm/usm_impl.cpp @@ -658,13 +658,6 @@ void *malloc_device(size_t numBytes, const device &syclDevice, return sycl::malloc_device(numBytes, syclDevice, ctxt, propList); } -template -T *malloc_device(size_t count, const device &syclDevice, - const property_list &propList) { - sycl::context ctxt = syclDevice.get_platform().khr_get_default_context(); - return sycl::malloc_device(count, syclDevice, ctxt, propList); -} - void *aligned_alloc_device(size_t alignment, size_t numBytes, const device &syclDevice, const property_list &propList) { @@ -673,28 +666,12 @@ void *aligned_alloc_device(size_t alignment, size_t numBytes, propList); } -template -T *aligned_alloc_device(size_t alignment, size_t count, - const device &syclDevice, - const property_list &propList) { - sycl::context ctxt = syclDevice.get_platform().khr_get_default_context(); - return sycl::aligned_alloc_device(alignment, count, syclDevice, ctxt, - propList); -} - void *malloc_shared(size_t numBytes, const device &syclDevice, const property_list &propList) { sycl::context ctxt = syclDevice.get_platform().khr_get_default_context(); return sycl::malloc_shared(numBytes, syclDevice, ctxt, propList); } -template -T *malloc_shared(size_t count, const device &syclDevice, - const property_list &propList) { - sycl::context ctxt = syclDevice.get_platform().khr_get_default_context(); - return sycl::malloc_shared(count, syclDevice, ctxt, propList); -} - void *aligned_alloc_shared(size_t alignment, size_t numBytes, const device &syclDevice, const property_list &propList) { @@ -703,42 +680,18 @@ void *aligned_alloc_shared(size_t alignment, size_t numBytes, propList); } -template -T *aligned_alloc_shared(size_t alignment, size_t count, - const device &syclDevice, - const property_list &propList) { - sycl::context ctxt = syclDevice.get_platform().khr_get_default_context(); - return sycl::aligned_alloc_shared(alignment, count, syclDevice, ctxt, - propList); -} - void *malloc(size_t numBytes, const device &syclDevice, usm::alloc kind, const property_list &propList) { sycl::context ctxt = syclDevice.get_platform().khr_get_default_context(); return sycl::malloc(numBytes, syclDevice, ctxt, kind, propList); } -template -T *malloc(size_t count, const device &syclDevice, usm::alloc kind, - const property_list &propList) { - sycl::context ctxt = syclDevice.get_platform().khr_get_default_context(); - return sycl::malloc_shared(count, syclDevice, ctxt, kind, propList); -} - void *aligned_alloc(size_t alignment, size_t numBytes, const device &syclDevice, usm::alloc kind, const property_list &propList) { sycl::context ctxt = syclDevice.get_platform().khr_get_default_context(); return sycl::aligned_alloc(alignment, numBytes, syclDevice, ctxt, kind, propList); } - -template -T *aligned_alloc(size_t alignment, size_t count, const device &syclDevice, - usm::alloc kind, const property_list &propList) { - sycl::context ctxt = syclDevice.get_platform().khr_get_default_context(); - return sycl::aligned_alloc(alignment, count, syclDevice, ctxt, kind, - propList); -} } // namespace ext::oneapi::experimental __SYCL_EXPORT void verifyUSMAllocatorProperties(const property_list &PropList) { diff --git a/sycl/source/feature_test.hpp.in b/sycl/source/feature_test.hpp.in index bb744a8896b72..993fbd2e9b7bd 100644 --- a/sycl/source/feature_test.hpp.in +++ b/sycl/source/feature_test.hpp.in @@ -129,6 +129,7 @@ inline namespace _V1 { #define SYCL_EXT_INTEL_EVENT_MODE 1 #define SYCL_EXT_ONEAPI_TANGLE 1 #define SYCL_EXT_ONEAPI_INTER_PROCESS_COMMUNICATION 1 +#define SYCL_EXT_ONEAPI_USM_SHORTCUTS 1 // Unfinished KHR extensions. These extensions are only available if the // __DPCPP_ENABLE_UNFINISHED_KHR_EXTENSIONS macro is defined. diff --git a/sycl/test-e2e/USM/usm_shortcuts_utility.cpp b/sycl/test-e2e/USM/usm_shortcuts_utility.cpp index c3d6418f47ec7..791de71db706d 100644 --- a/sycl/test-e2e/USM/usm_shortcuts_utility.cpp +++ b/sycl/test-e2e/USM/usm_shortcuts_utility.cpp @@ -46,6 +46,13 @@ int main() { (int *)malloc(N * sizeof(int), dev, usm::alloc::host, property_list{}); check_and_free(array, dev, ctxt, usm::alloc::host); + array = malloc(N * sizeof(int), dev, usm::alloc::host); + check_and_free(array, dev, ctxt, usm::alloc::host); + + array = + malloc(N * sizeof(int), dev, usm::alloc::host, property_list{}); + check_and_free(array, dev, ctxt, usm::alloc::host); + array = (int *)aligned_alloc(alignof(long long), N * sizeof(int), dev, usm::alloc::host); check_and_free(array, dev, ctxt, usm::alloc::host); @@ -53,6 +60,14 @@ int main() { array = (int *)aligned_alloc(alignof(long long), N * sizeof(int), dev, usm::alloc::host, property_list{}); check_and_free(array, dev, ctxt, usm::alloc::host); + + array = aligned_alloc(alignof(long long), N * sizeof(int), dev, + usm::alloc::host); + check_and_free(array, dev, ctxt, usm::alloc::host); + + array = aligned_alloc(alignof(long long), N * sizeof(int), dev, + usm::alloc::host, property_list{}); + check_and_free(array, dev, ctxt, usm::alloc::host); } if (dev.get_info()) { @@ -65,6 +80,15 @@ int main() { ext::intel::experimental::property::usm::buffer_location{2}}); check_and_free(array, dev, ctxt, usm::alloc::shared); + array = malloc_shared(N * sizeof(int), dev); + check_and_free(array, dev, ctxt, usm::alloc::shared); + + array = malloc_shared( + N * sizeof(int), dev, + property_list{ + ext::intel::experimental::property::usm::buffer_location{2}}); + check_and_free(array, dev, ctxt, usm::alloc::shared); + array = (int *)aligned_alloc_shared(alignof(long long), N * sizeof(int), dev); check_and_free(array, dev, ctxt, usm::alloc::shared); @@ -74,6 +98,15 @@ int main() { property_list{ ext::intel::experimental::property::usm::buffer_location{2}}); check_and_free(array, dev, ctxt, usm::alloc::shared); + + array = aligned_alloc_shared(alignof(long long), N * sizeof(int), dev); + check_and_free(array, dev, ctxt, usm::alloc::shared); + + array = aligned_alloc_shared( + alignof(long long), N * sizeof(int), dev, + property_list{ + ext::intel::experimental::property::usm::buffer_location{2}}); + check_and_free(array, dev, ctxt, usm::alloc::shared); } if (dev.get_info()) { @@ -86,6 +119,15 @@ int main() { ext::intel::experimental::property::usm::buffer_location(2)}); check_and_free(array, dev, ctxt, usm::alloc::device); + array = malloc_device(N * sizeof(int), dev); + check_and_free(array, dev, ctxt, usm::alloc::device); + + array = malloc_device( + N, dev, + property_list{ + ext::intel::experimental::property::usm::buffer_location(2)}); + check_and_free(array, dev, ctxt, usm::alloc::device); + array = (int *)aligned_alloc_device(alignof(long long), N * sizeof(int), dev); check_and_free(array, dev, ctxt, usm::alloc::device); @@ -93,6 +135,13 @@ int main() { array = (int *)aligned_alloc_device(alignof(long long), N * sizeof(int), dev, property_list{}); check_and_free(array, dev, ctxt, usm::alloc::device); + + array = aligned_alloc_device(alignof(long long), N * sizeof(int), dev); + check_and_free(array, dev, ctxt, usm::alloc::device); + + array = aligned_alloc_device(alignof(long long), N * sizeof(int), dev, + property_list{}); + check_and_free(array, dev, ctxt, usm::alloc::device); } return 0; diff --git a/sycl/test/abi/sycl_symbols_linux.dump b/sycl/test/abi/sycl_symbols_linux.dump index 65a98d741316f..61627b163fcf0 100644 --- a/sycl/test/abi/sycl_symbols_linux.dump +++ b/sycl/test/abi/sycl_symbols_linux.dump @@ -3011,6 +3011,9 @@ _ZN4sycl3_V13ext6oneapi12experimental12create_imageERNS3_9image_memERKNS3_22bind _ZN4sycl3_V13ext6oneapi12experimental12create_imageERNS3_9image_memERKNS3_22bindless_image_samplerERKNS3_16image_descriptorERKNS0_6deviceERKNS0_7contextE _ZN4sycl3_V13ext6oneapi12experimental12physical_memC1ERKNS0_6deviceERKNS0_7contextEm _ZN4sycl3_V13ext6oneapi12experimental12physical_memC2ERKNS0_6deviceERKNS0_7contextEm +_ZN4sycl3_V13ext6oneapi12experimental13aligned_allocEmmRKNS0_6deviceENS0_3usm5allocERKNS0_13property_listE +_ZN4sycl3_V13ext6oneapi12experimental13malloc_deviceEmRKNS0_6deviceERKNS0_13property_listE +_ZN4sycl3_V13ext6oneapi12experimental13malloc_sharedEmRKNS0_6deviceERKNS0_13property_listE _ZN4sycl3_V13ext6oneapi12experimental14free_image_memENS3_16image_mem_handleENS3_10image_typeERKNS0_5queueE _ZN4sycl3_V13ext6oneapi12experimental14free_image_memENS3_16image_mem_handleENS3_10image_typeERKNS0_6deviceERKNS0_7contextE _ZN4sycl3_V13ext6oneapi12experimental15alloc_image_memERKNS3_16image_descriptorERKNS0_5queueE @@ -3023,6 +3026,8 @@ _ZN4sycl3_V13ext6oneapi12experimental16free_virtual_memEmmRKNS0_7contextE _ZN4sycl3_V13ext6oneapi12experimental19get_mem_granularityERKNS0_6deviceERKNS0_7contextENS3_16granularity_modeE _ZN4sycl3_V13ext6oneapi12experimental19get_mem_granularityERKNS0_7contextENS3_16granularity_modeE _ZN4sycl3_V13ext6oneapi12experimental19reserve_virtual_memEmmRKNS0_7contextE +_ZN4sycl3_V13ext6oneapi12experimental20aligned_alloc_deviceEmmRKNS0_6deviceERKNS0_13property_listE +_ZN4sycl3_V13ext6oneapi12experimental20aligned_alloc_sharedEmmRKNS0_6deviceERKNS0_13property_listE _ZN4sycl3_V13ext6oneapi12experimental20destroy_image_handleERNS3_20sampled_image_handleERKNS0_5queueE _ZN4sycl3_V13ext6oneapi12experimental20destroy_image_handleERNS3_20sampled_image_handleERKNS0_6deviceERKNS0_7contextE _ZN4sycl3_V13ext6oneapi12experimental20destroy_image_handleERNS3_22unsampled_image_handleERKNS0_5queueE @@ -3130,6 +3135,7 @@ _ZN4sycl3_V13ext6oneapi12experimental6detail30dynamic_work_group_memory_baseC2Em _ZN4sycl3_V13ext6oneapi12experimental6detail30make_kernel_bundle_from_sourceERKNS0_7contextENS3_15source_languageENS0_6detail11string_viewESt6vectorISt4pairISA_SA_ESaISD_EE _ZN4sycl3_V13ext6oneapi12experimental6detail30make_kernel_bundle_from_sourceERKNS0_7contextENS3_15source_languageERKSt6vectorISt4byteSaISA_EES9_ISt4pairINS0_6detail11string_viewESH_ESaISI_EE _ZN4sycl3_V13ext6oneapi12experimental6detail33export_device_mem_win32_nt_handleEPvRKNS0_6deviceERKNS0_7contextE +_ZN4sycl3_V13ext6oneapi12experimental6mallocEmRKNS0_6deviceENS0_3usm5allocERKNS0_13property_listE _ZN4sycl3_V13ext6oneapi12experimental6memcpyENS0_5queueEPvPKvmRKNS0_6detail13code_locationE _ZN4sycl3_V13ext6oneapi12experimental6memsetENS0_5queueEPvimRKNS0_6detail13code_locationE _ZN4sycl3_V13ext6oneapi12experimental9image_memC1ERKNS3_16image_descriptorERKNS0_5queueE diff --git a/sycl/test/include_deps/sycl_khr_includes_reduction.hpp.cpp b/sycl/test/include_deps/sycl_khr_includes_reduction.hpp.cpp index 53e1da9695d09..591bf1facea93 100644 --- a/sycl/test/include_deps/sycl_khr_includes_reduction.hpp.cpp +++ b/sycl/test/include_deps/sycl_khr_includes_reduction.hpp.cpp @@ -183,5 +183,6 @@ // CHECK-NEXT: ext/oneapi/experimental/event_mode_property.hpp // CHECK-NEXT: sycl_span.hpp // CHECK-NEXT: usm.hpp +// CHECK-NEXT: platform.hpp // CHECK-NEXT: usm/usm_pointer_info.hpp // CHECK-EMPTY: diff --git a/sycl/test/include_deps/sycl_khr_includes_usm.hpp.cpp b/sycl/test/include_deps/sycl_khr_includes_usm.hpp.cpp index 7b0becee030d4..445f99831a8bf 100644 --- a/sycl/test/include_deps/sycl_khr_includes_usm.hpp.cpp +++ b/sycl/test/include_deps/sycl_khr_includes_usm.hpp.cpp @@ -170,6 +170,7 @@ // CHECK-NEXT: kernel.hpp // CHECK-NEXT: sampler.hpp // CHECK-NEXT: sycl_span.hpp +// CHECK-NEXT: platform.hpp // CHECK-NEXT: usm/usm_pointer_info.hpp // CHECK-NEXT: usm/usm_allocator.hpp // CHECK-EMPTY: From 279bb5614e86d8130ab0c74f8cb52e7438ef3189 Mon Sep 17 00:00:00 2001 From: "Hu, Peisen" Date: Tue, 23 Dec 2025 14:42:14 -0800 Subject: [PATCH 4/4] [SYCL] Fix outdated props in tests Signed-off-by: Hu, Peisen --- sycl/test-e2e/USM/usm_shortcuts_utility.cpp | 35 ++++++--------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/sycl/test-e2e/USM/usm_shortcuts_utility.cpp b/sycl/test-e2e/USM/usm_shortcuts_utility.cpp index 791de71db706d..7d9eb73614f90 100644 --- a/sycl/test-e2e/USM/usm_shortcuts_utility.cpp +++ b/sycl/test-e2e/USM/usm_shortcuts_utility.cpp @@ -1,8 +1,7 @@ // RUN: %{build} -o %t.out // RUN: %{run} %t.out -//==------ usm_shortcuts_utility.cpp - USM malloc and aligned_alloc test -//-------==// +//==------ usm_shortcuts_utility.cpp - USM shortcuts test ------------------==// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -74,38 +73,28 @@ int main() { array = (int *)malloc_shared(N * sizeof(int), dev); check_and_free(array, dev, ctxt, usm::alloc::shared); - array = (int *)malloc_shared( - N * sizeof(int), dev, - property_list{ - ext::intel::experimental::property::usm::buffer_location{2}}); + array = (int *)malloc_shared(N * sizeof(int), dev, property_list{}); check_and_free(array, dev, ctxt, usm::alloc::shared); array = malloc_shared(N * sizeof(int), dev); check_and_free(array, dev, ctxt, usm::alloc::shared); - array = malloc_shared( - N * sizeof(int), dev, - property_list{ - ext::intel::experimental::property::usm::buffer_location{2}}); + array = malloc_shared(N * sizeof(int), dev, property_list{}); check_and_free(array, dev, ctxt, usm::alloc::shared); array = (int *)aligned_alloc_shared(alignof(long long), N * sizeof(int), dev); check_and_free(array, dev, ctxt, usm::alloc::shared); - array = (int *)aligned_alloc_shared( - alignof(long long), N * sizeof(int), dev, - property_list{ - ext::intel::experimental::property::usm::buffer_location{2}}); + array = (int *)aligned_alloc_shared(alignof(long long), N * sizeof(int), + dev, property_list{}); check_and_free(array, dev, ctxt, usm::alloc::shared); array = aligned_alloc_shared(alignof(long long), N * sizeof(int), dev); check_and_free(array, dev, ctxt, usm::alloc::shared); - array = aligned_alloc_shared( - alignof(long long), N * sizeof(int), dev, - property_list{ - ext::intel::experimental::property::usm::buffer_location{2}}); + array = aligned_alloc_shared(alignof(long long), N * sizeof(int), dev, + property_list{}); check_and_free(array, dev, ctxt, usm::alloc::shared); } @@ -113,19 +102,13 @@ int main() { array = (int *)malloc_device(N * sizeof(int), dev); check_and_free(array, dev, ctxt, usm::alloc::device); - array = (int *)malloc_device( - N, dev, - property_list{ - ext::intel::experimental::property::usm::buffer_location(2)}); + array = (int *)malloc_device(N, dev, property_list{}); check_and_free(array, dev, ctxt, usm::alloc::device); array = malloc_device(N * sizeof(int), dev); check_and_free(array, dev, ctxt, usm::alloc::device); - array = malloc_device( - N, dev, - property_list{ - ext::intel::experimental::property::usm::buffer_location(2)}); + array = malloc_device(N, dev, property_list{}); check_and_free(array, dev, ctxt, usm::alloc::device); array =