# Configure for CUDA backend
BACKEND_NAME		:=cuda
BACKEND_NAMESPACE 	:=CUDA
GENERATOR_NAME		:=spineml_generator_cuda

# Check that CUDA path is set
ifndef CUDA_PATH
    $(error Environment variable CUDA_PATH must be defined - this is a required post-installation action when installing CUDA)
endif

# Include common makefile
include MakefileCommon

# Add include and link flags for CUDA
CXXFLAGS		+= -I"$(CUDA_PATH)/include"
ifeq ($(DARWIN),DARWIN)
    LDFLAGS		+=-rpath $(CUDA_PATH)/lib -L"$(CUDA_PATH)/lib" -lcuda -lcudart -pthread
else
    ifeq ($(MICROSOFT),MICROSOFT)
        LDFLAGS         +=-L"/usr/lib/wsl/lib"
    endif
    ifeq ($(OS_SIZE),32)
        LDFLAGS		+=-L"$(CUDA_PATH)/lib" -lcuda -lcudart -pthread
    else
        LDFLAGS		+=-L"$(CUDA_PATH)/lib64" -lcuda -lcudart -pthread
    endif
endif

