Skip to content

Commit

Permalink
avoid additional array
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandr-Solovev committed Nov 4, 2024
1 parent a634f09 commit b8dce34
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions cpp/oneapi/dal/backend/memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,7 @@ inline sycl::event memcpy_host2usm(sycl::queue& queue,
const event_vector& deps = {}) {
ONEDAL_ASSERT(is_known_usm(queue, dest_usm));

// TODO: Remove additional copy to host usm memory once
// bug in `copy` with the host memory is fixed
auto tmp_usm_host = make_unique_usm_host(queue, size);
memcpy(tmp_usm_host.get(), src_host, size);
memcpy(queue, dest_usm, tmp_usm_host.get(), size, deps).wait_and_throw();
memcpy(queue, dest_usm, src_host, size, deps).wait_and_throw();
return {};
}

Expand All @@ -236,11 +232,7 @@ inline sycl::event memcpy_usm2host(sycl::queue& queue,
const event_vector& deps = {}) {
ONEDAL_ASSERT(is_known_usm(queue, src_usm));

// TODO: Remove additional copy to host usm memory once
// bug in `copy` with the host memory is fixed
auto tmp_usm_host = make_unique_usm_host(queue, size);
memcpy(queue, tmp_usm_host.get(), src_usm, size, deps).wait_and_throw();
memcpy(dest_host, tmp_usm_host.get(), size);
memcpy(queue, dest_host, src_usm, size, deps).wait_and_throw();
return {};
}

Expand Down

0 comments on commit b8dce34

Please sign in to comment.