This patch forces copying aggregate type in kernel arguments by value when
compiling CUDA targeting SPIR-V. The original behavior is not passing by value
when there is any of destructor, copy constructor and move constructor defined
by user. This patch makes the behavior of SPIR-V generated from CUDA follow
the CUDA spec
(https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#global-function-argument-processing),
and matches the NVPTX
implementation (
https://github.com/llvm/llvm-project/blob/41958f76d8a2c47484fa176cba1de565cfe84de7/clang/lib/CodeGen/TargetInfo.cpp#L7241).
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM with a couple of nits.
clang/lib/CodeGen/TargetInfo.cpp | ||
---|---|---|
10450 | I would add a comment that this is a CUDA-specific behavior with the pointer to the relevant CUDA doc explaining what's going on. | |
10450 | Style nit: LLVM does not use braces for single-statement body. |
Comment Actions
The landed revision seems to have my comments addressed. Was there something missing?
I would add a comment that this is a CUDA-specific behavior with the pointer to the relevant CUDA doc explaining what's going on.