-
Notifications
You must be signed in to change notification settings - Fork 738
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UR][DeviceSanitizer] Update UR and add e2e tests for detecting memor…
…y leaks (#14378) UR Part: oneapi-src/unified-runtime#1808 --------- Co-authored-by: Piotr Balcer <[email protected]> Co-authored-by: omarahmed1111 <[email protected]>
- Loading branch information
1 parent
0985116
commit 9c3998c
Showing
4 changed files
with
33 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
sycl/test-e2e/AddressSanitizer/memory-leak/memory-leak.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// REQUIRES: linux, cpu | ||
// RUN: %{build} %device_asan_flags -O0 -g -o %t | ||
// RUN: %{run} %t 2>&1 | FileCheck %s | ||
|
||
#include <sycl/detail/core.hpp> | ||
|
||
#include <sycl/usm.hpp> | ||
|
||
int main() { | ||
sycl::queue Q; | ||
constexpr std::size_t N = 12; | ||
auto *array = sycl::malloc_device<char>(N, Q); | ||
|
||
Q.submit([&](sycl::handler &h) { | ||
h.parallel_for<class MyKernelR_4>( | ||
sycl::nd_range<1>(N, 1), | ||
[=](sycl::nd_item<1> item) { ++array[item.get_global_id(0)]; }); | ||
}).wait(); | ||
// CHECK: ERROR: DeviceSanitizer: detected memory leaks of Device USM | ||
// CHECK: Direct leak of 12 byte(s) at {{0x.*}} allocated from: | ||
// CHECK: in main {{.*memory-leak.cpp:}}[[@LINE-9]] | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters