Skip to content

Commit b8008a3

Browse files
AllanZyneKornevNikita
authored andcommitted
[DeviceASAN] Enhance sycl e2e options-statistics.cpp for improving code coverage rate (#16279)
Enhance sycl e2e options-statistics.cpp for improving code coverage rate
1 parent 18b8d6d commit b8008a3

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed
Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// REQUIRES: linux, cpu || (gpu && level_zero)
22
// RUN: %{build} %device_asan_flags -O2 -g -o %t
33
// RUN: %{run} %t 2>&1 | FileCheck %s
4-
// RUN: env UR_LAYER_ASAN_OPTIONS=print_stats:1 %{run} %t 2>&1 | FileCheck --check-prefixes CHECK-STATS %s
4+
// RUN: env UR_LAYER_ASAN_OPTIONS="print_stats:1;quarantine_size_mb:1" %{run} %t 2>&1 | FileCheck --check-prefixes CHECK-STATS %s
5+
// RUN: env UR_LAYER_ASAN_OPTIONS="print_stats:1;quarantine_size_mb:0" %{run} %t 2>&1 | FileCheck --check-prefixes CHECK-STATS %s
56
#include <sycl/usm.hpp>
67

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

1314
int main() {
1415
sycl::queue Q;
15-
int *array = sycl::malloc_device<int>(1024 * 1024, Q);
16+
int *array1 = sycl::malloc_device<int>(10 * 1024 * 1024, Q);
17+
int *array2 = sycl::malloc_device<int>(10 * 1024 * 1024, Q);
18+
int *array3 = sycl::malloc_device<int>(10 * 1024 * 1024, Q);
19+
20+
sycl::free(array2, Q);
21+
sycl::free(array3, Q);
1622

1723
Q.submit([&](sycl::handler &cgh) {
1824
auto acc = sycl::local_accessor<int>(group_size, cgh);
1925
cgh.parallel_for<class MyKernel>(
2026
sycl::nd_range<1>(N, group_size), [=](sycl::nd_item<1> item) {
21-
array[item.get_global_id()] = acc[item.get_local_id()];
27+
array1[item.get_global_id()] = acc[item.get_local_id()];
2228
});
2329
});
2430
Q.wait();
2531
// CHECK-STATS: Stats
2632
// CHECK-NOT: Stats
2733

28-
sycl::free(array, Q);
34+
sycl::free(array1, Q);
35+
2936
std::cout << "PASS" << std::endl;
3037
return 0;
3138
}

0 commit comments

Comments
 (0)