summaryrefslogtreecommitdiff
path: root/src/routines
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2017-04-07 07:34:32 +0200
committerCedric Nugteren <web@cedricnugteren.nl>2017-04-07 07:34:32 +0200
commitce369702d88a679d906677d9266a17cb72d78ff7 (patch)
treefbac130a5de190f476aeb7cf073169e5d4cdba90 /src/routines
parentea0aeadc34cdc3e352aea537d5265dd447afa1f6 (diff)
Added some missing const-ness
Diffstat (limited to 'src/routines')
-rw-r--r--src/routines/level1/xaxpy.cpp10
-rw-r--r--src/routines/level2/xgemv.cpp18
2 files changed, 14 insertions, 14 deletions
diff --git a/src/routines/level1/xaxpy.cpp b/src/routines/level1/xaxpy.cpp
index 39f61ef4..310562a0 100644
--- a/src/routines/level1/xaxpy.cpp
+++ b/src/routines/level1/xaxpy.cpp
@@ -44,12 +44,12 @@ void Xaxpy<T>::DoAxpy(const size_t n, const T alpha,
TestVectorY(n, y_buffer, y_offset, y_inc);
// Determines whether or not the fast-version can be used
- bool use_fast_kernel = (x_offset == 0) && (x_inc == 1) &&
- (y_offset == 0) && (y_inc == 1) &&
- IsMultiple(n, db_["WGS"]*db_["WPT"]*db_["VW"]);
+ const auto use_fast_kernel = (x_offset == 0) && (x_inc == 1) &&
+ (y_offset == 0) && (y_inc == 1) &&
+ IsMultiple(n, db_["WGS"]*db_["WPT"]*db_["VW"]);
// If possible, run the fast-version of the kernel
- auto kernel_name = (use_fast_kernel) ? "XaxpyFast" : "Xaxpy";
+ const auto kernel_name = (use_fast_kernel) ? "XaxpyFast" : "Xaxpy";
// Retrieves the Xaxpy kernel from the compiled binary
auto kernel = Kernel(program_, kernel_name);
@@ -79,7 +79,7 @@ void Xaxpy<T>::DoAxpy(const size_t n, const T alpha,
RunKernel(kernel, queue_, device_, global, local, event_);
}
else {
- auto n_ceiled = Ceil(n, db_["WGS"]*db_["WPT"]);
+ const auto n_ceiled = Ceil(n, db_["WGS"]*db_["WPT"]);
auto global = std::vector<size_t>{n_ceiled/db_["WPT"]};
auto local = std::vector<size_t>{db_["WGS"]};
RunKernel(kernel, queue_, device_, global, local, event_);
diff --git a/src/routines/level2/xgemv.cpp b/src/routines/level2/xgemv.cpp
index 3b5b5e8b..b7e8081b 100644
--- a/src/routines/level2/xgemv.cpp
+++ b/src/routines/level2/xgemv.cpp
@@ -70,14 +70,14 @@ void Xgemv<T>::MatVec(const Layout layout, const Transpose a_transpose,
if (m == 0 || n == 0) { throw BLASError(StatusCode::kInvalidDimension); }
// Computes whether or not the matrix has an alternative layout (row or column-major).
- auto a_altlayout = (layout == Layout::kRowMajor);
+ const auto a_altlayout = (layout == Layout::kRowMajor);
auto a_one = (a_altlayout) ? n : m;
- auto a_two = (a_altlayout) ? m : n;
+ const auto a_two = (a_altlayout) ? m : n;
// Swap m and n if the matrix is transposed
- auto a_transposed = (a_transpose != Transpose::kNo);
- auto m_real = (a_transposed) ? n : m;
- auto n_real = (a_transposed) ? m : n;
+ const auto a_transposed = (a_transpose != Transpose::kNo);
+ const auto m_real = (a_transposed) ? n : m;
+ const auto n_real = (a_transposed) ? m : n;
// Special adjustments for banded matrices
if (kl != 0 || ku != 0) {
@@ -85,10 +85,10 @@ void Xgemv<T>::MatVec(const Layout layout, const Transpose a_transpose,
}
// Determines whether the kernel needs to perform rotated access ('^' is the XOR operator)
- auto a_rotated = a_transposed ^ a_altlayout;
+ const auto a_rotated = a_transposed ^ a_altlayout;
// In case of complex data-types, the transpose can also become a conjugate transpose
- auto a_conjugate = (a_transpose == Transpose::kConjugate);
+ const auto a_conjugate = (a_transpose == Transpose::kConjugate);
// Tests the matrix and the vectors for validity
if (packed) { TestMatrixAP(n, a_buffer, a_offset); }
@@ -107,8 +107,8 @@ void Xgemv<T>::MatVec(const Layout layout, const Transpose a_transpose,
IsMultiple(a_ld, db_["VW3"]);
// If possible, run the fast-version (rotated or non-rotated) of the kernel
- auto kernel_name = "Xgemv";
- auto m_ceiled = Ceil(m_real, db_["WGS1"]*db_["WPT1"]);
+ auto kernel_name = std::string{"Xgemv"};
+ const auto m_ceiled = Ceil(m_real, db_["WGS1"]*db_["WPT1"]);
auto global_size = m_ceiled / db_["WPT1"];
auto local_size = db_["WGS1"];
if (fast_kernel) {