-
Notifications
You must be signed in to change notification settings - Fork 762
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
[SYCL][E2E] Fix DeviceLib/assert-windows.cpp
run-time errors
#17493
Merged
+6
−13
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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 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,22 +1,15 @@ | ||
// REQUIRES: cpu,windows | ||
// REQUIRES: windows | ||
// XFAIL: opencl && gpu | ||
// XFAIL-TRACKER: https://github.com/intel/llvm/issues/11364 | ||
// | ||
// RUN: %{build} -o %t.out | ||
// RUN: %{build} -DSYCL_FALLBACK_ASSERT=1 -o %t.out | ||
// | ||
// MSVC implementation of assert does not call an unreachable built-in, so the | ||
// program doesn't terminate when fallback is used. | ||
// | ||
// FIXME: SPIR-V Unreachable should be called from the fallback | ||
// explicitly. Since the test is going to crash, we'll have to follow a similar | ||
// approach as on Linux - call the test in a subprocess. | ||
// | ||
// RUN: env SYCL_UR_TRACE=2 SYCL_DEVICELIB_INHIBIT_NATIVE=1 CL_CONFIG_USE_VECTORIZER=False %{run} %t.out | FileCheck %s --check-prefix=CHECK-FALLBACK | ||
// RUN: env SHOULD_CRASH=1 SYCL_DEVICELIB_INHIBIT_NATIVE=1 CL_CONFIG_USE_VECTORIZER=False %{run} %t.out | FileCheck %s --check-prefix=CHECK-MESSAGE | ||
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. This line failed because the error message is sent to |
||
// RUN: not env SHOULD_CRASH=1 SYCL_DEVICELIB_INHIBIT_NATIVE=1 CL_CONFIG_USE_VECTORIZER=False \ | ||
// RUN: %{run} %t.out 2>&1 >/dev/null | FileCheck %s --check-prefix=CHECK-MESSAGE | ||
// | ||
// CHECK-MESSAGE: {{.*}}assert-windows.cpp:{{[0-9]+}}: (null): global id: | ||
// [{{[0-3]}},0,0], local id: [{{[0-3]}},0,0] Assertion `accessorC[wiID] == 0 && | ||
// "Invalid value"` failed. | ||
// | ||
// CHECK-FALLBACK: <--- urProgramLink | ||
|
||
#include "../helpers.hpp" | ||
#include <array> | ||
|
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.
I wasn't too sure what the correct fix for this line would be. Looking at the UR Trace when we crash, vs not crash the
urProgramLink
function never appears in the trace. To me it seemed suspicious given the git history, since this line has been changed multiple times since the test had been XFAILed, so its never been confirmed to pass with the changes that have happened since.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.
I believe urProgramLink call is supposed to be emitted in case when a backend doesn't support assert natively and we have to link the fallback assert device library at runtime.
I believe cpu backend supports assert natively, so I don't understand why this check has been added.
I belive such verification needs to be done in our unit tests, i.e. by mocking UR to report that backend doesn't support native assert and then verify that urProgramLink is called in this case.
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.
So I am not opposed to removing that check from this e2e test.
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.
Actually another question is why this test is limited to cpu. I believe it has to be enabled for gpu too or marked explicitly as failing on gpu if there is a problem.