forked from buddy-compiler/buddy-mlir
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tests] Add rountrip tests for DAP and DIP operations. (buddy-compile…
…r#157) - [DAP] iir & fir - [DIP] corr2d & resize2d & rotate2d
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// RUN: buddy-opt -verify-diagnostics %s | buddy-opt | FileCheck %s | ||
|
||
func.func @buddy_iir(%in : memref<?xf32>, %filter : memref<?x?xf32>, %out : memref<?xf32>) -> () { | ||
// CHECK: dap.iir {{.*}} : memref<?xf32>, memref<?x?xf32>, memref<?xf32> | ||
dap.iir %in, %filter, %out : memref<?xf32>, memref<?x?xf32>, memref<?xf32> | ||
return | ||
} | ||
|
||
func.func @buddy_fir(%in : memref<?xf32>, %filter : memref<?xf32>, %out : memref<?xf32>) -> () { | ||
// CHECK: dap.fir {{.*}} : memref<?xf32>, memref<?xf32>, memref<?xf32> | ||
dap.fir %in, %filter, %out : memref<?xf32>, memref<?xf32>, memref<?xf32> | ||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// RUN: buddy-opt -verify-diagnostics %s | buddy-opt | FileCheck %s | ||
|
||
func.func @buddy_corr2d_CONSTANT_PADDING(%input : memref<?x?xf32>, %identity : memref<?x?xf32>, %output : memref<?x?xf32>, %kernelAnchorX : index, %kernelAnchorY : index, %c : f32) -> () { | ||
// CHECK: dip.corr_2d <CONSTANT_PADDING>{{.*}} : memref<?x?xf32>, memref<?x?xf32>, memref<?x?xf32>, index, index, f32 | ||
dip.corr_2d <CONSTANT_PADDING> %input, %identity, %output, %kernelAnchorX, %kernelAnchorY, %c : memref<?x?xf32>, memref<?x?xf32>, memref<?x?xf32>, index, index, f32 | ||
return | ||
} | ||
|
||
func.func @buddy_corr2d_REPLICATE_PADDING(%input : memref<?x?xf32>, %identity : memref<?x?xf32>, %output : memref<?x?xf32>, %kernelAnchorX : index, %kernelAnchorY : index, %c : f32) -> () { | ||
// CHECK: dip.corr_2d <REPLICATE_PADDING>{{.*}} : memref<?x?xf32>, memref<?x?xf32>, memref<?x?xf32>, index, index, f32 | ||
dip.corr_2d <REPLICATE_PADDING> %input, %identity, %output, %kernelAnchorX, %kernelAnchorY, %c : memref<?x?xf32>, memref<?x?xf32>, memref<?x?xf32>, index, index, f32 | ||
return | ||
} | ||
|
||
func.func @buddy_resize2d_NEAREST_NEIGHBOUR_INTERPOLATION(%input : memref<?x?xf32>, %horizontal_scaling_factor : f32, %vertical_scaling_factor : f32, %output : memref<?x?xf32>) -> () { | ||
// CHECK: dip.resize_2d NEAREST_NEIGHBOUR_INTERPOLATION{{.*}} : memref<?x?xf32>, f32, f32, memref<?x?xf32> | ||
dip.resize_2d NEAREST_NEIGHBOUR_INTERPOLATION %input, %horizontal_scaling_factor, %vertical_scaling_factor, %output : memref<?x?xf32>, f32, f32, memref<?x?xf32> | ||
return | ||
} | ||
|
||
func.func @buddy_resize2d_BILINEAR_INTERPOLATION(%input : memref<?x?xf32>, %horizontal_scaling_factor : f32, %vertical_scaling_factor : f32, %output : memref<?x?xf32>) -> () { | ||
// CHECK: dip.resize_2d BILINEAR_INTERPOLATION{{.*}} : memref<?x?xf32>, f32, f32, memref<?x?xf32> | ||
dip.resize_2d BILINEAR_INTERPOLATION %input, %horizontal_scaling_factor, %vertical_scaling_factor, %output : memref<?x?xf32>, f32, f32, memref<?x?xf32> | ||
return | ||
} | ||
|
||
func.func @buddy_rotate2d(%input : memref<?x?xf32>, %angle : f32, %output : memref<?x?xf32>) -> () { | ||
// CHECK: dip.rotate_2d {{.*}} : memref<?x?xf32>, f32, memref<?x?xf32> | ||
dip.rotate_2d %input, %angle, %output : memref<?x?xf32>, f32, memref<?x?xf32> | ||
return | ||
} |