-
Notifications
You must be signed in to change notification settings - Fork 796
[DeviceSanitizer] Support nullpointer detection & enable GPU tests #14891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
dd2202d
b221419
6dd0eba
5a9a04a
195a800
7ee6dbb
4e321f1
1792b64
3ad24d7
1308e45
2280df1
dd06c90
1a64242
1556094
d51fd7a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -115,13 +115,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") | ||
| # commit bc1a28ede0df7f837047b632e00437587672c134 | ||
| # Author: Omar Ahmed <[email protected]> | ||
| # Date: Mon Jul 29 16:44:58 2024 +0100 | ||
| # Merge pull request #1819 from DBDuncan/sean/rename-interop-to-external | ||
| # [Bindless][Exp] Rename interop related structs/funcs with "external" | ||
| set(UNIFIED_RUNTIME_TAG bc1a28ede0df7f837047b632e00437587672c134) | ||
| set(UNIFIED_RUNTIME_REPO "https://github.com/AllanZyne/unified-runtime.git") | ||
| # commit a985a81dc9ba8adfcc8b54e35ad287e97766fb3e | ||
| # Merge: b7b0c8b3 f772f907 | ||
| # Author: Piotr Balcer <[email protected]> | ||
| # Date: Mon Jul 29 09:11:29 2024 +0200 | ||
| # Merge pull request #1905 from igchor/umf_hwloc_disable | ||
| # Bump UMF version to allow disabling hwloc | ||
| set(UNIFIED_RUNTIME_TAG review/yang/dsan_nullpointer) | ||
|
|
||
| set(UMF_BUILD_EXAMPLES OFF CACHE INTERNAL "EXAMPLES") | ||
| # Due to the use of dependentloadflag and no installer for UMF and hwloc we need | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| // REQUIRES: linux | ||
| // RUN-NOT: %{build} %device_asan_flags -O0 -g -o %t | ||
| // RUN-NOT: %{run} not %t 2>&1 | FileCheck %s | ||
| // RUN: %{build} %device_asan_flags -O1 -g -o %t | ||
| // RUN: %{run} not %t 2>&1 | FileCheck %s | ||
| // RUN: %{build} %device_asan_flags -O2 -g -o %t | ||
| // RUN: %{run} not %t 2>&1 | FileCheck %s | ||
|
|
||
| #include <sycl/detail/core.hpp> | ||
|
|
||
| int main() { | ||
| sycl::queue Q; | ||
| constexpr std::size_t N = 4; | ||
| int *array = 0; | ||
AllanZyne marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Q.submit([&](sycl::handler &h) { | ||
| h.parallel_for<class MyKernel>( | ||
| sycl::nd_range<1>(N, 1), [=](sycl::nd_item<1> item) { array[0] = 0; }); | ||
| Q.wait(); | ||
| }); | ||
| // CHECK: ERROR: DeviceSanitizer: null-pointer-access on Unknown Memory | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we construct cases to check null ptr for different address space? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I remember correctly, "0" is valid for local memory, and maybe we need to handle private memory as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test case for private memory was added, but can't enable now due to gfx driver issue |
||
| // CHECK: WRITE of size 4 at kernel {{<.*MyKernel>}} LID(0, 0, 0) GID({{.*}}, 0, 0) | ||
| // CHECK: #0 {{.*}} {{.*null-pointer.cpp}}:[[@LINE-5]] | ||
|
|
||
| return 0; | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.