From 75b65ef7e4d96a8b311e67c72078da3e2f8bbee6 Mon Sep 17 00:00:00 2001 From: Ashwin Srinath Date: Tue, 14 Jan 2025 09:40:16 -0500 Subject: [PATCH] Remove test_reduce_struct_type from test_reduce.py --- python/cuda_parallel/tests/test_reduce.py | 28 ----------------------- 1 file changed, 28 deletions(-) diff --git a/python/cuda_parallel/tests/test_reduce.py b/python/cuda_parallel/tests/test_reduce.py index fc0bcaf7995..9549ef7bee3 100644 --- a/python/cuda_parallel/tests/test_reduce.py +++ b/python/cuda_parallel/tests/test_reduce.py @@ -12,7 +12,6 @@ import cuda.parallel.experimental.algorithms as algorithms import cuda.parallel.experimental.iterators as iterators -from cuda.parallel.experimental.struct import gpu_struct def random_int(shape, dtype): @@ -551,30 +550,3 @@ def binary_op(x, y): d_in = cp.zeros(size)[::2] with pytest.raises(ValueError, match="Non-contiguous arrays are not supported."): _ = algorithms.reduce_into(d_in, d_out, binary_op, h_init) - - -def test_reduce_struct_type(): - @gpu_struct - class Pixel: - r: np.int32 - g: np.int32 - b: np.int32 - - def max_g_value(x, y): - return x if x.g > y.g else y - - d_rgb = cp.random.randint(0, 256, (10, 3), dtype=np.int32).view(Pixel.dtype) - d_out = cp.empty(1, Pixel.dtype) - - h_init = Pixel(0, 0, 0) - - reduce_into = algorithms.reduce_into(d_rgb, d_out, max_g_value, h_init) - temp_storage_bytes = reduce_into(None, d_rgb, d_out, len(d_rgb), h_init) - - d_temp_storage = cp.empty(temp_storage_bytes, dtype=np.uint8) - _ = reduce_into(d_temp_storage, d_rgb, d_out, len(d_rgb), h_init) - - h_rgb = d_rgb.get() - expected = h_rgb[h_rgb.view("int32")[:, 1].argmax()] - - np.testing.assert_equal(expected["g"], d_out.get()["g"])