-
Notifications
You must be signed in to change notification settings - Fork 313
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
341 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
python/pylibcugraph/pylibcugraph/components/_connectivity.pxd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Copyright (c) 2019-2021, NVIDIA CORPORATION. | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# cython: profile=False | ||
# distutils: language = c++ | ||
# cython: embedsignature = True | ||
# cython: language_level = 3 | ||
|
||
from pylibcugraph.structure.graph_primtypes cimport * | ||
from pylibcugraph.structure.graph_utilities cimport * | ||
|
||
|
||
cdef extern from "cugraph/algorithms.hpp" namespace "cugraph": | ||
|
||
ctypedef enum cugraph_cc_t: | ||
CUGRAPH_WEAK "cugraph::cugraph_cc_t::CUGRAPH_WEAK" | ||
CUGRAPH_STRONG "cugraph::cugraph_cc_t::CUGRAPH_STRONG" | ||
NUM_CONNECTIVITY_TYPES "cugraph::cugraph_cc_t::NUM_CONNECTIVITY_TYPES" | ||
|
||
cdef void connected_components[VT,ET,WT]( | ||
const GraphCSRView[VT,ET,WT] &graph, | ||
cugraph_cc_t connect_type, | ||
VT *labels) except + | ||
|
||
cdef extern from "cugraph/utilities/cython.hpp" namespace "cugraph::cython": | ||
cdef void call_wcc[vertex_t, weight_t]( | ||
const handle_t &handle, | ||
const graph_container_t &g, | ||
vertex_t *identifiers) except + | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
81 changes: 81 additions & 0 deletions
81
python/pylibcugraph/pylibcugraph/structure/graph_primtypes.pxd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Copyright (c) 2021, NVIDIA CORPORATION. | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# cython: profile=False | ||
# distutils: language = c++ | ||
# cython: embedsignature = True | ||
# cython: language_level = 3 | ||
|
||
from libcpp cimport bool | ||
from pylibcugraph.raft.common.handle cimport * | ||
|
||
cdef extern from "cugraph/legacy/graph.hpp" namespace "cugraph::legacy": | ||
|
||
ctypedef enum PropType: | ||
PROP_UNDEF "cugraph::legacy::PROP_UNDEF" | ||
PROP_FALSE "cugraph::legacy::PROP_FALSE" | ||
PROP_TRUE "cugraph::legacy::PROP_TRUE" | ||
|
||
ctypedef enum DegreeDirection: | ||
DIRECTION_IN_PLUS_OUT "cugraph::legacy::DegreeDirection::IN_PLUS_OUT" | ||
DIRECTION_IN "cugraph::legacy::DegreeDirection::IN" | ||
DIRECTION_OUT "cugraph::legacy::DegreeDirection::OUT" | ||
|
||
struct GraphProperties: | ||
bool directed | ||
bool weighted | ||
bool multigraph | ||
bool bipartite | ||
bool tree | ||
PropType has_negative_edges | ||
|
||
cdef cppclass GraphViewBase[VT,ET,WT]: | ||
WT *edge_data | ||
handle_t *handle; | ||
GraphProperties prop | ||
VT number_of_vertices | ||
ET number_of_edges | ||
VT* local_vertices | ||
ET* local_edges | ||
VT* local_offsets | ||
void set_handle(handle_t*) | ||
void set_local_data(VT* local_vertices_, ET* local_edges_, VT* local_offsets_) | ||
void get_vertex_identifiers(VT *) const | ||
|
||
GraphViewBase(WT*,VT,ET) | ||
|
||
cdef cppclass GraphCOOView[VT,ET,WT](GraphViewBase[VT,ET,WT]): | ||
VT *src_indices | ||
VT *dst_indices | ||
|
||
void degree(ET *,DegreeDirection) const | ||
|
||
GraphCOOView() | ||
GraphCOOView(const VT *, const ET *, const WT *, size_t, size_t) | ||
|
||
cdef cppclass GraphCompressedSparseBaseView[VT,ET,WT](GraphViewBase[VT,ET,WT]): | ||
ET *offsets | ||
VT *indices | ||
|
||
void get_source_indices(VT *) const | ||
void degree(ET *,DegreeDirection) const | ||
|
||
GraphCompressedSparseBaseView(const VT *, const ET *, const WT *, size_t, size_t) | ||
|
||
cdef cppclass GraphCSRView[VT,ET,WT](GraphCompressedSparseBaseView[VT,ET,WT]): | ||
GraphCSRView() | ||
GraphCSRView(const VT *, const ET *, const WT *, size_t, size_t) | ||
|
||
cdef cppclass GraphCSCView[VT,ET,WT](GraphCompressedSparseBaseView[VT,ET,WT]): | ||
GraphCSCView() | ||
GraphCSCView(const VT *, const ET *, const WT *, size_t, size_t) |
53 changes: 53 additions & 0 deletions
53
python/pylibcugraph/pylibcugraph/structure/graph_utilities.pxd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Copyright (c) 2021, NVIDIA CORPORATION. | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# cython: profile=False | ||
# distutils: language = c++ | ||
# cython: embedsignature = True | ||
# cython: language_level = 3 | ||
|
||
|
||
from pylibcugraph.raft.common.handle cimport * | ||
from libcpp cimport bool | ||
|
||
|
||
cdef extern from "cugraph/utilities/cython.hpp" namespace "cugraph::cython": | ||
|
||
ctypedef enum numberTypeEnum: | ||
int32Type "cugraph::cython::numberTypeEnum::int32Type" | ||
int64Type "cugraph::cython::numberTypeEnum::int64Type" | ||
floatType "cugraph::cython::numberTypeEnum::floatType" | ||
doubleType "cugraph::cython::numberTypeEnum::doubleType" | ||
|
||
cdef cppclass graph_container_t: | ||
pass | ||
|
||
cdef void populate_graph_container( | ||
graph_container_t &graph_container, | ||
handle_t &handle, | ||
void *src_vertices, | ||
void *dst_vertices, | ||
void *weights, | ||
void *vertex_partition_offsets, | ||
void *segment_offsets, | ||
size_t num_segments, | ||
numberTypeEnum vertexType, | ||
numberTypeEnum edgeType, | ||
numberTypeEnum weightType, | ||
size_t num_local_edges, | ||
size_t num_global_vertices, | ||
size_t num_global_edges, | ||
bool is_weighted, | ||
bool is_symmetric, | ||
bool transposed, | ||
bool multi_gpu) except + |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.