Skip to content

Commit

Permalink
Changed pi_context to ur_context_handle_t and include pi.hpp to ur.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
konradkusiak97 committed Aug 5, 2024
1 parent 8900fa4 commit c6f4fe0
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 32 deletions.
6 changes: 3 additions & 3 deletions src/blas/backends/cublas/cublas_scope_handle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ namespace cublas {
* takes place if no other element in the container has a key equivalent to
* the one being emplaced (keys in a map container are unique).
*/
thread_local cublas_handle<pi_context> CublasScopedContextHandler::handle_helper =
cublas_handle<pi_context>{};
thread_local cublas_handle<ur_context_handle_t> CublasScopedContextHandler::handle_helper =
cublas_handle<ur_context_handle_t>{};

CublasScopedContextHandler::CublasScopedContextHandler(sycl::queue queue, sycl::interop_handle &ih)
: ih(ih),
Expand Down Expand Up @@ -92,7 +92,7 @@ cublasHandle_t CublasScopedContextHandler::get_handle(const sycl::queue &queue)
CUresult cuErr;
CUcontext desired;
CUDA_ERROR_FUNC(cuDevicePrimaryCtxRetain, cuErr, &desired, cudaDevice);
auto piPlacedContext_ = reinterpret_cast<pi_context>(desired);
auto piPlacedContext_ = reinterpret_cast<ur_context_handle_t>(desired);
CUstream streamId = get_stream(queue);
cublasStatus_t err;
auto it = handle_helper.cublas_handle_mapper_.find(piPlacedContext_);
Expand Down
6 changes: 3 additions & 3 deletions src/blas/backends/cublas/cublas_scope_handle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
#include <sycl/backend/cuda.hpp>
#endif
#include <sycl/context.hpp>
#include <sycl/detail/pi.hpp>
#include <sycl/detail/ur.hpp>
#else
#include <CL/sycl/backend/cuda.hpp>
#include <CL/sycl/context.hpp>
#include <CL/sycl/detail/pi.hpp>
#include <CL/sycl/detail/ur.hpp>
#endif
#include <atomic>
#include <memory>
Expand Down Expand Up @@ -77,7 +77,7 @@ class CublasScopedContextHandler {
sycl::context *placedContext_;
bool needToRecover_;
sycl::interop_handle &ih;
static thread_local cublas_handle<pi_context> handle_helper;
static thread_local cublas_handle<ur_context_handle_t> handle_helper;
CUstream get_stream(const sycl::queue &queue);
sycl::context get_context(const sycl::queue &queue);

Expand Down
6 changes: 3 additions & 3 deletions src/blas/backends/cublas/cublas_task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
#include "oneapi/mkl/types.hpp"
#ifndef __HIPSYCL__
#include "cublas_scope_handle.hpp"
#if __has_include(<sycl/detail/pi.hpp>)
#include <sycl/detail/pi.hpp>
#if __has_include(<sycl/detail/ur.hpp>)
#include <sycl/detail/ur.hpp>
#else
#include <CL/sycl/detail/pi.hpp>
#include <CL/sycl/detail/ur.hpp>
#endif
#else
#include "cublas_scope_handle_hipsycl.hpp"
Expand Down
6 changes: 3 additions & 3 deletions src/blas/backends/rocblas/rocblas_scope_handle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ rocblas_handle_container<T>::~rocblas_handle_container() noexcept(false) {
* takes place if no other element in the container has a key equivalent to
* the one being emplaced (keys in a map container are unique).
*/
thread_local rocblas_handle_container<pi_context> RocblasScopedContextHandler::handle_helper =
rocblas_handle_container<pi_context>{};
thread_local rocblas_handle_container<ur_context_handle_t> RocblasScopedContextHandler::handle_helper =
rocblas_handle_container<ur_context_handle_t>{};

RocblasScopedContextHandler::RocblasScopedContextHandler(sycl::queue queue,
sycl::interop_handle &ih)
Expand Down Expand Up @@ -108,7 +108,7 @@ rocblas_handle RocblasScopedContextHandler::get_handle(const sycl::queue &queue)
hipError_t hipErr;
hipCtx_t desired;
HIP_ERROR_FUNC(hipDevicePrimaryCtxRetain, hipErr, &desired, hipDevice);
auto piPlacedContext_ = reinterpret_cast<pi_context>(desired);
auto piPlacedContext_ = reinterpret_cast<ur_context_handle_t>(desired);
hipStream_t streamId = get_stream(queue);
rocblas_status err;
auto it = handle_helper.rocblas_handle_container_mapper_.find(piPlacedContext_);
Expand Down
2 changes: 1 addition & 1 deletion src/blas/backends/rocblas/rocblas_scope_handle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class RocblasScopedContextHandler {
sycl::context *placedContext_;
bool needToRecover_;
sycl::interop_handle &interop_h;
static thread_local rocblas_handle_container<pi_context> handle_helper;
static thread_local rocblas_handle_container<ur_context_handle_t> handle_helper;
sycl::context get_context(const sycl::queue &queue);
hipStream_t get_stream(const sycl::queue &queue);

Expand Down
6 changes: 3 additions & 3 deletions src/blas/backends/rocblas/rocblas_task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
#include "oneapi/mkl/types.hpp"
#ifndef __HIPSYCL__
#include "rocblas_scope_handle.hpp"
#if __has_include(<sycl/detail/pi.hpp>)
#include <sycl/detail/pi.hpp>
#if __has_include(<sycl/detail/ur.hpp>)
#include <sycl/detail/ur.hpp>
#else
#include <CL/sycl/detail/pi.hpp>
#include <CL/sycl/detail/ur.hpp>
#endif
#else
#include "rocblas_scope_handle_hipsycl.hpp"
Expand Down
6 changes: 3 additions & 3 deletions src/lapack/backends/cusolver/cusolver_scope_handle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ namespace cusolver {
* takes place if no other element in the container has a key equivalent to
* the one being emplaced (keys in a map container are unique).
*/
thread_local cusolver_handle<pi_context> CusolverScopedContextHandler::handle_helper =
cusolver_handle<pi_context>{};
thread_local cusolver_handle<ur_context_handle_t> CusolverScopedContextHandler::handle_helper =
cusolver_handle<ur_context_handle_t>{};

CusolverScopedContextHandler::CusolverScopedContextHandler(sycl::queue queue,
sycl::interop_handle &ih)
Expand Down Expand Up @@ -93,7 +93,7 @@ cusolverDnHandle_t CusolverScopedContextHandler::get_handle(const sycl::queue &q
CUresult cuErr;
CUcontext desired;
CUDA_ERROR_FUNC(cuDevicePrimaryCtxRetain, cuErr, &desired, cudaDevice);
auto piPlacedContext_ = reinterpret_cast<pi_context>(desired);
auto piPlacedContext_ = reinterpret_cast<ur_context_handle_t>(desired);
CUstream streamId = get_stream(queue);
cusolverStatus_t err;
auto it = handle_helper.cusolver_handle_mapper_.find(piPlacedContext_);
Expand Down
6 changes: 3 additions & 3 deletions src/lapack/backends/cusolver/cusolver_scope_handle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
#include <sycl/backend/cuda.hpp>
#endif
#include <sycl/context.hpp>
#include <sycl/detail/pi.hpp>
#include <sycl/detail/ur.hpp>
#else
#include <CL/sycl/backend/cuda.hpp>
#include <CL/sycl/context.hpp>
#include <CL/sycl/detail/pi.hpp>
#include <CL/sycl/detail/ur.hpp>
#endif
#include <atomic>
#include <memory>
Expand Down Expand Up @@ -82,7 +82,7 @@ class CusolverScopedContextHandler {
sycl::context *placedContext_;
bool needToRecover_;
sycl::interop_handle &ih;
static thread_local cusolver_handle<pi_context> handle_helper;
static thread_local cusolver_handle<ur_context_handle_t> handle_helper;
CUstream get_stream(const sycl::queue &queue);
sycl::context get_context(const sycl::queue &queue);

Expand Down
6 changes: 3 additions & 3 deletions src/lapack/backends/cusolver/cusolver_task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
#endif
#include "oneapi/mkl/types.hpp"
#include "cusolver_scope_handle.hpp"
#if __has_include(<sycl/detail/pi.hpp>)
#include <sycl/detail/pi.hpp>
#if __has_include(<sycl/detail/ur.hpp>)
#include <sycl/detail/ur.hpp>
#else
#include <CL/sycl/detail/pi.hpp>
#include <CL/sycl/detail/ur.hpp>
#endif
namespace oneapi {
namespace mkl {
Expand Down
6 changes: 3 additions & 3 deletions src/lapack/backends/rocsolver/rocsolver_scope_handle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ namespace rocsolver {
* takes place if no other element in the container has a key equivalent to
* the one being emplaced (keys in a map container are unique).
*/
thread_local rocsolver_handle<pi_context> RocsolverScopedContextHandler::handle_helper =
rocsolver_handle<pi_context>{};
thread_local rocsolver_handle<ur_context_handle_t> RocsolverScopedContextHandler::handle_helper =
rocsolver_handle<ur_context_handle_t>{};

RocsolverScopedContextHandler::RocsolverScopedContextHandler(sycl::queue queue,
sycl::interop_handle &ih)
Expand Down Expand Up @@ -95,7 +95,7 @@ rocblas_handle RocsolverScopedContextHandler::get_handle(const sycl::queue &queu
hipError_t hipErr;
hipCtx_t desired;
HIP_ERROR_FUNC(hipDevicePrimaryCtxRetain, hipErr, &desired, hipDevice);
auto piPlacedContext_ = reinterpret_cast<pi_context>(desired);
auto piPlacedContext_ = reinterpret_cast<ur_context_handle_t>(desired);
hipStream_t streamId = get_stream(queue);
rocblas_status err;
auto it = handle_helper.rocsolver_handle_mapper_.find(piPlacedContext_);
Expand Down
2 changes: 1 addition & 1 deletion src/lapack/backends/rocsolver/rocsolver_scope_handle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class RocsolverScopedContextHandler {
sycl::context *placedContext_;
bool needToRecover_;
sycl::interop_handle &ih;
static thread_local rocsolver_handle<pi_context> handle_helper;
static thread_local rocsolver_handle<ur_context_handle_t> handle_helper;
hipStream_t get_stream(const sycl::queue &queue);
sycl::context get_context(const sycl::queue &queue);

Expand Down
6 changes: 3 additions & 3 deletions src/lapack/backends/rocsolver/rocsolver_task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
#endif
#include "oneapi/mkl/types.hpp"
#include "rocsolver_scope_handle.hpp"
#if __has_include(<sycl/detail/pi.hpp>)
#include <sycl/detail/pi.hpp>
#if __has_include(<sycl/detail/ur.hpp>)
#include <sycl/detail/ur.hpp>
#else
#include <CL/sycl/detail/pi.hpp>
#include <CL/sycl/detail/ur.hpp>
#endif

namespace oneapi {
Expand Down

0 comments on commit c6f4fe0

Please sign in to comment.