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 1414# See the License for the specific language governing permissions and
1515# limitations under the License.
1616
17+ import ctypes
18+
1719import numpy as np
1820import pytest
1921
@@ -60,6 +62,27 @@ def test_divide_dtype_matrix(op1_dtype, op2_dtype):
6062 assert (dpt .asnumpy (r ) == expected .astype (r .dtype )).all ()
6163
6264
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+
6386@pytest .mark .parametrize ("op1_dtype" , _all_dtypes )
6487@pytest .mark .parametrize ("op2_dtype" , _all_dtypes )
6588def test_divide_inplace_dtype_matrix (op1_dtype , op2_dtype ):
You can’t perform that action at this time.
0 commit comments