MMAMatrixStorage cannot use pointer or stringref in its hash otherwise we cannot have unique type for a given set of parameters. This solve the problem and limit the type to only two dimensions.
Instead of storing a string in the storeType replace it by an enum.
Details
Diff Detail
Event Timeline
Hi @ThomasRaoux,
Great to see this, But I am not fully sure why the earlier key did not work? Isn't the underlying data used to generate the hashCode for ArrayRef<> and StirngRef<>. Here are some references from llvm/include/llvm/ADT/ArrayRef.h and llvm/lib/Support/StringRef.cpp.
template <typename T> hash_code hash_value(ArrayRef<T> S) { return hash_combine_range(S.begin(), S.end()); }
// Implementation of StringRef hashing. hash_code llvm::hash_value(StringRef S) { return hash_combine_range(S.begin(), S.end()); }
Also, I remember before moving to tablegen, MemRefTypeStorage was using this as the KeyTy,
std::tuple<ArrayRef<int64_t>, Type, ArrayRef<AffineMap>, unsigned>
and now its,
std::tuple<::llvm::ArrayRef<int64_t>, Type, ::llvm::ArrayRef<AffineMap>, Attribute>
It seems like the earlier key would have worked. Please let me know If I am missing something.
Thanks!
mlir/include/mlir/Dialect/GPU/GPUDialect.h | ||
---|---|---|
104–105 | Is this the number of rows and columns? getRow() and getColumn() don't sound meaningful. | |
104–105 | Separate doc comments please. Doxygen uses them to generate doc that goes online on mlir.llvm.org. In this case, the wrong comment would appear for getRow. |
Hi @navdeepkk, you are right it looks like I was doing something wrong while trying to simplify the MMAMatrixType. I'll abandon this patch for now since it doesn't seem needed at the time. Thanks for reviewing.
Typo: column