From 7421f33c9ce05e257a170cb9900f2ba3d83bb167 Mon Sep 17 00:00:00 2001 From: PietroGhg Date: Wed, 17 Jul 2024 12:11:50 +0100 Subject: [PATCH 1/3] Update UR tag --- 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 ae79652feb6e4..e58da05c76155 100644 --- a/sycl/plugins/unified_runtime/CMakeLists.txt +++ b/sycl/plugins/unified_runtime/CMakeLists.txt @@ -129,8 +129,8 @@ if(SYCL_PI_UR_USE_FETCH_CONTENT) ) fetch_adapter_source(native_cpu - ${UNIFIED_RUNTIME_REPO} - ${UNIFIED_RUNTIME_TAG} + "https://github.com/PietroGhg/unified-runtime.git" + pietro/events_initial ) if(SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO) From 9d45f1c436bdef6f76eedea838462bfe56225536 Mon Sep 17 00:00:00 2001 From: PietroGhg Date: Tue, 20 Aug 2024 10:57:32 +0100 Subject: [PATCH 2/3] Update args test --- sycl/test/native_cpu/scalar_args.cpp | 75 ++++++++++++++++++---------- 1 file changed, 49 insertions(+), 26 deletions(-) diff --git a/sycl/test/native_cpu/scalar_args.cpp b/sycl/test/native_cpu/scalar_args.cpp index 93d3fe1fcb6fa..fbc382b03e4b2 100644 --- a/sycl/test/native_cpu/scalar_args.cpp +++ b/sycl/test/native_cpu/scalar_args.cpp @@ -12,39 +12,62 @@ const size_t N = 10; template class init_a; -template bool test(queue myQueue) { - { - buffer a(range<1>{N}); - const T test = rand() % 10; - - myQueue.submit([&](handler &cgh) { - auto A = a.get_access(cgh); - cgh.parallel_for>(range<1>{N}, - [=](id<1> index) { A[index] = test; }); - }); - - auto A = a.get_access(); - std::cout << "Result:" << std::endl; - for (size_t i = 0; i < N; i++) { - if (A[i] != test) { - std::cout << "ERROR at pos " << i << " expected " << test << ", got " - << A[i] << "\n"; - return false; - } - } +template +bool compare(const sycl::vec a, const sycl::vec truth) { + bool res = true; + for (int i = 0; i < M; i++) { + res &= a[i] == truth[i]; } + return res; +} - std::cout << "Good computation!" << std::endl; +template bool compare(const T a, const T truth) { + return a == truth; +} + +template bool check(buffer &result, const T truth) { + auto A = result.get_host_access(); + for (size_t i = 0; i < N; i++) { + if (!compare(A[i], truth)) { + return false; + } + } return true; } +template bool test(queue myQueue) { + buffer a(range<1>{N}); + const T test{42}; + + myQueue.submit([&](handler &cgh) { + auto A = a.template get_access(cgh); + cgh.parallel_for>(range<1>{N}, + [=](id<1> index) { A[index] = test; }); + }); + + return check(a, test); +} + int main() { queue q; - int res1 = test(q); - int res2 = test(q); - int res3 = test(q); - int res4 = test(q); - if (!(res1 && res2 && res3 && res4)) { + + std::vector res; + res.push_back(test(q)); + res.push_back(test(q)); + res.push_back(test(q)); + res.push_back(test(q)); + res.push_back(test>(q)); + res.push_back(test>(q)); + res.push_back(test>(q)); + res.push_back(test>(q)); + res.push_back(test>(q)); + res.push_back(test>(q)); + res.push_back(test>(q)); + res.push_back(test>(q)); + res.push_back(test>(q)); + res.push_back(test>(q)); + + if (std::any_of(res.begin(), res.end(), [](bool b) { return !b; })) { return 1; } return 0; From dd2d5e3883d81a92da099bdd657e0df6e2c3ab55 Mon Sep 17 00:00:00 2001 From: Aaron Greig Date: Thu, 24 Oct 2024 16:22:46 +0100 Subject: [PATCH 3/3] Update UR tag. --- sycl/cmake/modules/FetchUnifiedRuntime.cmake | 4 ++-- sycl/cmake/modules/UnifiedRuntimeTag.cmake | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sycl/cmake/modules/FetchUnifiedRuntime.cmake b/sycl/cmake/modules/FetchUnifiedRuntime.cmake index 20a10b90d2e10..72841724fa01d 100644 --- a/sycl/cmake/modules/FetchUnifiedRuntime.cmake +++ b/sycl/cmake/modules/FetchUnifiedRuntime.cmake @@ -150,8 +150,8 @@ if(SYCL_UR_USE_FETCH_CONTENT) ) fetch_adapter_source(native_cpu - "https://github.com/PietroGhg/unified-runtime.git" - pietro/events_initial + ${UNIFIED_RUNTIME_REPO} + ${UNIFIED_RUNTIME_TAG} ) if(SYCL_UR_OVERRIDE_FETCH_CONTENT_REPO) diff --git a/sycl/cmake/modules/UnifiedRuntimeTag.cmake b/sycl/cmake/modules/UnifiedRuntimeTag.cmake index da8ef592cd170..51c412c28e259 100644 --- a/sycl/cmake/modules/UnifiedRuntimeTag.cmake +++ b/sycl/cmake/modules/UnifiedRuntimeTag.cmake @@ -1,7 +1,7 @@ -# commit 58abf8fa778376546274c52304b9f924314d65e6 -# Merge: a96fddec a97df490 +# commit eddfd8ef62a267921612801ed4300cc429460b05 +# Merge: 58abf8fa ec5e8ea6 # Author: aarongreig -# Date: Thu Oct 24 13:37:02 2024 +0100 -# Merge pull request #2160 from aarongreig/aaron/clQuerySourceWGSize -# Query out and use local size set in program IL in CL adapter -set(UNIFIED_RUNTIME_TAG 58abf8fa778376546274c52304b9f924314d65e6) +# Date: Thu Oct 24 16:16:06 2024 +0100 +# Merge pull request #2153 from PietroGhg/pietro/events_initial +# [NATIVECPU] Initial implementation of events on Native CPU +set(UNIFIED_RUNTIME_TAG eddfd8ef62a267921612801ed4300cc429460b05)