Skip to content

Commit

Permalink
Cleaning up VCK5000 makefiles and removing test_vck5000.cpp and run_v…
Browse files Browse the repository at this point in the history
…ck5000.lit for tests hat don't have the appropriate kernels (#1407)

Co-authored-by: Joseph Melber <jgmelber@gmail.com>
  • Loading branch information
eddierichter-amd and jgmelber authored Apr 25, 2024
1 parent ee7311b commit 4039c7d
Show file tree
Hide file tree
Showing 20 changed files with 45 additions and 641 deletions.
21 changes: 8 additions & 13 deletions programming_examples/basic/matrix_scalar_add/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ srcdir := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))

include ${srcdir}/../../makefile-common

ACDC_AIE = $(dir $(shell which aie-opt))/..

SHELL := /bin/bash

targetname = matrixAddOne
Expand Down Expand Up @@ -46,17 +44,14 @@ vck5000: col=6

vck5000: build/aie.mlir
aiecc.py --link_against_hsa --host-target=x86_64-amd-linux-gnu build/aie.mlir \
-I/opt/xaiengine/include \
-I$(ACDC_AIE)/runtime_lib/x86_64-hsa/test_lib/include \
-I${ROCM_ROOT}/include \
-L/opt/xaiengine/lib \
-L/lib/x86_64-linux-gnu/ \
test_vck5000.cpp \
$(ACDC_AIE)/runtime_lib/x86_64-hsa/test_lib/src/test_library.cpp \
${ROCM_ROOT}/lib/libhsa-runtime64.so.1.9.0 \
-Wl,-R/opt/xaiengine/lib \
-Wl,-rpath,${ROCM_ROOT}/lib \
-Wl,--whole-archive -Wl,--no-whole-archive -lstdc++ -ldl -lelf -o test.elf
-I/opt/xaiengine/include \
-I${srcdir}/../../../install/runtime_lib/x86_64-hsa/test_lib/include \
-L/opt/xaiengine/lib \
-L/lib/x86_64-linux-gnu/ \
${srcdir}/test_vck5000.cpp \
${srcdir}/../../../install/runtime_lib/x86_64-hsa/test_lib/src/test_library.cpp \
-Wl,-R/opt/xaiengine/lib \
-Wl,--whole-archive -Wl,--no-whole-archive -lstdc++ -ldl -lelf -o test.elf

run: ${targetname}.exe build/final.xclbin build/insts.txt
${powershell} ./$< -x build/final.xclbin -i build/insts.txt -k MLIR_AIE
Expand Down
7 changes: 3 additions & 4 deletions programming_examples/basic/matrix_scalar_add/run_vck5000.lit
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// (c) Copyright 2023 Advanced Micro Devices, Inc.
// (c) Copyright 2024 Advanced Micro Devices, Inc.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// REQUIRES: hsa
//
// RUN: %python %S/aie2.py xcvc1902 6 > ./aie.mlir
// RUN: %python aiecc.py %VitisSysrootFlag% --host-target=%aieHostTargetTriplet% %link_against_hsa% ./aie.mlir -I%host_runtime_lib%/test_lib/include %extraAieCcFlags% %S/test_vck5000.cpp -o test.elf -L%host_runtime_lib%/test_lib/lib -ltest_lib
// RUN: make -f %S/Makefile clean
// RUN: make -f %S/Makefile vck5000
// RUN: %run_on_vck5000 ./test.elf

9 changes: 3 additions & 6 deletions programming_examples/basic/passthrough_dmas/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,12 @@ vck5000: col=6
vck5000: build/aie.mlir
aiecc.py --link_against_hsa --host-target=x86_64-amd-linux-gnu build/aie.mlir \
-I/opt/xaiengine/include \
-I$(ACDC_AIE)/runtime_lib/x86_64-hsa/test_lib/include \
-I${ROCM_ROOT}/include \
-I${srcdir}/../../../install/runtime_lib/x86_64-hsa/test_lib/include \
-L/opt/xaiengine/lib \
-L/lib/x86_64-linux-gnu/ \
test_vck5000.cpp \
$(ACDC_AIE)/runtime_lib/x86_64-hsa/test_lib/src/test_library.cpp \
${ROCM_ROOT}/lib/libhsa-runtime64.so.1.9.0 \
${srcdir}/test_vck5000.cpp \
${srcdir}/../../../install/runtime_lib/x86_64-hsa/test_lib/src/test_library.cpp \
-Wl,-R/opt/xaiengine/lib \
-Wl,-rpath,${ROCM_ROOT}/lib \
-Wl,--whole-archive -Wl,--no-whole-archive -lstdc++ -ldl -lelf -o test.elf

run_vck5000:
Expand Down
6 changes: 3 additions & 3 deletions programming_examples/basic/passthrough_dmas/run_vck5000.lit
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// (c) Copyright 2023 Advanced Micro Devices, Inc.
// (c) Copyright 2024 Advanced Micro Devices, Inc.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// REQUIRES: hsa
//
// RUN: %python %S/aie2.py xcvc1902 6 > ./aie.mlir
// RUN: %python aiecc.py %VitisSysrootFlag% --host-target=%aieHostTargetTriplet% %link_against_hsa% ./aie.mlir -I%host_runtime_lib%/test_lib/include %extraAieCcFlags% %S/test_vck5000.cpp -o test.elf -L%host_runtime_lib%/test_lib/lib -ltest_lib
// RUN: make -f %S/Makefile clean
// RUN: make -f %S/Makefile vck5000
// RUN: %run_on_vck5000 ./test.elf
23 changes: 0 additions & 23 deletions programming_examples/basic/vector_reduce_add/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ srcdir := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))

