Add an option to use Clang as CUDA compiler and an option to select CUDA Toolkit version
Pull-request for branch users/somov/platform/cuda
@@ -8,16 +8,25 @@ IF (NOT HAVE_CUDA)
MESSAGE(FATAL_ERROR "No CUDA Toolkit for your build")
ENDIF()
-IF (_USE_ARCADIA_CUDA)
+IF (USE_ARCADIA_CUDA)
IF (HOST_OS_LINUX AND HOST_ARCH_X86_64)
IF (OS_LINUX AND ARCH_X86_64)
- DECLARE_EXTERNAL_RESOURCE(CUDA sbr:235618970)
+ IF (CUDA_VERSION STREQUAL "9.1")
+ DECLARE_EXTERNAL_RESOURCE(CUDA sbr:494273996) # CUDA Toolkit 9.1.85.1 for Linux x86-64
+ DECLARE_EXTERNAL_RESOURCE(CUDA_HOST_TOOLCHAIN sbr:144212391) # GCC 6.1.0 for Linux x86-64
+ ELSEIF(CUDA_VERSION STREQUAL "8.0")
+ DECLARE_EXTERNAL_RESOURCE(CUDA sbr:494267287) # CUDA Toolkit 8.0.61.2 for Linux x86-64
+ DECLARE_EXTERNAL_RESOURCE(CUDA_HOST_TOOLCHAIN sbr:89559664) # GCC 4.9.2 for Linux x86-64
+ ELSE()
+ ENABLE(CUDA_NOT_FOUND)
+ ENDIF()
+
CFLAGS(GLOBAL "-I$CUDA_RESOURCE_GLOBAL/include")
LDFLAGS_FIXED("-L$CUDA_RESOURCE_GLOBAL/lib64")
ELSEIF (OS_LINUX AND ARCH_AARCH64)
- DECLARE_EXTERNAL_RESOURCE(CUDA sbr:152786617)
+ DECLARE_EXTERNAL_RESOURCE(CUDA sbr:152786617) # 8.0.61
CFLAGS(GLOBAL "-I$CUDA_RESOURCE_GLOBAL/targets/aarch64-linux/include")
LDFLAGS_FIXED("-L$CUDA_RESOURCE_GLOBAL/targets/aarch64-linux/lib")
@@ -28,8 +37,14 @@ IF (_USE_ARCADIA_CUDA)
ELSEIF (HOST_OS_DARWIN AND HOST_ARCH_X86_64)
IF (OS_DARWIN AND ARCH_X86_64)
+ IF (CUDA_VERSION STREQUAL "9.1")
+ DECLARE_EXTERNAL_RESOURCE(CUDA sbr:494327636) # CUDA Toolkit 9.1.128 for macOS x86-64
+ DECLARE_EXTERNAL_RESOURCE(CUDA_XCODE sbr:498971125) # Xcode 9.2 for CUDA Toolkit 9.1.128 macOS x86-64
+ ELSE()
DECLARE_EXTERNAL_RESOURCE(CUDA sbr:377468938)
DECLARE_EXTERNAL_RESOURCE(CUDA_XCODE sbr:377517442)
+ ENDIF()
+
CFLAGS(GLOBAL "-I$CUDA_RESOURCE_GLOBAL/include")
LDFLAGS_FIXED("-L$CUDA_RESOURCE_GLOBAL/lib")
