From 77967e431f0a25dcaa00108a23abeca9d64f6acc Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Sat, 23 Jul 2022 20:50:49 +0300 Subject: [PATCH] add scalar support to cla.min and cla.max --- pyopencl/array.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyopencl/array.py b/pyopencl/array.py index 7ee89b18..b8fde35e 100644 --- a/pyopencl/array.py +++ b/pyopencl/array.py @@ -3077,6 +3077,9 @@ def subset_dot(subset, a, b, dtype=None, queue=None, slice=None): def _make_minmax_kernel(what): def f(a, queue=None, initial=np._NoValue): + if isinstance(a, SCALAR_CLASSES): + return np.array(a).dtype.type(a) + if len(a) == 0: if initial is np._NoValue: raise ValueError( -- GitLab