meta_data.h 887 Bytes
Newer Older
Minjie Wang's avatar
Minjie Wang committed
1
2
3
4
5
/*!
 *  Copyright (c) 2017 by Contributors
 * \file meta_data.h
 * \brief Meta data related utilities
 */
6
7
#ifndef DGL_RUNTIME_META_DATA_H_
#define DGL_RUNTIME_META_DATA_H_
Minjie Wang's avatar
Minjie Wang committed
8
9

#include <dgl/runtime/packed_func.h>
10
11
12
#include <dmlc/io.h>
#include <dmlc/json.h>

Minjie Wang's avatar
Minjie Wang committed
13
14
#include <string>
#include <vector>
15

Minjie Wang's avatar
Minjie Wang committed
16
17
#include "runtime_base.h"

18
namespace dgl {
Minjie Wang's avatar
Minjie Wang committed
19
20
21
22
23
namespace runtime {

/*! \brief function information needed by device */
struct FunctionInfo {
  std::string name;
24
  std::vector<DGLDataType> arg_types;
Minjie Wang's avatar
Minjie Wang committed
25
26
27
28
29
30
31
32
  std::vector<std::string> thread_axis_tags;

  void Save(dmlc::JSONWriter *writer) const;
  void Load(dmlc::JSONReader *reader);
  void Save(dmlc::Stream *writer) const;
  bool Load(dmlc::Stream *reader);
};
}  // namespace runtime
33
}  // namespace dgl
Minjie Wang's avatar
Minjie Wang committed
34
35

namespace dmlc {
36
DMLC_DECLARE_TRAITS(has_saveload, ::dgl::runtime::FunctionInfo, true);
Minjie Wang's avatar
Minjie Wang committed
37
}  // namespace dmlc
38
#endif  // DGL_RUNTIME_META_DATA_H_