Skip to content

Commit

Permalink
Fix DPNP/DPCTL F-contiguous data processing (#1825)
Browse files Browse the repository at this point in the history
* Fix DPNP/DPCTL F-contiguous data processing

* Code formatting

* Fix linter error
  • Loading branch information
Vika-F authored May 7, 2024
1 parent 8bf52c2 commit 1a5c09c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion sklearnex/_device_offload.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,15 @@ def _transfer_to_host(queue, *data):
queue = usm_iface["syclobj"]

buffer = as_usm_memory(item).copy_to_host()
order = "C"
if usm_iface["strides"] is not None:
if usm_iface["strides"][0] < usm_iface["strides"][1]:
order = "F"
item = np.ndarray(
shape=usm_iface["shape"], dtype=usm_iface["typestr"], buffer=buffer
shape=usm_iface["shape"],
dtype=usm_iface["typestr"],
buffer=buffer,
order=order,
)
has_usm_data = True
else:
Expand Down

0 comments on commit 1a5c09c

Please sign in to comment.