clang  3.9.0
Cuda.h
Go to the documentation of this file.
1 //===--- Cuda.h - Utilities for compiling CUDA code ------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_CLANG_BASIC_CUDA_H
11 #define LLVM_CLANG_BASIC_CUDA_H
12 
13 namespace llvm {
14 class StringRef;
15 } // namespace llvm
16 
17 namespace clang {
18 
19 enum class CudaVersion {
20  UNKNOWN,
21  CUDA_70,
22  CUDA_75,
23  CUDA_80,
24 };
25 const char *CudaVersionToString(CudaVersion V);
26 
27 // No string -> CudaVersion conversion function because there's no canonical
28 // spelling of the various CUDA versions.
29 
30 enum class CudaArch {
31  UNKNOWN,
32  SM_20,
33  SM_21,
34  SM_30,
35  SM_32,
36  SM_35,
37  SM_37,
38  SM_50,
39  SM_52,
40  SM_53,
41  SM_60,
42  SM_61,
43  SM_62,
44 };
45 const char *CudaArchToString(CudaArch A);
46 
47 // The input should have the form "sm_20".
48 CudaArch StringToCudaArch(llvm::StringRef S);
49 
50 enum class CudaVirtualArch {
51  UNKNOWN,
52  COMPUTE_20,
53  COMPUTE_30,
54  COMPUTE_32,
55  COMPUTE_35,
56  COMPUTE_37,
57  COMPUTE_50,
58  COMPUTE_52,
59  COMPUTE_53,
60  COMPUTE_60,
61  COMPUTE_61,
62  COMPUTE_62,
63 };
65 
66 // The input should have the form "compute_20".
68 
69 /// Get the compute_xx corresponding to an sm_yy.
71 
72 /// Get the earliest CudaVersion that supports the given CudaArch.
74 
75 } // namespace clang
76 
77 #endif
CudaVirtualArch StringToCudaVirtualArch(llvm::StringRef S)
Definition: Cuda.cpp:102
CudaArch
Definition: Cuda.h:30
const char * CudaArchToString(CudaArch A)
Definition: Cuda.cpp:23
CudaArch StringToCudaArch(llvm::StringRef S)
Definition: Cuda.cpp:55
const char * CudaVersionToString(CudaVersion V)
Definition: Cuda.cpp:9
const char * CudaVirtualArchToString(CudaVirtualArch A)
Definition: Cuda.cpp:72
CudaVersion
Definition: Cuda.h:19
CudaVirtualArch
Definition: Cuda.h:50
CudaVersion MinVersionForCudaArch(CudaArch A)
Get the earliest CudaVersion that supports the given CudaArch.
Definition: Cuda.cpp:149
CudaVirtualArch VirtualArchForCudaArch(CudaArch A)
Get the compute_xx corresponding to an sm_yy.
Definition: Cuda.cpp:118