Skip to content

Commit eccf23c

Browse files
committed
feat(typing): return int from kernel_get_work_group_info
1 parent b3bb32d commit eccf23c

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

pyopencl/_monkeypatch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def kernel_set_arg_types(self: _cl.Kernel, arg_types):
259259
devs=self.context.devices))
260260

261261

262-
def kernel_get_work_group_info(self: _cl.Kernel, param: int, device: _cl.Device):
262+
def kernel_get_work_group_info(self: _cl.Kernel, param: int, device: _cl.Device) -> int:
263263
try:
264264
wg_info_cache = self._wg_info_cache
265265
except AttributeError:

pyopencl/array.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,9 @@ def kernel_runner(out: Array, *args: P.args, **kwargs: P.kwargs) -> cl.Event:
244244
assert queue is not None
245245

246246
knl = kernel_getter(out, *args, **kwargs)
247-
work_group_info = cast("int", knl.get_work_group_info(
247+
work_group_info = knl.get_work_group_info(
248248
cl.kernel_work_group_info.WORK_GROUP_SIZE,
249-
queue.device))
249+
queue.device)
250250
gs, ls = out._get_sizes(queue, work_group_info)
251251

252252
knl_args = (out, *args, out.size)

pyopencl/characterize/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
"""
2525

2626

27-
from typing import cast
28-
2927
from pytools import memoize
3028

3129
import pyopencl as cl
@@ -70,9 +68,9 @@ def reasonable_work_group_size_multiple(
7068
}
7169
""")
7270
prg.build()
73-
return cast("int", prg.knl.get_work_group_info(
71+
return prg.knl.get_work_group_info(
7472
cl.kernel_work_group_info.PREFERRED_WORK_GROUP_SIZE_MULTIPLE,
75-
dev))
73+
dev)
7674

7775

7876
def nv_compute_capability(dev: cl.Device):

0 commit comments

Comments
 (0)