diff --git a/test/unit_tests/aievec_tests/i16xi16_max_elem/i16xi16_max_elem.mlir b/test/unit_tests/aievec_tests/i16xi16_max_elem/i16xi16_max_elem.mlir index 339ab0b0cc..da6f704416 100644 --- a/test/unit_tests/aievec_tests/i16xi16_max_elem/i16xi16_max_elem.mlir +++ b/test/unit_tests/aievec_tests/i16xi16_max_elem/i16xi16_max_elem.mlir @@ -5,7 +5,7 @@ // RUN: mkdir -p %t/data; cd %t // RUN: aie-opt %s -affine-super-vectorize="virtual-vector-size=32" --convert-vector-to-aievec="aie-target=aieml" -lower-affine | aie-translate -aieml=true --aievec-to-cpp -o dut.cc // RUN: xchesscc_wrapper %xchesscc_aie2_args +w work +o work -I%S -I. -c dut.cc -o dut.o -// RUN: xchesscc_wrapper %xchesscc_aie2_args -DTO_CPP +w work +o work -I%S -I. %S/testbench.cc work/dut.o +// RUN: xchesscc_wrapper %xchesscc_aie2_args +w work +o work -I%S -I. %S/testbench.cc work/dut.o // RUN: xca_udm_dbg --aiearch aie-ml -qf -T -P %aietools/data/aie_ml/lib/ -t "%S/../profiling.tcl ./work/a.out" >& xca_udm_dbg.stdout // RUN: FileCheck --input-file=./xca_udm_dbg.stdout %s // CHECK: TEST PASSED diff --git a/test/unit_tests/aievec_tests/i16xi16_max_elem/testbench.cc b/test/unit_tests/aievec_tests/i16xi16_max_elem/testbench.cc index 60a6264401..de145a5642 100644 --- a/test/unit_tests/aievec_tests/i16xi16_max_elem/testbench.cc +++ b/test/unit_tests/aievec_tests/i16xi16_max_elem/testbench.cc @@ -5,15 +5,11 @@ #include #include -#ifdef TO_CPP -void dut(int16_t *restrict in0, int16_t *restrict in1, int16_t *restrict out0); -#elif TO_LLVM +#ifdef TO_LLVM extern "C" { -void dut(int16_t *in0_allocated, int16_t *in0_aligned, int64_t in0_offset, - int64_t in0_sizes_0, int64_t in0_strides_0, int16_t *in1_allocated, - int16_t *in1_aligned, int64_t in1_offset, int64_t in1_sizes_0, - int64_t in1_strides_0, int16_t *out0_allocated, int16_t *out0_aligned, - int64_t out0_offset, int64_t out0_sizes_0, int64_t out0_strides_0); +#endif +void dut(int16_t *restrict in0, int16_t *restrict in1, int16_t *restrict out0); +#ifdef TO_LLVM } #endif @@ -38,11 +34,7 @@ int main(int argc, char *argv[]) { chess_memory_fence(); auto cyclesBegin = chess_cycle_count(); -#ifdef TO_CPP dut(g_in0, g_in1, g_out0); -#elif TO_LLVM - dut(g_in0, g_in0, 0, 0, 0, g_in1, g_in1, 0, 0, 0, g_out0, g_out0, 0, 0, 0); -#endif auto cyclesEnd = chess_cycle_count(); chess_memory_fence(); diff --git a/test/unit_tests/aievec_tests/i16xi16_min_elem/i16xi16_min_elem.mlir b/test/unit_tests/aievec_tests/i16xi16_min_elem/i16xi16_min_elem.mlir index 377a4b42b5..0ea25f3cd5 100644 --- a/test/unit_tests/aievec_tests/i16xi16_min_elem/i16xi16_min_elem.mlir +++ b/test/unit_tests/aievec_tests/i16xi16_min_elem/i16xi16_min_elem.mlir @@ -5,7 +5,7 @@ // RUN: mkdir -p %t/data; cd %t // RUN: aie-opt %s -affine-super-vectorize="virtual-vector-size=32" --convert-vector-to-aievec="aie-target=aieml" -lower-affine | aie-translate -aieml=true --aievec-to-cpp -o dut.cc // RUN: xchesscc_wrapper %xchesscc_aie2_args +w work +o work -I%S -I. -c dut.cc -o dut.o -// RUN: xchesscc_wrapper %xchesscc_aie2_args -DTO_CPP +w work +o work -I%S -I. %S/testbench.cc work/dut.o +// RUN: xchesscc_wrapper %xchesscc_aie2_args +w work +o work -I%S -I. %S/testbench.cc work/dut.o // RUN: xca_udm_dbg --aiearch aie-ml -qf -T -P %aietools/data/aie_ml/lib/ -t "%S/../profiling.tcl ./work/a.out" >& xca_udm_dbg.stdout // RUN: FileCheck --input-file=./xca_udm_dbg.stdout %s // CHECK: TEST PASSED diff --git a/test/unit_tests/aievec_tests/i16xi16_min_elem/testbench.cc b/test/unit_tests/aievec_tests/i16xi16_min_elem/testbench.cc index 35240fbda2..39d8b1acd0 100644 --- a/test/unit_tests/aievec_tests/i16xi16_min_elem/testbench.cc +++ b/test/unit_tests/aievec_tests/i16xi16_min_elem/testbench.cc @@ -4,17 +4,15 @@ #include #include #include -#ifdef TO_CPP -void dut(int16_t *restrict in0, int16_t *restrict in1, int16_t *restrict out0); -#elif TO_LLVM + +#ifdef TO_LLVM extern "C" { -void dut(int16_t *in0_allocated, int16_t *in0_aligned, int64_t in0_offset, - int64_t in0_sizes_0, int64_t in0_strides_0, int16_t *in1_allocated, - int16_t *in1_aligned, int64_t in1_offset, int64_t in1_sizes_0, - int64_t in1_strides_0, int16_t *out0_allocated, int16_t *out0_aligned, - int64_t out0_offset, int64_t out0_sizes_0, int64_t out0_strides_0); +#endif +void dut(int16_t *restrict in0, int16_t *restrict in1, int16_t *restrict out0); +#ifdef TO_LLVM } #endif + void dut_ref(int16_t *in0, int16_t *in1, int16_t *out0); alignas(32) int16_t g_in0[IN0_SIZE]; @@ -36,11 +34,7 @@ int main(int argc, char *argv[]) { chess_memory_fence(); auto cyclesBegin = chess_cycle_count(); -#ifdef TO_CPP dut(g_in0, g_in1, g_out0); -#elif TO_LLVM - dut(g_in0, g_in0, 0, 0, 0, g_in1, g_in1, 0, 0, 0, g_out0, g_out0, 0, 0, 0); -#endif auto cyclesEnd = chess_cycle_count(); chess_memory_fence(); diff --git a/test/unit_tests/aievec_tests/i16xi16_mul_elem/i16xi16_mul_elem.mlir b/test/unit_tests/aievec_tests/i16xi16_mul_elem/i16xi16_mul_elem.mlir index 1f7a82db77..e4c88dadc1 100644 --- a/test/unit_tests/aievec_tests/i16xi16_mul_elem/i16xi16_mul_elem.mlir +++ b/test/unit_tests/aievec_tests/i16xi16_mul_elem/i16xi16_mul_elem.mlir @@ -5,7 +5,7 @@ // RUN: mkdir -p %t/data; cd %t // RUN: aie-opt %s -affine-super-vectorize="virtual-vector-size=32" --convert-vector-to-aievec="aie-target=aieml" -lower-affine | aie-translate -aieml=true --aievec-to-cpp -o dut.cc // RUN: xchesscc_wrapper %xchesscc_aie2_args +w work +o work -I%S -I. -c dut.cc -o dut.o -// RUN: xchesscc_wrapper %xchesscc_aie2_args -DTO_CPP +w work +o work -I%S -I. %S/testbench.cc work/dut.o +// RUN: xchesscc_wrapper %xchesscc_aie2_args +w work +o work -I%S -I. %S/testbench.cc work/dut.o // RUN: xca_udm_dbg --aiearch aie-ml -qf -T -P %aietools/data/aie_ml/lib/ -t "%S/../profiling.tcl ./work/a.out" >& xca_udm_dbg.stdout // RUN: FileCheck --input-file=./xca_udm_dbg.stdout %s // CHECK: TEST PASSED diff --git a/test/unit_tests/aievec_tests/i16xi16_mul_elem/testbench.cc b/test/unit_tests/aievec_tests/i16xi16_mul_elem/testbench.cc index 22046d53f7..ad4240870a 100644 --- a/test/unit_tests/aievec_tests/i16xi16_mul_elem/testbench.cc +++ b/test/unit_tests/aievec_tests/i16xi16_mul_elem/testbench.cc @@ -5,15 +5,11 @@ #include #include -#ifdef TO_CPP -void dut(int16_t *restrict in0, int16_t *restrict in1, int16_t *restrict out0); -#elif TO_LLVM +#ifdef TO_LLVM extern "C" { -void dut(int16_t *in0_allocated, int16_t *in0_aligned, int64_t in0_offset, - int64_t in0_sizes_0, int64_t in0_strides_0, int16_t *in1_allocated, - int16_t *in1_aligned, int64_t in1_offset, int64_t in1_sizes_0, - int64_t in1_strides_0, int16_t *out0_allocated, int16_t *out0_aligned, - int64_t out0_offset, int64_t out0_sizes_0, int64_t out0_strides_0); +#endif +void dut(int16_t *restrict in0, int16_t *restrict in1, int16_t *restrict out0); +#ifdef TO_LLVM } #endif @@ -37,11 +33,7 @@ int main(int argc, char *argv[]) { chess_memory_fence(); auto cyclesBegin = chess_cycle_count(); -#ifdef TO_CPP dut(g_in0, g_in1, g_out0); -#elif TO_LLVM - dut(g_in0, g_in0, 0, 0, 0, g_in1, g_in1, 0, 0, 0, g_out0, g_out0, 0, 0, 0); -#endif auto cyclesEnd = chess_cycle_count(); chess_memory_fence(); diff --git a/test/unit_tests/aievec_tests/i16xi16_mul_elem_2/i16xi16_mul_elem.mlir b/test/unit_tests/aievec_tests/i16xi16_mul_elem_2/i16xi16_mul_elem.mlir index e54eee29de..3f536d48b1 100644 --- a/test/unit_tests/aievec_tests/i16xi16_mul_elem_2/i16xi16_mul_elem.mlir +++ b/test/unit_tests/aievec_tests/i16xi16_mul_elem_2/i16xi16_mul_elem.mlir @@ -5,7 +5,7 @@ // RUN: mkdir -p %t/data; cd %t // RUN: aie-opt %s -affine-super-vectorize="virtual-vector-size=32" --convert-vector-to-aievec="aie-target=aieml" -lower-affine | aie-translate -aieml=true --aievec-to-cpp -o dut.cc // RUN: xchesscc_wrapper %xchesscc_aie2_args +w work +o work -I%S -I. -c dut.cc -o dut.o -// RUN: xchesscc_wrapper %xchesscc_aie2_args -DTO_CPP +w work +o work -I%S -I. %S/testbench.cc work/dut.o +// RUN: xchesscc_wrapper %xchesscc_aie2_args +w work +o work -I%S -I. %S/testbench.cc work/dut.o // RUN: xca_udm_dbg --aiearch aie-ml -qf -T -P %aietools/data/aie_ml/lib/ -t "%S/../profiling.tcl ./work/a.out" >& xca_udm_dbg.stdout // RUN: FileCheck --input-file=./xca_udm_dbg.stdout %s // CHECK: TEST PASSED diff --git a/test/unit_tests/aievec_tests/i16xi16_mul_elem_2/testbench.cc b/test/unit_tests/aievec_tests/i16xi16_mul_elem_2/testbench.cc index 14d6185243..d31c97785e 100644 --- a/test/unit_tests/aievec_tests/i16xi16_mul_elem_2/testbench.cc +++ b/test/unit_tests/aievec_tests/i16xi16_mul_elem_2/testbench.cc @@ -5,15 +5,11 @@ #include #include -#ifdef TO_CPP -void dut(int16_t *restrict in0, int16_t *restrict in1, int32_t *restrict out0); -#elif TO_LLVM +#ifdef TO_LLVM extern "C" { -void dut(int16_t *in0_allocated, int16_t *in0_aligned, int64_t in0_offset, - int64_t in0_sizes_0, int64_t in0_strides_0, int16_t *in1_allocated, - int16_t *in1_aligned, int64_t in1_offset, int64_t in1_sizes_0, - int64_t in1_strides_0, int32_t *out0_allocated, int32_t *out0_aligned, - int64_t out0_offset, int64_t out0_sizes_0, int64_t out0_strides_0); +#endif +void dut(int16_t *restrict in0, int16_t *restrict in1, int32_t *restrict out0); +#ifdef TO_LLVM } #endif @@ -37,11 +33,7 @@ int main(int argc, char *argv[]) { chess_memory_fence(); auto cyclesBegin = chess_cycle_count(); -#ifdef TO_CPP dut(g_in0, g_in1, g_out0); -#elif TO_LLVM - dut(g_in0, g_in0, 0, 0, 0, g_in1, g_in1, 0, 0, 0, g_out0, g_out0, 0, 0, 0); -#endif auto cyclesEnd = chess_cycle_count(); chess_memory_fence(); diff --git a/test/unit_tests/aievec_tests/i32xi32_max_elem/i32xi32_max_elem.mlir b/test/unit_tests/aievec_tests/i32xi32_max_elem/i32xi32_max_elem.mlir index 7ffd6698d0..be0d541c2d 100644 --- a/test/unit_tests/aievec_tests/i32xi32_max_elem/i32xi32_max_elem.mlir +++ b/test/unit_tests/aievec_tests/i32xi32_max_elem/i32xi32_max_elem.mlir @@ -5,7 +5,7 @@ // RUN: mkdir -p %t/data; cd %t // RUN: aie-opt %s -affine-super-vectorize="virtual-vector-size=16" --convert-vector-to-aievec="aie-target=aieml" -lower-affine | aie-translate -aieml=true --aievec-to-cpp -o dut.cc // RUN: xchesscc_wrapper %xchesscc_aie2_args +w work +o work -I%S -I. -c dut.cc -o dut.o -// RUN: xchesscc_wrapper %xchesscc_aie2_args -DTO_CPP +w work +o work -I%S -I. %S/testbench.cc work/dut.o +// RUN: xchesscc_wrapper %xchesscc_aie2_args +w work +o work -I%S -I. %S/testbench.cc work/dut.o // RUN: xca_udm_dbg --aiearch aie-ml -qf -T -P %aietools/data/aie_ml/lib/ -t "%S/../profiling.tcl ./work/a.out" >& xca_udm_dbg.stdout // RUN: FileCheck --input-file=./xca_udm_dbg.stdout %s // CHECK: TEST PASSED diff --git a/test/unit_tests/aievec_tests/i32xi32_max_elem/testbench.cc b/test/unit_tests/aievec_tests/i32xi32_max_elem/testbench.cc index 036f7ecb85..b3e9943c5c 100644 --- a/test/unit_tests/aievec_tests/i32xi32_max_elem/testbench.cc +++ b/test/unit_tests/aievec_tests/i32xi32_max_elem/testbench.cc @@ -5,15 +5,11 @@ #include #include -#ifdef TO_CPP -void dut(int32_t *restrict in0, int32_t *restrict in1, int32_t *restrict out0); -#elif TO_LLVM +#ifdef TO_LLVM extern "C" { -void dut(int32_t *in0_allocated, int32_t *in0_aligned, int64_t in0_offset, - int64_t in0_sizes_0, int64_t in0_strides_0, int32_t *in1_allocated, - int32_t *in1_aligned, int64_t in1_offset, int64_t in1_sizes_0, - int64_t in1_strides_0, int32_t *out0_allocated, int32_t *out0_aligned, - int64_t out0_offset, int64_t out0_sizes_0, int64_t out0_strides_0); +#endif +void dut(int32_t *restrict in0, int32_t *restrict in1, int32_t *restrict out0); +#ifdef TO_LLVM } #endif @@ -38,11 +34,7 @@ int main(int argc, char *argv[]) { chess_memory_fence(); auto cyclesBegin = chess_cycle_count(); -#ifdef TO_CPP dut(g_in0, g_in1, g_out0); -#elif TO_LLVM - dut(g_in0, g_in0, 0, 0, 0, g_in1, g_in1, 0, 0, 0, g_out0, g_out0, 0, 0, 0); -#endif auto cyclesEnd = chess_cycle_count(); chess_memory_fence(); diff --git a/test/unit_tests/aievec_tests/i32xi32_min_elem/i32xi32_min_elem.mlir b/test/unit_tests/aievec_tests/i32xi32_min_elem/i32xi32_min_elem.mlir index e0de66a437..a83cade0b1 100644 --- a/test/unit_tests/aievec_tests/i32xi32_min_elem/i32xi32_min_elem.mlir +++ b/test/unit_tests/aievec_tests/i32xi32_min_elem/i32xi32_min_elem.mlir @@ -5,7 +5,7 @@ // RUN: mkdir -p %t/data; cd %t // RUN: aie-opt %s -affine-super-vectorize="virtual-vector-size=16" --convert-vector-to-aievec="aie-target=aieml" -lower-affine | aie-translate -aieml=true --aievec-to-cpp -o dut.cc // RUN: xchesscc_wrapper %xchesscc_aie2_args +w work +o work -I%S -I. -c dut.cc -o dut.o -// RUN: xchesscc_wrapper %xchesscc_aie2_args -DTO_CPP +w work +o work -I%S -I. %S/testbench.cc work/dut.o +// RUN: xchesscc_wrapper %xchesscc_aie2_args +w work +o work -I%S -I. %S/testbench.cc work/dut.o // RUN: xca_udm_dbg --aiearch aie-ml -qf -T -P %aietools/data/aie_ml/lib/ -t "%S/../profiling.tcl ./work/a.out" >& xca_udm_dbg.stdout // RUN: FileCheck --input-file=./xca_udm_dbg.stdout %s // CHECK: TEST PASSED diff --git a/test/unit_tests/aievec_tests/i32xi32_min_elem/testbench.cc b/test/unit_tests/aievec_tests/i32xi32_min_elem/testbench.cc index f8ee9c2716..1d2876116b 100644 --- a/test/unit_tests/aievec_tests/i32xi32_min_elem/testbench.cc +++ b/test/unit_tests/aievec_tests/i32xi32_min_elem/testbench.cc @@ -5,15 +5,11 @@ #include #include -#ifdef TO_CPP -void dut(int32_t *restrict in0, int32_t *restrict in1, int32_t *restrict out0); -#elif TO_LLVM +#ifdef TO_LLVM extern "C" { -void dut(int32_t *in0_allocated, int32_t *in0_aligned, int64_t in0_offset, - int64_t in0_sizes_0, int64_t in0_strides_0, int32_t *in1_allocated, - int32_t *in1_aligned, int64_t in1_offset, int64_t in1_sizes_0, - int64_t in1_strides_0, int32_t *out0_allocated, int32_t *out0_aligned, - int64_t out0_offset, int64_t out0_sizes_0, int64_t out0_strides_0); +#endif +void dut(int32_t *restrict in0, int32_t *restrict in1, int32_t *restrict out0); +#ifdef TO_LLVM } #endif @@ -38,11 +34,7 @@ int main(int argc, char *argv[]) { chess_memory_fence(); auto cyclesBegin = chess_cycle_count(); -#ifdef TO_CPP dut(g_in0, g_in1, g_out0); -#elif TO_LLVM - dut(g_in0, g_in0, 0, 0, 0, g_in1, g_in1, 0, 0, 0, g_out0, g_out0, 0, 0, 0); -#endif auto cyclesEnd = chess_cycle_count(); chess_memory_fence(); diff --git a/test/unit_tests/aievec_tests/i32xi32_mul_elem/i32xi32_mul_elem.mlir b/test/unit_tests/aievec_tests/i32xi32_mul_elem/i32xi32_mul_elem.mlir index b90ab5bbaa..355b77e2d2 100644 --- a/test/unit_tests/aievec_tests/i32xi32_mul_elem/i32xi32_mul_elem.mlir +++ b/test/unit_tests/aievec_tests/i32xi32_mul_elem/i32xi32_mul_elem.mlir @@ -5,7 +5,7 @@ // RUN: mkdir -p %t/data; cd %t // RUN: aie-opt %s -affine-super-vectorize="virtual-vector-size=16" --convert-vector-to-aievec="aie-target=aieml" -lower-affine | aie-translate -aieml=true --aievec-to-cpp -o dut.cc // RUN: xchesscc_wrapper %xchesscc_aie2_args +w work +o work -I%S -I. -c dut.cc -o dut.o -// RUN: xchesscc_wrapper %xchesscc_aie2_args -DTO_CPP +w work +o work -I%S -I. %S/testbench.cc work/dut.o +// RUN: xchesscc_wrapper %xchesscc_aie2_args +w work +o work -I%S -I. %S/testbench.cc work/dut.o // RUN: xca_udm_dbg --aiearch aie-ml -qf -T -P %aietools/data/aie_ml/lib/ -t "%S/../profiling.tcl ./work/a.out" >& xca_udm_dbg.stdout // RUN: FileCheck --input-file=./xca_udm_dbg.stdout %s // CHECK: TEST PASSED diff --git a/test/unit_tests/aievec_tests/i32xi32_mul_elem/testbench.cc b/test/unit_tests/aievec_tests/i32xi32_mul_elem/testbench.cc index 5f437db045..7b194e4b82 100644 --- a/test/unit_tests/aievec_tests/i32xi32_mul_elem/testbench.cc +++ b/test/unit_tests/aievec_tests/i32xi32_mul_elem/testbench.cc @@ -5,15 +5,11 @@ #include #include -#ifdef TO_CPP -void dut(int32_t *restrict in0, int32_t *restrict in1, int32_t *restrict out0); -#elif TO_LLVM +#ifdef TO_LLVM extern "C" { -void dut(int32_t *in0_allocated, int32_t *in0_aligned, int64_t in0_offset, - int64_t in0_sizes_0, int64_t in0_strides_0, int32_t *in1_allocated, - int32_t *in1_aligned, int64_t in1_offset, int64_t in1_sizes_0, - int64_t in1_strides_0, int32_t *out0_allocated, int32_t *out0_aligned, - int64_t out0_offset, int64_t out0_sizes_0, int64_t out0_strides_0); +#endif +void dut(int32_t *restrict in0, int32_t *restrict in1, int32_t *restrict out0); +#ifdef TO_LLVM } #endif @@ -38,11 +34,7 @@ int main(int argc, char *argv[]) { chess_memory_fence(); auto cyclesBegin = chess_cycle_count(); -#ifdef TO_CPP dut(g_in0, g_in1, g_out0); -#elif TO_LLVM - dut(g_in0, g_in0, 0, 0, 0, g_in1, g_in1, 0, 0, 0, g_out0, g_out0, 0, 0, 0); -#endif auto cyclesEnd = chess_cycle_count(); chess_memory_fence(); diff --git a/test/unit_tests/aievec_tests/i8xi8_max_elem/i8xi8_max_elem.mlir b/test/unit_tests/aievec_tests/i8xi8_max_elem/i8xi8_max_elem.mlir index b69055b52a..410f3d9467 100644 --- a/test/unit_tests/aievec_tests/i8xi8_max_elem/i8xi8_max_elem.mlir +++ b/test/unit_tests/aievec_tests/i8xi8_max_elem/i8xi8_max_elem.mlir @@ -5,7 +5,7 @@ // RUN: mkdir -p %t/data; cd %t // RUN: aie-opt %s -affine-super-vectorize="virtual-vector-size=64" --convert-vector-to-aievec="aie-target=aieml" -lower-affine | aie-translate -aieml=true --aievec-to-cpp -o dut.cc // RUN: xchesscc_wrapper %xchesscc_aie2_args +w work +o work -I%S -I. -c dut.cc -o dut.o -// RUN: xchesscc_wrapper %xchesscc_aie2_args -DTO_CPP +w work +o work -I%S -I. %S/testbench.cc work/dut.o +// RUN: xchesscc_wrapper %xchesscc_aie2_args +w work +o work -I%S -I. %S/testbench.cc work/dut.o // RUN: xca_udm_dbg --aiearch aie-ml -qf -T -P %aietools/data/aie_ml/lib/ -t "%S/../profiling.tcl ./work/a.out" >& xca_udm_dbg.stdout // RUN: FileCheck --input-file=./xca_udm_dbg.stdout %s // CHECK: TEST PASSED diff --git a/test/unit_tests/aievec_tests/i8xi8_max_elem/testbench.cc b/test/unit_tests/aievec_tests/i8xi8_max_elem/testbench.cc index f9fdb84a62..dbb320d53d 100644 --- a/test/unit_tests/aievec_tests/i8xi8_max_elem/testbench.cc +++ b/test/unit_tests/aievec_tests/i8xi8_max_elem/testbench.cc @@ -5,15 +5,11 @@ #include #include -#ifdef TO_CPP -void dut(int8_t *restrict in0, int8_t *restrict in1, int8_t *restrict out0); -#elif TO_LLVM +#ifdef TO_LLVM extern "C" { -void dut(int8_t *in0_allocated, int8_t *in0_aligned, int64_t in0_offset, - int64_t in0_sizes_0, int64_t in0_strides_0, int8_t *in1_allocated, - int8_t *in1_aligned, int64_t in1_offset, int64_t in1_sizes_0, - int64_t in1_strides_0, int8_t *out0_allocated, int8_t *out0_aligned, - int64_t out0_offset, int64_t out0_sizes_0, int64_t out0_strides_0); +#endif +void dut(int8_t *restrict in0, int8_t *restrict in1, int8_t *restrict out0); +#ifdef TO_LLVM } #endif @@ -38,11 +34,7 @@ int main(int argc, char *argv[]) { chess_memory_fence(); auto cyclesBegin = chess_cycle_count(); -#ifdef TO_CPP dut(g_in0, g_in1, g_out0); -#elif TO_LLVM - dut(g_in0, g_in0, 0, 0, 0, g_in1, g_in1, 0, 0, 0, g_out0, g_out0, 0, 0, 0); -#endif auto cyclesEnd = chess_cycle_count(); chess_memory_fence(); diff --git a/test/unit_tests/aievec_tests/i8xi8_min_elem/i8xi8_min_elem.mlir b/test/unit_tests/aievec_tests/i8xi8_min_elem/i8xi8_min_elem.mlir index dcdf2cc288..4ecd849013 100644 --- a/test/unit_tests/aievec_tests/i8xi8_min_elem/i8xi8_min_elem.mlir +++ b/test/unit_tests/aievec_tests/i8xi8_min_elem/i8xi8_min_elem.mlir @@ -5,7 +5,7 @@ // RUN: mkdir -p %t/data; cd %t // RUN: aie-opt %s -affine-super-vectorize="virtual-vector-size=64" --convert-vector-to-aievec="aie-target=aieml" -lower-affine | aie-translate -aieml=true --aievec-to-cpp -o dut.cc // RUN: xchesscc_wrapper %xchesscc_aie2_args +w work +o work -I%S -I. -c dut.cc -o dut.o -// RUN: xchesscc_wrapper %xchesscc_aie2_args -DTO_CPP +w work +o work -I%S -I. %S/testbench.cc work/dut.o +// RUN: xchesscc_wrapper %xchesscc_aie2_args +w work +o work -I%S -I. %S/testbench.cc work/dut.o // RUN: xca_udm_dbg --aiearch aie-ml -qf -T -P %aietools/data/aie_ml/lib/ -t "%S/../profiling.tcl ./work/a.out" >& xca_udm_dbg.stdout // RUN: FileCheck --input-file=./xca_udm_dbg.stdout %s // CHECK: TEST PASSED diff --git a/test/unit_tests/aievec_tests/i8xi8_min_elem/testbench.cc b/test/unit_tests/aievec_tests/i8xi8_min_elem/testbench.cc index 0aed91af2f..457f7562c9 100644 --- a/test/unit_tests/aievec_tests/i8xi8_min_elem/testbench.cc +++ b/test/unit_tests/aievec_tests/i8xi8_min_elem/testbench.cc @@ -5,15 +5,11 @@ #include #include -#ifdef TO_CPP -void dut(int8_t *restrict in0, int8_t *restrict in1, int8_t *restrict out0); -#elif TO_LLVM +#ifdef TO_LLVM extern "C" { -void dut(int8_t *in0_allocated, int8_t *in0_aligned, int64_t in0_offset, - int64_t in0_sizes_0, int64_t in0_strides_0, int8_t *in1_allocated, - int8_t *in1_aligned, int64_t in1_offset, int64_t in1_sizes_0, - int64_t in1_strides_0, int8_t *out0_allocated, int8_t *out0_aligned, - int64_t out0_offset, int64_t out0_sizes_0, int64_t out0_strides_0); +#endif +void dut(int8_t *restrict in0, int8_t *restrict in1, int8_t *restrict out0); +#ifdef TO_LLVM } #endif @@ -38,11 +34,7 @@ int main(int argc, char *argv[]) { chess_memory_fence(); auto cyclesBegin = chess_cycle_count(); -#ifdef TO_CPP dut(g_in0, g_in1, g_out0); -#elif TO_LLVM - dut(g_in0, g_in0, 0, 0, 0, g_in1, g_in1, 0, 0, 0, g_out0, g_out0, 0, 0, 0); -#endif auto cyclesEnd = chess_cycle_count(); chess_memory_fence(); diff --git a/test/unit_tests/aievec_tests/i8xi8_mul_elem/i8xi8_mul_elem.mlir b/test/unit_tests/aievec_tests/i8xi8_mul_elem/i8xi8_mul_elem.mlir index 6063d818a0..32f3fc6fa5 100644 --- a/test/unit_tests/aievec_tests/i8xi8_mul_elem/i8xi8_mul_elem.mlir +++ b/test/unit_tests/aievec_tests/i8xi8_mul_elem/i8xi8_mul_elem.mlir @@ -5,7 +5,7 @@ // RUN: mkdir -p %t/data; cd %t // RUN: aie-opt %s -affine-super-vectorize="virtual-vector-size=32" --convert-vector-to-aievec="aie-target=aieml" -lower-affine | aie-translate -aieml=true --aievec-to-cpp -o dut.cc // RUN: xchesscc_wrapper %xchesscc_aie2_args +w work +o work -I%S -I. -c dut.cc -o dut.o -// RUN: xchesscc_wrapper %xchesscc_aie2_args -DTO_CPP +w work +o work -I%S -I. %S/testbench.cc work/dut.o +// RUN: xchesscc_wrapper %xchesscc_aie2_args +w work +o work -I%S -I. %S/testbench.cc work/dut.o // RUN: xca_udm_dbg --aiearch aie-ml -qf -T -P %aietools/data/aie_ml/lib/ -t "%S/../profiling.tcl ./work/a.out" >& xca_udm_dbg.stdout // RUN: FileCheck --input-file=./xca_udm_dbg.stdout %s // CHECK: TEST PASSED diff --git a/test/unit_tests/aievec_tests/i8xi8_mul_elem/testbench.cc b/test/unit_tests/aievec_tests/i8xi8_mul_elem/testbench.cc index f5de6520f9..b9190e5882 100644 --- a/test/unit_tests/aievec_tests/i8xi8_mul_elem/testbench.cc +++ b/test/unit_tests/aievec_tests/i8xi8_mul_elem/testbench.cc @@ -5,15 +5,11 @@ #include #include -#ifdef TO_CPP -void dut(int8_t *restrict in0, int8_t *restrict in1, int32_t *restrict out0); -#elif TO_LLVM +#ifdef TO_LLVM extern "C" { -void dut(int8_t *in0_allocated, int8_t *in0_aligned, int64_t in0_offset, - int64_t in0_sizes_0, int64_t in0_strides_0, int8_t *in1_allocated, - int8_t *in1_aligned, int64_t in1_offset, int64_t in1_sizes_0, - int64_t in1_strides_0, int32_t *out0_allocated, int32_t *out0_aligned, - int64_t out0_offset, int64_t out0_sizes_0, int64_t out0_strides_0); +#endif +void dut(int8_t *restrict in0, int8_t *restrict in1, int32_t *restrict out0); +#ifdef TO_LLVM } #endif @@ -38,11 +34,7 @@ int main(int argc, char *argv[]) { chess_memory_fence(); auto cyclesBegin = chess_cycle_count(); -#ifdef TO_CPP dut(g_in0, g_in1, g_out0); -#elif TO_LLVM - dut(g_in0, g_in0, 0, 0, 0, g_in1, g_in1, 0, 0, 0, g_out0, g_out0, 0, 0, 0); -#endif auto cyclesEnd = chess_cycle_count(); chess_memory_fence(); diff --git a/test/unit_tests/aievec_tests/i8xi8_mul_elem_2/i8xi8_mul_elem.mlir b/test/unit_tests/aievec_tests/i8xi8_mul_elem_2/i8xi8_mul_elem.mlir index ab5232e080..16cb9af325 100644 --- a/test/unit_tests/aievec_tests/i8xi8_mul_elem_2/i8xi8_mul_elem.mlir +++ b/test/unit_tests/aievec_tests/i8xi8_mul_elem_2/i8xi8_mul_elem.mlir @@ -5,7 +5,7 @@ // RUN: mkdir -p %t/data; cd %t // RUN: aie-opt %s -affine-super-vectorize="virtual-vector-size=32" --convert-vector-to-aievec="aie-target=aieml" -lower-affine | aie-translate -aieml=true --aievec-to-cpp -o dut.cc // RUN: xchesscc_wrapper %xchesscc_aie2_args +w work +o work -I%S -I. -c dut.cc -o dut.o -// RUN: xchesscc_wrapper %xchesscc_aie2_args -DTO_CPP +w work +o work -I%S -I. %S/testbench.cc work/dut.o +// RUN: xchesscc_wrapper %xchesscc_aie2_args +w work +o work -I%S -I. %S/testbench.cc work/dut.o // RUN: xca_udm_dbg --aiearch aie-ml -qf -T -P %aietools/data/aie_ml/lib/ -t "%S/../profiling.tcl ./work/a.out" >& xca_udm_dbg.stdout // RUN: FileCheck --input-file=./xca_udm_dbg.stdout %s // CHECK: TEST PASSED diff --git a/test/unit_tests/aievec_tests/i8xi8_mul_elem_2/testbench.cc b/test/unit_tests/aievec_tests/i8xi8_mul_elem_2/testbench.cc index fb8e2c85c9..af18ccf310 100644 --- a/test/unit_tests/aievec_tests/i8xi8_mul_elem_2/testbench.cc +++ b/test/unit_tests/aievec_tests/i8xi8_mul_elem_2/testbench.cc @@ -5,15 +5,11 @@ #include #include -#ifdef TO_CPP -void dut(int8_t *restrict in0, int8_t *restrict in1, int8_t *restrict out0); -#elif TO_LLVM +#ifdef TO_LLVM extern "C" { -void dut(int8_t *in0_allocated, int8_t *in0_aligned, int64_t in0_offset, - int64_t in0_sizes_0, int64_t in0_strides_0, int8_t *in1_allocated, - int8_t *in1_aligned, int64_t in1_offset, int64_t in1_sizes_0, - int64_t in1_strides_0, int8_t *out0_allocated, int8_t *out0_aligned, - int64_t out0_offset, int64_t out0_sizes_0, int64_t out0_strides_0); +#endif +void dut(int8_t *restrict in0, int8_t *restrict in1, int8_t *restrict out0); +#ifdef TO_LLVM } #endif @@ -37,11 +33,7 @@ int main(int argc, char *argv[]) { chess_memory_fence(); auto cyclesBegin = chess_cycle_count(); -#ifdef TO_CPP dut(g_in0, g_in1, g_out0); -#elif TO_LLVM - dut(g_in0, g_in0, 0, 0, 0, g_in1, g_in1, 0, 0, 0, g_out0, g_out0, 0, 0, 0); -#endif auto cyclesEnd = chess_cycle_count(); chess_memory_fence(); diff --git a/test/unit_tests/lit.local.cfg b/test/unit_tests/lit.local.cfg index d196f64b33..4cb834915e 100644 --- a/test/unit_tests/lit.local.cfg +++ b/test/unit_tests/lit.local.cfg @@ -25,8 +25,8 @@ if "peano" in config.available_features: # pipelines for using aie-opt and aie-translate vector_to_aievec = '--convert-vector-to-aievec="aie-target=aieml target-backend=llvmir"' - aievec_to_llvmir = '--convert-aievec-to-llvm -convert-vector-to-llvm -lower-affine -convert-scf-to-cf -canonicalize -cse -convert-math-to-llvm -expand-strided-metadata -finalize-memref-to-llvm -convert-func-to-llvm -convert-index-to-llvm -canonicalize -cse' - vector_to_generic_llvmir = '-canonicalize-vector-for-aievec=aie-target=aieml -convert-vector-to-llvm -lower-affine -convert-scf-to-cf -canonicalize -cse -convert-math-to-llvm -expand-strided-metadata -finalize-memref-to-llvm -convert-func-to-llvm -convert-index-to-llvm -canonicalize -cse' + aievec_to_llvmir = '--convert-aievec-to-llvm -convert-vector-to-llvm -lower-affine -convert-scf-to-cf -canonicalize -cse -convert-math-to-llvm -expand-strided-metadata -finalize-memref-to-llvm -convert-func-to-llvm=\'use-bare-ptr-memref-call-conv\' -convert-index-to-llvm -canonicalize -cse' + vector_to_generic_llvmir = '-canonicalize-vector-for-aievec=aie-target=aieml -convert-vector-to-llvm -lower-affine -convert-scf-to-cf -canonicalize -cse -convert-math-to-llvm -expand-strided-metadata -finalize-memref-to-llvm -convert-func-to-llvm=\'use-bare-ptr-memref-call-conv\' -convert-index-to-llvm -canonicalize -cse' llvmir_to_ll = '--mlir-to-llvmir' config.substitutions.append(('%vector-to-aievec%', vector_to_aievec)) config.substitutions.append(('%aievec-to-llvmir%', aievec_to_llvmir))