13 #ifndef MLIR_DIALECT_SPIRV_SPIRV_BINARY_UTILS_H_ 14 #define MLIR_DIALECT_SPIRV_SPIRV_BINARY_UTILS_H_ 34 #define GET_SPIRV_SERIALIZATION_UTILS 35 #include "mlir/Dialect/SPIRV/SPIRVSerialization.inc" 49 #endif // MLIR_DIALECT_SPIRV_SPIRV_BINARY_UTILS_H_ Definition: InferTypeOpInterface.cpp:20
constexpr unsigned kHeaderWordCount
SPIR-V binary header word count.
Definition: SPIRVBinaryUtils.h:25
uint32_t getPrefixedOpcode(uint32_t wordCount, spirv::Opcode opcode)
Returns the word-count-prefixed opcode for an SPIR-V instruction.
Definition: SPIRVBinaryUtils.cpp:47
LogicalResult encodeStringLiteralInto(SmallVectorImpl< uint32_t > &binary, StringRef literal)
Encodes an SPIR-V literal string into the given binary vector.
Definition: SPIRVBinaryUtils.cpp:52
constexpr uint32_t kMagicNumber
SPIR-V magic number.
Definition: SPIRVBinaryUtils.h:28
constexpr uint32_t kGeneratorNumber
The serializer tool ID registered to the Khronos Group.
Definition: SPIRVBinaryUtils.h:31
void appendModuleHeader(SmallVectorImpl< uint32_t > &header, uint32_t idBound)
Appends a SPRI-V module header to header with the given idBound.
Definition: SPIRVBinaryUtils.cpp:17