api_codegen.cc 709 Bytes
Newer Older
1 2 3 4 5 6 7 8
/*!
 *  Copyright (c) 2016 by Contributors
 *  Implementation of API functions related to Codegen
 * \file c_api_codegen.cc
 */
#include <tvm/expr.h>
#include <tvm/ir.h>
#include <tvm/codegen.h>
9
#include <tvm/lowered_func.h>
10 11 12 13 14
#include <tvm/api_registry.h>

namespace tvm {
namespace codegen {

15
TVM_REGISTER_API("codegen._Build")
16
.set_body([](TVMArgs args, TVMRetValue *ret) {
17 18
    if (args[0].IsNodeType<LoweredFunc>()) {
      *ret = Build({args[0]}, args[1]);
19
    } else {
20
      *ret = Build(args[0], args[1]);
21
    }
22
  });
23 24 25

TVM_REGISTER_API("module._PackImportsToC")
.set_body([](TVMArgs args, TVMRetValue *ret) {
26
    *ret = PackImportsToC(args[0], args[1]);
27
  });
28 29
}  // namespace codegen
}  // namespace tvm