Skip to content

[SYCL][CodeGen] Directly disable OCL kernel stub for SYCL (NFC) #19213

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 8 commits into from
Jul 2, 2025

Conversation

Maetveis
Copy link
Contributor

@Maetveis Maetveis commented Jun 30, 2025

The way 1ce3803 ([SYCL] Disable kernel stub for now (#28629)) and 3b170e3 ([SYCL][AMD] Fix kernel stub calling convention for AMD) disabled the OpenCL kernel stub for SYCL is weird, returning from TargetCodeGenInfo::setOCLKernelStubCallingConvention() in SYCL mode.

Basically we were actually emitting code for the stub would but we customized it to not change its calling convention.

Instead, add getLangOpts().OpenCL checks to CodeGenFunction::GenerateCode
(to emit the kernel contents directly into the kernel) and to
CodeGenModule::EmitGlobal (to disable the deferred emission of the stub).
With this change, we should never come across KernelReferenceKind::Stub
in SYCL mode.

Maetveis added 4 commits June 30, 2025 06:09
The way 1ce3803
    and bdd5232
disabled the kernel stub for SYCL is weird, returning from
`TargetCodeGenInfo::setOCLKernelStubCallingConvention()` in SYCL mode.

Basically we were actually emitting code for the stub would but we
customized it to not change its calling convention.

Instead, add `getLangOpts().OpenCL` checks to `CodeGenFunction::GenerateCode`
(to emit the kernel contents directly into the kernel) and to
`CodeGenModule::EmitGlobal` (to disable the deferred emission of the stub).
With this change, we should never come across `KernelReferenceKind::Stub`
in SYCL mode.
@Maetveis Maetveis requested review from frasercrmck and jsji June 30, 2025 13:13
@Maetveis Maetveis requested a review from a team as a code owner June 30, 2025 13:13
@Maetveis Maetveis changed the title [SYCL][CodeGen] Directly disable kernel stub for SYCL (NFC) [SYCL][CodeGen] Directly disable OCL kernel stub for SYCL (NFC) Jun 30, 2025
@Maetveis Maetveis marked this pull request as draft June 30, 2025 13:28
@Maetveis Maetveis removed request for frasercrmck and jsji June 30, 2025 13:28
@Maetveis Maetveis marked this pull request as ready for review June 30, 2025 13:31
@Maetveis Maetveis requested review from frasercrmck and jsji June 30, 2025 13:32
Copy link
Contributor

@frasercrmck frasercrmck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for cleaning this up

@Maetveis
Copy link
Contributor Author

Maetveis commented Jul 1, 2025

@Maetveis
Copy link
Contributor Author

Maetveis commented Jul 2, 2025

This should be ready to merge @intel/llvm-gatekeepers, thanks!

@steffenlarsen steffenlarsen merged commit 8b815fb into intel:sycl Jul 2, 2025
25 checks passed
@Maetveis Maetveis deleted the disable-kernel-stub-directly branch July 2, 2025 08:57
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.

6 participants