MLIR  20.0.0git
Public Member Functions | List of all members
mlir::spirv::Deserializer Class Reference

A SPIR-V module serializer. More...

#include "Target/SPIRV/Deserialization/Deserializer.h"

Public Member Functions

 Deserializer (ArrayRef< uint32_t > binary, MLIRContext *context)
 Creates a deserializer for the given SPIR-V binary module. More...
 
LogicalResult deserialize ()
 Deserializes the remembered SPIR-V binary module. More...
 
OwningOpRef< spirv::ModuleOp > collect ()
 Collects the final SPIR-V ModuleOp. More...
 

Detailed Description

A SPIR-V module serializer.

A SPIR-V binary module is a single linear stream of instructions; each instruction is composed of 32-bit words. The first word of an instruction records the total number of words of that instruction using the 16 higher-order bits. So this deserializer uses that to get instruction boundary and parse instructions and build a SPIR-V ModuleOp gradually.

Definition at line 120 of file Deserializer.h.

Constructor & Destructor Documentation

◆ Deserializer()

spirv::Deserializer::Deserializer ( ArrayRef< uint32_t >  binary,
MLIRContext context 
)
explicit

Creates a deserializer for the given SPIR-V binary module.

The SPIR-V ModuleOp will be created into `context.

Definition at line 51 of file Deserializer.cpp.

Member Function Documentation

◆ collect()

OwningOpRef< spirv::ModuleOp > spirv::Deserializer::collect ( )

Collects the final SPIR-V ModuleOp.

Definition at line 101 of file Deserializer.cpp.

Referenced by mlir::spirv::deserialize().

◆ deserialize()

LogicalResult spirv::Deserializer::deserialize ( )

Deserializes the remembered SPIR-V binary module.

Definition at line 62 of file Deserializer.cpp.

Referenced by mlir::spirv::deserialize().


The documentation for this class was generated from the following files: