[flang-commits] [flang] f5884fd - [flang][runtime] Improve error message for incompatible MATMUL arguments
Peter Klausler via flang-commits
flang-commits at lists.llvm.org
Thu Aug 18 13:59:29 PDT 2022
Author: Peter Klausler
Date: 2022-08-18T13:59:13-07:00
New Revision: f5884fd9de6cf2d8ecfb9aa02952f3094c116887
URL: https://github.com/llvm/llvm-project/commit/f5884fd9de6cf2d8ecfb9aa02952f3094c116887
DIFF: https://github.com/llvm/llvm-project/commit/f5884fd9de6cf2d8ecfb9aa02952f3094c116887.diff
LOG: [flang][runtime] Improve error message for incompatible MATMUL arguments
Print the full shapes of both argument when the dimensions that must
match do not do so.
Differential Revision: https://reviews.llvm.org/D132153
Added:
Modified:
flang/runtime/matmul.cpp
Removed:
################################################################################
diff --git a/flang/runtime/matmul.cpp b/flang/runtime/matmul.cpp
index 2d0459c0f35a9..df260e1fa5ebd 100644
--- a/flang/runtime/matmul.cpp
+++ b/flang/runtime/matmul.cpp
@@ -184,9 +184,11 @@ static inline void DoMatmul(
}
SubscriptValue n{x.GetDimension(xRank - 1).Extent()};
if (n != y.GetDimension(0).Extent()) {
- terminator.Crash("MATMUL: arrays do not conform (%jd != %jd)",
+ terminator.Crash("MATMUL: unacceptable operand shapes (%jdx%jd, %jdx%jd)",
+ static_cast<std::intmax_t>(x.GetDimension(0).Extent()),
static_cast<std::intmax_t>(n),
- static_cast<std::intmax_t>(y.GetDimension(0).Extent()));
+ static_cast<std::intmax_t>(y.GetDimension(0).Extent()),
+ static_cast<std::intmax_t>(y.GetDimension(1).Extent()));
}
using WriteResult =
CppTypeFor<RCAT == TypeCategory::Logical ? TypeCategory::Integer : RCAT,
More information about the flang-commits
mailing list