From 28fac0033ee283a1318bb7b264247c3fd0f1473d Mon Sep 17 00:00:00 2001 From: Daniele Cattaneo Date: Thu, 19 Oct 2023 17:40:51 +0000 Subject: [PATCH] polybench/ACC OpenCL: Fix the Makefile to properly find CLC and the NVidia OpenCL headers --- .../utilities/common.mk | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/test/polybench-opencl-nvidia/utilities/common.mk b/test/polybench-opencl-nvidia/utilities/common.mk index 62b368aa..77afb66a 100644 --- a/test/polybench-opencl-nvidia/utilities/common.mk +++ b/test/polybench-opencl-nvidia/utilities/common.mk @@ -1,14 +1,16 @@ -INCLUDE =-I${PATH_TO_UTILS} +INCLUDE =-I${PATH_TO_UTILS} -I/usr/local/cuda/include EXECUTABLE_TAFFO =$(patsubst %.exe,%.taffo.exe,${EXECUTABLE}) PTXFILE =$(patsubst %.cl,%.ptx,${CLFILE}) PTXFILE_TAFFO =$(patsubst %.cl,%.taffo.ptx,${CLFILE}) CLANG :=$(shell taffo -print-llvm-bin-dir)/clang LLVM_LINK :=$(shell taffo -print-llvm-bin-dir)/llvm-link -LIB =-lOpenCL -lm +OPT :=$(shell taffo -print-llvm-bin-dir)/opt +CLC_ROOT :=$(shell taffo -print-llvm-bin-dir)/../share/clc +LIB =-L/usr/local/cuda/lib64 -lOpenCL -lm -TAFFO_HOST_DTA ?=fixp -TAFFO_KERN_ARGS ?=fixp -TAFFO_KERN_DTA ?=fixp +TAFFO_HOST_DTA ?=f32 +TAFFO_KERN_ARGS ?=f16 +TAFFO_KERN_DTA ?=f16 ifeq ($(TAFFO_HOST_DTA),fixp) endif @@ -71,14 +73,14 @@ endif all: ${EXECUTABLE} ${PTXFILE} ${EXECUTABLE_TAFFO} ${PTXFILE_TAFFO} ${EXECUTABLE}: - $(CLANG) -O3 -DPOLYBENCH_STACK_ARRAYS -I${PATH_TO_UTILS} ${LIB} ${CFLAGS} ${CFILES} -o ${EXECUTABLE} + $(CLANG) -O3 -DPOLYBENCH_STACK_ARRAYS ${INCLUDE} ${LIB} ${CFLAGS} ${CFILES} -o ${EXECUTABLE} ${EXECUTABLE_TAFFO}: ${PTXFILE_TAFFO} mkdir -p taffo_drvr_logs taffo -O3 -DPOLYBENCH_STACK_ARRAYS \ -Xvra -max-unroll=0 \ $(TAFFO_EXEC_OPTS) \ - -I${PATH_TO_UTILS} ${LIB} ${CFLAGS} ${CFILES} -o ${EXECUTABLE_TAFFO} -temp-dir taffo_drvr_logs -debug \ + ${INCLUDE} ${LIB} ${CFLAGS} ${CFILES} -o ${EXECUTABLE_TAFFO} -temp-dir taffo_drvr_logs -debug \ 2> taffo_drvr_logs/taffo.log ${PTXFILE}: @@ -89,10 +91,11 @@ ${PTXFILE}: -O0 -march=sm_86 -S -emit-llvm \ -o ${CLFILE}.ll \ ${CLFILE} + $(OPT) -S -opaque-pointers=1 -o ${CLFILE}_opaque.ll ${CLFILE}.ll $(LLVM_LINK) \ -S -o ${CLFILE}.linked.ll \ - ${CLFILE}.ll \ - /usr/lib/clc/nvptx64--nvidiacl.bc + ${CLFILE}_opaque.ll \ + ${CLC_ROOT}/nvptx64--nvidiacl.bc $(CLANG) \ -O3 -target nvptx64-unknown-nvcl -march=sm_86 -S \ -o ${PTXFILE} \ @@ -105,10 +108,11 @@ ${PTXFILE_TAFFO}: ${PTXFILE} $(TAFFO_KERN_OPTS) \ -o ${CLFILE}.taffo.ll \ 2> taffo_kern_logs/taffo.log + $(OPT) -S -opaque-pointers=1 -o ${CLFILE}_opaque.taffo.ll ${CLFILE}.taffo.ll $(LLVM_LINK) \ -S -o ${CLFILE}.taffo.linked.ll \ - ${CLFILE}.taffo.ll \ - /usr/lib/clc/nvptx64--nvidiacl.bc + ${CLFILE}_opaque.taffo.ll \ + ${CLC_ROOT}/nvptx64--nvidiacl.bc $(CLANG) \ -O3 -target nvptx64-unknown-nvcl -march=sm_86 -S \ -o ${PTXFILE_TAFFO} \