File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
examples/pybind11/external_usm_allocation/tests Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 1717# coding: utf-8
1818
1919import external_usm_allocation as eua
20+ import numpy as np
2021
2122import dpctl
2223import dpctl .memory as dpm
23- import dpctl .tensor as dpt
2424
2525
2626def test_direct ():
@@ -30,8 +30,11 @@ def test_direct():
3030 mbuf = eua .make_zeroed_device_memory (nb , q )
3131
3232 assert isinstance (mbuf , dpm .MemoryUSMDevice )
33- assert mbuf .nbytes == 2 * 30
33+ assert mbuf .nbytes == nb
3434 assert mbuf .sycl_queue == q
3535
36- x = dpt .usm_ndarray (30 , dtype = "i2" , buffer = mbuf )
37- assert dpt .all (x == dpt .zeros (30 , dtype = "i2" , sycl_queue = q ))
36+ x = np .empty (30 , dtype = "i2" )
37+ assert x .nbytes == nb
38+
39+ q .memcpy (dest = x , src = mbuf , count = nb )
40+ assert np .all (x == 0 )
You can’t perform that action at this time.
0 commit comments