"vscode:/vscode.git/clone" did not exist on "899cf5c4389b83fc7d913bf23ce07282d09ffb91"
cuda_to_block.h 1.18 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*!
 *  Copyright (c) 2020 by Contributors
 * \file graph/transform/cuda_to_block.h
 * \brief Functions to convert a set of edges into a graph block with local
 * ids.
 */


#ifndef DGL_GRAPH_TRANSFORM_CUDA_CUDA_TO_BLOCK_H_
#define DGL_GRAPH_TRANSFORM_CUDA_CUDA_TO_BLOCK_H_

#include <dgl/array.h>
#include <dgl/base_heterograph.h>
#include <vector>
#include <tuple>

namespace dgl {
namespace transform {
namespace cuda {

/**
 * @brief Generate a subgraph with locally numbered vertices, from the given
 * edge set.
 *
 * @param graph The set of edges to construct the subgraph from.
 * @param rhs_nodes The unique set of destination vertices.
 * @param include_rhs_in_lhs Whether or not to include the `rhs_nodes` in the
 * set of source vertices for purposes of local numbering.
 *
 * @return The subgraph, the unique set of source nodes, and the mapping of
 * subgraph edges to global edges.
 */
std::tuple<HeteroGraphPtr, std::vector<IdArray>, std::vector<IdArray>>
CudaToBlock(
    HeteroGraphPtr graph,
    const std::vector<IdArray>& rhs_nodes,
    const bool include_rhs_in_lhs);

}  // namespace cuda
}  // namespace transform
}  // namespace dgl

#endif  // DGL_GRAPH_TRANSFORM_CUDA_CUDA_TO_BLOCK_H_