Skip to content

Commit

Permalink
Enable the NVPTX LLVM back-end, and add patches fixing bugs.
Browse files Browse the repository at this point in the history
Use of the NVPTX back-end is only tested on LLVM 3.9 (and hence depends on #19123),
in combination with the CUDAnative.jl package.
  • Loading branch information
maleadt committed Nov 15, 2016
1 parent 2751493 commit b103efd
Show file tree
Hide file tree
Showing 4 changed files with 1,409 additions and 1 deletion.
10 changes: 9 additions & 1 deletion deps/llvm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ LLVM_CFLAGS += $(CFLAGS)
LLVM_CXXFLAGS += $(CXXFLAGS)
LLVM_CPPFLAGS += $(CPPFLAGS)
LLVM_LDFLAGS += $(LDFLAGS)
LLVM_TARGETS := host
ifeq ($(LLVM_USE_CMAKE),1)
LLVM_TARGETS := host;NVPTX
else
LLVM_TARGETS := host,nvptx
endif
LLVM_TARGET_FLAGS := --enable-targets=$(LLVM_TARGETS)
LLVM_CMAKE += -DLLVM_TARGETS_TO_BUILD:STRING="$(LLVM_TARGETS)" -DCMAKE_BUILD_TYPE="$(LLVM_CMAKE_BUILDTYPE)"
LLVM_CMAKE += -DLLVM_TOOLS_INSTALL_DIR=$(shell $(JULIAHOME)/contrib/relative_path.sh $(build_prefix) $(build_depsbindir))
Expand Down Expand Up @@ -479,6 +483,10 @@ $(eval $(call LLVM_PATCH,llvm-PR22923)) # Remove for 4.0
$(eval $(call LLVM_PATCH,llvm-r282182)) # Remove for 4.0
$(eval $(call LLVM_PATCH,llvm-arm-fix-prel31))
$(eval $(call LLVM_PATCH,llvm-D25865-cmakeshlib))
# patches for NVPTX
$(eval $(call LLVM_PATCH,llvm-D9168_argument_alignment)) # Remove for 4.0
$(eval $(call LLVM_PATCH,llvm-D23597_sdag_names)) # Dep for D24300, remove for 4.0
$(eval $(call LLVM_PATCH,llvm-D24300_ptx_intrinsics)) # Remove for 4.0
endif # LLVM_VER

ifeq ($(LLVM_VER),3.7.1)
Expand Down
Loading

0 comments on commit b103efd

Please sign in to comment.