Explorar el Código

make : add optional CUDA_NATIVE_ARCH (#2482)

Use the environment variable `CUDA_NATIVE_ARCH` if present to set NVCC arch. Otherwise, use `native`.
Alex hace 2 años
padre
commit
96981f37b1
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      Makefile

+ 4 - 1
Makefile

@@ -391,9 +391,12 @@ else
 endif #LLAMA_CUDA_NVCC
 endif #LLAMA_CUDA_NVCC
 ifdef CUDA_DOCKER_ARCH
 ifdef CUDA_DOCKER_ARCH
 	NVCCFLAGS += -Wno-deprecated-gpu-targets -arch=$(CUDA_DOCKER_ARCH)
 	NVCCFLAGS += -Wno-deprecated-gpu-targets -arch=$(CUDA_DOCKER_ARCH)
+endif # CUDA_DOCKER_ARCH
+ifdef CUDA_NATIVE_ARCH
+	NVCCFLAGS += -arch=$(CUDA_NATIVE_ARCH)
 else
 else
 	NVCCFLAGS += -arch=native
 	NVCCFLAGS += -arch=native
-endif # CUDA_DOCKER_ARCH
+endif # CUDA_NATIVE_ARCH
 ifdef LLAMA_CUDA_FORCE_DMMV
 ifdef LLAMA_CUDA_FORCE_DMMV
 	NVCCFLAGS += -DGGML_CUDA_FORCE_DMMV
 	NVCCFLAGS += -DGGML_CUDA_FORCE_DMMV
 endif # LLAMA_CUDA_FORCE_DMMV
 endif # LLAMA_CUDA_FORCE_DMMV