MLIR  16.0.0git
Deserialization.cpp
Go to the documentation of this file.
1 //===- Deserialization.cpp - MLIR SPIR-V Deserialization ------------------===//
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 
10 
11 #include "Deserializer.h"
12 
13 using namespace mlir;
14 
16  MLIRContext *context) {
17  Deserializer deserializer(binary, context);
18 
19  if (failed(deserializer.deserialize()))
20  return nullptr;
21 
22  return deserializer.collect();
23 }
Include the generated interface declarations.
OwningOpRef< spirv::ModuleOp > deserialize(ArrayRef< uint32_t > binary, MLIRContext *context)
Deserializes the given SPIR-V binary module and creates a MLIR ModuleOp in the given context...
LogicalResult deserialize()
Deserializes the remembered SPIR-V binary module.
bool failed(LogicalResult result)
Utility function that returns true if the provided LogicalResult corresponds to a failure value...
Definition: LogicalResult.h:72
OwningOpRef< spirv::ModuleOp > collect()
Collects the final SPIR-V ModuleOp.
MLIRContext is the top-level object for a collection of MLIR operations.
Definition: MLIRContext.h:56
A SPIR-V module serializer.
Definition: Deserializer.h:119