aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorOnur Gündüz <ogunduz@gmail.com>2026-06-10 16:23:12 +0200
committerOnur Gündüz <ogunduz@gmail.com>2026-06-14 08:27:03 +0200
commit731135eef056db2e9b28c09d202368d5c0beabff (patch)
tree08a026247f8f1ba62d5951bd70b3d3237b7a5be6 /Makefile
parent0d422762c97071f446f7461c73adab55565db582 (diff)
downloadffwd-731135eef056db2e9b28c09d202368d5c0beabff.tar.gz
ffwd-731135eef056db2e9b28c09d202368d5c0beabff.zip
build: target the local GPU with -arch=native in the nvcc rule
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 3 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 76de83c..e118f68 100644
--- a/Makefile
+++ b/Makefile
@@ -133,8 +133,10 @@ cuda:
$(MAKE) $(TARGET) $(SERVER_TARGET) $(SHARED_LIB) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" EXTRA_OBJS="embed_cuda.o"
# -fPIC so the same object links into both binaries and the shared library.
+# -arch=native targets the GPU present at build time (we always build CUDA
+# on the machine that runs it), avoiding first-load PTX JIT.
embed_cuda.o: embed_cuda.cu embed_cuda.h embed_internal.h embed.h
- $(NVCC) -O3 -std=c++17 -Xcompiler -fPIC -DUSE_BLAS -DUSE_OPENBLAS -DUSE_CUDA -I/usr/include/openblas -I$(CUDA_HOME)/include -x cu -c -o $@ $<
+ $(NVCC) -O3 -std=c++17 -arch=native -Xcompiler -fPIC -DUSE_BLAS -DUSE_OPENBLAS -DUSE_CUDA -I/usr/include/openblas -I$(CUDA_HOME)/include -x cu -c -o $@ $<
# =============================================================================
# Shared library (built by every backend target from the same objects)