Skip to content

Conversation

@aelovikov-intel
Copy link
Contributor

Factored out from #19929.

Comment on lines +54 to +57
// No-compile time info for the kernel (i.e., kernel_bundle/interop/etc.),
// be conservative:
if (NumParams == 0)
return true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I don't understand why are we returning true if there's no parameters...

Copy link
Contributor

Choose a reason for hiding this comment

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

Basically, we had the following before

template <typename KernelNameType> constexpr bool hasSpecialCaptures() {
  bool FoundSpecialCapture = false;
  for (unsigned I = 0; I < getKernelNumParams<KernelNameType>(); ++I) {
    auto ParamDesc = getKernelParamDesc<KernelNameType>(I);
    bool IsSpecialCapture =
        (ParamDesc.kind != kernel_param_kind_t::kind_std_layout &&
         ParamDesc.kind != kernel_param_kind_t::kind_pointer);
    FoundSpecialCapture |= IsSpecialCapture;
  }
  return FoundSpecialCapture;
}

Which returns false for hasSpecialCaptures when there are no parameters.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This corresponds to the bool HasSpecialCaptures = true; on the left (which we chose in #19117 (comment)).

NumParams isn't really 0 unless we leave that data "uninitialized", like in the interop kernel code path where we only know its Name.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see.

Copy link
Contributor

@uditagarwal97 uditagarwal97 left a comment

Choose a reason for hiding this comment

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

LGTM

@aelovikov-intel aelovikov-intel merged commit 8e59722 into intel:sycl Sep 4, 2025
27 checks passed
@aelovikov-intel aelovikov-intel deleted the compile-time-kernel-info branch September 4, 2025 17:48
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