diff --git a/Makefile b/Makefile index e6d65a4..cff93ea 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,8 @@ DESTDIR ?= HIPARCH := gfx1201,gfx1200,gfx1100,gfx1101,gfx1102,gfx1103,gfx1151,gfx1012,gfx1030,gfx1031,gfx1032,gfx906,gfx801,gfx802,gfx803 +CUDA_CCBIN ?= + ifeq ($(OS),Windows_NT) vulkanLink := -I "${VULKAN_SDK}\Include" -L "${VULKAN_SDK}\Lib" -lvulkan-1 dllend := .dll @@ -37,6 +39,8 @@ else fatbincompresscuda := endif +cudaccbin = $(if $(CUDA_CCBIN),-ccbin $(CUDA_CCBIN),) + .FORCE: buildFFVSHIP: src/FFVship.cpp .FORCE @@ -46,10 +50,10 @@ build: src/VshipLib.cpp .FORCE hipcc src/VshipLib.cpp -g -std=c++17 -Wall -Wno-ignored-attributes -I "$(current_dir)include" --offload-arch=native -shared $(fpic) -o "$(current_dir)libvship$(dllend)" buildcuda: src/VshipLib.cpp .FORCE - nvcc -x cu src/VshipLib.cpp -g -std=c++17 -I "$(current_dir)include" -arch=native -shared $(fpiccuda) -o "$(current_dir)libvship$(dllend)" + nvcc $(cudaccbin) -x cu src/VshipLib.cpp -g -std=c++17 -I "$(current_dir)include" -arch=native -shared $(fpiccuda) -o "$(current_dir)libvship$(dllend)" buildcudaall: src/VshipLib.cpp .FORCE - nvcc -x cu src/VshipLib.cpp -g -std=c++17 -I "$(current_dir)include" $(fatbincompresscuda) -arch=all -shared $(fpiccuda) -o "$(current_dir)libvship$(dllend)" + nvcc $(cudaccbin) -x cu src/VshipLib.cpp -g -std=c++17 -I "$(current_dir)include" $(fatbincompresscuda) -arch=all -shared $(fpiccuda) -o "$(current_dir)libvship$(dllend)" buildall: src/VshipLib.cpp .FORCE hipcc src/VshipLib.cpp -g -std=c++17 -Wall -Wno-ignored-attributes -I "$(current_dir)include" $(fatbincompressamd) --offload-arch=$(HIPARCH) -shared $(fpic) -o "$(current_dir)libvship$(dllend)"