Skip to content

[SYCL][CUDA][HIP] Allow min_work_groups_per_cu/max_work_groups_per_mp on kernel lambdas - #23509

Open
kekaczma wants to merge 1 commit into
intel:syclfrom
kekaczma:fix-launch-bounds-lambda-attrs
Open

kekaczma wants to merge 1 commit into
intel:syclfrom
kekaczma:fix-launch-bounds-lambda-attrs

Conversation

@kekaczma

@kekaczma kekaczma commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Fixes two issues reported in #23322 with expressing CUDA launch bounds in SYCL:

  • Allow intel::min_work_groups_per_cu and intel::max_work_groups_per_mp attributes on kernel lambdas using SYCL's attribute placement syntax.
  • Add a diagnostic for the removed intel::max_work_group_size attribute, directing users to the max_work_group_size kernel property instead.

Add regression tests for kernel-lambda attribute placement and the new diagnostic.

@kekaczma
kekaczma force-pushed the fix-launch-bounds-lambda-attrs branch from c2237a4 to c90d585 Compare October 15, 2026 19:23
… on kernel lambdas

Fixes intel#23322, two problems with expressing CUDA's
__launch_bounds__ in SYCL that were discovered when revisiting the
guidance from intel#8080:

1. intel::min_work_groups_per_cu and intel::max_work_groups_per_mp lacked
   SupportsNonconformingLambdaSyntax, so placing them on a kernel lambda
   (the usual SYCL attribute placement, after the parameter list) was
   rejected with "attribute cannot be applied to types", even though their
   documentation says they apply to "a device function/lambda function".

2. intel::max_work_group_size was removed as an FPGA attribute by PR intel#21864,
   but on NVPTX/AMDGPU it was also the documented way to set maxntid launch
   bounds. Existing code using it now only gets a generic unknown-attribute
   warning and silently loses the launch bound. Add a dedicated diagnostic,
   gated to SYCL device compilation, that points users at the
   max_work_group_size kernel property from sycl_ext_oneapi_kernel_properties
   instead.
@bratpiorka
bratpiorka marked this pull request as ready for review October 16, 2026 08:54
@bratpiorka
bratpiorka requested a review from a team as a code owner October 16, 2026 08:54

This branch has not been deployed

No deployments
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.

1 participant