From 63ee4f268a67ee9e568bf31bd9f4a404001ba05f Mon Sep 17 00:00:00 2001 From: Aaron J Arthurs Date: Wed, 27 Jan 2021 12:55:26 -0600 Subject: [PATCH] Import basic TCP pad test --- test/npcomp-run-mlir/pad.mlir | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/npcomp-run-mlir/pad.mlir diff --git a/test/npcomp-run-mlir/pad.mlir b/test/npcomp-run-mlir/pad.mlir new file mode 100644 index 000000000..d4724479f --- /dev/null +++ b/test/npcomp-run-mlir/pad.mlir @@ -0,0 +1,18 @@ +// RUN: npcomp-run-mlir %s \ +// RUN: -invoke pad \ +// RUN: -arg-value="dense<[1.2, 3.4]> : tensor<2xf32>" \ +// RUN: -shared-libs=%npcomp_runtime_shlib 2>&1 \ +// RUN: | FileCheck %s + +// CHECK: output #0: dense< +// CHECK-SAME: [0.000000e+00, 1.200000e+00, 3.400000e+00, 0.000000e+00, 0.000000e+00] +// CHECK-SAME: > : tensor<5xf32> + +func @pad(%arg0: tensor ) -> tensor { + %lowerExpansion = shape.const_shape [1] : tensor + %upperExpansion = shape.const_shape [2] : tensor + %fillVal = constant 0.0 : f32 + %0 = tcp.pad %arg0, %lowerExpansion, %upperExpansion, %fillVal : (tensor, tensor, tensor, f32) -> tensor + return %0 : tensor +} +