diff --git a/src/database/database_structure.hpp b/src/database/database_structure.hpp index d592d7ac..9001b385 100644 --- a/src/database/database_structure.hpp +++ b/src/database/database_structure.hpp @@ -40,23 +40,24 @@ const std::string kDeviceTypeAll = "default"; const Name kDeviceNameDefault = {"default "}; struct DatabaseDevice { - const Name name; - const Params parameters; // parameter values + Name name; + Params parameters; // parameter values + }; struct DatabaseArchitecture { - const std::string name; - const std::vector devices; + std::string name; + std::vector devices; }; struct DatabaseVendor { - const std::string type; - const std::string name; - const std::vector architectures; + std::string type; + std::string name; + std::vector architectures; }; struct DatabaseEntry { - const std::string kernel; - const Precision precision; - const std::vector parameter_names; - const std::vector vendors; + std::string kernel; + Precision precision; + std::vector parameter_names; + std::vector vendors; }; // ================================================================================================= diff --git a/src/routines/levelx/xaxpybatched.cpp b/src/routines/levelx/xaxpybatched.cpp index 6a4269be..0b755ccf 100644 --- a/src/routines/levelx/xaxpybatched.cpp +++ b/src/routines/levelx/xaxpybatched.cpp @@ -53,8 +53,12 @@ void XaxpyBatched::DoAxpyBatched(const size_t n, const std::vector &alphas } // Upload the arguments to the device - std::vector x_offsets_int(x_offsets.begin(), x_offsets.end()); - std::vector y_offsets_int(y_offsets.begin(), y_offsets.end()); + auto x_offsets_int = std::vector(batch_count); + auto y_offsets_int = std::vector(batch_count); + for (auto batch = size_t{ 0 }; batch < batch_count; ++batch) { + x_offsets_int[batch] = static_cast(x_offsets[batch]); + y_offsets_int[batch] = static_cast(y_offsets[batch]); + } auto x_offsets_device = Buffer(context_, BufferAccess::kReadOnly, batch_count); auto y_offsets_device = Buffer(context_, BufferAccess::kReadOnly, batch_count); auto alphas_device = Buffer(context_, BufferAccess::kReadOnly, batch_count); diff --git a/src/routines/levelx/xgemmbatched.cpp b/src/routines/levelx/xgemmbatched.cpp index ee8448d2..4e9f0004 100644 --- a/src/routines/levelx/xgemmbatched.cpp +++ b/src/routines/levelx/xgemmbatched.cpp @@ -106,9 +106,14 @@ void XgemmBatched::DoGemmBatched(const Layout layout, const Transpose a_trans betas_device.Write(queue_, batch_count, betas); // Converts the offset to integers - std::vector a_offsets_int(a_offsets.begin(), a_offsets.end()); - std::vector b_offsets_int(b_offsets.begin(), b_offsets.end()); - std::vector c_offsets_int(c_offsets.begin(), c_offsets.end()); + auto a_offsets_int = std::vector(batch_count); + auto b_offsets_int = std::vector(batch_count); + auto c_offsets_int = std::vector(batch_count); + for (auto batch = size_t{ 0 }; batch < batch_count; ++batch) { + a_offsets_int[batch] = static_cast(a_offsets[batch]); + b_offsets_int[batch] = static_cast(b_offsets[batch]); + c_offsets_int[batch] = static_cast(c_offsets[batch]); + } // Selects which version of the batched GEMM to run const auto do_gemm_direct = true; @@ -169,9 +174,9 @@ void XgemmBatched::BatchedGemmIndirect(const size_t m, const size_t n, const auto b_offsets_i = std::vector(batch_count); auto c_offsets_i = std::vector(batch_count); for (auto batch = size_t{0}; batch < batch_count; ++batch) { - a_offsets_i[batch] = batch * a_one_i * a_two_i; - b_offsets_i[batch] = batch * b_one_i * b_two_i; - c_offsets_i[batch] = batch * c_one_i * c_two_i; + a_offsets_i[batch] = static_cast(batch * a_one_i * a_two_i); + b_offsets_i[batch] = static_cast(batch * b_one_i * b_two_i); + c_offsets_i[batch] = static_cast(batch * c_one_i * c_two_i); } // Determines whether or not temporary matrices are needed