Skip to content

Commit f516ad1

Browse files
sbalint98mmeterelmkrainiuk
authored
Add rocBLAS backend (#144)
* [BLAS] Add rocBLAS backend support through hipSYCL Co-authored-by: sbalint98 <[email protected]> Co-authored-by: Mesut Meterelliyoz <[email protected]> Co-authored-by: Maria Kraynyuk <[email protected]>
1 parent c988bde commit f516ad1

32 files changed

+15852
-38
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#===============================================================================
22
# Copyright 2020-2021 Intel Corporation
3+
# Copyright (C) 2022 Heidelberg University, Engineering Mathematics and Computing Lab (EMCL) and Computing Centre (URZ)
34
#
45
# Licensed under the Apache License, Version 2.0 (the "License");
56
# you may not use this file except in compliance with the License.
@@ -49,6 +50,7 @@ option(ENABLE_CUBLAS_BACKEND "" OFF)
4950

5051
option(ENABLE_CUSOLVER_BACKEND "" OFF)
5152

53+
option(ENABLE_ROCBLAS_BACKEND "" OFF)
5254
option(ENABLE_CURAND_BACKEND "" OFF)
5355
option(ENABLE_NETLIB_BACKEND "" OFF)
5456
set(ONEMKL_SYCL_IMPLEMENTATION "dpc++" CACHE STRING "Name of the SYCL compiler")

README.md

Lines changed: 114 additions & 20 deletions
Large diffs are not rendered by default.

include/oneapi/mkl/blas.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
#ifdef ENABLE_CUBLAS_BACKEND
3636
#include "oneapi/mkl/blas/detail/cublas/blas_ct.hpp"
3737
#endif
38+
#ifdef ENABLE_ROCBLAS_BACKEND
39+
#include "oneapi/mkl/blas/detail/rocblas/blas_ct.hpp"
40+
#endif
3841
#ifdef ENABLE_MKLCPU_BACKEND
3942
#include "oneapi/mkl/blas/detail/mklcpu/blas_ct.hpp"
4043
#endif

include/oneapi/mkl/blas/detail/blas_ct_backends.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ namespace column_major {
4141
#define BACKEND cublas
4242
#include "blas_ct_backends.hxx"
4343
#undef BACKEND
44+
#define BACKEND rocblas
45+
#include "blas_ct_backends.hxx"
46+
#undef BACKEND
4447
#define BACKEND netlib
4548
#include "blas_ct_backends.hxx"
4649
#undef BACKEND
@@ -57,6 +60,9 @@ namespace row_major {
5760
#define BACKEND cublas
5861
#include "blas_ct_backends.hxx"
5962
#undef BACKEND
63+
#define BACKEND rocblas
64+
#include "blas_ct_backends.hxx"
65+
#undef BACKEND
6066
#define BACKEND netlib
6167
#include "blas_ct_backends.hxx"
6268
#undef BACKEND
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/***************************************************************************
2+
* Copyright (C) Codeplay Software Limited
3+
* Copyright (C) 2022 Heidelberg University, Engineering Mathematics and Computing Lab (EMCL) and Computing Centre (URZ)
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* For your convenience, a copy of the License has been included in this
12+
* repository.
13+
*
14+
* Unless required by applicable law or agreed to in writing, software
15+
* distributed under the License is distributed on an "AS IS" BASIS,
16+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
* See the License for the specific language governing permissions and
18+
* limitations under the License.
19+
*
20+
**************************************************************************/
21+
22+
#ifndef _DETAIL_ROCBLAS_BLAS_CT_HPP_
23+
#define _DETAIL_ROCBLAS_BLAS_CT_HPP_
24+
25+
#include <CL/sycl.hpp>
26+
#include <complex>
27+
#include <cstdint>
28+
29+
#include "oneapi/mkl/types.hpp"
30+
#include "oneapi/mkl/detail/backend_selector.hpp"
31+
#include "oneapi/mkl/detail/config.hpp"
32+
#include "oneapi/mkl/blas/detail/rocblas/onemkl_blas_rocblas.hpp"
33+
#include "oneapi/mkl/blas/detail/blas_ct_backends.hpp"
34+
35+
namespace oneapi {
36+
namespace mkl {
37+
namespace blas {
38+
namespace column_major {
39+
40+
#define MAJOR column_major
41+
#include "blas_ct.hxx"
42+
#undef MAJOR
43+
44+
} //namespace column_major
45+
namespace row_major {
46+
47+
#define MAJOR row_major
48+
#include "blas_ct.hxx"
49+
#undef MAJOR
50+
51+
} //namespace row_major
52+
} //namespace blas
53+
} //namespace mkl
54+
} //namespace oneapi
55+
56+
#endif //_DETAIL_ROCBLAS_BLAS_CT_HPP_

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

Lines changed: 4824 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/***************************************************************************
2+
* Copyright (C) Codeplay Software Limited
3+
* Copyright (C) 2022 Heidelberg University, Engineering Mathematics and Computing Lab (EMCL) and Computing Centre (URZ)
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* For your convenience, a copy of the License has been included in this
12+
* repository.
13+
*
14+
* Unless required by applicable law or agreed to in writing, software
15+
* distributed under the License is distributed on an "AS IS" BASIS,
16+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
* See the License for the specific language governing permissions and
18+
* limitations under the License.
19+
*
20+
**************************************************************************/
21+
#ifndef _ONEMKL_BLAS_ROCBLAS_HPP_
22+
#define _ONEMKL_BLAS_ROCBLAS_HPP_
23+
#include <CL/sycl.hpp>
24+
#include <complex>
25+
#include <cstdint>
26+
#include <string>
27+
#include "oneapi/mkl/types.hpp"
28+
#include "oneapi/mkl/detail/config.hpp"
29+
30+
namespace oneapi {
31+
namespace mkl {
32+
using oneapi::mkl::diag;
33+
using oneapi::mkl::offset;
34+
using oneapi::mkl::side;
35+
using oneapi::mkl::transpose;
36+
using oneapi::mkl::uplo;
37+
namespace blas {
38+
namespace rocblas {
39+
namespace column_major {
40+
41+
#include "onemkl_blas_rocblas.hxx"
42+
43+
} //namespace column_major
44+
namespace row_major {
45+
46+
#include "onemkl_blas_rocblas.hxx"
47+
48+
} //namespace row_major
49+
} //namespace rocblas
50+
} //namespace blas
51+
} //namespace mkl
52+
} //namespace oneapi
53+
54+
#endif //_ONEMKL_BLAS_ROCBLAS_HPP_

0 commit comments

Comments
 (0)