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 {
29 const char *CudaVersionToString(CudaVersion V);
31 // No string -> CudaVersion conversion function because there's no canonical
32 // spelling of the various CUDA versions.
65 const char *CudaArchToString(CudaArch A);
67 // The input should have the form "sm_20".
68 CudaArch StringToCudaArch(llvm::StringRef S);
70 enum class CudaVirtualArch {
87 const char *CudaVirtualArchToString(CudaVirtualArch A);
89 // The input should have the form "compute_20".
90 CudaVirtualArch StringToCudaVirtualArch(llvm::StringRef S);
92 /// Get the compute_xx corresponding to an sm_yy.
93 CudaVirtualArch VirtualArchForCudaArch(CudaArch A);
95 /// Get the earliest CudaVersion that supports the given CudaArch.
96 CudaVersion MinVersionForCudaArch(CudaArch A);
98 /// Get the latest CudaVersion that supports the given CudaArch.
99 CudaVersion MaxVersionForCudaArch(CudaArch A);