mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 12:26:52 +08:00
[mlir][linalg] Add a FillOpInterface.
Add a FillOpInterface similar to the contraction and convolution op interfaces. The FillOpInterface is a preparation step to replace linalg.fill by its OpDSL version linalg.fill_tensor. The interface implements the `value()`, `output()`, and `result()` methods that by default are not available on linalg.fill_tensor. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D120725
This commit is contained in:
@@ -686,6 +686,7 @@ class OpInterfaceDef:
|
||||
|
||||
ContractionOpInterface = OpInterfaceDef("LinalgContractionOpInterface")
|
||||
ConvolutionOpInterface = OpInterfaceDef("LinalgConvolutionOpInterface")
|
||||
FillOpInterface = OpInterfaceDef("LinalgFillOpInterface")
|
||||
|
||||
|
||||
class OpMetadataDef(YAMLObject):
|
||||
|
||||
@@ -671,6 +671,7 @@ def fill_tensor(value=ScalarDef(T1), O=TensorDef(U, output=True)):
|
||||
accesses only and is thus rank polymorphic. Numeric casting is performed on
|
||||
the value operand, promoting it to the same data type as the output.
|
||||
"""
|
||||
implements(FillOpInterface)
|
||||
O[None] = TypeFn.cast_signed(U, value)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user