-
Notifications
You must be signed in to change notification settings - Fork 759
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][RTC] Hide user-facing RTC kernel ids #17356
base: sycl
Are you sure you want to change the base?
Conversation
@@ -775,6 +775,11 @@ class kernel_bundle_impl { | |||
const std::vector<device> &get_devices() const noexcept { return MDevices; } | |||
|
|||
std::vector<kernel_id> get_kernel_ids() const { | |||
// RTC kernel bundles shouldn't have user-facing kernel ids, return an | |||
// empty vector when the bundles contains RTC kernels. | |||
if (MLanguage == ext::oneapi::experimental::source_language::sycl_jit) { |
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.
if (MLanguage == ext::oneapi::experimental::source_language::sycl_jit) { | |
if (MLanguage == syclex::source_language::sycl_jit) { |
// for '$' should be enough. | ||
ids.erase(std::remove_if(ids.begin(), ids.end(), | ||
[](kernel_id id) { | ||
return strchr(id.get_name(), '$') != nullptr; |
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.
Nit: IMHO string_view::find
would be a bit more idiomatic here.
@@ -76,15 +76,10 @@ int test_persistent_cache() { | |||
// CHECK: [kernel_compiler Persistent Cache]: cache miss: [[KEY1:.*]] | |||
// CHECK: [kernel_compiler Persistent Cache]: storing device code IR: {{.*}}/[[KEY1]] | |||
exe_kb kbExe1a = syclex::build(kbSrc1); | |||
dumpKernelIDs(); |
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.
Also delete the function, please.
@@ -775,6 +775,11 @@ class kernel_bundle_impl { | |||
const std::vector<device> &get_devices() const noexcept { return MDevices; } | |||
|
|||
std::vector<kernel_id> get_kernel_ids() const { | |||
// RTC kernel bundles shouldn't have user-facing kernel ids, return an | |||
// empty vector when the bundles contains RTC kernels. |
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.
// empty vector when the bundles contains RTC kernels. | |
// empty vector when the bundle was compiled from source. |
if (!ok) { | ||
return 0; | ||
} | ||
std::string build_log; |
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 can drop the build log to make the test even more compact.
The SYCL spec mandates that kernel IDs for kernels generated through RTC shouldn't be accessible from the user application. This PR makes it so we filter out the output of
get_kernel_ids
so that we behave according to the spec.Removes tests that were relying on kernel_ids being accessible from the user application.