]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/clang/include/clang/Basic/Cuda.h
Merge clang trunk r321017 to contrib/llvm/tools/clang.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / clang / include / clang / Basic / Cuda.h
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 };
68 const char *CudaVirtualArchToString(CudaVirtualArch A);
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.
74 CudaVirtualArch VirtualArchForCudaArch(CudaArch A);
75
76 /// Get the earliest CudaVersion that supports the given CudaArch.
77 CudaVersion MinVersionForCudaArch(CudaArch A);
78
79 /// Get the latest CudaVersion that supports the given CudaArch.
80 CudaVersion MaxVersionForCudaArch(CudaArch A);
81
82 } // namespace clang
83
84 #endif