File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
dpnp/tests/third_party/cupy/binary_tests Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ from __future__ import annotations
2+
13import unittest
24
35from dpnp .tests .third_party .cupy import testing
@@ -27,6 +29,38 @@ def test_bitwise_or(self):
2729 def test_bitwise_xor (self ):
2830 self .check_binary_int ("bitwise_xor" )
2931
32+ @testing .with_requires ("numpy>=2.0.0" )
33+ @testing .for_int_dtypes (no_bool = True )
34+ @testing .numpy_cupy_array_equal ()
35+ def test_bitwise_count (self , xp , dtype ):
36+ info = xp .iinfo (dtype )
37+ if xp .issubdtype (dtype , xp .signedinteger ):
38+ a = xp .array (
39+ [
40+ 0 ,
41+ - 1 ,
42+ 1 ,
43+ info .min ,
44+ info .min + 1 ,
45+ info .max ,
46+ info .max - 1 ,
47+ info .max // 2 ,
48+ ],
49+ dtype = dtype ,
50+ )
51+ else :
52+ a = xp .array (
53+ [
54+ 0 ,
55+ 1 ,
56+ info .max ,
57+ info .max - 1 ,
58+ info .max // 2 ,
59+ ],
60+ dtype = dtype ,
61+ )
62+ return xp .bitwise_count (a )
63+
3064 def test_invert (self ):
3165 self .check_unary_int ("invert" )
3266
You can’t perform that action at this time.
0 commit comments