[all-commits] [llvm/llvm-project] 29a5c3: [NVPTX] Introduce attribute to mark kernels withou...

Joseph Huber via All-commits all-commits at lists.llvm.org
Fri Mar 24 12:42:42 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 29a5c3c8fe30dcfb19dd86dd5f3f201435311997
      https://github.com/llvm/llvm-project/commit/29a5c3c8fe30dcfb19dd86dd5f3f201435311997
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2023-03-24 (Fri, 24 Mar 2023)

  Changed paths:
    M clang/include/clang/Basic/Attr.td
    M clang/lib/CodeGen/TargetInfo.cpp
    M clang/lib/Sema/SemaDeclAttr.cpp
    A clang/test/CodeGen/nvptx_attributes.c
    M clang/test/Misc/pragma-attribute-supported-attributes-list.test

  Log Message:
  -----------
  [NVPTX] Introduce attribute to mark kernels without a language mode

We may want to be able to mark certain regions as kernels even without
being in an accepted CUDA or OpenCL language mode. This patch introduces
a new attribute limited to `nvptx` targets called `nvptx_kernel` which
will perform the same metadata action as the existing CUDA ones. This
closely mimics the behaviour of the `amdgpu_kernel` attribute. This
allows for making executable NVPTX device images without using an
existing offloading language model.

I was unsure how to do this, I could potentially re-use all the CUDA
attributes and just replace the `CUDA` language requirement with an
`NVPTX` architecture requirement. Also I don't know if I should add more
than just this attribute.

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D140226




More information about the All-commits mailing list