Skip to content

Commit 7de50be

Browse files
authored
[Offload] Fix return error with a condition (llvm#152876)
Adds a conditional to the error return so that it only returns if there was an error.
1 parent 59f31d4 commit 7de50be

File tree

1 file changed

+4
-3
lines changed
  • offload/plugins-nextgen/cuda/src

1 file changed

+4
-3
lines changed

offload/plugins-nextgen/cuda/src/rtl.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,9 +1317,10 @@ Error CUDAKernelTy::launchImpl(GenericDeviceTy &GenericDevice,
13171317
if (MaxDynCGroupMem >= MaxDynCGroupMemLimit) {
13181318
CUresult AttrResult = cuFuncSetAttribute(
13191319
Func, CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES, MaxDynCGroupMem);
1320-
return Plugin::check(
1321-
AttrResult,
1322-
"Error in cuLaunchKernel while setting the memory limits: %s");
1320+
if (auto Err = Plugin::check(
1321+
AttrResult,
1322+
"Error in cuLaunchKernel while setting the memory limits: %s"))
1323+
return Err;
13231324
MaxDynCGroupMemLimit = MaxDynCGroupMem;
13241325
}
13251326

0 commit comments

Comments
 (0)