diff options
author | Kevin Sala Penades <salapenades1@llnl.gov> | 2025-08-10 12:03:09 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-10 12:03:09 -0700 |
commit | 7de50beb5281ec860a810ffa544d67be21d78412 (patch) | |
tree | 8cb0ed523fa66473434dfe5002ef0d2b11787c66 | |
parent | 59f31d4e8df8cc35c816c05f2c653ca29e9a276e (diff) | |
download | llvm-7de50beb5281ec860a810ffa544d67be21d78412.zip llvm-7de50beb5281ec860a810ffa544d67be21d78412.tar.gz llvm-7de50beb5281ec860a810ffa544d67be21d78412.tar.bz2 |
[Offload] Fix return error with a condition (#152876)
Adds a conditional to the error return so that it only returns if there was an error.
-rw-r--r-- | offload/plugins-nextgen/cuda/src/rtl.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/offload/plugins-nextgen/cuda/src/rtl.cpp b/offload/plugins-nextgen/cuda/src/rtl.cpp index f3f3783..e94f3f6 100644 --- a/offload/plugins-nextgen/cuda/src/rtl.cpp +++ b/offload/plugins-nextgen/cuda/src/rtl.cpp @@ -1317,9 +1317,10 @@ Error CUDAKernelTy::launchImpl(GenericDeviceTy &GenericDevice, if (MaxDynCGroupMem >= MaxDynCGroupMemLimit) { CUresult AttrResult = cuFuncSetAttribute( Func, CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES, MaxDynCGroupMem); - return Plugin::check( - AttrResult, - "Error in cuLaunchKernel while setting the memory limits: %s"); + if (auto Err = Plugin::check( + AttrResult, + "Error in cuLaunchKernel while setting the memory limits: %s")) + return Err; MaxDynCGroupMemLimit = MaxDynCGroupMem; } |