From 5e10343cac59c8bb477b271f5b6536d7e85a4407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20H=C3=B6ster?= Date: Wed, 16 Jul 2025 20:50:24 +0200 Subject: [PATCH] Add option to compile CUDA with clang Probably not Windows-compatible for buildFFVSHIPcudaclang? Only tested on Linux. --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index d33aeb7..86453e1 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ ifeq ($(OS),Windows_NT) exeend := .exe fpiccuda := fpicamd := + fpicclang := plugin_install_path := $(APPDATA)\VapourSynth\plugins64 exe_install_path := $(ProgramFiles)\FFVship.exe ffvshiplibheader := -I include -lz_imp -lz -lffms2 @@ -16,6 +17,7 @@ else exeend := fpiccuda := -Xcompiler -fPIC fpicamd := -fPIC + fpicclang := -fPIC plugin_install_path := $(DESTDIR)$(PREFIX)/lib/vapoursynth exe_install_path := $(DESTDIR)$(PREFIX)/bin ffvshiplibheader := $(shell pkg-config --libs ffms2 zimg) @@ -29,6 +31,9 @@ buildFFVSHIP: src/ffmpegmain.cpp .FORCE buildFFVSHIPcuda: src/ffmpegmain.cpp .FORCE nvcc -x cu src/ffmpegmain.cpp -std=c++17 -arch=native $(subst -pthread,-Xcompiler="-pthread",$(ffvshiplibheader)) -o FFVship$(exeend) +buildFFVSHIPcudaclang: src/ffmpegmain.cpp .FORCE + clang++ -x cuda src/ffmpegmain.cpp -std=c++17 --cuda-gpu-arch=native -O3 -fcuda-approx-transcendentals -L/usr/local/cuda/lib64 -lcudart $(ffvshiplibheader) -o FFVship$(exeend) + buildFFVSHIPall: src/ffmpegmain.cpp .FORCE hipcc src/ffmpegmain.cpp -std=c++17 --offload-arch=gfx1100,gfx1101,gfx1102,gfx1103,gfx1030,gfx1031,gfx1032,gfx906,gfx801,gfx802,gfx803 -Wno-unused-result -Wno-ignored-attributes $(ffvshiplibheader) -o FFVship$(exeend) @@ -41,6 +46,9 @@ build: src/vapoursynthPlugin.cpp .FORCE buildcuda: src/vapoursynthPlugin.cpp .FORCE nvcc -x cu src/vapoursynthPlugin.cpp -std=c++17 -arch=native -I "$(current_dir)include" -shared $(fpiccuda) -o "$(current_dir)vship$(dllend)" +buildcudaclang: src/vapoursynthPlugin.cpp .FORCE + clang++ -x cuda src/vapoursynthPlugin.cpp -std=c++17 --cuda-gpu-arch=native -O3 -fcuda-approx-transcendentals -I "$(current_dir)include" -shared $(fpicclang) -o "$(current_dir)vship$(dllend)" + buildcudaall: src/vapoursynthPlugin.cpp .FORCE nvcc -x cu src/vapoursynthPlugin.cpp -std=c++17 -arch=all -I "$(current_dir)include" -shared $(fpiccuda) -o "$(current_dir)vship$(dllend)"