From 1abdc6d7bce4cbf071a79913d9c662d68539bcc3 Mon Sep 17 00:00:00 2001 From: JackAKirk Date: Mon, 8 Jul 2024 17:11:51 +0100 Subject: [PATCH 1/6] Test UR pr. Signed-off-by: JackAKirk --- sycl/plugins/unified_runtime/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sycl/plugins/unified_runtime/CMakeLists.txt b/sycl/plugins/unified_runtime/CMakeLists.txt index d6d75ae50c3a6..16ad6ee7e48a5 100644 --- a/sycl/plugins/unified_runtime/CMakeLists.txt +++ b/sycl/plugins/unified_runtime/CMakeLists.txt @@ -99,14 +99,14 @@ if(SYCL_PI_UR_USE_FETCH_CONTENT) CACHE PATH "Path to external '${name}' adapter source dir" FORCE) endfunction() - set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git") + set(UNIFIED_RUNTIME_REPO "https://github.com/JackAKirk/unified-runtime.git") # commit 01af5602345ac3289cc084eb19bf266c054da075 # Merge: 20844ddc ad3befd1 # Author: Kenneth Benzie (Benie) # Date: Mon Jul 8 10:32:14 2024 +0100 # Merge pull request #1809 from nrspruit/fix_l0_ur_deviceinfo # [L0] Fix Device Info return code to report unsupported enumeration - set(UNIFIED_RUNTIME_TAG 01af5602345ac3289cc084eb19bf266c054da075) + set(UNIFIED_RUNTIME_TAG a8bc0058ce292fd977e28346420a11192995c945) fetch_adapter_source(level_zero ${UNIFIED_RUNTIME_REPO} From cba0cdb7415d256bf6e8c6de40d3e70bff221451 Mon Sep 17 00:00:00 2001 From: JackAKirk Date: Thu, 11 Jul 2024 11:59:15 +0100 Subject: [PATCH 2/6] Throw for get native ctxt in HIP. Signed-off-by: JackAKirk --- sycl/include/sycl/backend.hpp | 13 ++++++------- sycl/test/basic_tests/interop-hip.cpp | 1 - 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/sycl/include/sycl/backend.hpp b/sycl/include/sycl/backend.hpp index 7fab7ed12c8c3..edb898d60a6c7 100644 --- a/sycl/include/sycl/backend.hpp +++ b/sycl/include/sycl/backend.hpp @@ -229,17 +229,16 @@ inline backend_return_t get_native< #if SYCL_EXT_ONEAPI_BACKEND_HIP template <> -__SYCL_DEPRECATED( - "Context interop is deprecated for HIP. If a native context is required," - " use hipDevicePrimaryCtxRetain with a native device") -inline backend_return_t get_native< - backend::ext_oneapi_hip, context>(const context &Obj) { +inline backend_return_t +get_native(const context &Obj) { if (Obj.get_backend() != backend::ext_oneapi_hip) { throw sycl::exception(make_error_code(errc::backend_mismatch), "Backends mismatch"); } - return reinterpret_cast>( - Obj.getNative()); + throw sycl::exception( + make_error_code(sycl::errc::runtime), + "Context interop is not supported for HIP. If a native context is " + "required, use hipDevicePrimaryCtxRetain with a native device"); } #endif // SYCL_EXT_ONEAPI_BACKEND_HIP diff --git a/sycl/test/basic_tests/interop-hip.cpp b/sycl/test/basic_tests/interop-hip.cpp index 57fd7d436acb5..a58e43405b7ff 100644 --- a/sycl/test/basic_tests/interop-hip.cpp +++ b/sycl/test/basic_tests/interop-hip.cpp @@ -51,7 +51,6 @@ int main() { // backend-defined and specified in the backend specification. hip_device = get_native(Device); - // expected-warning@+1{{'get_native' is deprecated: Context interop is deprecated for HIP. If a native context is required, use hipDevicePrimaryCtxRetain with a native device}} hip_context = get_native(Context); hip_event = get_native(Event); hip_queue = get_native(Queue); From 82624762955fa14d033f328084becc69c34bf91e Mon Sep 17 00:00:00 2001 From: ldrumm Date: Wed, 17 Jul 2024 11:52:05 +0100 Subject: [PATCH 3/6] Update CMakeLists.txt --- sycl/plugins/unified_runtime/CMakeLists.txt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sycl/plugins/unified_runtime/CMakeLists.txt b/sycl/plugins/unified_runtime/CMakeLists.txt index 2d5fa93205c9c..e229df49045e6 100644 --- a/sycl/plugins/unified_runtime/CMakeLists.txt +++ b/sycl/plugins/unified_runtime/CMakeLists.txt @@ -100,16 +100,16 @@ if(SYCL_PI_UR_USE_FETCH_CONTENT) endfunction() set(UNIFIED_RUNTIME_REPO "https://github.com/JackAKirk/unified-runtime.git") -# From 7e38b39ad717d30f013699e5002dbee892d743cc Mon Sep 17 00:00:00 2001 -# From: JackAKirk -# Date: Mon, 8 Jul 2024 14:35:56 +0100 -# Subject: [PATCH] Remove deprecated hip APIs. - -# Mostly these APIs were completely redundant already. HIP amd doesn't have have a context concept. - -# Signed-off-by: JackAKirk -# --- - set(UNIFIED_RUNTIME_TAG 7e38b39ad717d30f013699e5002dbee892d743cc) + # commit 9abb51ebe60ef86ccc86838183e9bf15842c5f08 (jack/hip-set-device) + # Author: JackAKirk + # Date: Fri Jul 12 10:40:28 2024 +0100 + # + # Update match: API passes if unsupported. + # + # The test should have been checking for success or unsupported, since most backends don't support context interop. + # + # Signed-off-by: JackAKirk + set(UNIFIED_RUNTIME_TAG 9abb51ebe60ef86ccc86838183e9bf15842c5f08) fetch_adapter_source(level_zero ${UNIFIED_RUNTIME_REPO} From f585393f37b8be868e9ebb8b40be766c2c69b745 Mon Sep 17 00:00:00 2001 From: JackAKirk Date: Fri, 20 Sep 2024 03:03:41 -0700 Subject: [PATCH 4/6] Use expected-no-diagnostics in test Signed-off-by: JackAKirk --- sycl/test/basic_tests/interop-hip.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sycl/test/basic_tests/interop-hip.cpp b/sycl/test/basic_tests/interop-hip.cpp index a58e43405b7ff..7deaf2956a3c1 100644 --- a/sycl/test/basic_tests/interop-hip.cpp +++ b/sycl/test/basic_tests/interop-hip.cpp @@ -1,6 +1,6 @@ // REQUIRES: hip -// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s -// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note -D__SYCL_INTERNAL_API %s +// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify %s +// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -D__SYCL_INTERNAL_API %s // Test for HIP interop API @@ -51,6 +51,7 @@ int main() { // backend-defined and specified in the backend specification. hip_device = get_native(Device); + // expected-no-diagnostics hip_context = get_native(Context); hip_event = get_native(Event); hip_queue = get_native(Queue); From 66835de127f926fbac985814f422a68c62a876f8 Mon Sep 17 00:00:00 2001 From: JackAKirk Date: Fri, 20 Sep 2024 08:53:54 -0700 Subject: [PATCH 5/6] Update interop test, check exception. Also made exception use feature_not_supported Signed-off-by: JackAKirk --- sycl/include/sycl/backend.hpp | 2 +- sycl/test-e2e/Basic/interop/interop_all_backends.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/sycl/include/sycl/backend.hpp b/sycl/include/sycl/backend.hpp index c5d3377d914cc..24750732b08ff 100644 --- a/sycl/include/sycl/backend.hpp +++ b/sycl/include/sycl/backend.hpp @@ -244,7 +244,7 @@ get_native(const context &Obj) { "Backends mismatch"); } throw sycl::exception( - make_error_code(sycl::errc::runtime), + make_error_code(sycl::errc::feature_not_supported), "Context interop is not supported for HIP. If a native context is " "required, use hipDevicePrimaryCtxRetain with a native device"); } diff --git a/sycl/test-e2e/Basic/interop/interop_all_backends.cpp b/sycl/test-e2e/Basic/interop/interop_all_backends.cpp index 7d018ba43f52d..c2bb68918d270 100644 --- a/sycl/test-e2e/Basic/interop/interop_all_backends.cpp +++ b/sycl/test-e2e/Basic/interop/interop_all_backends.cpp @@ -82,6 +82,15 @@ int main() { auto Event3 = InteropQueue.memcpy(&vec[0], A, N * sizeof(int), Event2); Event3.wait(); + if constexpr (BACKEND == backend::ext_oneapi_hip) { + try { + backend_traits::return_type NativeContext = + get_native(Context); + } catch (sycl::exception &e) { + assert(e.code() == sycl::errc::feature_not_supported); + } + } + free(A, InteropQueue); for (const auto &val : vec) { From e5e94eaa403708034f68d50c555183f71e781841 Mon Sep 17 00:00:00 2001 From: JackAKirk Date: Mon, 23 Sep 2024 09:03:52 -0700 Subject: [PATCH 6/6] Update UR commit hash. Signed-off-by: JackAKirk --- sycl/cmake/modules/FetchUnifiedRuntime.cmake | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sycl/cmake/modules/FetchUnifiedRuntime.cmake b/sycl/cmake/modules/FetchUnifiedRuntime.cmake index c5ba91a5ac841..ec6c1c5d7838b 100644 --- a/sycl/cmake/modules/FetchUnifiedRuntime.cmake +++ b/sycl/cmake/modules/FetchUnifiedRuntime.cmake @@ -116,14 +116,14 @@ if(SYCL_UR_USE_FETCH_CONTENT) CACHE PATH "Path to external '${name}' adapter source dir" FORCE) endfunction() - set(UNIFIED_RUNTIME_REPO "https://github.com/JackAKirk/unified-runtime.git") - # commit 4d19115165b5497b647ae1b2e110488f84d1806a - # Merge: fb6df497 3f128d09 - # Author: Piotr Balcer - # Date: Tue Sep 17 10:31:44 2024 +0200 - # Merge pull request #2087 from nrspruit/fix_driver_inorder_event_wait - # [L0] Fix urEnqueueEventsWaitWithBarrier for driver in order lists - set(UNIFIED_RUNTIME_TAG 0ac56783090f481081edea84bacc236092a0f695) + set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git") + # commit f5c907a0f74fd6729be5c2e137144f1a43f87111 + # Merge: 9ca3ec7 be38e567 + # Author: aarongreig + # Date: Mon Sep 23 08:27:12 2024 -0700 + # Merge pull request #1830 from JackAKirk/hip-set-device + # [hip] Remove deprecated hip APIs, simplify urContext + set(UNIFIED_RUNTIME_TAG f5c907a0f74fd6729be5c2e137144f1a43f87111) set(UMF_BUILD_EXAMPLES OFF CACHE INTERNAL "EXAMPLES") # Due to the use of dependentloadflag and no installer for UMF and hwloc we need