cuda-v12-defs.make 1002 B

1234567891011121314151617
  1. # Common definitions for the various Makefiles which set cuda settings
  2. # No rules are defined here so this is safe to include at the beginning of other makefiles
  3. ifeq ($(OS),windows)
  4. CUDA_PATH?=$(shell cygpath -m -s "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\" 2>/dev/null)unknown
  5. CUDA_BASE_DIR := $(dir $(shell cygpath -m -s "$(CUDA_PATH)\\.." 2>/dev/null))
  6. CUDA_12_PATH:=$(shell ls -d $(CUDA_BASE_DIR)/v12.? 2>/dev/null)
  7. CUDA_12_COMPILER:=$(wildcard $(CUDA_12_PATH)/bin/nvcc.exe)
  8. CUDA_12_LIB_DIR = $(strip $(shell ls -d $(CUDA_12_PATH)/bin 2>/dev/null))
  9. CUDA_12_CGO_EXTRA_LDFLAGS = -L"$(CUDA_12_PATH)/lib/x64"
  10. else ifeq ($(OS),linux)
  11. CUDA_PATH?=/usr/local/cuda
  12. CUDA_12_PATH:=$(shell ls -d $(CUDA_PATH)-12 2>/dev/null)
  13. CUDA_12_COMPILER:=$(wildcard $(CUDA_12_PATH)/bin/nvcc)
  14. CUDA_12_LIB_DIR=$(strip $(shell ls -d $(CUDA_12_PATH)/lib64 2>/dev/null || ls -d $(CUDA_12_PATH)/lib 2>/dev/null))
  15. CUDA_12_CGO_EXTRA_LDFLAGS = -L"$(CUDA_12_LIB_DIR)" -L"$(CUDA_12_LIB_DIR)/stubs"
  16. endif