MLCompilerBridge
Tools for streamlining communication with ML models for compiler optimizations.
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Enumerations
baseSerDes.h File Reference

Supporting new SerDes: More...

#include "MLModelRunner/Utils/Debug.h"
#include "google/protobuf/extension_set.h"
#include "google/protobuf/message.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <map>
#include <string>
#include <vector>
Include dependency graph for baseSerDes.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  MLBridge::BaseSerDes
 

Namespaces

namespace  MLBridge
 

Macros

#define SUPPORTED_TYPES(M)
 
#define SET_FEATURE(TYPE, _)
 setFeature() is used to set the features of the data structure used for communication.
 

Enumerations

enum class  MLBridge::SerDesKind : int {
  MLBridge::Unknown , MLBridge::Json , MLBridge::Bitstream , MLBridge::Protobuf ,
  MLBridge::Tensorflow
}
 This is the base class for SerDes. More...
 

Detailed Description

Supporting new SerDes:

  1. Create a new class which inherits from BaseSerDes.
  2. Implement the setFeature(), getSerializedData(), cleanDataStructures() and deserializeUntyped() methods.
  3. Add the new SerDes to the enum class SerDesKind in this class.

Definition in file baseSerDes.h.

Macro Definition Documentation

◆ SET_FEATURE

#define SET_FEATURE ( TYPE,
_ )
Value:
virtual void setFeature(const std::string &, const TYPE) = 0; \
virtual void setFeature(const std::string &, const std::vector<TYPE> &){};

setFeature() is used to set the features of the data structure used for communication.

The features are set as key-value pairs. The key is a string and the value can be any of the supported types.

Definition at line 54 of file baseSerDes.h.

◆ SUPPORTED_TYPES

#define SUPPORTED_TYPES ( M)
Value:
M(int, int) \
M(long, long) \
M(float, float) \
M(double, double) \
M(std::string, string) \
M(bool, bool)

Definition at line 32 of file baseSerDes.h.