-
Notifications
You must be signed in to change notification settings - Fork 791
[DevMSAN] Propagate shadow memory in buffer related APIs #16526
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
fae5ef6
[DevMSAN] Propagate shadow memory in buffer related APIs
zhaomaosu 33a431a
update tag
zhaomaosu b81772f
Merge branch 'sycl' into fix-buffer-shadow
zhaomaosu be62615
Merge branch 'sycl' into fix-buffer-shadow
zhaomaosu f0ab972
Merge remote-tracking branch 'origin/sycl' into fix-buffer-shadow
kbenzie 6bd30e9
[UR] Bump main tag to afbb289a
kbenzie 7a23de8
Merge remote-tracking branch 'origin/sycl' into fix-buffer-shadow
kbenzie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
@@ -1,9 +1,7 @@ | ||
# commit ad88f0a1e3a22807866af4f6dad53e8986733abb | ||
# Merge: 68aed2d5 599a28e1 | ||
# Author: Ross Brunton <[email protected]> | ||
# Date: Tue Jan 14 10:28:07 2025 +0000 | ||
|
||
# Merge pull request #2527 from RossBrunton/ross/wrapper | ||
# | ||
# Wrap urEventSetCallback when ran through loader | ||
set(UNIFIED_RUNTIME_TAG ad88f0a1e3a22807866af4f6dad53e8986733abb) | ||
# commit afbb289aa8d4f3b27b1536ba33ca618b0aba65c7 | ||
# Merge: ef70004f d7c33f88 | ||
# Author: Kenneth Benzie (Benie) <[email protected]> | ||
# Date: Wed Jan 15 11:54:25 2025 +0000 | ||
# Merge pull request #2520 from zhaomaosu/fix-buffer-shadow | ||
# [DevMSAN] Propagate shadow memory in buffer related APIs | ||
set(UNIFIED_RUNTIME_TAG afbb289aa8d4f3b27b1536ba33ca618b0aba65c7) |
This file contains hidden or 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 was deleted.
Oops, something went wrong.
64 changes: 64 additions & 0 deletions
64
sycl/test-e2e/MemorySanitizer/check_buffer_memset_memcpy.cpp
This file contains hidden or 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,64 @@ | ||
// REQUIRES: linux, cpu || (gpu && level_zero) | ||
// RUN: %{build} %device_msan_flags -O0 -g -o %t1.out | ||
// RUN: %{run} %t1.out 2>&1 | FileCheck %s | ||
// RUN: %{build} %device_msan_flags -O2 -g -o %t2.out | ||
// RUN: %{run} %t2.out 2>&1 | FileCheck %s | ||
|
||
#include <sycl/detail/core.hpp> | ||
|
||
__attribute__((noinline)) int foo(int data1, int data2) { | ||
return data1 + data2; | ||
} | ||
|
||
void check_memset(sycl::queue &q) { | ||
std::cout << "check_memset" << std::endl; | ||
sycl::buffer<int, 1> buf(sycl::range<1>(2)); | ||
const int Pattern = 0; | ||
|
||
q.submit([&](sycl::handler &h) { | ||
auto array = buf.get_access<sycl::access::mode::read_write>(h); | ||
h.fill(array, Pattern); | ||
}).wait(); | ||
|
||
q.submit([&](sycl::handler &h) { | ||
auto array = buf.get_access<sycl::access::mode::read_write>(h); | ||
h.single_task<class MyKernel1>( | ||
[=]() { array[0] = foo(array[0], array[1]); }); | ||
}).wait(); | ||
std::cout << "PASS" << std::endl; | ||
// CHECK-LABEL: check_memset | ||
// CHECK-NOT: use-of-uninitialized-value | ||
// CHECK: PASS | ||
} | ||
|
||
void check_memcpy(sycl::queue &q) { | ||
std::cout << "check_memcpy" << std::endl; | ||
int host[2] = {1, 2}; | ||
sycl::buffer<int, 1> buf1(sycl::range<1>(2)); | ||
sycl::buffer<int, 1> buf2(host, sycl::range<1>(2)); | ||
|
||
q.submit([&](sycl::handler &h) { | ||
auto array1 = buf1.get_access<sycl::access::mode::read_write>(h); | ||
auto array2 = buf2.get_access<sycl::access::mode::read_write>(h); | ||
h.copy(array2, array1); | ||
}).wait(); | ||
|
||
q.submit([&](sycl::handler &h) { | ||
auto array = buf1.get_access<sycl::access::mode::read_write>(h); | ||
h.single_task<class MyKernel2>( | ||
[=]() { array[0] = foo(array[0], array[1]); }); | ||
}).wait(); | ||
std::cout << "PASS" << std::endl; | ||
// CHECK-LABEL: check_memcpy | ||
// CHECK-NOT: use-of-uninitialized-value | ||
// CHECK: PASS | ||
} | ||
|
||
int main() { | ||
sycl::queue q; | ||
|
||
check_memset(q); | ||
check_memcpy(q); | ||
|
||
return 0; | ||
} |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note: we shouldn't change the test name after feature freeze, or we should remember to sync this change with jira config.