Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions sycl/test-e2e/AddressSanitizer/common/options-statistics.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// REQUIRES: linux, cpu || (gpu && level_zero)
// RUN: %{build} %device_asan_flags -O2 -g -o %t
// 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
// RUN: env UR_LAYER_ASAN_OPTIONS="print_stats:1;quarantine_size_mb:1" %{run} %t 2>&1 | FileCheck --check-prefixes CHECK-STATS %s
// RUN: env UR_LAYER_ASAN_OPTIONS="print_stats:1;quarantine_size_mb:0" %{run} %t 2>&1 | FileCheck --check-prefixes CHECK-STATS %s
#include <sycl/usm.hpp>

/// This test is used to check enabling/disabling memory overhead statistics
Expand All @@ -12,20 +13,26 @@ constexpr std::size_t group_size = 1;

int main() {
sycl::queue Q;
int *array = sycl::malloc_device<int>(1024 * 1024, Q);
int *array1 = sycl::malloc_device<int>(10 * 1024 * 1024, Q);
int *array2 = sycl::malloc_device<int>(10 * 1024 * 1024, Q);
int *array3 = sycl::malloc_device<int>(10 * 1024 * 1024, Q);

sycl::free(array2, Q);
sycl::free(array3, Q);

Q.submit([&](sycl::handler &cgh) {
auto acc = sycl::local_accessor<int>(group_size, cgh);
cgh.parallel_for<class MyKernel>(
sycl::nd_range<1>(N, group_size), [=](sycl::nd_item<1> item) {
array[item.get_global_id()] = acc[item.get_local_id()];
array1[item.get_global_id()] = acc[item.get_local_id()];
});
});
Q.wait();
// CHECK-STATS: Stats
// CHECK-NOT: Stats

sycl::free(array, Q);
sycl::free(array1, Q);

std::cout << "PASS" << std::endl;
return 0;
}
Loading