[PATCH] D140226: [NVPTX] Introduce attribute to mark kernels without a language mode

Joseph Huber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 18 11:59:04 PST 2022


jhuber6 added a comment.

In D140226#4003826 <https://reviews.llvm.org/D140226#4003826>, @tschuett wrote:

> But then you are maybe mixing two concepts. `kernel` is source code or AST feature. nvptx or AMDGPU are command line flags.
>
> CUDA, Sycl, nvtx, and AMDGPU are modes or calling conventions?

The way I understand it, the architecture determines the actual ISA for the code and the `kernel` metadata operates like a calling convention for whatever "OS" will be executing it. For example, for the triple `amdgcn-amd-amdhsa` we generate code for the `amdgcn` architecture and emit kernels such that the `hsa` runtime can call them. Similarly, for `nvptx64-nvidia-cuda` we emit code for `nvptx64` and our kernels use the calling convention such that the `cuda` runtime can call them. I think the main question of this patch is if we can separate the `cuda` runtime from the CUDA language. That is, we don't need to be using the CUDA language to emit functions that the `cuda` runtime can call. So this is more or less thinking of these kernel calls as a calling convention for a runtime or operating system rather than as a language feature.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140226/new/

https://reviews.llvm.org/D140226



More information about the cfe-commits mailing list