diff --git a/test/test_array.py b/test/test_array.py index dc67aa2069faf1cae817ce7e7dc462d303803c94..6df793c8c7aca711fe1c74ac489ee4145b01462f 100644 --- a/test/test_array.py +++ b/test/test_array.py @@ -656,6 +656,11 @@ def test_view(ctx_factory): view = a_dev.view(np.int16) assert view.shape == (8, 32) and view.dtype == np.int16 +mmc_dtype = np.dtype([("cur_min", np.float32), ("cur_max", np.float32)]) + +from pyopencl.tools import register_dtype +register_dtype(mmc_dtype, "minmax_collector") + @pytools.test.mark_test.opencl def test_struct_reduce(ctx_factory): context = ctx_factory() @@ -694,14 +699,11 @@ def test_struct_reduce(ctx_factory): """ - mmc_dtype = np.dtype([("cur_min", np.float32), ("cur_max", np.float32)]) from pyopencl.clrandom import rand as clrand a_gpu = clrand(queue, (20000,), dtype=np.float32) a = a_gpu.get() - from pyopencl.tools import register_dtype - register_dtype(mmc_dtype, "minmax_collector") from pyopencl.reduction import ReductionKernel red = ReductionKernel(context, mmc_dtype,