MLIR  20.0.0git
Deserialization.h
Go to the documentation of this file.
1 //===- Serialization.h - MLIR SPIR-V (De)serialization ----------*- 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 entry points for deserializing SPIR-V binary modules.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef MLIR_TARGET_SPIRV_DESERIALIZATION_H
14 #define MLIR_TARGET_SPIRV_DESERIALIZATION_H
15 
16 #include "mlir/IR/OwningOpRef.h"
17 #include "mlir/Support/LLVM.h"
18 
19 namespace mlir {
20 class MLIRContext;
21 
22 namespace spirv {
23 class ModuleOp;
24 
25 /// Deserializes the given SPIR-V `binary` module and creates a MLIR ModuleOp
26 /// in the given `context`. Returns the ModuleOp on success; otherwise, reports
27 /// errors to the error handler registered with `context` and returns a null
28 /// module.
29 OwningOpRef<spirv::ModuleOp> deserialize(ArrayRef<uint32_t> binary,
30  MLIRContext *context);
31 
32 } // namespace spirv
33 } // namespace mlir
34 
35 #endif // MLIR_TARGET_SPIRV_DESERIALIZATION_H
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.
Include the generated interface declarations.