clang  7.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  LATEST = CUDA_91,
27 };
28 const char *CudaVersionToString(CudaVersion V);
29 
30 // No string -> CudaVersion conversion function because there's no canonical
31 // spelling of the various CUDA versions.
32 
33 enum class CudaArch {
34  UNKNOWN,
35  SM_20,
36  SM_21,
37  SM_30,
38  SM_32,
39  SM_35,
40  SM_37,
41  SM_50,
42  SM_52,
43  SM_53,
44  SM_60,
45  SM_61,
46  SM_62,
47  SM_70,
48  SM_72,
49  LAST,
50 };
51 const char *CudaArchToString(CudaArch A);
52 
53 // The input should have the form "sm_20".
54 CudaArch StringToCudaArch(llvm::StringRef S);
55 
56 enum class CudaVirtualArch {
57  UNKNOWN,
58  COMPUTE_20,
59  COMPUTE_30,
60  COMPUTE_32,
61  COMPUTE_35,
62  COMPUTE_37,
63  COMPUTE_50,
64  COMPUTE_52,
65  COMPUTE_53,
66  COMPUTE_60,
67  COMPUTE_61,
68  COMPUTE_62,
69  COMPUTE_70,
70  COMPUTE_72,
71 };
73 
74 // The input should have the form "compute_20".
75 CudaVirtualArch StringToCudaVirtualArch(llvm::StringRef S);
76 
77 /// Get the compute_xx corresponding to an sm_yy.
79 
80 /// Get the earliest CudaVersion that supports the given CudaArch.
82 
83 /// Get the latest CudaVersion that supports the given CudaArch.
85 
86 } // namespace clang
87 
88 #endif
CudaVirtualArch StringToCudaVirtualArch(llvm::StringRef S)
Definition: Cuda.cpp:118
CudaArch
Definition: Cuda.h:33
const char * CudaArchToString(CudaArch A)
Definition: Cuda.cpp:27
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
Definition: Dominators.h:26
CudaArch StringToCudaArch(llvm::StringRef S)
Definition: Cuda.cpp:65
const char * CudaVersionToString(CudaVersion V)
Definition: Cuda.cpp:9
const char * CudaVirtualArchToString(CudaVirtualArch A)
Definition: Cuda.cpp:84
CudaVersion MaxVersionForCudaArch(CudaArch A)
Get the latest CudaVersion that supports the given CudaArch.
Definition: Cuda.cpp:201
CudaVersion
Definition: Cuda.h:19
CudaVirtualArch
Definition: Cuda.h:56
CudaVersion MinVersionForCudaArch(CudaArch A)
Get the earliest CudaVersion that supports the given CudaArch.
Definition: Cuda.cpp:173
Dataflow Directional Tag Classes.
CudaVirtualArch VirtualArchForCudaArch(CudaArch A)
Get the compute_xx corresponding to an sm_yy.
Definition: Cuda.cpp:136