api_registry.h 636 Bytes
Newer Older
1
/*!
2
 *  Copyright (c) 2017 by Contributors
3
 * \file api_registry.h
4 5
 * \brief This files include necessary headers to
 *  be used to register an global API function.
6 7 8 9 10 11
 */
#ifndef TVM_API_REGISTRY_H_
#define TVM_API_REGISTRY_H_

#include "./base.h"
#include "./packed_func_ext.h"
12
#include "./runtime/registry.h"
13 14

/*!
15 16
 * \brief Register an API function globally.
 * It simply redirects to TVM_REGISTER_GLOBAL
17 18 19 20 21 22 23 24
 *
 * \code
 *   TVM_REGISTER_API(MyPrint)
 *   .set_body([](TVMArgs args, TVMRetValue* rv) {
 *     // my code.
 *   });
 * \endcode
 */
25 26
#define TVM_REGISTER_API(OpName) TVM_REGISTER_GLOBAL(OpName)

27
#endif  // TVM_API_REGISTRY_H_