Skip to content

Commit

Permalink
Revert "use the correct SYCL context for host USM allocations"
Browse files Browse the repository at this point in the history
Manually reverting:
#7858

Signed-off-by: Joe Todd <[email protected]>
  • Loading branch information
joeatodd committed Jun 13, 2024
1 parent abd7c7b commit 18133ca
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions ggml-sycl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13072,12 +13072,9 @@ void *ggml_sycl_host_malloc(size_t size) try {
return nullptr;
}

ggml_sycl_set_device(g_main_device);
dpct::queue_ptr main_stream = g_syclStreams[g_main_device][0];

void * ptr = nullptr;
dpct::err0 err = CHECK_TRY_ERROR(
ptr = (void *)sycl::malloc_host(size, *main_stream));
ptr = (void *)sycl::malloc_host(size, dpct::get_in_order_queue()));

if (err != 0) {
// clear the error
Expand All @@ -13098,9 +13095,7 @@ catch (sycl::exception const &exc) {
}

void ggml_sycl_host_free(void *ptr) try {
ggml_sycl_set_device(g_main_device);
dpct::queue_ptr main_stream = g_syclStreams[g_main_device][0];
SYCL_CHECK(CHECK_TRY_ERROR(sycl::free(ptr, *main_stream)));
SYCL_CHECK(CHECK_TRY_ERROR(sycl::free(ptr, dpct::get_in_order_queue())));
}
catch (sycl::exception const &exc) {
std::cerr << exc.what() << "Exception caught at file:" << __FILE__
Expand Down

0 comments on commit 18133ca

Please sign in to comment.