summaryrefslogtreecommitdiffstats
path: root/mlir/test/mlir-cpu-runner/cblas.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Adjust License.txt file to use the LLVM licenseMehdi Amini2019-12-231-13/+4
| | | | PiperOrigin-RevId: 286906740
* Automated rollback of commit 3708f53219aa2b201e82e7172c5064c1eb9d483bNicolas Vasilache2019-07-261-71/+7
| | | | PiperOrigin-RevId: 260136255
* Add sgemm specializations - NFCNicolas Vasilache2019-07-261-7/+71
| | | | | | | | | This CL adds a few specializations for sgemm. A minor change to alpha is made in cblas_interface.cpp to be compatible with actual BLAS calls. For now this is for internal testing purposes only. PiperOrigin-RevId: 260129027
* Fix linalg_matmul_impl interfacing with sgemmNicolas Vasilache2019-07-261-1/+1
| | | | | | This CL provides a fix that makes linal_matmul_impl compliant with the BLAS interface. Before this CL it would compute either C += A * B when called with cblas.cpp:cblas_sgemm implementation and C = A * B with other implementations. PiperOrigin-RevId: 260117367
* Add a lowering for Linalg matmul to LLVMNicolas Vasilache2019-06-191-0/+56
This CL adds a lowering to LLVM for MamulOp and a corresponding integration test. View descriptor manipulation is moved from MLIR's LLVM dialect to C++ code compiled on the side. To this end a separation is introduced between `cblas.cpp` and `cblas_interface.cpp`, the latter operating on view types whose ABI correspond to the LLVM signature generated by MLIR. An intermediary step is introduced that allocates a new descriptor on the MLIR side for the purpose of passing it to LLVM. The reason for this extra step is that the ABI for by-value ViewType objects wants aligned descriptors, e.g.: ``` extern "C" void linalg_dot_impl(ViewType<float, 1> X, ViewType<float, 1> Y, BaseViewType<float> Z) { ... } ``` produces LLVM IR with the signature: ``` %struct.ViewType = type { %struct.BaseViewType, [1 x i64], [1 x i64] } %struct.BaseViewType = type { float*, i64 } define void @linalg_dot_impl(%struct.ViewType* byval align 8, %struct.ViewType* byval align 8, float*, i64) tensorflow/mlir#0 { ... } ``` We don't seem to be able to make such aligned allocations in the MLIR -> LLVM converter atm. Going through a level of indirection allows the test to pass. The temporary tradeoff is that the MLIR shims have to be written by hand. They will disappear in the future. PiperOrigin-RevId: 252670672
OpenPOWER on IntegriCloud