From f4b52e9e45cd8ba925744ada18f9397a2d6c84c9 Mon Sep 17 00:00:00 2001 From: Joseph Melber Date: Fri, 18 Oct 2024 19:28:34 -0600 Subject: [PATCH] Cascade matrix multiplication test with Peano (#1856) Co-authored-by: Javier Setoain Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- aie_kernels/aie2/cascade_mm.cc | 8 ++++---- .../basic/matrix_multiplication/cascade/Makefile | 4 +--- .../basic/matrix_multiplication/cascade/run_makefile.lit | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/aie_kernels/aie2/cascade_mm.cc b/aie_kernels/aie2/cascade_mm.cc index d62c29dcba..e7a785954f 100644 --- a/aie_kernels/aie2/cascade_mm.cc +++ b/aie_kernels/aie2/cascade_mm.cc @@ -34,7 +34,7 @@ void matmul_scalar_cascade_put_only(T_in *a, T_in *b, T_out *c) { running_sum += a[row * colA + i] * b[i * colB + col]; } v16int32 v16 = undef_v16int32(); - v16 = upd_elem(v16, 0, running_sum); + v16 = upd_elem(v16, 0, (int)running_sum); put_mcd(v16); } } @@ -51,7 +51,7 @@ void matmul_scalar_cascade_get_only(T_in *a, T_in *b, T_out *c) { running_sum += a[row * colA + i] * b[i * colB + col]; } v16int32 v16 = get_scd_v16int32(); - running_sum += ext_elem(v16, 0); + running_sum += ext_elem(v16, 0U); c[row * colB + col] += running_sum; } } @@ -68,8 +68,8 @@ void matmul_scalar_cascade_put_get(T_in *a, T_in *b, T_out *c) { running_sum += a[row * colA + i] * b[i * colB + col]; } v16int32 v16 = get_scd_v16int32(); - running_sum += ext_elem(v16, 0); - v16 = upd_elem(v16, 0, running_sum); + running_sum += ext_elem(v16, 0U); + v16 = upd_elem(v16, 0, (int)running_sum); put_mcd(v16); } } diff --git a/programming_examples/basic/matrix_multiplication/cascade/Makefile b/programming_examples/basic/matrix_multiplication/cascade/Makefile index 2bb2540969..bf915edf02 100644 --- a/programming_examples/basic/matrix_multiplication/cascade/Makefile +++ b/programming_examples/basic/matrix_multiplication/cascade/Makefile @@ -25,8 +25,6 @@ target_suffix=${M}x${K}x${N}_${m}x${k}x${n}_${n_aie_cols}c include ${srcdir}/../makefile-common -CHESS=true - build/mm_${m}x${k}x${n}.o: ${kernels_dir}/cascade_mm.cc mkdir -p ${@D} - cd ${@D} && xchesscc_wrapper ${CHESSCCWRAP2_FLAGS} -DBIT_WIDTH=8 -DDIM_M=${m} -DDIM_K=${k} -DDIM_N=${n} -c $< -o ${@F} + cd ${@D} && ${PEANO_INSTALL_DIR}/bin/clang++ ${PEANOWRAP2_FLAGS} -fno-unroll-loops -DBIT_WIDTH=8 -DDIM_M=${m} -DDIM_K=${k} -DDIM_N=${n} -c $< -o ${@F} diff --git a/programming_examples/basic/matrix_multiplication/cascade/run_makefile.lit b/programming_examples/basic/matrix_multiplication/cascade/run_makefile.lit index 6875524001..cdae3657a2 100644 --- a/programming_examples/basic/matrix_multiplication/cascade/run_makefile.lit +++ b/programming_examples/basic/matrix_multiplication/cascade/run_makefile.lit @@ -1,7 +1,7 @@ // (c) Copyright 2024 Advanced Micro Devices, Inc. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// REQUIRES: ryzen_ai, chess +// REQUIRES: ryzen_ai, peano // // RUN: make -f %S/Makefile clean // RUN: make -f %S/Makefile