File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 14
14
# See the License for the specific language governing permissions and
15
15
# limitations under the License.
16
16
17
+ import ctypes
18
+
17
19
import numpy as np
18
20
import pytest
19
21
@@ -60,6 +62,27 @@ def test_divide_dtype_matrix(op1_dtype, op2_dtype):
60
62
assert (dpt .asnumpy (r ) == expected .astype (r .dtype )).all ()
61
63
62
64
65
+ @pytest .mark .parametrize ("arr_dt" , _all_dtypes )
66
+ def test_divide_python_scalar (arr_dt ):
67
+ q = get_queue_or_skip ()
68
+ skip_if_dtype_not_supported (arr_dt , q )
69
+
70
+ X = dpt .ones ((10 , 10 ), dtype = arr_dt , sycl_queue = q )
71
+ py_ones = (
72
+ bool (1 ),
73
+ int (1 ),
74
+ float (1 ),
75
+ complex (1 ),
76
+ np .float32 (1 ),
77
+ ctypes .c_int (1 ),
78
+ )
79
+ for sc in py_ones :
80
+ R = dpt .divide (X , sc )
81
+ assert isinstance (R , dpt .usm_ndarray )
82
+ R = dpt .divide (sc , X )
83
+ assert isinstance (R , dpt .usm_ndarray )
84
+
85
+
63
86
@pytest .mark .parametrize ("op1_dtype" , _all_dtypes )
64
87
@pytest .mark .parametrize ("op2_dtype" , _all_dtypes )
65
88
def test_divide_inplace_dtype_matrix (op1_dtype , op2_dtype ):
You can’t perform that action at this time.
0 commit comments