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
+
1
3
import unittest
2
4
3
5
from dpnp .tests .third_party .cupy import testing
@@ -27,6 +29,38 @@ def test_bitwise_or(self):
27
29
def test_bitwise_xor (self ):
28
30
self .check_binary_int ("bitwise_xor" )
29
31
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
+
30
64
def test_invert (self ):
31
65
self .check_unary_int ("invert" )
32
66
You can’t perform that action at this time.
0 commit comments