Skip to content

Commit 966f48b

Browse files
Added blocking kernel to copy-and-cast np.ndarray -> usm_ndarray
The kernel accesses NumPy allocation using read-only buffer, hence the blocking. ``` In [1]: import dpctl.tensor as dpt In [2]: import numpy as np In [3]: X = dpt.zeros((81,81,81),'d') In [4]: %time X[:41,:41,:41] = np.random.randn(41,41,41) CPU times: user 100 ms, sys: 8.28 ms, total: 108 ms Wall time: 106 ms In [5]: %time X[:41,:41,:41] = np.random.randn(41,41,41) CPU times: user 17.8 ms, sys: 3.81 ms, total: 21.6 ms Wall time: 20 ms ``` This used to take over 30 seconds.
1 parent ca0ef9b commit 966f48b

File tree

1 file changed

+546
-100
lines changed

1 file changed

+546
-100
lines changed

0 commit comments

Comments
 (0)