clang 22.0.0git
Cuda.h
Go to the documentation of this file.
1//===--- Cuda.h - Utilities for compiling CUDA code ------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_CLANG_BASIC_CUDA_H
10#define LLVM_CLANG_BASIC_CUDA_H
11
13
14namespace llvm {
15class StringRef;
16class Twine;
17class VersionTuple;
18} // namespace llvm
19
20namespace clang {
21
22enum class CudaVersion {
23 UNKNOWN,
24 CUDA_70,
25 CUDA_75,
26 CUDA_80,
27 CUDA_90,
28 CUDA_91,
29 CUDA_92,
53 CUDA_129, // Partially supported. Proceed with a warning.
54 NEW = 10000, // Too new. Issue a warning, but allow using it.
55};
57// Input is "Major.Minor"
58CudaVersion CudaStringToVersion(const llvm::Twine &S);
59
61 Device,
62 Global,
63 Host,
66};
67
68/// Get the earliest CudaVersion that supports the given OffloadArch.
70
71/// Get the latest CudaVersion that supports the given OffloadArch.
73
74// Various SDK-dependent features that affect CUDA compilation
75enum class CudaFeature {
76 // CUDA-9.2+ uses a new API for launching kernels.
78 // CUDA-10.1+ needs explicit end of GPU binary registration.
80};
81
82CudaVersion ToCudaVersion(llvm::VersionTuple);
83bool CudaFeatureEnabled(llvm::VersionTuple, CudaFeature);
85
86} // namespace clang
87
88#endif
#define V(N, I)
Definition: ASTContext.h:3597
The JSON file list parser is used to communicate input to InstallAPI.
CudaVersion MaxVersionForOffloadArch(OffloadArch A)
Get the latest CudaVersion that supports the given OffloadArch.
Definition: Cuda.cpp:133
CUDAFunctionTarget
Definition: Cuda.h:60
OffloadArch
Definition: OffloadArch.h:18
CudaVersion ToCudaVersion(llvm::VersionTuple)
Definition: Cuda.cpp:69
CudaVersion CudaStringToVersion(const llvm::Twine &S)
Definition: Cuda.cpp:61
bool CudaFeatureEnabled(llvm::VersionTuple, CudaFeature)
Definition: Cuda.cpp:155
const char * CudaVersionToString(CudaVersion V)
Definition: Cuda.cpp:53
CudaVersion
Definition: Cuda.h:22
CudaFeature
Definition: Cuda.h:75
CudaVersion MinVersionForOffloadArch(OffloadArch A)
Get the earliest CudaVersion that supports the given OffloadArch.
Definition: Cuda.cpp:76
Diagnostic wrappers for TextAPI types for error reporting.
Definition: Dominators.h:30