File tree Expand file tree Collapse file tree 1 file changed +1
-18
lines changed Expand file tree Collapse file tree 1 file changed +1
-18
lines changed Original file line number Diff line number Diff line change 31
31
)
32
32
33
33
34
- def _has_memory_overlap (x1 , x2 ):
35
- if x1 .size and x2 .size :
36
- m1 = dpm .as_usm_memory (x1 )
37
- m2 = dpm .as_usm_memory (x2 )
38
- # can only overlap if bound to the same context
39
- if m1 .sycl_context == m2 .sycl_context :
40
- p1_beg = m1 ._pointer
41
- p1_end = p1_beg + m1 .nbytes
42
- p2_beg = m2 ._pointer
43
- p2_end = p2_beg + m2 .nbytes
44
- # may intersect if not ((p1_beg >= p2_end) or (p2_beg >= p2_end))
45
- return (p1_beg < p2_end ) and (p2_beg < p1_end )
46
- return False
47
- # zero element array do not overlap anything
48
- return False
49
-
50
-
51
34
def _copy_to_numpy (ary ):
52
35
if not isinstance (ary , dpt .usm_ndarray ):
53
36
raise TypeError
@@ -209,7 +192,7 @@ def _copy_overlapping(dst, src):
209
192
def _copy_same_shape (dst , src ):
210
193
"""Assumes src and dst have the same shape."""
211
194
# check that memory regions do not overlap
212
- if _has_memory_overlap (dst , src ):
195
+ if ti . _array_overlap (dst , src ):
213
196
_copy_overlapping (src = src , dst = dst )
214
197
return
215
198
You can’t perform that action at this time.
0 commit comments