[PATCH] D70456: [Matrix] Add first set of matrix intrinsics and initial lowering pass.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 28 08:41:30 PST 2019


fhahn added a comment.

In D70456#1762440 <https://reviews.llvm.org/D70456#1762440>, @LuoYuanke wrote:

> Thanks for the example. I think most of time the dimension of the matrix is unknown in compile time. How do we write the below code with static dimension matrix type?


Assuming the dimensions are known at the call sites, you could implement it as a templated function, with the dimension being template parameters.

>   // Let's assume  0 < m, k, n <= 4. 
>   void matrix_multipy(float *a, float *b, int m, int k, int n) {
>   // ???
>   }
> 
> 
> Do you plan to support dynamic matrix type like array?

In our initial proposal, we focus exclusively on matrixes with dimensions known at compile-time (for example, uses cases similar to using Eigen with known dimensions). This is where most of the optimization potential comes from and to start with, we are focusing on generating the best code for that use case. We also think this is were LLVM can provide the most value initially.

However, we plan to implement fusion of matrix operations, which I think is the key building block to also generate efficient code with dynamic dimensions. We would love to collaborate with people interested in supporting dynamic dimensions!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70456/new/

https://reviews.llvm.org/D70456





More information about the llvm-commits mailing list