MLIR
20.0.0git
include
mlir
Target
SPIRV
Serialization.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 point for serializing SPIR-V binary modules.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#ifndef MLIR_TARGET_SPIRV_SERIALIZATION_H
14
#define MLIR_TARGET_SPIRV_SERIALIZATION_H
15
16
#include "
mlir/Support/LLVM.h
"
17
18
namespace
mlir
{
19
class
MLIRContext;
20
21
namespace
spirv {
22
class
ModuleOp;
23
24
struct
SerializationOptions
{
25
/// Whether to emit `OpName` instructions for SPIR-V symbol ops.
26
bool
emitSymbolName
=
true
;
27
/// Whether to emit `OpLine` location information for SPIR-V ops.
28
bool
emitDebugInfo
=
false
;
29
};
30
31
/// Serializes the given SPIR-V `module` and writes to `binary`. On failure,
32
/// reports errors to the error handler registered with the MLIR context for
33
/// `module`.
34
LogicalResult
serialize
(ModuleOp module,
SmallVectorImpl<uint32_t>
&binary,
35
const
SerializationOptions
&
options
= {});
36
37
}
// namespace spirv
38
}
// namespace mlir
39
40
#endif
// MLIR_TARGET_SPIRV_SERIALIZATION_H
options
static llvm::ManagedStatic< PassManagerOptions > options
Definition:
PassManagerOptions.cpp:89
llvm::SmallVectorImpl
Definition:
LLVM.h:74
LLVM.h
mlir::spirv::serialize
LogicalResult serialize(ModuleOp module, SmallVectorImpl< uint32_t > &binary, const SerializationOptions &options={})
Serializes the given SPIR-V module and writes to binary.
mlir
Include the generated interface declarations.
Definition:
LocalAliasAnalysis.h:20
mlir::spirv::SerializationOptions
Definition:
Serialization.h:24
mlir::spirv::SerializationOptions::emitSymbolName
bool emitSymbolName
Whether to emit OpName instructions for SPIR-V symbol ops.
Definition:
Serialization.h:26
mlir::spirv::SerializationOptions::emitDebugInfo
bool emitDebugInfo
Whether to emit OpLine location information for SPIR-V ops.
Definition:
Serialization.h:28
Generated on Tue Nov 19 2024 04:32:20 for MLIR by
1.9.1