| 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 | |
| 9 | #include "mlir/Target/SPIRV/Deserialization.h" |
| 10 | |
| 11 | #include "Deserializer.h" |
| 12 | |
| 13 | using namespace mlir; |
| 14 | |
| 15 | OwningOpRef<spirv::ModuleOp> |
| 16 | spirv::deserialize(ArrayRef<uint32_t> binary, MLIRContext *context, |
| 17 | const DeserializationOptions &options) { |
| 18 | Deserializer deserializer(binary, context, options); |
| 19 | |
| 20 | if (failed(Result: deserializer.deserialize())) |
| 21 | return nullptr; |
| 22 | |
| 23 | return deserializer.collect(); |
| 24 | } |
| 25 |
