Skip to content

Commit 75b65ef

Browse files
committed
Remove test_reduce_struct_type from test_reduce.py
1 parent 1ff1386 commit 75b65ef

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

python/cuda_parallel/tests/test_reduce.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
import cuda.parallel.experimental.algorithms as algorithms
1414
import cuda.parallel.experimental.iterators as iterators
15-
from cuda.parallel.experimental.struct import gpu_struct
1615

1716

1817
def random_int(shape, dtype):
@@ -551,30 +550,3 @@ def binary_op(x, y):
551550
d_in = cp.zeros(size)[::2]
552551
with pytest.raises(ValueError, match="Non-contiguous arrays are not supported."):
553552
_ = algorithms.reduce_into(d_in, d_out, binary_op, h_init)
554-
555-
556-
def test_reduce_struct_type():
557-
@gpu_struct
558-
class Pixel:
559-
r: np.int32
560-
g: np.int32
561-
b: np.int32
562-
563-
def max_g_value(x, y):
564-
return x if x.g > y.g else y
565-
566-
d_rgb = cp.random.randint(0, 256, (10, 3), dtype=np.int32).view(Pixel.dtype)
567-
d_out = cp.empty(1, Pixel.dtype)
568-
569-
h_init = Pixel(0, 0, 0)
570-
571-
reduce_into = algorithms.reduce_into(d_rgb, d_out, max_g_value, h_init)
572-
temp_storage_bytes = reduce_into(None, d_rgb, d_out, len(d_rgb), h_init)
573-
574-
d_temp_storage = cp.empty(temp_storage_bytes, dtype=np.uint8)
575-
_ = reduce_into(d_temp_storage, d_rgb, d_out, len(d_rgb), h_init)
576-
577-
h_rgb = d_rgb.get()
578-
expected = h_rgb[h_rgb.view("int32")[:, 1].argmax()]
579-
580-
np.testing.assert_equal(expected["g"], d_out.get()["g"])

0 commit comments

Comments
 (0)