From f977a759b8cafac2389e5c9e7ffe15427e9472ab Mon Sep 17 00:00:00 2001 From: Hugh Delaney Date: Fri, 17 Nov 2023 10:45:02 -0500 Subject: [PATCH] Remove old test, add ur_lock and update UR SHA --- sycl/plugins/unified_runtime/CMakeLists.txt | 10 ++----- sycl/plugins/unified_runtime/ur/ur.hpp | 12 +++++++++ sycl/test-e2e/Plugin/interop-buffer-hip.cpp | 29 --------------------- 3 files changed, 14 insertions(+), 37 deletions(-) delete mode 100644 sycl/test-e2e/Plugin/interop-buffer-hip.cpp diff --git a/sycl/plugins/unified_runtime/CMakeLists.txt b/sycl/plugins/unified_runtime/CMakeLists.txt index af3e1397b3a6f..3ab25ec68b502 100644 --- a/sycl/plugins/unified_runtime/CMakeLists.txt +++ b/sycl/plugins/unified_runtime/CMakeLists.txt @@ -55,14 +55,8 @@ endif() if(SYCL_PI_UR_USE_FETCH_CONTENT) include(FetchContent) - set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git") - # commit 659d3f469faa99a886fa680a3d6d20449b109578 - # Merge: 192e9404 f94550b4 - # Author: Kenneth Benzie (Benie) - # Date: Tue Nov 14 16:45:24 2023 +0000 - # Merge pull request #1059 from martygrant/martin/moveNativeCPUAdapterToUR - # [NATIVECPU] Move Native CPU adapter to UR. - set(UNIFIED_RUNTIME_TAG 659d3f469faa99a886fa680a3d6d20449b109578) + set(UNIFIED_RUNTIME_REPO "https://github.com/hdelan/unified-runtime.git") + set(UNIFIED_RUNTIME_TAG ornl-m2) if(SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO) set(UNIFIED_RUNTIME_REPO "${SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO}") diff --git a/sycl/plugins/unified_runtime/ur/ur.hpp b/sycl/plugins/unified_runtime/ur/ur.hpp index 50d41e96042cc..7dbf33a1dc6d3 100644 --- a/sycl/plugins/unified_runtime/ur/ur.hpp +++ b/sycl/plugins/unified_runtime/ur/ur.hpp @@ -100,6 +100,7 @@ class ur_shared_mutex { // nop. class ur_mutex { std::mutex Mutex; + friend class ur_lock; public: void lock() { @@ -113,6 +114,17 @@ class ur_mutex { } }; +class ur_lock { + std::unique_lock Lock; + +public: + explicit ur_lock(ur_mutex &Mutex) { + if (!SingleThreadMode) { + Lock = std::unique_lock(Mutex.Mutex); + } + } +}; + /// SpinLock is a synchronization primitive, that uses atomic variable and /// causes thread trying acquire lock wait in loop while repeatedly check if /// the lock is available. diff --git a/sycl/test-e2e/Plugin/interop-buffer-hip.cpp b/sycl/test-e2e/Plugin/interop-buffer-hip.cpp deleted file mode 100644 index dd1cc4fd03b9e..0000000000000 --- a/sycl/test-e2e/Plugin/interop-buffer-hip.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// REQUIRES: hip - -// RUN: %{build} -o %t.out -// RUN: %{run} %t.out - -//==--- interop-buffer-hip.cpp - SYCL test for HIP buffer interop API ----------===// -// -// 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 - -int main() { - int Data[1] = {0}; - sycl::buffer Buffer(&Data[0], sycl::range<1>(1)); - { - sycl::queue Queue{sycl::gpu_selector_v}; - Queue.submit([&](sycl::handler &cgh) { - auto Acc = Buffer.get_access(cgh); - cgh.single_task([=]() { (void)Acc; }); - }); - } - - auto NativeObj = sycl::get_native(Buffer); - assert(NativeObj != 0); -}