From 18133cab40075e4cf8f953440a2d45fdfaf2a04e Mon Sep 17 00:00:00 2001 From: Joe Todd Date: Thu, 13 Jun 2024 12:08:27 +0100 Subject: [PATCH] Revert "use the correct SYCL context for host USM allocations" Manually reverting: https://github.com/ggerganov/llama.cpp/pull/7858 Signed-off-by: Joe Todd --- ggml-sycl.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/ggml-sycl.cpp b/ggml-sycl.cpp index 261bbcd6f..f6ae84ce9 100644 --- a/ggml-sycl.cpp +++ b/ggml-sycl.cpp @@ -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 @@ -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__