From a15a76d0d8c321b16997205e7bfa344def1d9c04 Mon Sep 17 00:00:00 2001 From: "Zhao, Yang2" Date: Tue, 16 Jul 2024 20:25:40 -0700 Subject: [PATCH 1/5] change ur repo --- 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..71b67416b3a41 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/AllanZyne/unified-runtime.git") # commit 7e38af77174f92bf4025122b1fa8e3fc49f3ba29 # Merge: ddafd29b 6c7d7a76 # Author: Kenneth Benzie (Benie) # Date: Mon Jul 15 15:14:47 2024 +0100 # Merge pull request #1863 from kbenzie/benie/main-reverts # Revert "Merge pull request #1849 from ayylol/cl-subgroupsizes" - set(UNIFIED_RUNTIME_TAG 7e38af77174f92bf4025122b1fa8e3fc49f3ba29) + set(UNIFIED_RUNTIME_TAG review/yang/statistics) fetch_adapter_source(level_zero ${UNIFIED_RUNTIME_REPO} From 4fa308e5bbdbfdd45156ec865b9dd293f1bd35b5 Mon Sep 17 00:00:00 2001 From: "Zhao, Yang2" Date: Wed, 17 Jul 2024 00:14:09 -0700 Subject: [PATCH 2/5] add tests --- .../AddressSanitizer/common/statistics.cpp | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 sycl/test-e2e/AddressSanitizer/common/statistics.cpp diff --git a/sycl/test-e2e/AddressSanitizer/common/statistics.cpp b/sycl/test-e2e/AddressSanitizer/common/statistics.cpp new file mode 100644 index 0000000000000..fb48df4feaec7 --- /dev/null +++ b/sycl/test-e2e/AddressSanitizer/common/statistics.cpp @@ -0,0 +1,31 @@ +// REQUIRES: linux, cpu +// RUN: %{build} %device_asan_flags -O2 -g -o %t +// RUN: env SYCL_PREFER_UR=1 %{run} %t 2>&1 | FileCheck %s +// RUN: env SYCL_PREFER_UR=1 UR_LAYER_ASAN_OPTIONS=print_stats:1 %{run} %t 2>&1 | FileCheck --check-prefixes CHECK-STATS %s +#include + +/// This test is used to check enabling/disabling kernel debug message +/// We always use "[kernel]" prefix in kernel debug message + +constexpr std::size_t N = 4; +constexpr std::size_t group_size = 1; + +int main() { + sycl::queue Q; + int *array = sycl::malloc_device(1024 * 1024, Q); + + Q.submit([&](sycl::handler &cgh) { + auto acc = sycl::local_accessor(group_size, cgh); + cgh.parallel_for( + sycl::nd_range<1>(N, group_size), [=](sycl::nd_item<1> item) { + array[item.get_global_id()] = acc[item.get_local_id()]; + }); + }); + Q.wait(); + // CHECK-STATS: Stats + // CHECK-NOT: Stats + + sycl::free(array, Q); + std::cout << "PASS" << std::endl; + return 0; +} From 7bde56277d12c8997e8c24f3604bfe31e57156e2 Mon Sep 17 00:00:00 2001 From: "Zhao, Yang2" Date: Wed, 28 Aug 2024 10:43:58 +0200 Subject: [PATCH 3/5] fix test --- sycl/test-e2e/AddressSanitizer/common/statistics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/test-e2e/AddressSanitizer/common/statistics.cpp b/sycl/test-e2e/AddressSanitizer/common/statistics.cpp index fb48df4feaec7..d525502af3269 100644 --- a/sycl/test-e2e/AddressSanitizer/common/statistics.cpp +++ b/sycl/test-e2e/AddressSanitizer/common/statistics.cpp @@ -1,4 +1,4 @@ -// REQUIRES: linux, cpu +// REQUIRES: linux // RUN: %{build} %device_asan_flags -O2 -g -o %t // RUN: env SYCL_PREFER_UR=1 %{run} %t 2>&1 | FileCheck %s // RUN: env SYCL_PREFER_UR=1 UR_LAYER_ASAN_OPTIONS=print_stats:1 %{run} %t 2>&1 | FileCheck --check-prefixes CHECK-STATS %s From 82d86bfccd6b066d2898a5af61bf93664216c554 Mon Sep 17 00:00:00 2001 From: Yang Zhao Date: Thu, 5 Sep 2024 15:17:43 +0800 Subject: [PATCH 4/5] Update sycl/test-e2e/AddressSanitizer/common/statistics.cpp --- sycl/test-e2e/AddressSanitizer/common/statistics.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sycl/test-e2e/AddressSanitizer/common/statistics.cpp b/sycl/test-e2e/AddressSanitizer/common/statistics.cpp index d525502af3269..c8ea516ef61f2 100644 --- a/sycl/test-e2e/AddressSanitizer/common/statistics.cpp +++ b/sycl/test-e2e/AddressSanitizer/common/statistics.cpp @@ -1,7 +1,7 @@ // REQUIRES: linux // RUN: %{build} %device_asan_flags -O2 -g -o %t -// RUN: env SYCL_PREFER_UR=1 %{run} %t 2>&1 | FileCheck %s -// RUN: env SYCL_PREFER_UR=1 UR_LAYER_ASAN_OPTIONS=print_stats:1 %{run} %t 2>&1 | FileCheck --check-prefixes CHECK-STATS %s +// RUN: %{run} %t 2>&1 | FileCheck %s +// RUN: env UR_LAYER_ASAN_OPTIONS=print_stats:1 %{run} %t 2>&1 | FileCheck --check-prefixes CHECK-STATS %s #include /// This test is used to check enabling/disabling kernel debug message From 4dc75ccd994f80f735ffb6dd44a552aca9fb13ca Mon Sep 17 00:00:00 2001 From: Yang Zhao Date: Thu, 5 Sep 2024 15:18:55 +0800 Subject: [PATCH 5/5] Update sycl/test-e2e/AddressSanitizer/common/statistics.cpp --- sycl/test-e2e/AddressSanitizer/common/statistics.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sycl/test-e2e/AddressSanitizer/common/statistics.cpp b/sycl/test-e2e/AddressSanitizer/common/statistics.cpp index c8ea516ef61f2..07bdb734738ee 100644 --- a/sycl/test-e2e/AddressSanitizer/common/statistics.cpp +++ b/sycl/test-e2e/AddressSanitizer/common/statistics.cpp @@ -4,8 +4,8 @@ // RUN: env UR_LAYER_ASAN_OPTIONS=print_stats:1 %{run} %t 2>&1 | FileCheck --check-prefixes CHECK-STATS %s #include -/// This test is used to check enabling/disabling kernel debug message -/// We always use "[kernel]" prefix in kernel debug message +/// This test is used to check enabling/disabling memory overhead statistics +/// We always use "Stats" prefix in statistics message like asan constexpr std::size_t N = 4; constexpr std::size_t group_size = 1;