From 95d05c71d9b4ffc13e002c535fa384c5926199ce Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Wed, 29 Sep 2021 13:56:40 -0500 Subject: [PATCH] Silly typo behind slow copy The following example used to be very slow ```python import dpctl.tensor as dpt X = dpt.usm_ndarray((1_000_000, 4), "d") Z1 = dpt.usm_ndarray((1_000, 4), "d") X[:1_000] = Z1 ``` due to missing return after early optimization call. --- dpctl/tensor/_copy_utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/dpctl/tensor/_copy_utils.py b/dpctl/tensor/_copy_utils.py index bcd92ae718..2a295707f9 100644 --- a/dpctl/tensor/_copy_utils.py +++ b/dpctl/tensor/_copy_utils.py @@ -181,6 +181,7 @@ def copy_same_dtype(dst, src): def copy_same_shape(dst, src): if src.dtype == dst.dtype: copy_same_dtype(dst, src) + return # check that memory regions do not overlap if has_memory_overlap(dst, src):