File tree Expand file tree Collapse file tree 4 files changed +20
-1
lines changed
Expand file tree Collapse file tree 4 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -237,8 +237,12 @@ BUILD_LLVM_CLANG := 0
237237# set to 1 to get lldb (often does not work, no chance with llvm3.2 and earlier)
238238# see http://lldb.llvm.org/build.html for dependencies
239239BUILD_LLDB := 0
240+
241+ # Options to enable Polly and its code-generation options
240242USE_POLLY := 0
241- USE_POLLY_OPENMP := 0
243+ USE_POLLY_OPENMP := 0 # Enable OpenMP code-generation
244+ USE_POLLY_ACC := 0 # Enable GPU code-generation
245+ CUDALIB_INCLUDE_DIR := # Path to CUDA header files
242246
243247# Cross-compile
244248# XC_HOST := i686-w64-mingw32
Original file line number Diff line number Diff line change @@ -66,6 +66,9 @@ LLVM_CXXFLAGS += $(CXXFLAGS)
6666LLVM_CPPFLAGS += $(CPPFLAGS )
6767LLVM_LDFLAGS += $(LDFLAGS )
6868LLVM_CMAKE += -DLLVM_TARGETS_TO_BUILD:STRING="$(LLVM_TARGETS ) " -DCMAKE_BUILD_TYPE="$(LLVM_CMAKE_BUILDTYPE ) "
69+ ifeq ($(USE_POLLY_ACC ) ,1)
70+ LLVM_CMAKE += -DPOLLY_ENABLE_GPGPU_CODEGEN=ON
71+ endif
6972LLVM_CMAKE += -DLLVM_TOOLS_INSTALL_DIR=$(shell $(JULIAHOME ) /contrib/relative_path.sh $(build_prefix ) $(build_depsbindir ) )
7073LLVM_CMAKE += -DLLVM_BINDINGS_LIST="" -DLLVM_INCLUDE_DOCS=Off -DLLVM_ENABLE_TERMINFO=Off -DHAVE_HISTEDIT_H=Off -DHAVE_LIBEDIT=Off
7174LLVM_FLAGS += --disable-profiling --enable-static --enable-targets=$(LLVM_TARGETS )
Original file line number Diff line number Diff line change @@ -64,6 +64,15 @@ FLAGS += -DUSE_POLLY
6464ifeq ($(USE_POLLY_OPENMP ) ,1)
6565FLAGS += -fopenmp
6666endif
67+ ifeq ($(USE_POLLY_ACC ) ,1)
68+ LLVMLINK += -lPollyPPCG
69+ FLAGS += -DUSE_POLLY_ACC
70+ ifeq ($(CUDALIB_INCLUDE_DIR ) ,)
71+ $(error CUDALIB_INCLUDE_DIR not set : If compiling with USE_POLLY_ACC, user must provide the path to CUDA header files)
72+ endif
73+ FLAGS += -I$(CUDALIB_INCLUDE_DIR )
74+ FLAGS += -I$(shell $(LLVM_CONFIG_HOST ) --src-root) /tools/polly/tools
75+ endif
6776endif
6877else
6978SRCS += anticodegen
Original file line number Diff line number Diff line change 2525#include < polly/RegisterPasses.h>
2626#include < polly/LinkAllPasses.h>
2727#include < polly/CodeGen/CodegenCleanup.h>
28+ #if defined(USE_POLLY_ACC)
29+ #include < polly/Support/LinkGPURuntime.h>
30+ #endif
2831#endif
2932
3033#include < llvm/Transforms/IPO.h>
You can’t perform that action at this time.
0 commit comments