1 //===--- Cuda.h - Utilities for compiling CUDA code ------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_CLANG_BASIC_CUDA_H
11 #define LLVM_CLANG_BASIC_CUDA_H
19 enum class CudaVersion {
27 const char *CudaVersionToString(CudaVersion V);
29 // No string -> CudaVersion conversion function because there's no canonical
30 // spelling of the various CUDA versions.
48 const char *CudaArchToString(CudaArch A);
50 // The input should have the form "sm_20".
51 CudaArch StringToCudaArch(llvm::StringRef S);
53 enum class CudaVirtualArch {
68 const char *CudaVirtualArchToString(CudaVirtualArch A);
70 // The input should have the form "compute_20".
71 CudaVirtualArch StringToCudaVirtualArch(llvm::StringRef S);
73 /// Get the compute_xx corresponding to an sm_yy.
74 CudaVirtualArch VirtualArchForCudaArch(CudaArch A);
76 /// Get the earliest CudaVersion that supports the given CudaArch.
77 CudaVersion MinVersionForCudaArch(CudaArch A);
79 /// Get the latest CudaVersion that supports the given CudaArch.
80 CudaVersion MaxVersionForCudaArch(CudaArch A);