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