clang  8.0.0svn
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  CUDA_90,
25  CUDA_91,
26  CUDA_92,
27  CUDA_100,
28  LATEST = CUDA_100,
29 };
30 const char *CudaVersionToString(CudaVersion V);
31 
32 // No string -> CudaVersion conversion function because there's no canonical
33 // spelling of the various CUDA versions.
34 
35 enum class CudaArch {
36  UNKNOWN,
37  SM_20,
38  SM_21,
39  SM_30,
40  SM_32,
41  SM_35,
42  SM_37,
43  SM_50,
44  SM_52,
45  SM_53,
46  SM_60,
47  SM_61,
48  SM_62,
49  SM_70,
50  SM_72,
51  SM_75,
52  GFX600,
53  GFX601,
54  GFX700,
55  GFX701,
56  GFX702,
57  GFX703,
58  GFX704,
59  GFX801,
60  GFX802,
61  GFX803,
62  GFX810,
63  GFX900,
64  GFX902,
65  GFX904,
66  GFX906,
67  GFX909,
68  LAST,
69 };
70 const char *CudaArchToString(CudaArch A);
71 
72 // The input should have the form "sm_20".
73 CudaArch StringToCudaArch(llvm::StringRef S);
74 
75 enum class CudaVirtualArch {
76  UNKNOWN,
77  COMPUTE_20,
78  COMPUTE_30,
79  COMPUTE_32,
80  COMPUTE_35,
81  COMPUTE_37,
82  COMPUTE_50,
83  COMPUTE_52,
84  COMPUTE_53,
85  COMPUTE_60,
86  COMPUTE_61,
87  COMPUTE_62,
88  COMPUTE_70,
89  COMPUTE_72,
90  COMPUTE_75,
92 };
94 
95 // The input should have the form "compute_20".
96 CudaVirtualArch StringToCudaVirtualArch(llvm::StringRef S);
97 
98 /// Get the compute_xx corresponding to an sm_yy.
100 
101 /// Get the earliest CudaVersion that supports the given CudaArch.
103 
104 /// Get the latest CudaVersion that supports the given CudaArch.
106 
107 } // namespace clang
108 
109 #endif
CudaVirtualArch StringToCudaVirtualArch(llvm::StringRef S)
Definition: Cuda.cpp:177
CudaArch
Definition: Cuda.h:35
const char * CudaArchToString(CudaArch A)
Definition: Cuda.cpp:31
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
Definition: Dominators.h:30
CudaArch StringToCudaArch(llvm::StringRef S)
Definition: Cuda.cpp:103
const char * CudaVersionToString(CudaVersion V)
Definition: Cuda.cpp:9
const char * CudaVirtualArchToString(CudaVirtualArch A)
Definition: Cuda.cpp:139
CudaVersion MaxVersionForCudaArch(CudaArch A)
Get the latest CudaVersion that supports the given CudaArch.
Definition: Cuda.cpp:300
CudaVersion
Definition: Cuda.h:19
CudaVirtualArch
Definition: Cuda.h:75
CudaVersion MinVersionForCudaArch(CudaArch A)
Get the earliest CudaVersion that supports the given CudaArch.
Definition: Cuda.cpp:253
Dataflow Directional Tag Classes.
CudaVirtualArch VirtualArchForCudaArch(CudaArch A)
Get the compute_xx corresponding to an sm_yy.
Definition: Cuda.cpp:197