include ${srcdir}/../../makefile-common

ACDC_AIE = $(dir $(shell which aie-opt))/..

targetname = reduce_add
devicename = npu
col = 0
Expand Down Expand Up @@ -54,26 +52,5 @@ trace:
clean_trace:
rm -rf tmpTrace trace.txt

# Changing variables when we target VCK5000
vck5000: devicename=xcvc1902
vck5000: col=6
vck5000: CHESS_FLAGS=${CHESSCCWRAP1_FLAGS}
vck5000: KERNEL_LIB=${ACDC_AIE}/../aie_kernels/aie1/

vck5000: build/aie.mlir build/scale.o
cp build/scale.o* ./
aiecc.py --link_against_hsa --host-target=x86_64-amd-linux-gnu build/aie.mlir \
-I/opt/xaiengine/include \
-I$(ACDC_AIE)/runtime_lib/x86_64-hsa/test_lib/include \
-I${ROCM_ROOT}/include \
-L/opt/xaiengine/lib \
-L/lib/x86_64-linux-gnu/ \
test_vck5000.cpp \
$(ACDC_AIE)/runtime_lib/x86_64-hsa/test_lib/src/test_library.cpp \
${ROCM_ROOT}/lib/libhsa-runtime64.so.1.9.0 \
-Wl,-R/opt/xaiengine/lib \
-Wl,-rpath,${ROCM_ROOT}/lib \
-Wl,--whole-archive -Wl,--no-whole-archive -lstdc++ -ldl -lelf -o test.elf

clean: clean_trace
rm -rf build _build inst aie.mlir.prj core_* test.elf ${targetname}.exe
17 changes: 0 additions & 17 deletions programming_examples/basic/vector_reduce_add/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ This example does not contain a C++ kernel file. The kernel is expressed in Pyth

1. `test.cpp`: This C++ code is a testbench for the design example targetting Ryzen™ AI (AIE2). The code is responsible for loading the compiled XCLBIN file, configuring the AIE module, providing input data, and executing the AIE design on the NPU. After executing, the program verifies the results.

1. `test_vck5000.cpp`: This C++ code is a testbench for the design example targetting the VCK5000 PCIe card (AIE1). The code is responsible for configuring the AIEs, allocating memory, providing input data, and executing the AIE design on the VCK5000. After executing, the program verifies the results.

## Ryzen™ AI Usage

### C++ Testbench
Expand All @@ -41,18 +39,3 @@ To run the design:
make run
```

## VCK5000 Usage

### C++ Testbench

To compile the design and C++ testbench:

```
make vck5000
```

To run the design:

```
./test.elf
```
11 changes: 0 additions & 11 deletions programming_examples/basic/vector_reduce_add/run_vck5000.lit

This file was deleted.

148 changes: 0 additions & 148 deletions programming_examples/basic/vector_reduce_add/test_vck5000.cpp

This file was deleted.

21 changes: 0 additions & 21 deletions programming_examples/basic/vector_reduce_max/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,26 +54,5 @@ trace:
clean_trace:
rm -rf tmpTrace trace.txt

# Changing variables when we target VCK5000
vck5000: devicename=xcvc1902
vck5000: col=6
vck5000: CHESS_FLAGS=${CHESSCCWRAP1_FLAGS}
vck5000: KERNEL_LIB=${ACDC_AIE}/../aie_kernels/aie1/

vck5000: build/aie.mlir build/scale.o
cp build/scale.o* ./
aiecc.py --link_against_hsa --host-target=x86_64-amd-linux-gnu build/aie.mlir \
-I/opt/xaiengine/include \
-I$(ACDC_AIE)/runtime_lib/x86_64-hsa/test_lib/include \
-I${ROCM_ROOT}/include \
-L/opt/xaiengine/lib \
-L/lib/x86_64-linux-gnu/ \
test_vck5000.cpp \
$(ACDC_AIE)/runtime_lib/x86_64-hsa/test_lib/src/test_library.cpp \
${ROCM_ROOT}/lib/libhsa-runtime64.so.1.9.0 \
-Wl,-R/opt/xaiengine/lib \
-Wl,-rpath,${ROCM_ROOT}/lib \
-Wl,--whole-archive -Wl,--no-whole-archive -lstdc++ -ldl -lelf -o test.elf

clean: clean_trace
rm -rf build _build inst aie.mlir.prj core_* test.elf ${targetname}.exe
17 changes: 0 additions & 17 deletions programming_examples/basic/vector_reduce_max/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ This example does not contain a C++ kernel file. The kernel is expressed in Pyth

1. `test.cpp`: This C++ code is a testbench for the design example targetting Ryzen™ AI (AIE2). The code is responsible for loading the compiled XCLBIN file, configuring the AIE module, providing input data, and executing the AIE design on the NPU. After executing, the program verifies the results.

1. `test_vck5000.cpp`: This C++ code is a testbench for the design example targetting the VCK5000 PCIe card (AIE1). The code is responsible for configuring the AIEs, allocating memory, providing input data, and executing the AIE design on the VCK5000. After executing, the program verifies the results.

## Ryzen™ AI Usage

### C++ Testbench
Expand All @@ -41,18 +39,3 @@ To run the design:
make run
```

## VCK5000 Usage

### C++ Testbench

To compile the design and C++ testbench:

```
make vck5000
```

To run the design:

```
./test.elf
```
11 changes: 0 additions & 11 deletions programming_examples/basic/vector_reduce_max/run_vck5000.lit

This file was deleted.

Loading

0 comments on commit 4039c7d

Please sign in to comment.