File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,20 @@ def test_from_dlpack(arr_dtype,shape):
41
41
W = dpnp .from_dlpack (V )
42
42
assert V .strides == W .strides
43
43
44
+ @pytest .mark .parametrize ("arr_dtype" , get_all_dtypes ())
45
+ def test_from_dlpack_with_dpt (arr_dtype ):
46
+ X = dpt .empty ((64 ,),dtype = arr_dtype )
47
+ Y = dpnp .from_dlpack (X )
48
+ assert_array_equal (X , Y )
49
+ assert isinstance (Y , dpnp .dpnp_array .dpnp_array )
50
+ assert X .__dlpack_device__ () == Y .__dlpack_device__ ()
51
+ assert X .shape == Y .shape
52
+ assert X .dtype == Y .dtype or (
53
+ str (X .dtype ) == "bool" and str (Y .dtype ) == "uint8"
54
+ )
55
+ assert X .sycl_device == Y .sycl_device
56
+ assert X .usm_type == Y .usm_type
57
+
44
58
45
59
@pytest .mark .parametrize ("arr_dtype" , get_all_dtypes ())
46
60
@pytest .mark .parametrize ("arr" ,
You can’t perform that action at this time.
0 commit comments