perf(math): route ordinary products through MKL and preserve arithmetic
This commit is contained in:
@@ -5,6 +5,17 @@
|
||||
|
||||
namespace fesa::dense_blas_internal {
|
||||
|
||||
Matrix MultiplyTransposeLeft(const Matrix& left, const Matrix& right) {
|
||||
if (left.Rows() != right.Rows()) {
|
||||
throw std::invalid_argument{"Transpose product dimensions differ."};
|
||||
}
|
||||
Matrix transposed{left.Columns(), left.Rows()};
|
||||
for (std::size_t row = 0; row < left.Rows(); ++row)
|
||||
for (std::size_t column = 0; column < left.Columns(); ++column)
|
||||
transposed(column, row) = left(row, column);
|
||||
return transposed.Multiply(right);
|
||||
}
|
||||
|
||||
Result<MKL_INT> ToMklSize(const std::size_t size) {
|
||||
if (size > static_cast<std::size_t>((std::numeric_limits<MKL_INT>::max)())) {
|
||||
return Result<MKL_INT>::Failure(Status::Failure(
|
||||
|
||||
Reference in New Issue
Block a user