Skip to content

Commit

Permalink
polybench/ACC OpenCL: Fix the Makefile to properly find CLC and the N…
Browse files Browse the repository at this point in the history
…Vidia OpenCL headers
  • Loading branch information
danielecattaneo committed Oct 19, 2023
1 parent 491a374 commit 28fac00
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions test/polybench-opencl-nvidia/utilities/common.mk
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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}:
Expand All @@ -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} \
Expand All @@ -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} \
Expand Down

0 comments on commit 28fac00

Please sign in to comment.