Added some missing const-ness

pull/145/head
Cedric Nugteren 2017-04-07 07:34:32 +02:00
parent ea0aeadc34
commit ce369702d8
2 changed files with 14 additions and 14 deletions

View File

@ -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_);

View File

@ -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) {