================
@@ -277,7 +277,9 @@ void NVPTXTargetCodeGenInfo::setTargetAttributes(
}
}
// Attach kernel metadata directly if compiling for NVPTX.
- if (FD->hasAttr<DeviceKernelAttr>())
+ // NOTE: Don't set kernel calling convention for handled OpenCL kernel,
+ // otherwise the stub version of kernel would be incorrect.
+ if (FD->hasAttr<DeviceKernelAttr>() && !M.getLangOpts().OpenCL)
----------------
XChy wrote:
In the context here, I didn't find a way to check whether it's a stub unless by
the mangled name. So I apply this code to the ones without
`__clang_ocl_kern_imp_` prefix in the mangled name.
https://github.com/llvm/llvm-project/pull/170170
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits