MLIR 24.0.0git
SPIRVEnums.h
Go to the documentation of this file.
1//===- SPIRVEnums.h - MLIR SPIR-V Enums -------------------------*- 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// This file declares the C/C++ enums from SPIR-V spec.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef MLIR_DIALECT_SPIRV_IR_SPIRVENUMS_H_
14#define MLIR_DIALECT_SPIRV_IR_SPIRVENUMS_H_
15
17#include "mlir/Support/LLVM.h"
18
19// Forward declare enum classes related to op availability. Their definitions
20// are in the TableGen'erated SPIRVEnums.h.inc and can be referenced by other
21// declarations in SPIRVEnums.h.inc.
22namespace mlir {
23namespace spirv {
24enum class Version : uint32_t;
25enum class Extension : uint32_t;
26enum class Capability : uint32_t;
27} // namespace spirv
28} // namespace mlir
29
30// Pull in all enum type definitions and utility function declarations
31#include "mlir/Dialect/SPIRV/IR/SPIRVEnums.h.inc"
32
33// Pull in all enum type availability query function declarations
34#include "mlir/Dialect/SPIRV/IR/SPIRVEnumAvailability.h.inc"
35
36namespace mlir {
37namespace spirv {
38/// Returns the implied extensions for the given version. These extensions are
39/// incorporated into the current version so they are implicitly declared when
40/// targeting the given version.
42
43/// Returns the directly implied capabilities for the given capability. These
44/// capabilities are implicitly declared by the given capability.
46/// Returns the recursively implied capabilities for the given capability. These
47/// capabilities are implicitly declared by the given capability. Compared to
48/// the above function, this function collects implied capabilities recursively:
49/// if an implicitly declared capability implicitly declares a third one, the
50/// third one will also be returned.
52
53/// Converts a SPIR-V Decoration enum value to its snake_case string
54/// representation for use in MLIR attributes.
55std::string getDecorationString(Decoration decoration);
56
57} // namespace spirv
58} // namespace mlir
59
60#endif // MLIR_DIALECT_SPIRV_IR_SPIRVENUMS_H_
ArrayRef< Extension > getImpliedExtensions(Version version)
Returns the implied extensions for the given version.
ArrayRef< Capability > getDirectImpliedCapabilities(Capability cap)
Returns the directly implied capabilities for the given capability.
SmallVector< Capability, 0 > getRecursiveImpliedCapabilities(Capability cap)
Returns the recursively implied capabilities for the given capability.
std::string getDecorationString(Decoration decoration)
Converts a SPIR-V Decoration enum value to its snake_case string representation for use in MLIR attri...
Include the generated interface declarations.