Program Listing for File model_parser_registry.h
↰ Return to documentation for file (include/model_parser_registry.h
)
#ifndef MINDSPORE_LITE_INCLUDE_REGISTRY_MODEL_PARSER_REGISTRY_H
#define MINDSPORE_LITE_INCLUDE_REGISTRY_MODEL_PARSER_REGISTRY_H
#include <memory>
#include "include/lite_utils.h"
#include "include/registry/converter_context.h"
using mindspore::converter::FmkType;
namespace mindspore {
namespace converter {
class ModelParser;
} // namespace converter
namespace registry {
typedef converter::ModelParser *(*ModelParserCreator)();
class ModelParserRegistry {
public:
ModelParserRegistry(FmkType fmk, ModelParserCreator creator);
~ModelParserRegistry() = default;
static converter::ModelParser *GetModelParser(FmkType fmk);
};
#define REG_MODEL_PARSER(fmk, parserCreator) \
static mindspore::registry::ModelParserRegistry g_##type##fmk##ModelParserReg(fmk, parserCreator);
} // namespace registry
} // namespace mindspore
#endif // MINDSPORE_LITE_INCLUDE_REGISTRY_MODEL_PARSER_REGISTRY_H