MLIR  16.0.0git
Classes | Macros | Functions
SPIRVTypes.cpp File Reference
#include "mlir/Dialect/SPIRV/IR/SPIRVTypes.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h"
#include "mlir/IR/Attributes.h"
#include "mlir/IR/BuiltinTypes.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/TypeSwitch.h"
#include <iterator>
+ Include dependency graph for SPIRVTypes.cpp:

Go to the source code of this file.

Classes

struct  mlir::spirv::detail::ArrayTypeStorage
 
struct  mlir::spirv::detail::CooperativeMatrixTypeStorage
 
struct  mlir::spirv::detail::JointMatrixTypeStorage
 
struct  mlir::spirv::detail::ImageTypeStorage
 
struct  mlir::spirv::detail::PointerTypeStorage
 
struct  mlir::spirv::detail::RuntimeArrayTypeStorage
 
struct  mlir::spirv::detail::SampledImageTypeStorage
 
struct  mlir::spirv::detail::StructTypeStorage
 Type storage for SPIR-V structure types: More...
 
struct  mlir::spirv::detail::MatrixTypeStorage
 

Macros

#define STORAGE_CASE(storage, cap8, cap16)
 
#define WIDTH_CASE(type, width)
 

Functions

template<typename T >
static constexpr unsigned getNumBits ()
 
template<>
constexpr unsigned getNumBits< Dim > ()
 
template<>
constexpr unsigned getNumBits< ImageDepthInfo > ()
 
template<>
constexpr unsigned getNumBits< ImageArrayedInfo > ()
 
template<>
constexpr unsigned getNumBits< ImageSamplingInfo > ()
 
template<>
constexpr unsigned getNumBits< ImageSamplerUseInfo > ()
 
template<>
constexpr unsigned getNumBits< ImageFormat > ()
 

Macro Definition Documentation

◆ STORAGE_CASE

#define STORAGE_CASE (   storage,
  cap8,
  cap16 
)
Value:
case StorageClass::storage: { \
if (bitwidth == 8) { \
static const Capability caps[] = {Capability::cap8}; \
ArrayRef<Capability> ref(caps, std::size(caps)); \
capabilities.push_back(ref); \
return; \
} \
if (bitwidth == 16) { \
static const Capability caps[] = {Capability::cap16}; \
ArrayRef<Capability> ref(caps, std::size(caps)); \
capabilities.push_back(ref); \
return; \
} \
/* For 64-bit integers/floats, Int64/Float64 enables support for all */ \
/* storage classes. Fall through to the next section. */ \
} break

◆ WIDTH_CASE

#define WIDTH_CASE (   type,
  width 
)
Value:
case width: { \
static const Capability caps[] = {Capability::type##width}; \
ArrayRef<Capability> ref(caps, std::size(caps)); \
capabilities.push_back(ref); \
} break

Function Documentation

◆ getNumBits()

template<typename T >
static constexpr unsigned getNumBits ( )
staticconstexpr

Definition at line 339 of file SPIRVTypes.cpp.

◆ getNumBits< Dim >()

template<>
constexpr unsigned getNumBits< Dim > ( )
constexpr

Definition at line 343 of file SPIRVTypes.cpp.

◆ getNumBits< ImageArrayedInfo >()

template<>
constexpr unsigned getNumBits< ImageArrayedInfo > ( )
constexpr

Definition at line 355 of file SPIRVTypes.cpp.

◆ getNumBits< ImageDepthInfo >()

template<>
constexpr unsigned getNumBits< ImageDepthInfo > ( )
constexpr

Definition at line 349 of file SPIRVTypes.cpp.

◆ getNumBits< ImageFormat >()

template<>
constexpr unsigned getNumBits< ImageFormat > ( )
constexpr

Definition at line 373 of file SPIRVTypes.cpp.

◆ getNumBits< ImageSamplerUseInfo >()

template<>
constexpr unsigned getNumBits< ImageSamplerUseInfo > ( )
constexpr

Definition at line 367 of file SPIRVTypes.cpp.

◆ getNumBits< ImageSamplingInfo >()

template<>
constexpr unsigned getNumBits< ImageSamplingInfo > ( )
constexpr

Definition at line 361 of file SPIRVTypes.cpp.