Skip to content

Commit 6fd193c

Browse files
author
Vahid Tavanashad
committed
use constexpr for defining is_row_major
1 parent aceeb2b commit 6fd193c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

dpnp/backend/extensions/blas/gemm.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static sycl::event gemm_impl(sycl::queue &exec_q,
9696
const Tab *a, const std::int64_t lda, const Tab *b,
9797
const std::int64_t ldb, Tab beta, Tc *c, const std::int64_t ldc,
9898
const std::vector<sycl::event> &deps) -> sycl::event {
99-
if (is_row_major) {
99+
if constexpr (is_row_major) {
100100
return mkl_blas::row_major::gemm(q, transA, transB, m, n, k,
101101
alpha, a, lda, b, ldb, beta, c,
102102
ldc, deps);
@@ -232,7 +232,7 @@ std::tuple<sycl::event, sycl::event, bool>
232232

233233
// cuBLAS supports only column-major storage
234234
#if defined(USE_ONEMATH_CUBLAS)
235-
const bool is_row_major = false;
235+
constexpr bool is_row_major = false;
236236

237237
transA = is_matrixA_c_contig ? oneapi::mkl::transpose::T
238238
: oneapi::mkl::transpose::N;

dpnp/backend/extensions/blas/gemm_batch.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static sycl::event gemm_batch_impl(sycl::queue &exec_q,
108108
Tc *c, const std::int64_t ldc, const std::int64_t stridec,
109109
const std::int64_t batch_size,
110110
const std::vector<sycl::event> &deps) -> sycl::event {
111-
if (is_row_major) {
111+
if constexpr (is_row_major) {
112112
return mkl_blas::row_major::gemm_batch(
113113
q, transA, transB, m, n, k, alpha, a, lda, stridea, b, ldb,
114114
strideb, beta, c, ldc, stridec, batch_size, deps);
@@ -307,7 +307,7 @@ std::tuple<sycl::event, sycl::event, bool>
307307

308308
// cuBLAS supports only column-major storage
309309
#if defined(USE_ONEMATH_CUBLAS)
310-
const bool is_row_major = false;
310+
constexpr bool is_row_major = false;
311311

312312
transA = A_base_is_c_contig ? oneapi::mkl::transpose::T
313313
: oneapi::mkl::transpose::N;

dpnp/backend/extensions/blas/gemv.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static sycl::event gemv_impl(sycl::queue &exec_q,
8989
const std::int64_t lda, const T *x, const std::int64_t incx,
9090
T beta, T *y, const std::int64_t incy,
9191
const std::vector<sycl::event> &deps) -> sycl::event {
92-
if (is_row_major) {
92+
if constexpr (is_row_major) {
9393
return mkl_blas::row_major::gemv(q, transA, m, n, alpha, a, lda,
9494
x, incx, beta, y, incy, deps);
9595
}
@@ -187,7 +187,7 @@ std::pair<sycl::event, sycl::event>
187187

188188
// cuBLAS supports only column-major storage
189189
#if defined(USE_ONEMATH_CUBLAS)
190-
const bool is_row_major = false;
190+
constexpr bool is_row_major = false;
191191
std::int64_t m;
192192
std::int64_t n;
193193

0 commit comments

Comments
 (0)