Skip to content

Commit e9ea138

Browse files
authored
[BLAS][rocBLAS] Switch to using sycl:: insteald of cl::sycl:: (#192)
1 parent ca34cad commit e9ea138

File tree

10 files changed

+5273
-5586
lines changed

10 files changed

+5273
-5586
lines changed

include/oneapi/mkl/blas/detail/rocblas/blas_ct.hxx

Lines changed: 1289 additions & 1351 deletions
Large diffs are not rendered by default.

include/oneapi/mkl/blas/detail/rocblas/onemkl_blas_rocblas.hxx

Lines changed: 1566 additions & 1667 deletions
Large diffs are not rendered by default.

src/blas/backends/rocblas/rocblas_batch.cpp

Lines changed: 615 additions & 651 deletions
Large diffs are not rendered by default.

src/blas/backends/rocblas/rocblas_extensions.cpp

Lines changed: 136 additions & 144 deletions
Large diffs are not rendered by default.

src/blas/backends/rocblas/rocblas_level1.cpp

Lines changed: 455 additions & 495 deletions
Large diffs are not rendered by default.

src/blas/backends/rocblas/rocblas_level2.cpp

Lines changed: 783 additions & 823 deletions
Large diffs are not rendered by default.

src/blas/backends/rocblas/rocblas_level3.cpp

Lines changed: 410 additions & 434 deletions
Large diffs are not rendered by default.

src/blas/backends/rocblas/rocblas_scope_handle_hipsycl.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ rocblas_handle_container::~rocblas_handle_container() noexcept(false) {
4545
thread_local rocblas_handle_container RocblasScopedContextHandler::handle_helper =
4646
rocblas_handle_container{};
4747

48-
RocblasScopedContextHandler::RocblasScopedContextHandler(cl::sycl::queue queue,
49-
cl::sycl::interop_handle &ih)
48+
RocblasScopedContextHandler::RocblasScopedContextHandler(sycl::queue queue,
49+
sycl::interop_handle &ih)
5050
: interop_h(ih) {}
5151

52-
rocblas_handle RocblasScopedContextHandler::get_handle(const cl::sycl::queue &queue) {
53-
cl::sycl::device device = queue.get_device();
54-
int current_device = interop_h.get_native_device<cl::sycl::backend::hip>();
52+
rocblas_handle RocblasScopedContextHandler::get_handle(const sycl::queue &queue) {
53+
sycl::device device = queue.get_device();
54+
int current_device = interop_h.get_native_device<sycl::backend::hip>();
5555
hipStream_t streamId = get_stream(queue);
5656
rocblas_status err;
5757
auto it = handle_helper.rocblas_handle_mapper_.find(current_device);
@@ -84,8 +84,8 @@ rocblas_handle RocblasScopedContextHandler::get_handle(const cl::sycl::queue &qu
8484
return handle;
8585
}
8686

87-
hipStream_t RocblasScopedContextHandler::get_stream(const cl::sycl::queue &queue) {
88-
return interop_h.get_native_queue<cl::sycl::backend::hip>();
87+
hipStream_t RocblasScopedContextHandler::get_stream(const sycl::queue &queue) {
88+
return interop_h.get_native_queue<sycl::backend::hip>();
8989
}
9090

9191
} // namespace rocblas

src/blas/backends/rocblas/rocblas_scope_handle_hipsycl.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,21 @@ struct rocblas_handle_container {
3737
};
3838

3939
class RocblasScopedContextHandler {
40-
cl::sycl::interop_handle interop_h;
40+
sycl::interop_handle interop_h;
4141
static thread_local rocblas_handle_container handle_helper;
42-
cl::sycl::context get_context(const cl::sycl::queue &queue);
43-
hipStream_t get_stream(const cl::sycl::queue &queue);
42+
sycl::context get_context(const sycl::queue &queue);
43+
hipStream_t get_stream(const sycl::queue &queue);
4444

4545
public:
46-
RocblasScopedContextHandler(cl::sycl::queue queue, cl::sycl::interop_handle &ih);
46+
RocblasScopedContextHandler(sycl::queue queue, sycl::interop_handle &ih);
4747

48-
rocblas_handle get_handle(const cl::sycl::queue &queue);
48+
rocblas_handle get_handle(const sycl::queue &queue);
4949

5050
// This is a work-around function for reinterpret_casting the memory. This
5151
// will be fixed when SYCL-2020 has been implemented for Pi backend.
5252
template <typename T, typename U>
5353
inline T get_mem(U acc) {
54-
return reinterpret_cast<T>(interop_h.get_native_mem<cl::sycl::backend::hip>(acc));
54+
return reinterpret_cast<T>(interop_h.get_native_mem<sycl::backend::hip>(acc));
5555
}
5656
};
5757

src/blas/backends/rocblas/rocblas_task.hpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@
2929
#include <CL/sycl/detail/pi.hpp>
3030
#else
3131
#include "rocblas_scope_handle_hipsycl.hpp"
32-
namespace cl::sycl {
33-
using interop_handler = cl::sycl::interop_handle;
34-
}
32+
3533
#endif
3634
namespace oneapi {
3735
namespace mkl {
@@ -40,23 +38,23 @@ namespace rocblas {
4038

4139
#ifdef __HIPSYCL__
4240
template <typename H, typename F>
43-
static inline void host_task_internal(H &cgh, cl::sycl::queue queue, F f) {
44-
cgh.hipSYCL_enqueue_custom_operation([f, queue](cl::sycl::interop_handle ih) {
41+
static inline void host_task_internal(H &cgh, sycl::queue queue, F f) {
42+
cgh.hipSYCL_enqueue_custom_operation([f, queue](sycl::interop_handle ih) {
4543
auto sc = RocblasScopedContextHandler(queue, ih);
4644
f(sc);
4745
});
4846
}
4947
#else
5048
template <typename H, typename F>
51-
static inline void host_task_internal(H &cgh, cl::sycl::queue queue, F f) {
52-
cgh.interop_task([f, queue](cl::sycl::interop_handler ih) {
49+
static inline void host_task_internal(H &cgh, sycl::queue queue, F f) {
50+
cgh.interop_task([f, queue](sycl::interop_handler ih) {
5351
auto sc = RocblasScopedContextHandler(queue, ih);
5452
f(sc);
5553
});
5654
}
5755
#endif
5856
template <typename H, typename F>
59-
static inline void onemkl_rocblas_host_task(H &cgh, cl::sycl::queue queue, F f) {
57+
static inline void onemkl_rocblas_host_task(H &cgh, sycl::queue queue, F f) {
6058
(void)host_task_internal(cgh, queue, f);
6159
}
6260

0 commit comments

Comments
 (0)