-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL][USM] Enable per-context USM behavior. Use PI interfaces and avoid directly calling CL inside SYCL RT. #517
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
Conversation
Signed-off-by: James Brodman <[email protected]> Initial commit for rewriting USM to support PI and multiple contexts. Signed-off-by: James Brodman <[email protected]> Update CLUSM test. clext test no longer relevant. Signed-off-by: James Brodman <[email protected]>
…tictxt tests. Signed-off-by: James Brodman <[email protected]>
Signed-off-by: James Brodman <[email protected]>
0220bc5
to
e545d17
Compare
sycl/test/usm/findplatforms.hpp
Outdated
@@ -11,24 +11,23 @@ bool findPlatformAndDevice(cl_device_type deviceType, | |||
cl_int errorCode; | |||
|
|||
errorCode = clGetPlatformIDs(0, nullptr, &numPlatforms); | |||
if (errorCode != CL_SUCCESS) return false; |
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.
Why are you removing check. Does it make sense to continue if this call fails?
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.
Error checking was causing problems. Those slipped out.
Signed-off-by: James Brodman <[email protected]>
Signed-off-by: James Brodman <[email protected]>
Signed-off-by: James Brodman <[email protected]>
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.
void *ParamValue, size_t *ParamValueSizeRet); | ||
|
||
private: | ||
bool mEmulated = false; |
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.
Probably instead of having this var you can check if mEmulator is nullptr or not.
|
||
void *hostMemAlloc(pi_context Context, cl_mem_properties_intel *Properties, | ||
size_t Size, pi_uint32 Alignment, pi_result *ErrcodeRet); | ||
void *deviceMemAlloc(pi_context Context, pi_device Device, |
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.
Are you going to move these functions to pi.hpp/pi.cpp ?
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.
No, I think it's better to keep them here as we need some state (the CLUSM object). In some sense the Dispatcher is separate piece of PI. It's easy to wire new backends up here.
USM Impl now goes through a USMDispatcher class tied to a context. USMDispatcher provides the single location to map to low-level APIs.
Add tests for multi-context behavior. These tests only run if both a CPU and GPU are found.
Replaces #467