-
Notifications
You must be signed in to change notification settings - Fork 768
[SYCL][RTC] Initial support for device globals #16565
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: Julian Oppermann <[email protected]>
Signed-off-by: Julian Oppermann <[email protected]>
Signed-off-by: Julian Oppermann <[email protected]>
Signed-off-by: Julian Oppermann <[email protected]>
Signed-off-by: Julian Oppermann <[email protected]>
Signed-off-by: Julian Oppermann <[email protected]>
Signed-off-by: Julian Oppermann <[email protected]>
Signed-off-by: Julian Oppermann <[email protected]>
Signed-off-by: Julian Oppermann <[email protected]>
Signed-off-by: Julian Oppermann <[email protected]>
…ncl:gpu. Signed-off-by: Julian Oppermann <[email protected]>
Signed-off-by: Julian Oppermann <[email protected]>
Signed-off-by: Julian Oppermann <[email protected]>
Signed-off-by: Julian Oppermann <[email protected]>
Signed-off-by: Julian Oppermann <[email protected]>
Implementation (here) and specification draft (#17401) are up-to-date. |
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 one question, rest LGTM.
@@ -778,6 +879,39 @@ class kernel_bundle_impl { | |||
return AdjustedName; | |||
} | |||
|
|||
bool ext_oneapi_has_device_global(const std::string &Name) { | |||
std::string MangledName = mangle_device_global_name(Name); |
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.
Do we currently check this part?
only true if kernel_bundle was created from source
Would that enable an early return, avoiding the linear search?
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.
A non-RTC bundle would just have an empty list of names, so the linear search isn't really a problem, but we can at least detect that before doing the string operations (and map lookups in case of kernels); see 1be7568.
Signed-off-by: Julian Oppermann <[email protected]>
Signed-off-by: Julian Oppermann <[email protected]>
Adds limited support for device globals in runtime-compiled SYCL code. The application interacts with the globals via three new methods on
kernel_bundle
:This PR uses the same trick as #16316, i.e. prepending a kernel-bundle-specific prefix to the names of device globals to make them distinguishable for the program manager.
Limitations:
device_image_scope
property cannot be read/written from the host, because the runtime currently cannot expose USM pointers for them. A workaround is using explicit kernels to read/write the global's value into a USM buffer.