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 {
25 const char *CudaVersionToString(CudaVersion V);
27 // No string -> CudaVersion conversion function because there's no canonical
28 // spelling of the various CUDA versions.
45 const char *CudaArchToString(CudaArch A);
47 // The input should have the form "sm_20".
48 CudaArch StringToCudaArch(llvm::StringRef S);
50 enum class CudaVirtualArch {
64 const char *CudaVirtualArchToString(CudaVirtualArch A);
66 // The input should have the form "compute_20".
67 CudaVirtualArch StringToCudaVirtualArch(llvm::StringRef S);
69 /// Get the compute_xx corresponding to an sm_yy.
70 CudaVirtualArch VirtualArchForCudaArch(CudaArch A);
72 /// Get the earliest CudaVersion that supports the given CudaArch.
73 CudaVersion MinVersionForCudaArch(CudaArch A);