diff options
| author | Onur Gündüz <ogunduz@gmail.com> | 2026-06-10 16:23:12 +0200 |
|---|---|---|
| committer | Onur Gündüz <ogunduz@gmail.com> | 2026-06-14 08:27:03 +0200 |
| commit | 731135eef056db2e9b28c09d202368d5c0beabff (patch) | |
| tree | 08a026247f8f1ba62d5951bd70b3d3237b7a5be6 | |
| parent | 0d422762c97071f446f7461c73adab55565db582 (diff) | |
| download | ffwd-731135eef056db2e9b28c09d202368d5c0beabff.tar.gz ffwd-731135eef056db2e9b28c09d202368d5c0beabff.zip | |
build: target the local GPU with -arch=native in the nvcc rule
| -rw-r--r-- | Makefile | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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) |
