Skip to content

Commit 9193901

Browse files
Move ParamInfo to class context
Used modern namedtuple instance constructor.
1 parent 96f60d8 commit 9193901

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cuda_core/cuda/core/experimental/_module.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ class Kernel:
196196
"""
197197

198198
__slots__ = ("_handle", "_module", "_attributes")
199+
ParamInfo = namedtuple("ParamInfo", ["offset", "size"])
199200

200201
def __new__(self, *args, **kwargs):
201202
raise RuntimeError("Kernel objects cannot be instantiated directly. Please use ObjectCode APIs.")
@@ -222,15 +223,14 @@ def _get_arguments_info(self, param_info=False) -> tuple[int, list[NamedTuple]]:
222223
if attr_impl._backend_version != "new":
223224
raise NotImplementedError("New backend is required")
224225
arg_pos = 0
225-
if param_info:
226-
ParamInfo = namedtuple("ParamInfo", ["offset", "size"])
227226
param_info_data = []
228227
while True:
229228
result = attr_impl._loader["paraminfo"](self._handle, arg_pos)
230229
if result[0] != driver.CUresult.CUDA_SUCCESS:
231230
break
232231
if param_info:
233-
param_info_data.append(ParamInfo._make(result[1:3]))
232+
p_info = Kernel.ParamInfo(offset=result[1], size=result[2])
233+
param_info_data.append(p_info)
234234
arg_pos = arg_pos + 1
235235
return arg_pos, param_info_data
236236

0 commit comments

Comments
 (0)