"vscode:/vscode.git/clone" did not exist on "ee570b668403e855c3be1221ce90e8fe5359951e"
c_api_common.h 804 Bytes
Newer Older
1
2
3
4
5
/*!
 *  Copyright (c) 2018 by Contributors
 * \file c_api_common.h
 * \brief DGL C API common util functions
 */
Lingfan Yu's avatar
Lingfan Yu committed
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef DGL_C_API_COMMON_H_
#define DGL_C_API_COMMON_H_

#include <dgl/runtime/ndarray.h>
#include <dgl/runtime/packed_func.h>
#include <dgl/runtime/registry.h>
#include <vector>

namespace dgl {

// Graph handler type
typedef void* GraphHandle;

19
20
21
22
23
24
25
/*!
 * \brief Convert the given DLTensor to DLManagedTensor.
 *
 * Return a temporary DLManagedTensor that does not own memory.
 */
DLManagedTensor* CreateTmpDLManagedTensor(
    const tvm::runtime::TVMArgValue& arg);
Lingfan Yu's avatar
Lingfan Yu committed
26

27
28
29
30
31
/*!
 * \brief Convert a vector of NDArray to PackedFunc.
 */
tvm::runtime::PackedFunc ConvertNDArrayVectorToPackedFunc(
    const std::vector<tvm::runtime::NDArray>& vec);
Lingfan Yu's avatar
Lingfan Yu committed
32

33
}  // namespace dgl
Lingfan Yu's avatar
Lingfan Yu committed
34

35
#endif  // DGL_C_API_COMMON_H_