Core types and resources#
Types and errors#
Enums
Typedefs
-
typedef enum cugraph_error_code_ cugraph_error_code_t#
-
typedef struct cugraph_error_ cugraph_error_t#
Enums
Functions
-
const char *cugraph_error_message(const cugraph_error_t *error)#
Return an error message.
- Parameters:
error – [in] The error object from some cugraph function call
- Returns:
a C-style string that provides detail for the error
-
void cugraph_error_free(cugraph_error_t *error)#
Destroy an error message.
- Parameters:
error – [in] The error object from some cugraph function call
Resource handles and arrays#
Typedefs
-
typedef struct cugraph_resource_handle_ cugraph_resource_handle_t#
Functions
- cugraph_resource_handle_t *cugraph_create_resource_handle(
- void *raft_handle
Construct a resource handle.
- Parameters:
raft_handle – [in] Handle for accessing resources If NULL, we will create a raft handle internally
- Returns:
A graph resource handle
- int cugraph_resource_handle_get_comm_size(
- const cugraph_resource_handle_t *handle
get comm_size from resource handle
If the resource handle has been configured for multi-gpu, this will return the comm_size for this cluster. If the resource handle has not been configured for multi-gpu this will always return 1.
- Parameters:
handle – [in] Handle for accessing resources
- Returns:
comm_size
- int cugraph_resource_handle_get_rank(
- const cugraph_resource_handle_t *handle
get rank from resource handle
If the resource handle has been configured for multi-gpu, this will return the rank for this worker. If the resource handle has not been configured for multi-gpu this will always return 0.
- Parameters:
handle – [in] Handle for accessing resources
- Returns:
rank
-
void cugraph_free_resource_handle(cugraph_resource_handle_t *handle)#
Free resources in the resource handle.
- Parameters:
handle – [in] Handle for accessing resources
Functions
- cugraph_error_code_t cugraph_type_erased_device_array_create(
- const cugraph_resource_handle_t *handle,
- size_t n_elems,
- cugraph_data_type_id_t dtype,
- cugraph_type_erased_device_array_t **array,
- cugraph_error_t **error
Create a type erased device array.
- Parameters:
handle – [in] Handle for accessing resources
n_elems – [in] The number of elements in the array
dtype – [in] The type of array to create
array – [out] Pointer to the location to store the pointer to the device array
error – [out] Pointer to an error object storing details of any error. Will be populated if error code is not CUGRAPH_SUCCESS
- Returns:
error code
- cugraph_error_code_t cugraph_type_erased_device_array_create_from_view(
- const cugraph_resource_handle_t *handle,
- const cugraph_type_erased_device_array_view_t *view,
- cugraph_type_erased_device_array_t **array,
- cugraph_error_t **error
Create a type erased device array from a view.
Copies the data from the view into the new device array
- Parameters:
handle – [in] Handle for accessing resources
view – [in] Type erased device array view to copy from
array – [out] Pointer to the location to store the pointer to the device array
error – [out] Pointer to an error object storing details of any error. Will be populated if error code is not CUGRAPH_SUCCESS
- Returns:
error code
- void cugraph_type_erased_device_array_free( )#
Destroy a type erased device array.
- Parameters:
p – [in] Pointer to the type erased device array
- cugraph_type_erased_device_array_view_t *cugraph_type_erased_device_array_view( )#
Create a type erased device array view from a type erased device array.
- Parameters:
array – [in] Pointer to the type erased device array
- Returns:
Pointer to the view of the host array
- cugraph_error_code_t cugraph_type_erased_device_array_view_as_type(
- cugraph_type_erased_device_array_t *array,
- cugraph_data_type_id_t dtype,
- cugraph_type_erased_device_array_view_t **result_view,
- cugraph_error_t **error
Create a type erased device array view with a different type.
Create a type erased device array view from a type erased device array treating the underlying pointer as a different type.
Note: This is only viable when the underlying types are the same size. That is, you can switch between INT32 and FLOAT32, or between INT64 and FLOAT64. But if the types are different sizes this will be an error.
- Parameters:
array – [in] Pointer to the type erased device array
dtype – [in] The type to cast the pointer to
result_view – [out] Address where to put the allocated device view
error – [out] Pointer to an error object storing details of any error. Will be populated if error code is not CUGRAPH_SUCCESS
- Returns:
error code
- cugraph_type_erased_device_array_view_t *cugraph_type_erased_device_array_view_create(
- void *pointer,
- size_t n_elems,
- cugraph_data_type_id_t dtype
Create a type erased device array view from a raw device pointer.
- Parameters:
pointer – [in] Raw device pointer
n_elems – [in] The number of elements in the array
dtype – [in] The type of array to create
- Returns:
Pointer to the view of the host array
- void cugraph_type_erased_device_array_view_free( )#
Destroy a type erased device array view.
- Parameters:
p – [in] Pointer to the type erased device array view
- size_t cugraph_type_erased_device_array_view_size( )#
Get the size of a type erased device array view.
- Parameters:
p – [in] Pointer to the type erased device array view
- Returns:
The number of elements in the array
- cugraph_data_type_id_t cugraph_type_erased_device_array_view_type( )#
Get the type of a type erased device array view.
- Parameters:
p – [in] Pointer to the type erased device array view
- Returns:
The type of the elements in the array
- const void *cugraph_type_erased_device_array_view_pointer( )#
Get the raw pointer of the type erased device array view.
- Parameters:
p – [in] Pointer to the type erased device array view
- Returns:
Pointer (device memory) for the data in the array
- cugraph_error_code_t cugraph_type_erased_host_array_create(
- const cugraph_resource_handle_t *handle,
- size_t n_elems,
- cugraph_data_type_id_t dtype,
- cugraph_type_erased_host_array_t **array,
- cugraph_error_t **error
Create a type erased host array.
- Parameters:
handle – [in] Handle for accessing resources
n_elems – [in] The number of elements in the array
dtype – [in] The type of array to create
array – [out] Pointer to the location to store the pointer to the host array
error – [out] Pointer to an error object storing details of any error. Will be populated if error code is not CUGRAPH_SUCCESS
- Returns:
error code
- void cugraph_type_erased_host_array_free( )#
Destroy a type erased host array.
- Parameters:
p – [in] Pointer to the type erased host array
- cugraph_type_erased_host_array_view_t *cugraph_type_erased_host_array_view( )#
Create a type erased host array view from a type erased host array.
- Parameters:
array – [in] Pointer to the type erased host array
- Returns:
Pointer to the view of the host array
- cugraph_type_erased_host_array_view_t *cugraph_type_erased_host_array_view_create(
- void *pointer,
- size_t n_elems,
- cugraph_data_type_id_t dtype
Create a type erased host array view from a raw host pointer.
- Parameters:
pointer – [in] Raw host pointer
n_elems – [in] The number of elements in the array
dtype – [in] The type of array to create
- Returns:
pointer to the view of the host array
- void cugraph_type_erased_host_array_view_free( )#
Destroy a type erased host array view.
- Parameters:
p – [in] Pointer to the type erased host array view
- size_t cugraph_type_erased_host_array_size( )#
Get the size of a type erased host array view.
- Parameters:
p – [in] Pointer to the type erased host array view
- Returns:
The number of elements in the array
- cugraph_data_type_id_t cugraph_type_erased_host_array_type( )#
Get the type of a type erased host array view.
- Parameters:
p – [in] Pointer to the type erased host array view
- Returns:
The type of the elements in the array
- void *cugraph_type_erased_host_array_pointer( )#
Get the raw pointer of the type erased host array view.
- Parameters:
p – [in] Pointer to the type erased host array view
- Returns:
Pointer (host memory) for the data in the array
- cugraph_error_code_t cugraph_type_erased_host_array_view_copy(
- const cugraph_resource_handle_t *handle,
- cugraph_type_erased_host_array_view_t *dst,
- const cugraph_type_erased_host_array_view_t *src,
- cugraph_error_t **error
Copy data between two type erased device array views.
- Parameters:
handle – [in] Handle for accessing resources
dst – [out] Pointer to type erased host array view destination
src – [in] Pointer to type erased host array view source
error – [out] Pointer to an error object storing details of any error. Will be populated if error code is not CUGRAPH_SUCCESS
- Returns:
error code
- cugraph_error_code_t cugraph_type_erased_device_array_view_copy_from_host(
- const cugraph_resource_handle_t *handle,
- cugraph_type_erased_device_array_view_t *dst,
- const byte_t *h_src,
- cugraph_error_t **error
Copy data from host to a type erased device array view.
- Parameters:
handle – [in] Handle for accessing resources
dst – [out] Pointer to the type erased device array view
h_src – [in] Pointer to host array to copy into device memory
error – [out] Pointer to an error object storing details of any error. Will be populated if error code is not CUGRAPH_SUCCESS
- Returns:
error code
- cugraph_error_code_t cugraph_type_erased_device_array_view_copy_to_host(
- const cugraph_resource_handle_t *handle,
- byte_t *h_dst,
- const cugraph_type_erased_device_array_view_t *src,
- cugraph_error_t **error
Copy data from device to a type erased host array.
- Parameters:
handle – [in] Handle for accessing resources
h_dst – [out] Pointer to host array
src – [in] Pointer to the type erased device array view source
error – [out] Pointer to an error object storing details of any error. Will be populated if error code is not CUGRAPH_SUCCESS
- Returns:
error code
- cugraph_error_code_t cugraph_type_erased_device_array_view_copy(
- const cugraph_resource_handle_t *handle,
- cugraph_type_erased_device_array_view_t *dst,
- const cugraph_type_erased_device_array_view_t *src,
- cugraph_error_t **error
Copy data between two type erased device array views.
- Parameters:
handle – [in] Handle for accessing resources
dst – [out] Pointer to type erased device array view destination
src – [in] Pointer to type erased device array view source
error – [out] Pointer to an error object storing details of any error. Will be populated if error code is not CUGRAPH_SUCCESS
- Returns:
error code
Graph objects and properties#
Functions
- cugraph_error_code_t cugraph_graph_create_sg(
- const cugraph_resource_handle_t *handle,
- const cugraph_graph_properties_t *properties,
- const cugraph_type_erased_device_array_view_t *vertices,
- const cugraph_type_erased_device_array_view_t *src,
- const cugraph_type_erased_device_array_view_t *dst,
- const cugraph_type_erased_device_array_view_t *weights,
- const cugraph_type_erased_device_array_view_t *edge_ids,
- const cugraph_type_erased_device_array_view_t *edge_type_ids,
- bool_t store_transposed,
- bool_t renumber,
- bool_t drop_self_loops,
- bool_t drop_multi_edges,
- bool_t symmetrize,
- bool_t do_expensive_check,
- cugraph_graph_t **graph,
- cugraph_error_t **error
Construct an SG graph.
- Deprecated:
Use cugraph_graph_create_with_times_sg instead
- Parameters:
handle – [in] Handle for accessing resources
properties – [in] Properties of the constructed graph
vertices – [in] Optional device array containing a list of vertex ids (specify NULL if we should create vertex ids from the unique contents of
srcanddst)src – [in] Device array containing the source vertex ids.
dst – [in] Device array containing the destination vertex ids
weights – [in] Device array containing the edge weights. Note that an unweighted graph can be created by passing weights == NULL.
edge_ids – [in] Device array containing the edge ids for each edge. Optional argument that can be NULL if edge ids are not used.
edge_type_ids – [in] Device array containing the edge types for each edge. Optional argument that can be NULL if edge types are not used.
store_transposed – [in] If true create the graph initially in transposed format
renumber – [in] If true, renumber vertices to make an efficient data structure. If false, do not renumber. Renumbering enables some significant optimizations within the graph primitives library, so it is strongly encouraged. Renumbering is required if the vertices are not sequential integer values from 0 to num_vertices.
drop_self_loops – [in] If true, drop any self loops that exist in the provided edge list.
drop_multi_edges – [in] If true, drop any multi edges that exist in the provided edge list. Note that setting this flag will arbitrarily select one instance of a multi edge to be the edge that survives. If the edges have properties that should be honored (e.g. sum the weights, or take the maximum weight), the caller should remove specific edges themselves and not rely on this flag.
symmetrize – [in] If true, symmetrize the edgelist. The symmetrization of edges with edge_ids and/or edge_type_ids is currently not supported.
do_expensive_check – [in] If true, do expensive checks to validate the input data is consistent with software assumptions. If false bypass these checks.
graph – [out] A pointer to the graph object
error – [out] Pointer to an error object storing details of any error. Will be populated if error code is not CUGRAPH_SUCCESS
- Returns:
error code
- cugraph_error_code_t cugraph_graph_create_with_times_sg(
- const cugraph_resource_handle_t *handle,
- const cugraph_graph_properties_t *properties,
- const cugraph_type_erased_device_array_view_t *vertices,
- const cugraph_type_erased_device_array_view_t *src,
- const cugraph_type_erased_device_array_view_t *dst,
- const cugraph_type_erased_device_array_view_t *weights,
- const cugraph_type_erased_device_array_view_t *edge_ids,
- const cugraph_type_erased_device_array_view_t *edge_type_ids,
- const cugraph_type_erased_device_array_view_t *edge_start_time_ids,
- const cugraph_type_erased_device_array_view_t *edge_end_time_ids,
- bool_t store_transposed,
- bool_t renumber,
- bool_t drop_self_loops,
- bool_t drop_multi_edges,
- bool_t symmetrize,
- bool_t do_expensive_check,
- cugraph_graph_t **graph,
- cugraph_error_t **error
Construct an SG graph.
- Parameters:
handle – [in] Handle for accessing resources
properties – [in] Properties of the constructed graph
vertices – [in] Optional device array containing a list of vertex ids (specify NULL if we should create vertex ids from the unique contents of
srcanddst)src – [in] Device array containing the source vertex ids.
dst – [in] Device array containing the destination vertex ids
weights – [in] Device array containing the edge weights. Note that an unweighted graph can be created by passing weights == NULL.
edge_ids – [in] Device array containing the edge ids for each edge. Optional argument that can be NULL if edge ids are not used.
edge_type_ids – [in] Device array containing the edge types for each edge. Optional argument that can be NULL if edge types are not used.
edge_start_time_ids – [in] Device array containing the edge start times for each edge. Optional argument that can be NULL if edge start times are not used.
edge_end_time_ids – [in] Device array containing the edge end times for each edge. Optional argument that can be NULL if edge end times are not used.
store_transposed – [in] If true create the graph initially in transposed format
renumber – [in] If true, renumber vertices to make an efficient data structure. If false, do not renumber. Renumbering enables some significant optimizations within the graph primitives library, so it is strongly encouraged. Renumbering is required if the vertices are not sequential integer values from 0 to num_vertices.
drop_self_loops – [in] If true, drop any self loops that exist in the provided edge list.
drop_multi_edges – [in] If true, drop any multi edges that exist in the provided edge list. Note that setting this flag will arbitrarily select one instance of a multi edge to be the edge that survives. If the edges have properties that should be honored (e.g. sum the weights, or take the maximum weight), the caller should remove specific edges themselves and not rely on this flag.
symmetrize – [in] If true, symmetrize the edgelist. The symmetrization of edges with edge_ids and/or edge_type_ids is currently not supported.
do_expensive_check – [in] If true, do expensive checks to validate the input data is consistent with software assumptions. If false bypass these checks.
graph – [out] A pointer to the graph object
error – [out] Pointer to an error object storing details of any error. Will be populated if error code is not CUGRAPH_SUCCESS
- Returns:
error code
- cugraph_error_code_t cugraph_graph_create_sg_from_csr(
- const cugraph_resource_handle_t *handle,
- const cugraph_graph_properties_t *properties,
- const cugraph_type_erased_device_array_view_t *offsets,
- const cugraph_type_erased_device_array_view_t *indices,
- const cugraph_type_erased_device_array_view_t *weights,
- const cugraph_type_erased_device_array_view_t *edge_ids,
- const cugraph_type_erased_device_array_view_t *edge_type_ids,
- bool_t store_transposed,
- bool_t renumber,
- bool_t symmetrize,
- bool_t do_expensive_check,
- cugraph_graph_t **graph,
- cugraph_error_t **error
Construct an SG graph from a CSR input.
- Parameters:
handle – [in] Handle for accessing resources
properties – [in] Properties of the constructed graph
offsets – [in] Device array containing the CSR offsets array
indices – [in] Device array containing the destination vertex ids
weights – [in] Device array containing the edge weights. Note that an unweighted graph can be created by passing weights == NULL.
edge_ids – [in] Device array containing the edge ids for each edge. Optional argument that can be NULL if edge ids are not used.
edge_type_ids – [in] Device array containing the edge types for each edge. Optional argument that can be NULL if edge types are not used.
store_transposed – [in] If true create the graph initially in transposed format
renumber – [in] If true, renumber vertices to make an efficient data structure. If false, do not renumber. Renumbering enables some significant optimizations within the graph primitives library, so it is strongly encouraged. Renumbering is required if the vertices are not sequential integer values from 0 to num_vertices.
symmetrize – [in] If true, symmetrize the edgelist. The symmetrization of edges with edge_ids and/or edge_type_ids is currently not supported.
do_expensive_check – [in] If true, do expensive checks to validate the input data is consistent with software assumptions. If false bypass these checks.
graph – [out] A pointer to the graph object
error – [out] Pointer to an error object storing details of any error. Will be populated if error code is not CUGRAPH_SUCCESS
- Returns:
error code
- cugraph_error_code_t cugraph_graph_create_mg(
- cugraph_resource_handle_t const *handle,
- cugraph_graph_properties_t const *properties,
- cugraph_type_erased_device_array_view_t const *const *vertices,
- cugraph_type_erased_device_array_view_t const *const *src,
- cugraph_type_erased_device_array_view_t const *const *dst,
- cugraph_type_erased_device_array_view_t const *const *weights,
- cugraph_type_erased_device_array_view_t const *const *edge_ids,
- cugraph_type_erased_device_array_view_t const *const *edge_type_ids,
- bool_t store_transposed,
- size_t num_arrays,
- bool_t drop_self_loops,
- bool_t drop_multi_edges,
- bool_t symmetrize,
- bool_t do_expensive_check,
- cugraph_graph_t **graph,
- cugraph_error_t **error
Construct an MG graph.
- Deprecated:
Use cugraph_graph_create_with_times_mg instead
- Parameters:
handle – [in] Handle for accessing resources
properties – [in] Properties of the constructed graph
vertices – [in] List of device arrays containing the unique vertex ids. If NULL we will construct this internally using the unique entries specified in src and dst All entries in this list will be concatenated on this GPU into a single array.
src – [in] List of device array containing the source vertex ids All entries in this list will be concatenated on this GPU into a single array.
dst – [in] List of device array containing the destination vertex ids All entries in this list will be concatenated on this GPU into a single array.
weights – [in] List of device array containing the edge weights. Note that an unweighted graph can be created by passing weights == NULL. If a weighted graph is to be created, the weights device array should be created on each rank, but the pointer can be NULL and the size 0 if there are no inputs provided by this rank All entries in this list will be concatenated on this GPU into a single array.
edge_ids – [in] List of device array containing the edge ids for each edge. Optional argument that can be NULL if edge ids are not used. All entries in this list will be concatenated on this GPU into a single array.
edge_type_ids – [in] List of device array containing the edge types for each edge. Optional argument that can be NULL if edge types are not used. All entries in this list will be concatenated on this GPU into a single array.
store_transposed – [in] If true create the graph initially in transposed format
num_arrays – [in] The number of arrays specified in
vertices,src,dst,weights,edge_idsandedge_type_idsdrop_self_loops – [in] If true, drop any self loops that exist in the provided edge list.
drop_multi_edges – [in] If true, drop any multi edges that exist in the provided edge list. Note that setting this flag will arbitrarily select one instance of a multi edge to be the edge that survives. If the edges have properties that should be honored (e.g. sum the weights, or take the maximum weight), the caller should do that on not rely on this flag.
symmetrize – [in] If true, symmetrize the edgelist. The symmetrization of edges with edge_ids and/or edge_type_ids is currently not supported.
do_expensive_check – [in] If true, do expensive checks to validate the input data is consistent with software assumptions. If false bypass these checks.
graph – [out] A pointer to the graph object
error – [out] Pointer to an error object storing details of any error. Will be populated if error code is not CUGRAPH_SUCCESS
- Returns:
error code
- cugraph_error_code_t cugraph_graph_create_with_times_mg(
- cugraph_resource_handle_t const *handle,
- cugraph_graph_properties_t const *properties,
- cugraph_type_erased_device_array_view_t const *const *vertices,
- cugraph_type_erased_device_array_view_t const *const *src,
- cugraph_type_erased_device_array_view_t const *const *dst,
- cugraph_type_erased_device_array_view_t const *const *weights,
- cugraph_type_erased_device_array_view_t const *const *edge_ids,
- cugraph_type_erased_device_array_view_t const *const *edge_type_ids,
- cugraph_type_erased_device_array_view_t const *const *edge_start_time_ids,
- cugraph_type_erased_device_array_view_t const *const *edge_end_time_ids,
- bool_t store_transposed,
- size_t num_arrays,
- bool_t drop_self_loops,
- bool_t drop_multi_edges,
- bool_t symmetrize,
- bool_t do_expensive_check,
- cugraph_graph_t **graph,
- cugraph_error_t **error
Construct an MG graph.
- Parameters:
handle – [in] Handle for accessing resources
properties – [in] Properties of the constructed graph
vertices – [in] List of device arrays containing the unique vertex ids. If NULL we will construct this internally using the unique entries specified in src and dst All entries in this list will be concatenated on this GPU into a single array.
src – [in] List of device array containing the source vertex ids All entries in this list will be concatenated on this GPU into a single array.
dst – [in] List of device array containing the destination vertex ids All entries in this list will be concatenated on this GPU into a single array.
weights – [in] List of device array containing the edge weights. Note that an unweighted graph can be created by passing weights == NULL. If a weighted graph is to be created, the weights device array should be created on each rank, but the pointer can be NULL and the size 0 if there are no inputs provided by this rank All entries in this list will be concatenated on this GPU into a single array.
edge_ids – [in] List of device array containing the edge ids for each edge. Optional argument that can be NULL if edge ids are not used. All entries in this list will be concatenated on this GPU into a single array.
edge_type_ids – [in] List of device array containing the edge types for each edge. Optional argument that can be NULL if edge types are not used. All entries in this list will be concatenated on this GPU into a single array.
edge_type_ids – [in] List of device array containing the edge types for each edge. Optional argument that can be NULL if edge types are not used. All entries in this list will be concatenated on this GPU into a single array.
edge_start_time_ids – [in] List of device array containing the edge start times for each edge. Optional argument that can be NULL if edge start times are not used. All entries in this list will be concatenated on this GPU into a single array.
edge_end_time_ids – [in] List of device array containing the edge end times for each edge. Optional argument that can be NULL if edge end times are not used. All entries in this list will be concatenated on this GPU into a single array.
store_transposed – [in] If true create the graph initially in transposed format
num_arrays – [in] The number of arrays specified in
vertices,src,dst,weights,edge_idsandedge_type_idsdrop_self_loops – [in] If true, drop any self loops that exist in the provided edge list.
drop_multi_edges – [in] If true, drop any multi edges that exist in the provided edge list. Note that setting this flag will arbitrarily select one instance of a multi edge to be the edge that survives. If the edges have properties that should be honored (e.g. sum the weights, or take the maximum weight), the caller should do that on not rely on this flag.
symmetrize – [in] If true, symmetrize the edgelist. The symmetrization of edges with edge_ids and/or edge_type_ids is currently not supported.
do_expensive_check – [in] If true, do expensive checks to validate the input data is consistent with software assumptions. If false bypass these checks.
graph – [out] A pointer to the graph object
error – [out] Pointer to an error object storing details of any error. Will be populated if error code is not CUGRAPH_SUCCESS
- Returns:
error code
-
void cugraph_graph_free(cugraph_graph_t *graph)#
Destroy an graph.
- Parameters:
graph – [in] A pointer to the graph object to destroy
- cugraph_error_code_t cugraph_data_mask_create(
- const cugraph_resource_handle_t *handle,
- const cugraph_type_erased_device_array_view_t *vertex_bit_mask,
- const cugraph_type_erased_device_array_view_t *edge_bit_mask,
- bool_t complement,
- cugraph_data_mask_t **mask,
- cugraph_error_t **error
Create a data mask.
- Parameters:
handle – [in] Handle for accessing resources
vertex_bit_mask – [in] Device array containing vertex bit mask
edge_bit_mask – [in] Device array containing edge bit mask
complement – [in] If true, a 0 in one of the bit masks implies the vertex/edge should be included and a 1 should be excluded. If false a 1 in one of the bit masks implies the vertex/edge should be included and a 0 should be excluded.
mask – [out] An opaque pointer to the constructed mask object
error – [out] Pointer to an error object storing details of any error. Will be populated if error code is not CUGRAPH_SUCCESS
- Returns:
error code
- cugraph_error_code_t cugraph_graph_get_data_mask(
- cugraph_graph_t *graph,
- cugraph_data_mask_t **mask,
- cugraph_error_t **error
Get the data mask currently associated with a graph.
- Parameters:
graph – [in] The input graph
mask – [out] Opaque pointer where we should store the current mask. Will be NULL if there is no mask currently assigned to the graph.
error – [out] Pointer to an error object storing details of any error. Will be populated if error code is not CUGRAPH_SUCCESS
- Returns:
error code
- cugraph_error_code_t cugraph_graph_add_data_mask(
- cugraph_graph_t *graph,
- cugraph_data_mask_t *mask,
- cugraph_error_t **error
Associate a data mask with a graph.
NOTE: This function will fail if there is already a data mask associated with this graph
- Parameters:
graph – [in] The input graph
mask – [out] Opaque pointer of the new data mask
error – [out] Pointer to an error object storing details of any error. Will be populated if error code is not CUGRAPH_SUCCESS
- Returns:
error code
- cugraph_error_code_t cugraph_graph_release_data_mask(
- cugraph_graph_t *graph,
- cugraph_data_mask_t **mask,
- cugraph_error_t **error
Release the data mask currently associated with a graph.
This function will remove the associated of the current data mask with this graph. The caller will be responsible for destroying the data mask using graph_data_mask_destroy.
If this function is not called and the graph is destroyed, the act of destroying the graph will also destroy the data mask.
If this function is called on a graph that is not currently associated with a graph, then the mask will be set to NULL.
- Parameters:
graph – [in] The input graph
mask – [out] Opaque pointer where we should store the current mask.
error – [out] Pointer to an error object storing details of any error. Will be populated if error code is not CUGRAPH_SUCCESS
- Returns:
error code
-
void cugraph_data_mask_destroy(cugraph_data_mask_t *mask)#
Destroy a data mask.
- Parameters:
mask – [in] A pointer to the data mask to destroy
-
struct cugraph_graph_properties_t#
Interoperability and utilities#
Functions
- cugraph_type_erased_device_array_view_t *cugraph_coo_get_sources(
- cugraph_coo_t *coo
Get the source vertex ids.
- Parameters:
coo – [in] Opaque pointer to COO
- Returns:
type erased array view of source vertex ids
- cugraph_type_erased_device_array_view_t *cugraph_coo_get_destinations(
- cugraph_coo_t *coo
Get the destination vertex ids.
- Parameters:
coo – [in] Opaque pointer to COO
- Returns:
type erased array view of destination vertex ids
- cugraph_type_erased_device_array_view_t *cugraph_coo_get_edge_weights(
- cugraph_coo_t *coo
Get the edge weights.
- Parameters:
coo – [in] Opaque pointer to COO
- Returns:
type erased array view of edge weights, NULL if no edge weights in COO
- cugraph_type_erased_device_array_view_t *cugraph_coo_get_edge_id(
- cugraph_coo_t *coo
Get the edge id.
- Parameters:
coo – [in] Opaque pointer to COO
- Returns:
type erased array view of edge id, NULL if no edge ids in COO
- cugraph_type_erased_device_array_view_t *cugraph_coo_get_edge_type(
- cugraph_coo_t *coo
Get the edge type.
- Parameters:
coo – [in] Opaque pointer to COO
- Returns:
type erased array view of edge type, NULL if no edge types in COO
-
size_t cugraph_coo_list_size(const cugraph_coo_list_t *coo_list)#
Get the number of coo object in the list.
- Parameters:
coo_list – [in] Opaque pointer to COO list
- Returns:
number of elements
- cugraph_coo_t *cugraph_coo_list_element(
- cugraph_coo_list_t *coo_list,
- size_t index
Get a COO from the list.
- Parameters:
coo_list – [in] Opaque pointer to COO list
index – [in] Index of desired COO from list
- Returns:
a cugraph_coo_t* object from the list
-
void cugraph_coo_free(cugraph_coo_t *coo)#
Free coo object.
- Parameters:
coo – [in] Opaque pointer to COO
-
void cugraph_coo_list_free(cugraph_coo_list_t *coo_list)#
Free coo list.
- Parameters:
coo_list – [in] Opaque pointer to list of COO objects
-
struct cugraph_coo_list_t#
- #include <coo.h>
Opaque COO list definition.
Public Members
-
int32_t align_#
-
int32_t align_#
Functions
- cugraph_error_code_t cugraph_data_type_id_from_dlpack(
- const DLDataType *dlpack_dtype,
- cugraph_data_type_id_t *dtype,
- cugraph_error_t **error
Convert a DLPack DLDataType to a cugraph_data_type_id_t.
Converts the dtype field from a DLPack tensor (e.g. DLTensor::dtype or dlpack metadata) into the cugraph_data_type_id_t required by cugraph_type_erased_device_array_view_create() and related array APIs.
Only scalar types (lanes == 1) are supported. Vectorized DLPack types, bfloat16, complex, and opaque handle types are rejected.
- Parameters:
dlpack_dtype – [in] Pointer to the DLPack data type to convert. Must not be NULL.
dtype – [out] Pointer to store the resulting cuGraph data type. Must not be NULL.
error – [out] Pointer to an error object storing details of any error. Will be populated if the return code is not CUGRAPH_SUCCESS. Must not be NULL.
- Returns:
CUGRAPH_SUCCESS on success, or an error code on failure.
Functions
- cugraph_error_code_t cugraph_rng_state_create(
- const cugraph_resource_handle_t *handle,
- uint64_t seed,
- cugraph_rng_state_t **state,
- cugraph_error_t **error
Create a Random Number Generator State.
- Parameters:
seed – [in] Initial value for seed. In MG this should be different on each GPU
state – [out] Pointer to the location to store the pointer to the RngState
error – [out] Pointer to an error object storing details of any error. Will be populated if error code is not CUGRAPH_SUCCESS
- Returns:
error code
-
void cugraph_rng_state_free(cugraph_rng_state_t *p)#
Destroy a Random Number Generator State.
- Parameters:
p – [in] Pointer to the Random Number Generator State