Skip to content

Commit 36cddbc

Browse files
committed
fix: do not edit memcpy
1 parent ae492b5 commit 36cddbc

File tree

4 files changed

+10
-42
lines changed

4 files changed

+10
-42
lines changed

dpctl/_sycl_queue.pyx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,9 @@ cdef DPCTLSyclEventRef _copy_impl(
592592
)
593593

594594
if dep_events_count == 0 or dep_events is NULL:
595-
ERef = DPCTLQueue_CopyData(q._queue_ref, c_dst_ptr, c_src_ptr, byte_count)
595+
ERef = DPCTLQueue_CopyData(
596+
q._queue_ref, c_dst_ptr, c_src_ptr, byte_count
597+
)
596598
else:
597599
ERef = DPCTLQueue_CopyDataWithEvents(
598600
q._queue_ref,

dpctl/tests/test_sycl_queue_memcpy.py

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -155,40 +155,6 @@ def test_memcpy_async():
155155
assert dst_buf2 == src_buf
156156

157157

158-
def test_copy_copy_host_to_host():
159-
try:
160-
q = dpctl.SyclQueue()
161-
except dpctl.SyclQueueCreationError:
162-
pytest.skip("Default constructor for SyclQueue failed")
163-
164-
src_buf = b"abcdefghijklmnopqrstuvwxyz"
165-
dst_buf = bytearray(len(src_buf))
166-
167-
q.copy(dst_buf, src_buf, len(src_buf))
168-
169-
assert dst_buf == src_buf
170-
171-
172-
def test_copy_async():
173-
try:
174-
q = dpctl.SyclQueue()
175-
except dpctl.SyclQueueCreationError:
176-
pytest.skip("Default constructor for SyclQueue failed")
177-
178-
src_buf = b"abcdefghijklmnopqrstuvwxyz"
179-
n = len(src_buf)
180-
dst_buf = bytearray(n)
181-
dst_buf2 = bytearray(n)
182-
183-
e = q.copy_async(dst_buf, src_buf, n)
184-
e2 = q.copy_async(dst_buf2, src_buf, n, [e])
185-
186-
e.wait()
187-
e2.wait()
188-
assert dst_buf == src_buf
189-
assert dst_buf2 == src_buf
190-
191-
192158
def test_memcpy_type_error():
193159
try:
194160
q = dpctl.SyclQueue()

libsyclinterface/source/dpctl_sycl_queue_interface.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -742,9 +742,9 @@ DPCTLQueue_CopyDataWithEvents(__dpctl_keep const DPCTLSyclQueueRef QRef,
742742
}
743743

744744
// Bind queue::copy with uint8_t so Count is interpreted as bytes.
745-
auto ev = Q->copy(static_cast<const std::uint8_t *>(Src),
746-
static_cast<std::uint8_t *>(Dest), Count,
747-
dep_events);
745+
auto ev =
746+
Q->copy(static_cast<const std::uint8_t *>(Src),
747+
static_cast<std::uint8_t *>(Dest), Count, dep_events);
748748
return wrap<event>(new event(std::move(ev)));
749749
} catch (const std::exception &ex) {
750750
error_handler(ex, __FILE__, __func__, __LINE__);

libsyclinterface/tests/test_sycl_queue_interface.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,8 @@ TEST(TestDPCTLSyclQueueInterface, CheckMemOpsZeroQRef)
374374
ASSERT_NO_FATAL_FAILURE(ERef = DPCTLQueue_CopyData(QRef, p1, p2, n_bytes));
375375
ASSERT_FALSE(bool(ERef));
376376

377-
ASSERT_NO_FATAL_FAILURE(ERef = DPCTLQueue_CopyDataWithEvents(
378-
QRef, p1, p2, n_bytes, NULL, 0));
377+
ASSERT_NO_FATAL_FAILURE(
378+
ERef = DPCTLQueue_CopyDataWithEvents(QRef, p1, p2, n_bytes, NULL, 0));
379379
ASSERT_FALSE(bool(ERef));
380380

381381
ASSERT_NO_FATAL_FAILURE(ERef = DPCTLQueue_Prefetch(QRef, p1, n_bytes));
@@ -439,8 +439,8 @@ TEST_P(TestDPCTLQueueMemberFunctions, CheckMemOpsNullPtr)
439439
ASSERT_NO_FATAL_FAILURE(ERef = DPCTLQueue_CopyData(QRef, p1, p2, n_bytes));
440440
ASSERT_FALSE(bool(ERef));
441441

442-
ASSERT_NO_FATAL_FAILURE(ERef = DPCTLQueue_CopyDataWithEvents(
443-
QRef, p1, p2, n_bytes, NULL, 0));
442+
ASSERT_NO_FATAL_FAILURE(
443+
ERef = DPCTLQueue_CopyDataWithEvents(QRef, p1, p2, n_bytes, NULL, 0));
444444
ASSERT_FALSE(bool(ERef));
445445

446446
ASSERT_NO_FATAL_FAILURE(ERef = DPCTLQueue_Prefetch(QRef, p1, n_bytes));

0 commit comments

Comments
 (0)