[Linalg] Add basic linalg ops
authorNicolas Vasilache <ntv@google.com>
Tue, 23 Apr 2019 20:21:40 +0000 (13:21 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Wed, 24 Apr 2019 05:03:06 +0000 (22:03 -0700)
commita2e7775441bf86897cb46c0dd451b21a33a69628
tree5d2489304d16ea9f5236bf35b0fbe095296937fa
parentff6804c0456c81349684ee2e1c32f265614c1b72
[Linalg] Add basic linalg ops

    This CL adds linalg.dot, linalg.matvec and linalg.matmul ops with the proper roundtripping test. These are the first LinalgOp that operate on views and that will lower to library calls.
    Linalg ops exhibit some common properties and behavior that are modeled with Traits.

    A LinalgOp is defined as a generic Op that operates on input and output views (passed as operands) and has the following properties:
    1. a number of input and outputs captured by the `NInputsAndOutputs` trait.
    2. a list of ranks for each operand captured by the `ViewRanks` trait.
    3. a set of parallel, reduction and windowing loops captured by `NLoopTypes` trait.

    These represent are a first set of generic properties that will enable the definition of generic linear algebra operations and the properties necessary for upcoming transformations.

--

PiperOrigin-RevId: 244912754
mlir/include/mlir/CMakeLists.txt
mlir/include/mlir/Linalg/CMakeLists.txt [new file with mode: 0644]
mlir/include/mlir/Linalg/LinalgOps.h
mlir/include/mlir/Linalg/LinalgOps.td [new file with mode: 0644]
mlir/include/mlir/Linalg/LinalgTraits.h [new file with mode: 0644]
mlir/include/mlir/Linalg/LinalgTypes.h
mlir/lib/Linalg/CMakeLists.txt
mlir/lib/Linalg/LinalgOps.cpp
mlir/lib/Linalg/LinalgTypes.cpp
mlir/test/Linalg/roundtrip.mlir