llvm icon indicating copy to clipboard operation
llvm copied to clipboard

[SYCL] Free function traits and APIs

Open rdeodhar opened this issue 9 months ago • 0 comments

This PR implements the traits and other APIs for free function support.

The free function spec is here: https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/proposed/sycl_ext_oneapi_free_function_kernels.asciidoc.

Later PRs will add the remaining parts of the spec. This is the current status:

  1. Free functions are supported at file scope only.
  2. The SYCL_EXTERNAL markup is needed for free functions in addition to the SYCL_EXT_ONEAPI_FUNCTION_PROPERTY property.
  3. The compiler does not yet diagnose an error if the application violates any of the restrictions listed in the specification under the section "Defining a free function kernel".
  4. Device code generation is supported for scalars and USM pointers only. It is not supported for complex kernel argument types requiring decomposition like accessor, local_accessor, or stream.
  5. The implementation has not been tested to handle the case when a kernel argument is optimized away. The switch -fno-sycl-dead-args-optimization could be used to disable this optimization, if needed
  6. The kernel information descriptor info::kernel::num_args cannot yet be used to query the number of arguments in a free function kernel.

rdeodhar avatar May 23 '24 01:05 rdeodhar