Skip to content

Commit c8a5343

Browse files
Applied unique changes from #1131
These were: ``` commit e57df0e (pr_1131) Author: Denis Smirnov <[email protected]> Date: Fri Apr 1 17:57:51 2022 +0300 Revert fallback to numpy commit 92c2fae Author: Denis Smirnov <[email protected]> Date: Wed Mar 30 12:32:58 2022 +0300 Normilize queue and device + change copying from numpy in call_origin commit 9fb287c Author: Denis Smirnov <[email protected]> Date: Wed Mar 23 11:36:59 2022 +0300 Change output array creation in dpnp_diag (part 2) commit a1597d0 Author: Denis Smirnov <[email protected]> Date: Wed Mar 23 09:52:50 2022 +0300 Change output array creation in dpnp_diag ```
1 parent 404b587 commit c8a5343

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

dpnp/dpnp_algo/dpnp_algo_arraycreation.pyx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,21 +121,15 @@ cpdef utils.dpnp_descriptor dpnp_diag(utils.dpnp_descriptor v, int k):
121121
result_shape = (n, )
122122

123123
v_obj = v.get_array()
124-
125-
result_obj = dpnp_container.empty(result_shape,
126-
dtype=v.dtype,
127-
device=v_obj.sycl_device,
128-
usm_type=v_obj.usm_type,
129-
sycl_queue=v_obj.sycl_queue)
124+
125+
# TODO need to call dpnp_container.zeros instead
126+
result_obj = dpnp.zeros(result_shape, dtype=v.dtype).to_device(v_obj.sycl_device)
130127
cdef utils.dpnp_descriptor result = dpnp_descriptor(result_obj)
131128

132129
cdef DPNPFuncType param1_type = dpnp_dtype_to_DPNPFuncType(v.dtype)
133130

134131
cdef DPNPFuncData kernel_data = get_dpnp_function_ptr(DPNP_FN_DIAG_EXT, param1_type, param1_type)
135132

136-
result_type = dpnp_DPNPFuncType_to_dtype(< size_t > kernel_data.return_type)
137-
138-
139133
result_sycl_queue = result.get_array().sycl_queue
140134

141135
cdef c_dpctl.SyclQueue q = <c_dpctl.SyclQueue> result_sycl_queue

dpnp/dpnp_container.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import dpctl.tensor as dpt
4444
from dpctl.tensor._device import normalize_queue_device
4545

46+
4647
if config.__DPNP_OUTPUT_DPCTL__:
4748
try:
4849
"""

0 commit comments

Comments
 (0)