mirror of
https://github.com/CNugteren/CLBlast.git
synced 2024-07-07 12:23:46 +02:00
Merge branch 'msvc2013_fixes'
This commit is contained in:
commit
44b59ec0cb
|
@ -40,23 +40,24 @@ const std::string kDeviceTypeAll = "default";
|
||||||
const Name kDeviceNameDefault = {"default "};
|
const Name kDeviceNameDefault = {"default "};
|
||||||
|
|
||||||
struct DatabaseDevice {
|
struct DatabaseDevice {
|
||||||
const Name name;
|
Name name;
|
||||||
const Params parameters; // parameter values
|
Params parameters; // parameter values
|
||||||
|
|
||||||
};
|
};
|
||||||
struct DatabaseArchitecture {
|
struct DatabaseArchitecture {
|
||||||
const std::string name;
|
std::string name;
|
||||||
const std::vector<DatabaseDevice> devices;
|
std::vector<DatabaseDevice> devices;
|
||||||
};
|
};
|
||||||
struct DatabaseVendor {
|
struct DatabaseVendor {
|
||||||
const std::string type;
|
std::string type;
|
||||||
const std::string name;
|
std::string name;
|
||||||
const std::vector<DatabaseArchitecture> architectures;
|
std::vector<DatabaseArchitecture> architectures;
|
||||||
};
|
};
|
||||||
struct DatabaseEntry {
|
struct DatabaseEntry {
|
||||||
const std::string kernel;
|
std::string kernel;
|
||||||
const Precision precision;
|
Precision precision;
|
||||||
const std::vector<std::string> parameter_names;
|
std::vector<std::string> parameter_names;
|
||||||
const std::vector<DatabaseVendor> vendors;
|
std::vector<DatabaseVendor> vendors;
|
||||||
};
|
};
|
||||||
|
|
||||||
// =================================================================================================
|
// =================================================================================================
|
||||||
|
|
|
@ -53,8 +53,12 @@ void XaxpyBatched<T>::DoAxpyBatched(const size_t n, const std::vector<T> &alphas
|
||||||
}
|
}
|
||||||
|
|
||||||
// Upload the arguments to the device
|
// Upload the arguments to the device
|
||||||
std::vector<int> x_offsets_int(x_offsets.begin(), x_offsets.end());
|
auto x_offsets_int = std::vector<int>(batch_count);
|
||||||
std::vector<int> y_offsets_int(y_offsets.begin(), y_offsets.end());
|
auto y_offsets_int = std::vector<int>(batch_count);
|
||||||
|
for (auto batch = size_t{ 0 }; batch < batch_count; ++batch) {
|
||||||
|
x_offsets_int[batch] = static_cast<int>(x_offsets[batch]);
|
||||||
|
y_offsets_int[batch] = static_cast<int>(y_offsets[batch]);
|
||||||
|
}
|
||||||
auto x_offsets_device = Buffer<int>(context_, BufferAccess::kReadOnly, batch_count);
|
auto x_offsets_device = Buffer<int>(context_, BufferAccess::kReadOnly, batch_count);
|
||||||
auto y_offsets_device = Buffer<int>(context_, BufferAccess::kReadOnly, batch_count);
|
auto y_offsets_device = Buffer<int>(context_, BufferAccess::kReadOnly, batch_count);
|
||||||
auto alphas_device = Buffer<T>(context_, BufferAccess::kReadOnly, batch_count);
|
auto alphas_device = Buffer<T>(context_, BufferAccess::kReadOnly, batch_count);
|
||||||
|
|
|
@ -106,9 +106,14 @@ void XgemmBatched<T>::DoGemmBatched(const Layout layout, const Transpose a_trans
|
||||||
betas_device.Write(queue_, batch_count, betas);
|
betas_device.Write(queue_, batch_count, betas);
|
||||||
|
|
||||||
// Converts the offset to integers
|
// Converts the offset to integers
|
||||||
std::vector<int> a_offsets_int(a_offsets.begin(), a_offsets.end());
|
auto a_offsets_int = std::vector<int>(batch_count);
|
||||||
std::vector<int> b_offsets_int(b_offsets.begin(), b_offsets.end());
|
auto b_offsets_int = std::vector<int>(batch_count);
|
||||||
std::vector<int> c_offsets_int(c_offsets.begin(), c_offsets.end());
|
auto c_offsets_int = std::vector<int>(batch_count);
|
||||||
|
for (auto batch = size_t{ 0 }; batch < batch_count; ++batch) {
|
||||||
|
a_offsets_int[batch] = static_cast<int>(a_offsets[batch]);
|
||||||
|
b_offsets_int[batch] = static_cast<int>(b_offsets[batch]);
|
||||||
|
c_offsets_int[batch] = static_cast<int>(c_offsets[batch]);
|
||||||
|
}
|
||||||
|
|
||||||
// Selects which version of the batched GEMM to run
|
// Selects which version of the batched GEMM to run
|
||||||
const auto do_gemm_direct = true;
|
const auto do_gemm_direct = true;
|
||||||
|
@ -169,9 +174,9 @@ void XgemmBatched<T>::BatchedGemmIndirect(const size_t m, const size_t n, const
|
||||||
auto b_offsets_i = std::vector<int>(batch_count);
|
auto b_offsets_i = std::vector<int>(batch_count);
|
||||||
auto c_offsets_i = std::vector<int>(batch_count);
|
auto c_offsets_i = std::vector<int>(batch_count);
|
||||||
for (auto batch = size_t{0}; batch < batch_count; ++batch) {
|
for (auto batch = size_t{0}; batch < batch_count; ++batch) {
|
||||||
a_offsets_i[batch] = batch * a_one_i * a_two_i;
|
a_offsets_i[batch] = static_cast<int>(batch * a_one_i * a_two_i);
|
||||||
b_offsets_i[batch] = batch * b_one_i * b_two_i;
|
b_offsets_i[batch] = static_cast<int>(batch * b_one_i * b_two_i);
|
||||||
c_offsets_i[batch] = batch * c_one_i * c_two_i;
|
c_offsets_i[batch] = static_cast<int>(batch * c_one_i * c_two_i);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determines whether or not temporary matrices are needed
|
// Determines whether or not temporary matrices are needed
|
||||||
|
|
Loading…
Reference in a new issue