Skip to content

[SYCL] Split throwOnKernelParameterMisuse to improve compile time #17670

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

Merged
merged 3 commits into from
Mar 31, 2025

Conversation

aelovikov-intel
Copy link
Contributor

For the following code (note no submit, just bare minimum cgh.single_task):


int main() {
  int *p;
  sycl::detail::loop<2>([&](auto outer_idx) {
    sycl::detail::loop<200>([&](auto idx) {
      auto krn = [=]() { *p = 42; };
      auto s = [&](sycl::handler &cgh) { cgh.single_task(krn); };
      (void)sycl::detail::type_erased_cgfo_ty{s};
    });
  });
}

compiled as

$ time clang++ -isystem ~/sycl/build/include a.cpp -c -o /dev/null -Wno-deprecated

(to simulate host-only compilation), improves 3.4s -> 3.0s.

For the following code (note no submit, just bare minimum
`cgh.single_task`):

```

int main() {
  int *p;
  sycl::detail::loop<2>([&](auto outer_idx) {
    sycl::detail::loop<200>([&](auto idx) {
      auto krn = [=]() { *p = 42; };
      auto s = [&](sycl::handler &cgh) { cgh.single_task(krn); };
      (void)sycl::detail::type_erased_cgfo_ty{s};
    });
  });
}
```

compiled as

` $ time clang++ -isystem ~/sycl/build/include a.cpp -c -o /dev/null -Wno-deprecated`

(to simulate host-only compilation), improves 3.4s -> 3.0s.
@aelovikov-intel
Copy link
Contributor Author

Don't think affects CTS much [compared to general noise level at least].

@aelovikov-intel
Copy link
Contributor Author

RHEL build failure is unrelated, merging.

@aelovikov-intel aelovikov-intel merged commit ac30c32 into intel:sycl Mar 31, 2025
33 of 35 checks passed
@aelovikov-intel aelovikov-intel deleted the split-throw-on-misuse branch March 31, 2025 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants