Index: lib/Basic/Targets.cpp =================================================================== --- lib/Basic/Targets.cpp +++ lib/Basic/Targets.cpp @@ -1694,11 +1694,15 @@ GK_SM20, GK_SM21, GK_SM30, + GK_SM32, GK_SM35, GK_SM37, GK_SM50, GK_SM52, GK_SM53, + GK_SM60, + GK_SM61, + GK_SM62, } GPU; public: @@ -1780,35 +1784,37 @@ Builder.defineMacro("__NVPTX__"); if (Opts.CUDAIsDevice) { // Set __CUDA_ARCH__ for the GPU specified. - std::string CUDAArchCode; - switch (GPU) { - case GK_SM20: - CUDAArchCode = "200"; - break; - case GK_SM21: - CUDAArchCode = "210"; - break; - case GK_SM30: - CUDAArchCode = "300"; - break; - case GK_SM35: - CUDAArchCode = "350"; - break; - case GK_SM37: - CUDAArchCode = "370"; - break; - case GK_SM50: - CUDAArchCode = "500"; - break; - case GK_SM52: - CUDAArchCode = "520"; - break; - case GK_SM53: - CUDAArchCode = "530"; - break; - default: - llvm_unreachable("Unhandled target CPU"); - } + std::string CUDAArchCode = [this] { + switch (GPU) { + case GK_NONE: + assert(false && "No GPU arch when compiling CUDA device code."); + return ""; + case GK_SM20: + return "200"; + case GK_SM21: + return "210"; + case GK_SM30: + return "300"; + case GK_SM32: + return "320"; + case GK_SM35: + return "350"; + case GK_SM37: + return "370"; + case GK_SM50: + return "500"; + case GK_SM52: + return "520"; + case GK_SM53: + return "530"; + case GK_SM60: + return "600"; + case GK_SM61: + return "610"; + case GK_SM62: + return "620"; + } + }(); Builder.defineMacro("__CUDA_ARCH__", CUDAArchCode); } } @@ -1853,11 +1859,15 @@ .Case("sm_20", GK_SM20) .Case("sm_21", GK_SM21) .Case("sm_30", GK_SM30) + .Case("sm_32", GK_SM32) .Case("sm_35", GK_SM35) .Case("sm_37", GK_SM37) .Case("sm_50", GK_SM50) .Case("sm_52", GK_SM52) .Case("sm_53", GK_SM53) + .Case("sm_60", GK_SM60) + .Case("sm_61", GK_SM61) + .Case("sm_62", GK_SM62) .Default(GK_NONE); return GPU != GK_NONE; Index: lib/Driver/Action.cpp =================================================================== --- lib/Driver/Action.cpp +++ lib/Driver/Action.cpp @@ -66,6 +66,9 @@ .Case("sm_50", "compute_50") .Case("sm_52", "compute_52") .Case("sm_53", "compute_53") + .Case("sm_60", "compute_60") + .Case("sm_61", "compute_61") + .Case("sm_62", "compute_62") .Default(nullptr); } Index: lib/Driver/ToolChains.cpp =================================================================== --- lib/Driver/ToolChains.cpp +++ lib/Driver/ToolChains.cpp @@ -1712,6 +1712,7 @@ Args.getLastArgValue(options::OPT_cuda_path_EQ)); else { CudaPathCandidates.push_back(D.SysRoot + "/usr/local/cuda"); + CudaPathCandidates.push_back(D.SysRoot + "/usr/local/cuda-8.0"); CudaPathCandidates.push_back(D.SysRoot + "/usr/local/cuda-7.5"); CudaPathCandidates.push_back(D.SysRoot + "/usr/local/cuda-7.0"); } @@ -1758,6 +1759,9 @@ CudaLibDeviceMap["sm_50"] = FilePath; CudaLibDeviceMap["sm_52"] = FilePath; CudaLibDeviceMap["sm_53"] = FilePath; + CudaLibDeviceMap["sm_60"] = FilePath; + CudaLibDeviceMap["sm_61"] = FilePath; + CudaLibDeviceMap["sm_62"] = FilePath; } }