diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2025-05-23 14:42:05 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2025-05-23 14:42:05 +0200 |
commit | b1f82770b817d0558044d3cfb1ef4d36b4492055 (patch) | |
tree | 5d08ac0ace62954fd0662dfedc0f7bedbd0be5bc /RED | |
parent | 887aac6ff274e972e21ddab400502d76b78dfcbf (diff) |
RED: support → include; fix runtime for NR_DPUS==1
Diffstat (limited to 'RED')
-rw-r--r-- | RED/Makefile | 33 | ||||
-rw-r--r-- | RED/dpu/task.c | 4 | ||||
-rw-r--r-- | RED/host/app.c | 12 | ||||
-rwxr-xr-x | RED/include/common.h (renamed from RED/support/common.h) | 0 | ||||
-rw-r--r-- | RED/include/cyclecount.h (renamed from RED/support/cyclecount.h) | 0 | ||||
-rw-r--r-- | RED/include/params.h (renamed from RED/support/params.h) | 0 | ||||
-rwxr-xr-x | RED/include/timer.h (renamed from RED/support/timer.h) | 0 |
7 files changed, 34 insertions, 15 deletions
diff --git a/RED/Makefile b/RED/Makefile index f20e1f7..c65df94 100644 --- a/RED/Makefile +++ b/RED/Makefile @@ -8,17 +8,34 @@ WITH_ALLOC_OVERHEAD ?= 0 WITH_LOAD_OVERHEAD ?= 0 WITH_FREE_OVERHEAD ?= 0 -COMMON_INCLUDES := support HOST_SOURCES := $(wildcard host/*.c) DPU_SOURCES := $(wildcard dpu/*.c) -COMMON_FLAGS := -Wall -Wextra -g -I${COMMON_INCLUDES} -HOST_FLAGS := ${COMMON_FLAGS} -std=c11 -O3 `dpu-pkg-config --cflags --libs dpu` -DNR_TASKLETS=${NR_TASKLETS} -DNR_DPUS=${NR_DPUS} -DBL=${BL} -D${TYPE} -DENERGY=${ENERGY} -DPERF=${PERF} -DWITH_ALLOC_OVERHEAD=${WITH_ALLOC_OVERHEAD} -DWITH_LOAD_OVERHEAD=${WITH_LOAD_OVERHEAD} -DWITH_FREE_OVERHEAD=${WITH_FREE_OVERHEAD} +aspectc ?= 0 +aspectc_timing ?= 0 +dfatool_timing ?= 1 + +HOST_CC := ${CC} + +COMMON_FLAGS := -Wall -Wextra -g -Iinclude +HOST_FLAGS := ${COMMON_FLAGS} -O3 `dpu-pkg-config --cflags --libs dpu` -DNR_TASKLETS=${NR_TASKLETS} -DNR_DPUS=${NR_DPUS} -DBL=${BL} -D${TYPE} -DENERGY=${ENERGY} -DPERF=${PERF} -DWITH_ALLOC_OVERHEAD=${WITH_ALLOC_OVERHEAD} -DWITH_LOAD_OVERHEAD=${WITH_LOAD_OVERHEAD} -DWITH_FREE_OVERHEAD=${WITH_FREE_OVERHEAD} -DASPECTC=${aspectc} -DDFATOOL_TIMING=${dfatool_timing} DPU_FLAGS := ${COMMON_FLAGS} -O2 -DNR_TASKLETS=${NR_TASKLETS} -DBL=${BL} -D${TYPE} -DPERF=${PERF} +ifeq (${aspectc_timing}, 1) + ASPECTC_HOST_FLAGS += -ainclude/dfatool_host_dpu.ah -ainclude/dfatool_host.ah +endif + +ASPECTC_HOST_FLAGS ?= -a0 + +ifeq (${aspectc}, 1) + HOST_CC = ag++ -r repo.acp -v 0 ${ASPECTC_HOST_FLAGS} --c_compiler ${UPMEM_HOME}/bin/clang++ -p . --Xcompiler +else + HOST_FLAGS += -std=c11 +endif + QUIET = @ -ifdef verbose +ifeq (${verbose}, 1) QUIET = endif @@ -27,10 +44,12 @@ all: bin/host_code bin/dpu_code bin: ${QUIET}mkdir -p bin -bin/host_code: ${HOST_SOURCES} ${COMMON_INCLUDES} bin - ${QUIET}${CC} -o $@ ${HOST_SOURCES} ${HOST_FLAGS} +bin/host_code: ${HOST_SOURCES} include bin + ${QUIET}cp ../include/dfatool_host_dpu.ah include + ${QUIET}${HOST_CC} -o $@ ${HOST_SOURCES} ${HOST_FLAGS} + ${QUIET}rm -f include/dfatool_host_dpu.ah -bin/dpu_code: ${DPU_SOURCES} ${COMMON_INCLUDES} bin +bin/dpu_code: ${DPU_SOURCES} include bin ${QUIET}dpu-upmem-dpurte-clang ${DPU_FLAGS} -o $@ ${DPU_SOURCES} clean: diff --git a/RED/dpu/task.c b/RED/dpu/task.c index 5536d4d..90386b2 100644 --- a/RED/dpu/task.c +++ b/RED/dpu/task.c @@ -11,8 +11,8 @@ #include <handshake.h> #include <barrier.h> -#include "../support/common.h" -#include "../support/cyclecount.h" +#include "common.h" +#include "cyclecount.h" __host dpu_arguments_t DPU_INPUT_ARGUMENTS; __host dpu_results_t DPU_RESULTS[NR_TASKLETS]; diff --git a/RED/host/app.c b/RED/host/app.c index 204f056..885ddb8 100644 --- a/RED/host/app.c +++ b/RED/host/app.c @@ -13,9 +13,9 @@ #include <getopt.h> #include <assert.h> -#include "../support/common.h" -#include "../support/timer.h" -#include "../support/params.h" +#include "common.h" +#include "timer.h" +#include "params.h" // Define the DPU Binary path as DPU_BINARY here #ifndef DPU_BINARY @@ -168,9 +168,9 @@ int main(int argc, char **argv) { // Input arguments unsigned int kernel = 0; dpu_arguments_t input_arguments[NR_DPUS]; - for(i=0; i<NR_DPUS-1; i++) { - input_arguments[i].size=input_size_dpu_8bytes * sizeof(T); - input_arguments[i].kernel=kernel; + for(int j=0; j<NR_DPUS-1; i++) { + input_arguments[j].size=input_size_dpu_8bytes * sizeof(T); + input_arguments[j].kernel=kernel; } input_arguments[NR_DPUS-1].size=(input_size_8bytes - input_size_dpu_8bytes * (NR_DPUS-1)) * sizeof(T); input_arguments[NR_DPUS-1].kernel=kernel; diff --git a/RED/support/common.h b/RED/include/common.h index 121bf31..121bf31 100755 --- a/RED/support/common.h +++ b/RED/include/common.h diff --git a/RED/support/cyclecount.h b/RED/include/cyclecount.h index c4247b5..c4247b5 100644 --- a/RED/support/cyclecount.h +++ b/RED/include/cyclecount.h diff --git a/RED/support/params.h b/RED/include/params.h index 97bc50a..97bc50a 100644 --- a/RED/support/params.h +++ b/RED/include/params.h diff --git a/RED/support/timer.h b/RED/include/timer.h index 4d597b9..4d597b9 100755 --- a/RED/support/timer.h +++ b/RED/include/timer.h |