File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -277,7 +277,9 @@ void NVPTXTargetCodeGenInfo::setTargetAttributes(
277277 }
278278 }
279279 // Attach kernel metadata directly if compiling for NVPTX.
280- if (FD->hasAttr <DeviceKernelAttr>())
280+ // NOTE: Don't set kernel calling convention for handled OpenCL kernel,
281+ // otherwise the stub version of kernel would be incorrect.
282+ if (FD->hasAttr <DeviceKernelAttr>() && !M.getLangOpts ().OpenCL )
281283 F->setCallingConv (getDeviceKernelCallingConv ());
282284}
283285
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ void device_function() {
1212// CHECK-LABEL: define dso_local ptx_kernel void @kernel_function(
1313// CHECK-SAME: ) local_unnamed_addr #[[ATTR1:[0-9]+]] !kernel_arg_addr_space [[META7:![0-9]+]] !kernel_arg_access_qual [[META7]] !kernel_arg_type [[META7]] !kernel_arg_base_type [[META7]] !kernel_arg_type_qual [[META7]] {
1414// CHECK-NEXT: [[ENTRY:.*:]]
15- // CHECK-NEXT: unreachable
15+ // CHECK-NEXT: ret void
1616//
1717__kernel void kernel_function () {
1818 device_function ();
You can’t perform that action at this time.
0 commit comments