Skip to content

Conversation

Naghasan
Copy link

@Naghasan Naghasan commented Oct 2, 2024

Make them more precise by providing better context and avoid false overload resolution errors.

retargeted PR from #45, not addressing #45 (comment) yet

tahonermann and others added 2 commits September 28, 2024 22:29
The `sycl_kernel_entry_point` attribute is used to declare a function that
defines a pattern for an offload kernel to be emitted. The attribute requires
a single type argument that specifies a class type that meets the requirements
for a SYCL kernel name as described in section 5.2, "Naming of kernels", of
the SYCL 2020 specification. A unique kernel name type is required for each
function declared with the attribute. The attribute may not first appear on a
declaration that follows a definition of the function. The function is
required to have a `void` return type. The function's parameters define the
parameters to the offload kernel. The function must not be a non-static member
function, be deleted or defaulted, be declared with the `constexpr` or
`consteval` specifiers, be declared with the `[[noreturn]]` attribute, be a
coroutine, or accept variadic arguments.

Properties of the offload kernel are collected when a function declared with
the `sycl_kernel_entry_point` attribute is parsed or instantiated. These
properties, such as the kernel name type, are stored in the AST context where
they are (or will be) used for diagnostic purposes and to facilitate reflection
to a SYCL run-time library. These properties are not serialized with the AST
but are recreated upon deserialization.

The `sycl_kernel_entry_point` attribute is intended to replace the existing
`sycl_kernel` attribute which is intended to be deprecated in a future change
and removed following an appropriate deprecation period. The new attribute
differs in that it is enabled for both SYCL host and device compilation, may
be used with non-template functions, explicitly indicates the type used as
the kernel name type, and will impact AST generation.

This change adds the basic infrastructure for the new attribute. Future
changes will alter the AST produced for a function defined with the attribute
and drive generation of the corresponding offload kernel.
Make them more precise by providing better context and avoid false overload resolution errors.
@tahonermann tahonermann force-pushed the sycl-upstream-fe-pr1 branch from 4f5358e to 3c4a2b8 Compare October 4, 2024 18:19
…e instantiation.

In case of template instantiation, CheckSYCLEntryPointFunctionDecl checks are postponed
until diagnosic of decl use or when finishing explicit instanciation.

Note: this currently trigger an issue in the note emission as we are missing the call site.
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