diff --git a/src/dft/backends/mklcpu/descriptor.cpp b/src/dft/backends/mklcpu/descriptor.cpp index b981d530f..2bb0e2835 100644 --- a/src/dft/backends/mklcpu/descriptor.cpp +++ b/src/dft/backends/mklcpu/descriptor.cpp @@ -32,7 +32,7 @@ void descriptor::commit(backend_selector selector) { if (pimpl_) { pimpl_->get_queue().wait(); } - pimpl_.reset(mklgpu::create_commit(*this, selector.get_queue())); + pimpl_.reset(mklcpu::create_commit(*this, selector.get_queue())); } pimpl_->commit(values_); } diff --git a/src/lapack/backends/cusolver/cusolver_scope_handle.cpp b/src/lapack/backends/cusolver/cusolver_scope_handle.cpp index b2881cdc0..0db72603c 100644 --- a/src/lapack/backends/cusolver/cusolver_scope_handle.cpp +++ b/src/lapack/backends/cusolver/cusolver_scope_handle.cpp @@ -42,9 +42,9 @@ CusolverScopedContextHandler::CusolverScopedContextHandler(sycl::queue queue, sycl::interop_handler &ih) : ih(ih), needToRecover_(false) { - placedContext_ = queue.get_context(); + placedContext_ = new sycl::context(queue.get_context()); auto device = queue.get_device(); - auto desired = sycl::get_native(placedContext_); + auto desired = sycl::get_native(*placedContext_); CUresult err; CUDA_ERROR_FUNC(cuCtxGetCurrent, err, &original_); if (original_ != desired) { @@ -65,6 +65,7 @@ CusolverScopedContextHandler::~CusolverScopedContextHandler() noexcept(false) { CUresult err; CUDA_ERROR_FUNC(cuCtxSetCurrent, err, original_); } + delete placedContext_; } void ContextCallback(void *userData) { @@ -88,7 +89,7 @@ void ContextCallback(void *userData) { cusolverDnHandle_t CusolverScopedContextHandler::get_handle(const sycl::queue &queue) { auto piPlacedContext_ = - reinterpret_cast(sycl::get_native(placedContext_)); + reinterpret_cast(sycl::get_native(*placedContext_)); CUstream streamId = get_stream(queue); cusolverStatus_t err; auto it = handle_helper.cusolver_handle_mapper_.find(piPlacedContext_); @@ -120,7 +121,7 @@ cusolverDnHandle_t CusolverScopedContextHandler::get_handle(const sycl::queue &q auto insert_iter = handle_helper.cusolver_handle_mapper_.insert( std::make_pair(piPlacedContext_, new std::atomic(handle))); - sycl::detail::pi::contextSetExtendedDeleter(placedContext_, ContextCallback, + sycl::detail::pi::contextSetExtendedDeleter(*placedContext_, ContextCallback, insert_iter.first->second); return handle; diff --git a/src/lapack/backends/cusolver/cusolver_scope_handle.hpp b/src/lapack/backends/cusolver/cusolver_scope_handle.hpp index f26a9c449..e36920b7d 100644 --- a/src/lapack/backends/cusolver/cusolver_scope_handle.hpp +++ b/src/lapack/backends/cusolver/cusolver_scope_handle.hpp @@ -23,8 +23,10 @@ #else #include #endif -#if __has_include() +#if __has_include() +#if __SYCL_COMPILER_VERSION <= 20220930 #include +#endif #include #include #else @@ -77,7 +79,7 @@ cuSolver handle to the SYCL context. class CusolverScopedContextHandler { CUcontext original_; - sycl::context placedContext_; + sycl::context *placedContext_; bool needToRecover_; sycl::interop_handler &ih; static thread_local cusolver_handle handle_helper;