Skip to content

[KHR] Introduce "sycl free function kernels" - #1033

Open
koparasy wants to merge 14 commits into
KhronosGroup:mainfrom
koparasy:me/khr-ffk
Open

[KHR] Introduce "sycl free function kernels"#1033
koparasy wants to merge 14 commits into
KhronosGroup:mainfrom
koparasy:me/khr-ffk

Conversation

@koparasy

@koparasy koparasy commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

This PR proposes a new KHR extension, sycl_khr_free_function_kernels, which lets an ordinary namespace-scope C++ function serve as a device kernel entry point.

A free function kernel is declared by decorating the function with a macro.

Its kernel arguments are the function's parameters (each must be device-copyable), giving them a defined order, and the kernel is identified by the function itself. As such it can be launched and queried by reference to the function rather than only as a lambda.

The extension defines:

  • the decoration macros and the rules a free function kernel must obey;
  • compile-time traits (is_nd_kernel_v<Func, Dims>, is_task_kernel_v<Func>) that report a function's kernel kind from its declaration alone;
  • launch APIs (launch_grouped, launch_task) that take the kernel via a kernel_function<Func> handle.

@koparasy koparasy changed the title Me/khr ffk [KHR] Introduce "SYCL FREE FUNCTION KERNELS" Jul 29, 2026
@koparasy koparasy changed the title [KHR] Introduce "SYCL FREE FUNCTION KERNELS" [KHR] Introduce "sycl free function kernels" Jul 29, 2026
@koparasy

koparasy commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

I am attaching the presentation that I did today.
Kernel Free functions KHR - Khronos Presentation.pdf

@TApplencourt

Copy link
Copy Markdown
Contributor

Thanks a lot! I forwarded it to a few people.

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.

2 participants