-
Notifications
You must be signed in to change notification settings - Fork 83
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
Add support for SimSYCL as a SYCL implementation #871
base: main
Are you sure you want to change the base?
Conversation
cmake/AddSYCLExecutable.cmake
Outdated
if (NOT ${SYCL_IMPLEMENTATION} IN_LIST KNOWN_SYCL_IMPLEMENTATIONS) | ||
message(FATAL_ERROR | ||
"The SYCL CTS requires specifying a SYCL implementation with " | ||
"-DSYCL_IMPLEMENTATION=[Intel_SYCL,DPCPP;hipSYCL]") | ||
"-DSYCL_IMPLEMENTATION=[Intel_SYCL,DPCPP;hipSYCL;SimSYCL]") |
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 wonder if we should just put KNOWN_SYCL_IMPLEMENTATIONS
directly into the message instead of modifying it every time we change list of known implementations?
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.
Perhaps CTS_GRADE_SYCL_IMPLEMENTATION
or something better, because we know quite many other implementations. :-)
tests/event/event.cpp
Outdated
#if SYCL_CTS_COMPILING_WITH_SIMSYCL | ||
SKIP("SimSYCL does not implement asynchronous execution."); | ||
#endif |
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 think that from the conformance point of view the better to use DISABLED_FOR_TEST_CASE
macro so the test appears as failed.
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 this is even non-conformant. IIRC an implementation only needs to guarantee forward progress on an event when wait
is called on it, which does not happen in any of these test cases.
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 don't think this test requires a guarantee of forward progress, does it? It seems like it is just calling event::get_wait_list
and making sure the list contains the direct dependencies of a pending command. There is no expectation that the command has completed when get_wait_list
is called.
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 agree, I don't understand why SimSYCL couldn't implement these features.
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.
You're right, I read this code the wrong way! It needs the host task to launch asynchronously in the background at least once wait()
is called, and then start running once the delayed_host_event
is signalled. SimSYCL is fully synchronous and does not overlap command groups with the main thread, so the host task unconditionally deadlocks. This will probably never work. I changed the SKIP
to FAIL
to account for this.
Please also document SimSYCL in |
Ideally we should also include SimSYCL in our CI setup. I think it should be relatively straightforward to add, analogously to hipSYCL/AdaptiveCpp. |
How do we move on this? |
ae3274e
to
7d5f825
Compare
7d5f825
to
a330782
Compare
3c601ad
to
28402a6
Compare
28402a6
to
47b7b26
Compare
I've added a CI step for a SimSYCL build, but creating the docker image needs some secrets. Not sure how to proceed on this. |
I've launched a manual run to create the image here. It went through, but it looks like there's some issue while building the CTS itself! |
Thanks, it's building now! |
66159bf
to
8518e9a
Compare
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.
That looks good after merge conflict resolution.
atomicity_with_host_code requires a memory_scope argument (always `system`). atomic_ref<float> has no operator++ and must use fetch_add() instead.
acfbda6
to
613b97d
Compare
The WG discussed this today - can you resolve the CI failure please. Thanks! |
613b97d
to
07edd6c
Compare
@bader I've turned these into runtime checks (2cf5cc4) so we don't need to re-build containers for now. I don't feel like the checks actually benefitted from being static assertions, please correct me if I'm wrong! @AlexeySachkov I've drive-by fixed two inconsistencies (3dc17f6, 110c739) that caused a lot of warnings with GCC. |
Usually, the earlier you detect the problem the better. I.e. compile-time checks usually preferred over the run-time checks. I suggest we keep the check compile time but disable it for SimSYCL implementation. We should enable the check for SimSYCL with the implementation update. Does it sound okay to you? |
@tomdeakin Note that this PR is based on #1011, so we need to figure out what the correct behavior is supposed to be and implement it in SimSYCL before this PR can proceed (at least with the current filter list). @bader Since we need to update SimSYCL ^ now anyway I'm going to implement the new behavior and drop that commit. |
See also discussion here. What we can do is switch
Thanks, warnings cleanup is always appreciated! |
I don't think this is a good idea. Technically, you suggest disabling all "static assertions" checks in pre-commit as CI do not run compiled tests (i.e. there is no run-time). Disabling either the compilation of the whole test via CMake filters or specific test cases via macro is preferable as it provides fine-grain control over tested functionality. |
07edd6c
to
00c3a37
Compare
CHECK(std::is_same_v<decltype(SYCL_LANGUAGE_VERSION), long>); | ||
CHECK(SYCL_LANGUAGE_VERSION == 202012L); |
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.
@fknorr, please, revert this change.
You can disable these checks for SimSYCL if needed.
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.
LGTM! There are still quite a lot compiler warnings left, but it looks to me like most/all of those are legitimate issues with the CTS, and not SimSYCL's fault. We'll have to look into these separately I guess.
This adds SimSYCL as a supported SYCL implementation, complete with CMake integration and an exclude-list for the "fast" conformance build.
This should be merged after #870 #872 and #873, because the CTS it will not actually compile for many of the non-excluded cases unless those bugs are addressed.