[clang] [Clang][OpenCL][AMDGPU] Allow a kernel to call another kernel (PR #115821)

Aniket Lal via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 22 02:12:19 PST 2025


================
@@ -71,14 +71,19 @@ class GlobalDecl {
   GlobalDecl(const FunctionDecl *D, unsigned MVIndex = 0)
       : MultiVersionIndex(MVIndex) {
     if (!D->hasAttr<CUDAGlobalAttr>()) {
+      if (D->hasAttr<OpenCLKernelAttr>()) {
+        Value.setPointerAndInt(D, unsigned(KernelReferenceKind::Kernel));
+        return;
+      }
----------------
lalaniket8 wrote:

Added `isReferenceableKernel()` to `FunctionDecl`. Since OpenCL does not support template kernel functions, I have not added it to `FunctionTemplateDecl`.

https://github.com/llvm/llvm-project/pull/115821


More information about the cfe-commits mailing list