-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL] Fix error handling for max_num_work_groups launch query test #15508
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] Fix error handling for max_num_work_groups launch query test #15508
Conversation
8f53ea5
to
35f7f19
Compare
35f7f19
to
b52d752
Compare
b52d752
to
25f53e3
Compare
25f53e3
to
8a183d0
Compare
friendly ping @steffenlarsen @intel/llvm-reviewers-runtime |
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 sorry for the delay! Overall it looks good! One small nit.
std::cerr << "Test (LocalMemory) with exceeded resource limits failed\n"; | ||
else | ||
std::cerr << "Test with exceed resource limits failed\n"; | ||
return 1; // We shouldn't be here, exception is expected |
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.
Alternatively, you could change the return after the catch
block to 1
. With this, it is now dead code.
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.
Sure 👍. Addressed in a new commit.
Apologies for the force-push, it was because I rebased on latest sycl
branch and messed my branch updating strategy here with what I normally do in unified-runtime where I rebase on top rather the merge.
8a183d0
to
8b938cf
Compare
@@ -198,19 +207,20 @@ int test_max_num_work_groups(sycl::queue &q, const sycl::device &dev) { | |||
return 1; | |||
} | |||
|
|||
return 0; | |||
return result; |
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'm not sure I understand the need for the result
variable. In what case would we reach this and it not being 1
?
The AND/OR part was fixed in #16610 so I'm not sure if this PR is still needed, but if it is would you mind rebasing it @GeorgeWeb ? it seems pretty close to being merged. |
@npmiller Thanks for the update! ... and apologies for slightly abandoning this one. It is not strictly needed as that was the main reason I originally opened it up. The rest are a few minor quality improvements. I am okay to close it if you think that's fine. |
The error capturing logic escaped me when first submitting the
max_num_work_groups
implementation and the tests alongside it. We want to bitwise OR the return resulting code from the test function (either 0 or 1) with 0 rather than AND-ing it.Previously the test was still valid for what its main purpose was, which is the assertion of the value returned from the
max_num_work_groups
kernel-queue-specific launch query.This fix is to better catch the negative test of launching a kernel with invalid launch configuration in the case where the query reports that no (0) workgroups can be launched on the device for that configuration (e.g. nd_range).