meta_data.h 883 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
/*!
 *  Copyright (c) 2017 by Contributors
 * \file meta_data.h
 * \brief Meta data related utilities
 */
#ifndef TVM_RUNTIME_META_DATA_H_
#define TVM_RUNTIME_META_DATA_H_

#include <dmlc/json.h>
10 11
#include <dmlc/io.h>
#include <tvm/runtime/packed_func.h>
12 13 14 15 16 17 18 19 20 21 22 23 24
#include <string>
#include <vector>
#include "./runtime_base.h"

namespace tvm {
namespace runtime {

/*! \brief function information needed by device */
struct FunctionInfo {
  std::string name;
  std::vector<TVMType> arg_types;
  std::vector<std::string> thread_axis_tags;

25 26
  void Save(dmlc::JSONWriter *writer) const;
  void Load(dmlc::JSONReader *reader);
27 28
  void Save(dmlc::Stream *writer) const;
  bool Load(dmlc::Stream *reader);
29 30 31
};
}  // namespace runtime
}  // namespace tvm
32 33 34 35

namespace dmlc {
DMLC_DECLARE_TRAITS(has_saveload, ::tvm::runtime::FunctionInfo, true);
}  // namespace dmlc
36
#endif  // TVM_RUNTIME_META_DATA_H_