diff options
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index e2437d1..ef6bb4f 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -635,7 +635,9 @@ void CodeGenFunction::EmitKernelMetadata(const FunctionDecl *FD, CGM.GenKernelArgMetadata(Fn, FD, this); - if (!getLangOpts().OpenCL) + if (!(getLangOpts().OpenCL || + (getLangOpts().CUDA && + getContext().getTargetInfo().getTriple().isSPIRV()))) return; if (const VecTypeHintAttr *A = FD->getAttr<VecTypeHintAttr>()) { @@ -1022,6 +1024,8 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy, } if (FD && (getLangOpts().OpenCL || + (getLangOpts().CUDA && + getContext().getTargetInfo().getTriple().isSPIRV()) || ((getLangOpts().HIP || getLangOpts().OffloadViaLLVM) && getLangOpts().CUDAIsDevice))) { // Add metadata for a kernel function. |