Skip to content

Commit a217c3b

Browse files
_get_arguments_info mustn't treat all error code as equal
As `arg_pos` is being incremented, eventually `CUDA_ERROR_INVALID_VALUE` is expected when `arg_pos` exceeds the number of kernel arguments. But other errors like CUDA_ERROR_INVALID_CONTEXT are possible, and they should be treated as errors. Failure to do that was behind the unintuitive behavior I reported in the PR.
1 parent 9193901 commit a217c3b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cuda_core/cuda/core/experimental/_module.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ def _get_arguments_info(self, param_info=False) -> tuple[int, list[NamedTuple]]:
232232
p_info = Kernel.ParamInfo(offset=result[1], size=result[2])
233233
param_info_data.append(p_info)
234234
arg_pos = arg_pos + 1
235+
if result[0] != driver.CUresult.CUDA_ERROR_INVALID_VALUE:
236+
handle_return(result)
235237
return arg_pos, param_info_data
236238

237239
@property

0 commit comments

Comments
 (0)