15#include "llvm/ADT/APFloat.h"
16#include "llvm/ADT/TypeSwitch.h"
29 val = valOr->convertToDouble();
33#include "mlir/Dialect/Quant/IR/QuantDialectBytecode.cpp.inc"
37 QuantDialectBytecodeInterface(Dialect *dialect)
38 : BytecodeDialectInterface(dialect) {}
43 Attribute readAttribute(DialectBytecodeReader &reader)
const override {
47 LogicalResult writeAttribute(Attribute attr,
48 DialectBytecodeWriter &writer)
const override {
49 return ::writeAttribute(attr, writer);
55 Type readType(DialectBytecodeReader &reader)
const override {
59 LogicalResult writeType(Type type,
60 DialectBytecodeWriter &writer)
const override {
61 return ::writeType(type, writer);
67 dialect->addInterfaces<QuantDialectBytecodeInterface>();
This class defines a virtual interface for reading a bytecode stream, providing hooks into the byteco...
virtual FailureOr< APFloat > readAPFloatWithKnownSemantics(const llvm::fltSemantics &semantics)=0
Read an APFloat that is known to have been encoded with the given semantics.
void addBytecodeInterface(QuantDialect *dialect)
Add the interfaces necessary for encoding the quantization dialect components in bytecode.
Include the generated interface declarations.