clang 23.0.0git
OffloadArch.h
Go to the documentation of this file.
1//===--- OffloadArch.h - Definition of offloading architectures --- 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_OFFLOADARCH_H
10#define LLVM_CLANG_BASIC_OFFLOADARCH_H
11
12namespace llvm {
13class StringRef;
14class Triple;
15} // namespace llvm
16
17namespace clang {
18
19enum class OffloadArch {
22 // TODO: Deprecate and remove GPU architectures older than sm_52.
26 // This has a name conflict with sys/mac.h on AIX, rename it as a workaround.
115 Generic, // A processor model named 'generic' if the target backend defines a
116 // public one.
117 // Intel CPUs
119 // Intel GPUs
122
125};
126
127static inline bool IsNVIDIAOffloadArch(OffloadArch A) {
128 return A >= OffloadArch::SM_20 && A < OffloadArch::GFX600;
129}
130
131static inline bool IsAMDOffloadArch(OffloadArch A) {
132 // Generic processor model is for testing only.
133 return A >= OffloadArch::GFX600 && A < OffloadArch::Generic;
134}
135
139
143
147
148const char *OffloadArchToString(OffloadArch A);
149const char *OffloadArchToVirtualArchString(OffloadArch A);
150
151// Convert a string to an OffloadArch enum value. Returns
152// OffloadArch::Unknown if the string is not recognized.
153OffloadArch StringToOffloadArch(llvm::StringRef S);
154
155llvm::StringRef OffloadArchToTriple(const llvm::Triple &DefaultToolchainTriple,
156 OffloadArch ID);
157
158} // namespace clang
159
160#endif // LLVM_CLANG_BASIC_OFFLOADARCH_H
The JSON file list parser is used to communicate input to InstallAPI.
static bool IsIntelOffloadArch(OffloadArch Arch)
static bool IsIntelCPUOffloadArch(OffloadArch Arch)
static bool IsAMDOffloadArch(OffloadArch A)
llvm::StringRef OffloadArchToTriple(const llvm::Triple &DefaultToolchainTriple, OffloadArch ID)
static bool IsNVIDIAOffloadArch(OffloadArch A)
const char * OffloadArchToVirtualArchString(OffloadArch A)
OffloadArch StringToOffloadArch(llvm::StringRef S)
const char * OffloadArchToString(OffloadArch A)
static bool IsIntelGPUOffloadArch(OffloadArch Arch)
@ Generic
not a target-specific vector type
Definition TypeBase.h:4186
Diagnostic wrappers for TextAPI types for error reporting.
Definition Dominators.h:30