/* automatically generated by rust-bindgen 0.71.1 */
#[doc = " \\brief Struct to represent a complex number with float precision real and imaginary parts."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct rocsparse_float_complex {
#[doc = "< real part."]
pub x: f32,
#[doc = "< imaginary part."]
pub y: f32,
}
#[doc = " \\brief Struct to represent a complex number with double precision real and imaginary parts."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct rocsparse_double_complex {
#[doc = "< real part."]
pub x: f64,
#[doc = "< imaginary part."]
pub y: f64,
}
#[doc = " \\brief Struct to represent a 16-bit brain floating-point number."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct rocsparse_bfloat16 {
#[doc = "< brain float storage."]
pub data: u16,
}
pub type rocsparse_int = i32;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ihipStream_t {
_unused: [u8; 0],
}
#[doc = " \\cond DO_NOT_DOCUMENT"]
pub type hipStream_t = *mut ihipStream_t;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _rocsparse_handle {
_unused: [u8; 0],
}
#[doc = " \\ingroup types_module\n \\brief Handle to the rocSPARSE library context queue.\n\n \\details\n The rocSPARSE handle is a structure holding the rocSPARSE library context. It must\n be initialized using rocsparse_create_handle(), and the returned handle must be\n passed to all subsequent library function calls. It should be destroyed at the end\n using rocsparse_destroy_handle()."]
pub type rocsparse_handle = *mut _rocsparse_handle;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _rocsparse_error {
_unused: [u8; 0],
}
#[doc = " \\ingroup types_module\n \\brief Descriptor of the error.\n\n \\details\n The rocSPARSE error descriptor is a structure holding the information related to an error\n that occurred during the execution of a rocSPARSE routine.\n It should be destroyed using rocsparse_destroy_error()."]
pub type rocsparse_error = *mut _rocsparse_error;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _rocsparse_mat_descr {
_unused: [u8; 0],
}
#[doc = " \\ingroup types_module\n \\brief Descriptor of the matrix.\n\n \\details\n The rocSPARSE matrix descriptor is a structure holding all properties of a matrix.\n It must be initialized using rocsparse_create_mat_descr(), and the returned\n descriptor must be passed to all subsequent library calls that involve the matrix.\n It should be destroyed at the end using rocsparse_destroy_mat_descr()."]
pub type rocsparse_mat_descr = *mut _rocsparse_mat_descr;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _rocsparse_hyb_mat {
_unused: [u8; 0],
}
#[doc = " \\ingroup types_module\n \\brief HYB matrix storage format.\n\n \\details\n The rocSPARSE HYB matrix structure holds the HYB matrix. It must be initialized using\n rocsparse_create_hyb_mat(), and the returned HYB matrix must be passed to all\n subsequent library calls that involve the matrix. It should be destroyed at the end\n using rocsparse_destroy_hyb_mat()."]
pub type rocsparse_hyb_mat = *mut _rocsparse_hyb_mat;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _rocsparse_mat_info {
_unused: [u8; 0],
}
#[doc = " \\ingroup types_module\n \\brief Info structure to hold all matrix meta data.\n\n \\details\n The rocSPARSE matrix info is a structure holding all matrix information that is\n gathered during analysis routines. It must be initialized using\n rocsparse_create_mat_info(), and the returned info structure must be passed to all\n subsequent library calls that require additional matrix information. It should be\n destroyed at the end using rocsparse_destroy_mat_info()."]
pub type rocsparse_mat_info = *mut _rocsparse_mat_info;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _rocsparse_spvec_descr {
_unused: [u8; 0],
}
#[doc = " \\ingroup types_module\n \\brief Generic API descriptor of the sparse vector.\n\n \\details\n The rocSPARSE sparse vector descriptor is a structure holding all properties of a sparse vector.\n It must be initialized using rocsparse_create_spvec_descr(), and the returned\n descriptor must be passed to all subsequent generic API library calls that involve the sparse vector.\n It should be destroyed at the end using rocsparse_destroy_spvec_descr()."]
pub type rocsparse_spvec_descr = *mut _rocsparse_spvec_descr;
#[doc = " \\ingroup types_module\n \\brief Generic API descriptor of the sparse vector.\n\n \\details\n The rocSPARSE constant sparse vector descriptor is a structure holding all properties of a sparse vector.\n It must be initialized using \\ref rocsparse_create_const_spvec_descr(), and the returned\n descriptor must be passed to all subsequent generic API library calls that involve the sparse vector.\n It should be destroyed at the end using rocsparse_destroy_spvec_descr()."]
pub type rocsparse_const_spvec_descr = *const _rocsparse_spvec_descr;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _rocsparse_spmat_descr {
_unused: [u8; 0],
}
#[doc = " \\ingroup types_module\n \\brief Generic API descriptor of the sparse matrix.\n\n \\details\n The rocSPARSE sparse matrix descriptor is a structure holding all properties of a sparse matrix.\n It must be initialized using rocsparse_create_coo_descr(), rocsparse_create_coo_aos_descr(),\n rocsparse_create_bsr_descr(), rocsparse_create_csr_descr(), rocsparse_create_csc_descr(),\n rocsparse_create_ell_descr(), or rocsparse_create_bell_descr(), and the returned\n descriptor must be passed to all subsequent generic API library calls that involve the sparse matrix.\n It should be destroyed at the end using rocsparse_destroy_spmat_descr()."]
pub type rocsparse_spmat_descr = *mut _rocsparse_spmat_descr;
#[doc = " \\ingroup types_module\n \\brief Generic API descriptor of the sparse matrix.\n\n \\details\n The rocSPARSE constant sparse matrix descriptor is a structure holding all properties of a sparse matrix.\n It must be initialized using rocsparse_create_const_coo_descr(),\n rocsparse_create_const_csr_descr(), rocsparse_create_const_csc_descr(),\n rocsparse_create_const_bsr_descr(), or rocsparse_create_const_bell_descr(), and the returned\n descriptor must be passed to all subsequent generic API library calls that involve the sparse matrix.\n It should be destroyed at the end using rocsparse_destroy_spmat_descr()."]
pub type rocsparse_const_spmat_descr = *const _rocsparse_spmat_descr;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _rocsparse_dnvec_descr {
_unused: [u8; 0],
}
#[doc = " \\ingroup types_module\n \\brief Generic API descriptor of the dense vector.\n\n \\details\n The rocSPARSE dense vector descriptor is a structure holding all properties of a dense vector.\n It must be initialized using rocsparse_create_dnvec_descr(), and the returned\n descriptor must be passed to all subsequent generic API library calls that involve the dense vector.\n It should be destroyed at the end using rocsparse_destroy_dnvec_descr()."]
pub type rocsparse_dnvec_descr = *mut _rocsparse_dnvec_descr;
#[doc = " \\ingroup types_module\n \\brief Generic API descriptor of the dense vector.\n\n \\details\n The rocSPARSE constant dense vector descriptor is a structure holding all properties of a dense vector.\n It must be initialized using rocsparse_create_const_dnvec_descr(), and the returned\n descriptor must be passed to all subsequent generic API library calls that involve the dense vector.\n It should be destroyed at the end using rocsparse_destroy_dnvec_descr()."]
pub type rocsparse_const_dnvec_descr = *const _rocsparse_dnvec_descr;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _rocsparse_dnmat_descr {
_unused: [u8; 0],
}
#[doc = " \\ingroup types_module\n \\brief Generic API descriptor of the dense matrix.\n\n \\details\n The rocSPARSE dense matrix descriptor is a structure holding all properties of a dense matrix.\n It must be initialized using rocsparse_create_dnmat_descr(), and the returned\n descriptor must be passed to all subsequent generic API library calls that involve the dense matrix.\n It should be destroyed at the end using rocsparse_destroy_dnmat_descr()."]
pub type rocsparse_dnmat_descr = *mut _rocsparse_dnmat_descr;
#[doc = " \\ingroup types_module\n \\brief Generic API descriptor of the dense matrix.\n\n \\details\n The rocSPARSE constant dense matrix descriptor is a structure holding all properties of a dense matrix.\n It must be initialized using rocsparse_create_const_dnmat_descr(), and the returned\n descriptor must be passed to all subsequent generic API library calls that involve the dense matrix.\n It should be destroyed at the end using rocsparse_destroy_dnmat_descr()."]
pub type rocsparse_const_dnmat_descr = *const _rocsparse_dnmat_descr;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _rocsparse_color_info {
_unused: [u8; 0],
}
#[doc = " \\ingroup types_module\n \\brief Coloring info structure to hold data gathered during analysis and later used in\n rocSPARSE sparse matrix coloring routines.\n\n \\details\n The rocSPARSE color info is a structure holding coloring data that is\n gathered during analysis routines. It must be initialized using\n rocsparse_create_color_info(), and the returned info structure must be passed to all\n subsequent library calls that require coloring information. It should be\n destroyed at the end using rocsparse_destroy_color_info()."]
pub type rocsparse_color_info = *mut _rocsparse_color_info;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _rocsparse_sparse_to_sparse_descr {
_unused: [u8; 0],
}
#[doc = " \\ingroup types_module\n \\brief \\p rocsparse_sparse_to_sparse_descr is a structure holding the rocSPARSE sparse_to_sparse\n descriptor data. It must be initialized using\n the rocsparse_create_sparse_to_sparse_descr() routine. It should be destroyed at the\n end using rocsparse_destroy_sparse_to_sparse_descr()."]
pub type rocsparse_sparse_to_sparse_descr = *mut _rocsparse_sparse_to_sparse_descr;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _rocsparse_extract_descr {
_unused: [u8; 0],
}
#[doc = " \\ingroup types_module\n \\brief \\p rocsparse_extract_descr is a structure holding the rocSPARSE extract\n descriptor data. It must be initialized using\n the rocsparse_create_extract_descr() routine. It should be destroyed at the\n end using rocsparse_destroy_extract_descr()."]
pub type rocsparse_extract_descr = *mut _rocsparse_extract_descr;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _rocsparse_spgeam_descr {
_unused: [u8; 0],
}
#[doc = " \\ingroup types_module\n \\brief \\p rocsparse_spgeam_descr is a structure holding the rocSPARSE spgeam\n descriptor data. It must be initialized using\n the rocsparse_create_spgeam_descr() routine. It should be destroyed at the\n end using rocsparse_destroy_spgeam_descr()."]
pub type rocsparse_spgeam_descr = *mut _rocsparse_spgeam_descr;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _rocsparse_spmv_descr {
_unused: [u8; 0],
}
#[doc = " \\ingroup types_module\n \\brief \\p rocsparse_spmv_descr is a structure holding the rocSPARSE spmv\n descriptor data. It must be initialized using\n the rocsparse_create_spmv_descr() routine. It should be destroyed at the\n end using rocsparse_destroy_spmv_descr()."]
pub type rocsparse_spmv_descr = *mut _rocsparse_spmv_descr;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _rocsparse_sptrsv_descr {
_unused: [u8; 0],
}
#[doc = " \\ingroup types_module\n \\brief \\p rocsparse_sptrsv_descr is a structure holding the rocSPARSE sptrsv\n descriptor data. It must be initialized using\n the rocsparse_create_sptrsv_descr() or rocsparse_sptrsv_descr_create() routine. It should be destroyed at the\n end using rocsparse_destroy_sptrsv_descr() or rocsparse_sptrsv_descr_destroy()."]
pub type rocsparse_sptrsv_descr = *mut _rocsparse_sptrsv_descr;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _rocsparse_sptrsm_descr {
_unused: [u8; 0],
}
#[doc = " \\ingroup types_module\n \\brief \\p rocsparse_sptrsm_descr is a structure holding the rocSPARSE sptrsm\n descriptor data. It must be initialized using\n the rocsparse_create_sptrsm_descr() routine. It should be destroyed at the\n end using rocsparse_destroy_sptrsm_descr()."]
pub type rocsparse_sptrsm_descr = *mut _rocsparse_sptrsm_descr;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _rocsparse_spic0_descr {
_unused: [u8; 0],
}
#[doc = " \\ingroup types_module\n \\brief \\p rocsparse_spic0_descr is a structure holding the rocSPARSE spic0\n descriptor data. It must be initialized using\n the rocsparse_spic0_descr_create() routine. It should be destroyed at the\n end using rocsparse_spic0_descr_destroy()."]
pub type rocsparse_spic0_descr = *mut _rocsparse_spic0_descr;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _rocsparse_spilu0_descr {
_unused: [u8; 0],
}
#[doc = " \\ingroup types_module\n \\brief \\p rocsparse_spilu0_descr is a structure holding the rocSPARSE spilu0\n descriptor data. It must be initialized using\n the rocsparse_spilu0_descr_create() routine. It should be destroyed at the\n end using rocsparse_spilu0_descr_destroy()."]
pub type rocsparse_spilu0_descr = *mut _rocsparse_spilu0_descr;
#[doc = "< Operate with matrix."]
pub const rocsparse_operation__rocsparse_operation_none: rocsparse_operation_ = 111;
#[doc = "< Operate with transpose."]
pub const rocsparse_operation__rocsparse_operation_transpose: rocsparse_operation_ = 112;
#[doc = "< Operate with conj. transpose."]
pub const rocsparse_operation__rocsparse_operation_conjugate_transpose: rocsparse_operation_ = 113;
#[doc = " \\ingroup types_module\n \\brief Specify whether the matrix is to be transposed or not.\n\n \\details\n The \\ref rocsparse_operation indicates the operation performed with the given matrix."]
pub type rocsparse_operation_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief Specify whether the matrix is to be transposed or not.\n\n \\details\n The \\ref rocsparse_operation indicates the operation performed with the given matrix."]
pub use self::rocsparse_operation_ as rocsparse_operation;
#[doc = "< Zero-based indexing."]
pub const rocsparse_index_base__rocsparse_index_base_zero: rocsparse_index_base_ = 0;
#[doc = "< One-based indexing."]
pub const rocsparse_index_base__rocsparse_index_base_one: rocsparse_index_base_ = 1;
#[doc = " \\ingroup types_module\n \\brief Specify the matrix index base.\n\n \\details\n The \\ref rocsparse_index_base indicates the index base of the indices. For a\n given \\ref rocsparse_mat_descr, the \\ref rocsparse_index_base can be set using\n rocsparse_set_mat_index_base(). The current \\ref rocsparse_index_base of a matrix\n can be obtained by rocsparse_get_mat_index_base()."]
pub type rocsparse_index_base_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief Specify the matrix index base.\n\n \\details\n The \\ref rocsparse_index_base indicates the index base of the indices. For a\n given \\ref rocsparse_mat_descr, the \\ref rocsparse_index_base can be set using\n rocsparse_set_mat_index_base(). The current \\ref rocsparse_index_base of a matrix\n can be obtained by rocsparse_get_mat_index_base()."]
pub use self::rocsparse_index_base_ as rocsparse_index_base;
#[doc = "< General matrix type."]
pub const rocsparse_matrix_type__rocsparse_matrix_type_general: rocsparse_matrix_type_ = 0;
#[doc = "< Symmetric matrix type."]
pub const rocsparse_matrix_type__rocsparse_matrix_type_symmetric: rocsparse_matrix_type_ = 1;
#[doc = "< Hermitian matrix type."]
pub const rocsparse_matrix_type__rocsparse_matrix_type_hermitian: rocsparse_matrix_type_ = 2;
#[doc = "< Triangular matrix type."]
pub const rocsparse_matrix_type__rocsparse_matrix_type_triangular: rocsparse_matrix_type_ = 3;
#[doc = " \\ingroup types_module\n \\brief Specify the matrix type.\n\n \\details\n The \\ref rocsparse_matrix_type indicates the type of a matrix. For a given\n \\ref rocsparse_mat_descr, the \\ref rocsparse_matrix_type can be set using\n rocsparse_set_mat_type(). The current \\ref rocsparse_matrix_type of a matrix can be\n obtained by rocsparse_get_mat_type().\n\n For the matrix types \\ref rocsparse_matrix_type_symmetric, \\ref rocsparse_matrix_type_hermitian,\n and \\ref rocsparse_matrix_type_triangular, only the upper or lower part of the matrix\n (specified by setting the \\ref rocsparse_fill_mode) is assumed to be stored. The purpose of this\n is to minimize the amount of memory required to store the matrix.\n\n Routines that accept \\ref rocsparse_matrix_type_symmetric or \\ref rocsparse_matrix_type_hermitian\n will only read from the stored upper or lower part of the matrix but will perform the computation\n as if the full symmetric/Hermitian matrix existed. For example, when computing \\f$y=A*x\\f$, where\n A is symmetric and only the lower part is stored, internally the multiplication will be performed\n in two steps. First, the computation \\f$y=(L+D)*x\\f$ will be performed. Secondly, the multiplication\n will be completed by performing \\f$y=L^T*x + y\\f$. This second step involves a transposed\n multiplication, which is slower. For this reason, where space allows, it is faster to store the\n entire symmetric matrix and use \\ref rocsparse_matrix_type_general instead of\n \\ref rocsparse_matrix_type_symmetric."]
pub type rocsparse_matrix_type_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief Specify the matrix type.\n\n \\details\n The \\ref rocsparse_matrix_type indicates the type of a matrix. For a given\n \\ref rocsparse_mat_descr, the \\ref rocsparse_matrix_type can be set using\n rocsparse_set_mat_type(). The current \\ref rocsparse_matrix_type of a matrix can be\n obtained by rocsparse_get_mat_type().\n\n For the matrix types \\ref rocsparse_matrix_type_symmetric, \\ref rocsparse_matrix_type_hermitian,\n and \\ref rocsparse_matrix_type_triangular, only the upper or lower part of the matrix\n (specified by setting the \\ref rocsparse_fill_mode) is assumed to be stored. The purpose of this\n is to minimize the amount of memory required to store the matrix.\n\n Routines that accept \\ref rocsparse_matrix_type_symmetric or \\ref rocsparse_matrix_type_hermitian\n will only read from the stored upper or lower part of the matrix but will perform the computation\n as if the full symmetric/Hermitian matrix existed. For example, when computing \\f$y=A*x\\f$, where\n A is symmetric and only the lower part is stored, internally the multiplication will be performed\n in two steps. First, the computation \\f$y=(L+D)*x\\f$ will be performed. Secondly, the multiplication\n will be completed by performing \\f$y=L^T*x + y\\f$. This second step involves a transposed\n multiplication, which is slower. For this reason, where space allows, it is faster to store the\n entire symmetric matrix and use \\ref rocsparse_matrix_type_general instead of\n \\ref rocsparse_matrix_type_symmetric."]
pub use self::rocsparse_matrix_type_ as rocsparse_matrix_type;
#[doc = "< Diagonal entries are non-unity."]
pub const rocsparse_diag_type__rocsparse_diag_type_non_unit: rocsparse_diag_type_ = 0;
#[doc = "< Diagonal entries are unity."]
pub const rocsparse_diag_type__rocsparse_diag_type_unit: rocsparse_diag_type_ = 1;
#[doc = " \\ingroup types_module\n \\brief Indicates if the diagonal entries are unity.\n\n \\details\n The \\ref rocsparse_diag_type indicates whether the diagonal entries of a matrix are\n unity or not. If \\ref rocsparse_diag_type_unit is specified, all present diagonal\n values will be ignored. For a given \\ref rocsparse_mat_descr, the\n \\ref rocsparse_diag_type can be set using rocsparse_set_mat_diag_type(). The current\n \\ref rocsparse_diag_type of a matrix can be obtained by\n rocsparse_get_mat_diag_type()."]
pub type rocsparse_diag_type_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief Indicates if the diagonal entries are unity.\n\n \\details\n The \\ref rocsparse_diag_type indicates whether the diagonal entries of a matrix are\n unity or not. If \\ref rocsparse_diag_type_unit is specified, all present diagonal\n values will be ignored. For a given \\ref rocsparse_mat_descr, the\n \\ref rocsparse_diag_type can be set using rocsparse_set_mat_diag_type(). The current\n \\ref rocsparse_diag_type of a matrix can be obtained by\n rocsparse_get_mat_diag_type()."]
pub use self::rocsparse_diag_type_ as rocsparse_diag_type;
#[doc = "< Lower triangular part is stored."]
pub const rocsparse_fill_mode__rocsparse_fill_mode_lower: rocsparse_fill_mode_ = 0;
#[doc = "< Upper triangular part is stored."]
pub const rocsparse_fill_mode__rocsparse_fill_mode_upper: rocsparse_fill_mode_ = 1;
#[doc = " \\ingroup types_module\n \\brief Specify the matrix fill mode.\n\n \\details\n The \\ref rocsparse_fill_mode indicates whether the lower or the upper part is stored\n in a sparse triangular matrix. For a given \\ref rocsparse_mat_descr, the\n \\ref rocsparse_fill_mode can be set using rocsparse_set_mat_fill_mode(). The current\n \\ref rocsparse_fill_mode of a matrix can be obtained by\n rocsparse_get_mat_fill_mode()."]
pub type rocsparse_fill_mode_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief Specify the matrix fill mode.\n\n \\details\n The \\ref rocsparse_fill_mode indicates whether the lower or the upper part is stored\n in a sparse triangular matrix. For a given \\ref rocsparse_mat_descr, the\n \\ref rocsparse_fill_mode can be set using rocsparse_set_mat_fill_mode(). The current\n \\ref rocsparse_fill_mode of a matrix can be obtained by\n rocsparse_get_mat_fill_mode()."]
pub use self::rocsparse_fill_mode_ as rocsparse_fill_mode;
#[doc = "< Matrix is sorted."]
pub const rocsparse_storage_mode__rocsparse_storage_mode_sorted: rocsparse_storage_mode_ = 0;
#[doc = "< Matrix is unsorted."]
pub const rocsparse_storage_mode__rocsparse_storage_mode_unsorted: rocsparse_storage_mode_ = 1;
#[doc = " \\ingroup types_module\n \\brief Specify whether the matrix is stored sorted or not.\n\n \\details\n The \\ref rocsparse_storage_mode indicates whether the matrix is stored as sorted or not.\n For a given \\ref rocsparse_mat_descr, the \\ref rocsparse_storage_mode can be set\n using rocsparse_set_mat_storage_mode(). The current \\ref rocsparse_storage_mode of a\n matrix can be obtained by rocsparse_get_mat_storage_mode()."]
pub type rocsparse_storage_mode_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief Specify whether the matrix is stored sorted or not.\n\n \\details\n The \\ref rocsparse_storage_mode indicates whether the matrix is stored as sorted or not.\n For a given \\ref rocsparse_mat_descr, the \\ref rocsparse_storage_mode can be set\n using rocsparse_set_mat_storage_mode(). The current \\ref rocsparse_storage_mode of a\n matrix can be obtained by rocsparse_get_mat_storage_mode()."]
pub use self::rocsparse_storage_mode_ as rocsparse_storage_mode;
#[doc = "< Operate only on indices."]
pub const rocsparse_action__rocsparse_action_symbolic: rocsparse_action_ = 0;
#[doc = "< Operate on data and indices."]
pub const rocsparse_action__rocsparse_action_numeric: rocsparse_action_ = 1;
#[doc = " \\ingroup types_module\n \\brief Specify where the operation is performed on.\n\n \\details\n The \\ref rocsparse_action indicates whether the operation is performed on the full\n matrix or only on the sparsity pattern of the matrix."]
pub type rocsparse_action_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief Specify where the operation is performed on.\n\n \\details\n The \\ref rocsparse_action indicates whether the operation is performed on the full\n matrix or only on the sparsity pattern of the matrix."]
pub use self::rocsparse_action_ as rocsparse_action;
#[doc = "< Parse the matrix by rows."]
pub const rocsparse_direction__rocsparse_direction_row: rocsparse_direction_ = 0;
#[doc = "< Parse the matrix by columns."]
pub const rocsparse_direction__rocsparse_direction_column: rocsparse_direction_ = 1;
#[doc = " \\ingroup types_module\n \\brief Specify the matrix direction.\n\n \\details\n The \\ref rocsparse_direction indicates whether a dense matrix should be parsed by\n rows or by columns, assuming column-major storage."]
pub type rocsparse_direction_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief Specify the matrix direction.\n\n \\details\n The \\ref rocsparse_direction indicates whether a dense matrix should be parsed by\n rows or by columns, assuming column-major storage."]
pub use self::rocsparse_direction_ as rocsparse_direction;
#[doc = "< Automatically decide on ELL nnz per row."]
pub const rocsparse_hyb_partition__rocsparse_hyb_partition_auto: rocsparse_hyb_partition_ = 0;
#[doc = "< User-provided ELL nnz per row."]
pub const rocsparse_hyb_partition__rocsparse_hyb_partition_user: rocsparse_hyb_partition_ = 1;
#[doc = "< Max ELL nnz per row, no COO part."]
pub const rocsparse_hyb_partition__rocsparse_hyb_partition_max: rocsparse_hyb_partition_ = 2;
#[doc = " \\ingroup types_module\n \\brief HYB matrix partitioning type.\n\n \\details\n The \\ref rocsparse_hyb_partition type indicates how the hybrid format partitioning\n between COO and ELL storage formats is performed."]
pub type rocsparse_hyb_partition_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief HYB matrix partitioning type.\n\n \\details\n The \\ref rocsparse_hyb_partition type indicates how the hybrid format partitioning\n between COO and ELL storage formats is performed."]
pub use self::rocsparse_hyb_partition_ as rocsparse_hyb_partition;
#[doc = "< Try to reuse meta data."]
pub const rocsparse_analysis_policy__rocsparse_analysis_policy_reuse: rocsparse_analysis_policy_ =
0;
#[doc = "< Force to rebuild meta data."]
pub const rocsparse_analysis_policy__rocsparse_analysis_policy_force: rocsparse_analysis_policy_ =
1;
#[doc = " \\ingroup types_module\n \\brief Specify policy in analysis functions.\n\n \\details\n The \\ref rocsparse_analysis_policy specifies whether gathered analysis data should be\n reused or not. If meta data from, for example, a previous \\ref rocsparse_scsrilu0_analysis\n \"rocsparse_Xcsrilu0_analysis()\" call is available, it can be reused for subsequent calls to, for example,\n \\ref rocsparse_scsrsv_analysis \"rocsparse_Xcsrsv_analysis()\" and greatly improve performance\n of the analysis function."]
pub type rocsparse_analysis_policy_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief Specify policy in analysis functions.\n\n \\details\n The \\ref rocsparse_analysis_policy specifies whether gathered analysis data should be\n reused or not. If meta data from, for example, a previous \\ref rocsparse_scsrilu0_analysis\n \"rocsparse_Xcsrilu0_analysis()\" call is available, it can be reused for subsequent calls to, for example,\n \\ref rocsparse_scsrsv_analysis \"rocsparse_Xcsrsv_analysis()\" and greatly improve performance\n of the analysis function."]
pub use self::rocsparse_analysis_policy_ as rocsparse_analysis_policy;
#[doc = "< Automatically decide on level information."]
pub const rocsparse_solve_policy__rocsparse_solve_policy_auto: rocsparse_solve_policy_ = 0;
#[doc = " \\ingroup types_module\n \\brief Specify policy in triangular solvers and factorizations.\n\n \\details\n This is a placeholder."]
pub type rocsparse_solve_policy_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief Specify policy in triangular solvers and factorizations.\n\n \\details\n This is a placeholder."]
pub use self::rocsparse_solve_policy_ as rocsparse_solve_policy;
#[doc = "< Scalar pointers are in host memory."]
pub const rocsparse_pointer_mode__rocsparse_pointer_mode_host: rocsparse_pointer_mode_ = 0;
#[doc = "< Scalar pointers are in device memory."]
pub const rocsparse_pointer_mode__rocsparse_pointer_mode_device: rocsparse_pointer_mode_ = 1;
#[doc = " \\ingroup types_module\n \\brief Indicates if the pointer is a device pointer or host pointer.\n\n \\details\n The \\ref rocsparse_pointer_mode indicates whether scalar values are passed by\n reference on the host or device. The \\ref rocsparse_pointer_mode can be changed by\n rocsparse_set_pointer_mode(). The current pointer mode in use can be obtained by\n rocsparse_get_pointer_mode()."]
pub type rocsparse_pointer_mode_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief Indicates if the pointer is a device pointer or host pointer.\n\n \\details\n The \\ref rocsparse_pointer_mode indicates whether scalar values are passed by\n reference on the host or device. The \\ref rocsparse_pointer_mode can be changed by\n rocsparse_set_pointer_mode(). The current pointer mode in use can be obtained by\n rocsparse_get_pointer_mode()."]
pub use self::rocsparse_pointer_mode_ as rocsparse_pointer_mode;
#[doc = "< Layer is not active."]
pub const rocsparse_layer_mode_rocsparse_layer_mode_none: rocsparse_layer_mode = 0;
#[doc = "< Layer is in logging mode."]
pub const rocsparse_layer_mode_rocsparse_layer_mode_log_trace: rocsparse_layer_mode = 1;
#[doc = "< Layer is in benchmarking mode (deprecated)."]
pub const rocsparse_layer_mode_rocsparse_layer_mode_log_bench: rocsparse_layer_mode = 2;
#[doc = "< Layer is in debug mode."]
pub const rocsparse_layer_mode_rocsparse_layer_mode_log_debug: rocsparse_layer_mode = 4;
#[doc = " \\ingroup types_module\n \\brief Indicates if the layer is active through the use of a bitmask.\n\n \\details\n The \\ref rocsparse_layer_mode bit mask indicates the logging characteristics."]
pub type rocsparse_layer_mode = ::std::os::raw::c_uint;
#[doc = "< success."]
pub const rocsparse_status__rocsparse_status_success: rocsparse_status_ = 0;
#[doc = "< handle not initialized, invalid, or null."]
pub const rocsparse_status__rocsparse_status_invalid_handle: rocsparse_status_ = 1;
#[doc = "< function is not implemented."]
pub const rocsparse_status__rocsparse_status_not_implemented: rocsparse_status_ = 2;
#[doc = "< invalid pointer parameter."]
pub const rocsparse_status__rocsparse_status_invalid_pointer: rocsparse_status_ = 3;
#[doc = "< invalid size parameter."]
pub const rocsparse_status__rocsparse_status_invalid_size: rocsparse_status_ = 4;
#[doc = "< failed memory allocation, copy or dealloc."]
pub const rocsparse_status__rocsparse_status_memory_error: rocsparse_status_ = 5;
#[doc = "< other internal library failure."]
pub const rocsparse_status__rocsparse_status_internal_error: rocsparse_status_ = 6;
#[doc = "< invalid value parameter."]
pub const rocsparse_status__rocsparse_status_invalid_value: rocsparse_status_ = 7;
#[doc = "< device arch is not supported."]
pub const rocsparse_status__rocsparse_status_arch_mismatch: rocsparse_status_ = 8;
#[doc = "< encountered zero pivot."]
pub const rocsparse_status__rocsparse_status_zero_pivot: rocsparse_status_ = 9;
#[doc = "< descriptor has not been initialized."]
pub const rocsparse_status__rocsparse_status_not_initialized: rocsparse_status_ = 10;
#[doc = "< index types do not match."]
pub const rocsparse_status__rocsparse_status_type_mismatch: rocsparse_status_ = 11;
#[doc = "< sorted storage required."]
pub const rocsparse_status__rocsparse_status_requires_sorted_storage: rocsparse_status_ = 12;
#[doc = "< exception being thrown."]
pub const rocsparse_status__rocsparse_status_thrown_exception: rocsparse_status_ = 13;
#[doc = "< Nothing preventing the function to proceed"]
pub const rocsparse_status__rocsparse_status_continue: rocsparse_status_ = 14;
#[doc = " \\ingroup types_module\n \\brief List of rocSPARSE status codes definition.\n\n \\details\n This is a list of the \\ref rocsparse_status types that are used by the rocSPARSE\n library."]
pub type rocsparse_status_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of rocSPARSE status codes definition.\n\n \\details\n This is a list of the \\ref rocsparse_status types that are used by the rocSPARSE\n library."]
pub use self::rocsparse_status_ as rocsparse_status;
#[doc = "< Success."]
pub const rocsparse_data_status__rocsparse_data_status_success: rocsparse_data_status_ = 0;
#[doc = "< An inf value detected."]
pub const rocsparse_data_status__rocsparse_data_status_inf: rocsparse_data_status_ = 1;
#[doc = "< A nan value detected."]
pub const rocsparse_data_status__rocsparse_data_status_nan: rocsparse_data_status_ = 2;
#[doc = "< An invalid row pointer offset detected."]
pub const rocsparse_data_status__rocsparse_data_status_invalid_offset_ptr: rocsparse_data_status_ =
3;
#[doc = "< An invalid row index detected."]
pub const rocsparse_data_status__rocsparse_data_status_invalid_index: rocsparse_data_status_ = 4;
#[doc = "< Duplicate indices detected."]
pub const rocsparse_data_status__rocsparse_data_status_duplicate_entry: rocsparse_data_status_ = 5;
#[doc = "< Incorrect sorting detected."]
pub const rocsparse_data_status__rocsparse_data_status_invalid_sorting: rocsparse_data_status_ = 6;
#[doc = "< Incorrect fill mode detected."]
pub const rocsparse_data_status__rocsparse_data_status_invalid_fill: rocsparse_data_status_ = 7;
#[doc = " \\ingroup types_module\n \\brief List of rocSPARSE data status code definitions.\n\n \\details\n This is a list of the \\ref rocsparse_data_status types that are used by the rocSPARSE\n library in the matrix check routines."]
pub type rocsparse_data_status_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of rocSPARSE data status code definitions.\n\n \\details\n This is a list of the \\ref rocsparse_data_status types that are used by the rocSPARSE\n library in the matrix check routines."]
pub use self::rocsparse_data_status_ as rocsparse_data_status;
#[doc = "< 16-bit unsigned integer."]
pub const rocsparse_indextype__rocsparse_indextype_u16: rocsparse_indextype_ = 1;
#[doc = "< 32-bit signed integer."]
pub const rocsparse_indextype__rocsparse_indextype_i32: rocsparse_indextype_ = 2;
#[doc = "< 64-bit signed integer."]
pub const rocsparse_indextype__rocsparse_indextype_i64: rocsparse_indextype_ = 3;
#[doc = " \\ingroup types_module\n \\brief List of rocSPARSE index types.\n\n \\details\n Indicates the index width of a rocSPARSE index type."]
pub type rocsparse_indextype_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of rocSPARSE index types.\n\n \\details\n Indicates the index width of a rocSPARSE index type."]
pub use self::rocsparse_indextype_ as rocsparse_indextype;
#[doc = "< 16-bit floating point, real."]
pub const rocsparse_datatype__rocsparse_datatype_f16_r: rocsparse_datatype_ = 150;
#[doc = "< 32-bit floating point, real."]
pub const rocsparse_datatype__rocsparse_datatype_f32_r: rocsparse_datatype_ = 151;
#[doc = "< 64-bit floating point, real."]
pub const rocsparse_datatype__rocsparse_datatype_f64_r: rocsparse_datatype_ = 152;
#[doc = "< 32-bit floating point, complex."]
pub const rocsparse_datatype__rocsparse_datatype_f32_c: rocsparse_datatype_ = 154;
#[doc = "< 64-bit floating point, complex."]
pub const rocsparse_datatype__rocsparse_datatype_f64_c: rocsparse_datatype_ = 155;
#[doc = "< 8-bit signed integer, real"]
pub const rocsparse_datatype__rocsparse_datatype_i8_r: rocsparse_datatype_ = 160;
#[doc = "< 8-bit unsigned integer, real"]
pub const rocsparse_datatype__rocsparse_datatype_u8_r: rocsparse_datatype_ = 161;
#[doc = "< 32-bit signed integer, real"]
pub const rocsparse_datatype__rocsparse_datatype_i32_r: rocsparse_datatype_ = 162;
#[doc = "< 32-bit unsigned integer, real"]
pub const rocsparse_datatype__rocsparse_datatype_u32_r: rocsparse_datatype_ = 163;
#[doc = "< 16-bit brain floating point, real"]
pub const rocsparse_datatype__rocsparse_datatype_bf16_r: rocsparse_datatype_ = 168;
#[doc = " \\ingroup types_module\n \\brief List of rocSPARSE data types.\n\n \\details\n Indicates the precision width of data stored in a rocSPARSE type."]
pub type rocsparse_datatype_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of rocSPARSE data types.\n\n \\details\n Indicates the precision width of data stored in a rocSPARSE type."]
pub use self::rocsparse_datatype_ as rocsparse_datatype;
#[doc = "< COO sparse matrix format."]
pub const rocsparse_format__rocsparse_format_coo: rocsparse_format_ = 0;
#[doc = "< COO AoS sparse matrix format."]
pub const rocsparse_format__rocsparse_format_coo_aos: rocsparse_format_ = 1;
#[doc = "< CSR sparse matrix format."]
pub const rocsparse_format__rocsparse_format_csr: rocsparse_format_ = 2;
#[doc = "< CSC sparse matrix format."]
pub const rocsparse_format__rocsparse_format_csc: rocsparse_format_ = 3;
#[doc = "< ELL sparse matrix format."]
pub const rocsparse_format__rocsparse_format_ell: rocsparse_format_ = 4;
#[doc = "< Blocked ELL sparse matrix format."]
pub const rocsparse_format__rocsparse_format_bell: rocsparse_format_ = 5;
#[doc = "< BSR sparse matrix format."]
pub const rocsparse_format__rocsparse_format_bsr: rocsparse_format_ = 6;
#[doc = "< Sliced ELL sparse matrix format."]
pub const rocsparse_format__rocsparse_format_sell: rocsparse_format_ = 7;
#[doc = " \\ingroup types_module\n \\brief List of sparse matrix formats.\n\n \\details\n This is a list of supported \\ref rocsparse_format types that are used to describe a\n sparse matrix."]
pub type rocsparse_format_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of sparse matrix formats.\n\n \\details\n This is a list of supported \\ref rocsparse_format types that are used to describe a\n sparse matrix."]
pub use self::rocsparse_format_ as rocsparse_format;
#[doc = "< Row major."]
pub const rocsparse_order__rocsparse_order_row: rocsparse_order_ = 0;
#[doc = "< Column major."]
pub const rocsparse_order__rocsparse_order_column: rocsparse_order_ = 1;
#[doc = " \\ingroup types_module\n \\brief List of dense matrix ordering.\n\n \\details\n This is a list of supported \\ref rocsparse_order types that are used to describe the\n memory layout of a dense matrix."]
pub type rocsparse_order_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of dense matrix ordering.\n\n \\details\n This is a list of supported \\ref rocsparse_order types that are used to describe the\n memory layout of a dense matrix."]
pub use self::rocsparse_order_ as rocsparse_order;
#[doc = "< Fill mode attribute."]
pub const rocsparse_spmat_attribute__rocsparse_spmat_fill_mode: rocsparse_spmat_attribute_ = 0;
#[doc = "< Diag type attribute."]
pub const rocsparse_spmat_attribute__rocsparse_spmat_diag_type: rocsparse_spmat_attribute_ = 1;
#[doc = "< Matrix type attribute."]
pub const rocsparse_spmat_attribute__rocsparse_spmat_matrix_type: rocsparse_spmat_attribute_ = 2;
#[doc = "< Matrix storage attribute."]
pub const rocsparse_spmat_attribute__rocsparse_spmat_storage_mode: rocsparse_spmat_attribute_ = 3;
#[doc = " \\ingroup types_module\n \\brief List of sparse matrix attributes."]
pub type rocsparse_spmat_attribute_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of sparse matrix attributes."]
pub use self::rocsparse_spmat_attribute_ as rocsparse_spmat_attribute;
pub const rocsparse_sparse_to_sparse_alg__rocsparse_sparse_to_sparse_alg_default:
rocsparse_sparse_to_sparse_alg_ = 0;
#[doc = " \\ingroup types_module\n \\brief List of sparse-to-sparse algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_sparse_to_sparse_alg types that are used to perform\n sparse-to-sparse conversion."]
pub type rocsparse_sparse_to_sparse_alg_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of sparse-to-sparse algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_sparse_to_sparse_alg types that are used to perform\n sparse-to-sparse conversion."]
pub use self::rocsparse_sparse_to_sparse_alg_ as rocsparse_sparse_to_sparse_alg;
#[doc = "< Data analysis."]
pub const rocsparse_sparse_to_sparse_stage__rocsparse_sparse_to_sparse_stage_analysis:
rocsparse_sparse_to_sparse_stage_ = 0;
#[doc = "< Performs the actual conversion."]
pub const rocsparse_sparse_to_sparse_stage__rocsparse_sparse_to_sparse_stage_compute:
rocsparse_sparse_to_sparse_stage_ = 1;
#[doc = " \\ingroup types_module\n \\brief List of sparse-to-sparse stages.\n\n \\details\n This is a list of possible stages during sparse-to-sparse conversion. The typical order is\n \\ref rocsparse_sparse_to_sparse_stage_analysis, then \\ref rocsparse_sparse_to_sparse_stage_compute."]
pub type rocsparse_sparse_to_sparse_stage_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of sparse-to-sparse stages.\n\n \\details\n This is a list of possible stages during sparse-to-sparse conversion. The typical order is\n \\ref rocsparse_sparse_to_sparse_stage_analysis, then \\ref rocsparse_sparse_to_sparse_stage_compute."]
pub use self::rocsparse_sparse_to_sparse_stage_ as rocsparse_sparse_to_sparse_stage;
#[doc = "< Default extract algorithm for the given format."]
pub const rocsparse_extract_alg__rocsparse_extract_alg_default: rocsparse_extract_alg_ = 0;
#[doc = " \\ingroup types_module\n \\brief List of extract algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_extract_alg types that are used to perform\n the submatrix extraction."]
pub type rocsparse_extract_alg_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of extract algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_extract_alg types that are used to perform\n the submatrix extraction."]
pub use self::rocsparse_extract_alg_ as rocsparse_extract_alg;
#[doc = "< Data analysis."]
pub const rocsparse_extract_stage__rocsparse_extract_stage_analysis: rocsparse_extract_stage_ = 0;
#[doc = "< Performs the actual extraction."]
pub const rocsparse_extract_stage__rocsparse_extract_stage_compute: rocsparse_extract_stage_ = 1;
#[doc = " \\ingroup types_module\n \\brief List of extract stages.\n\n \\details\n The analysis \\ref rocsparse_extract_stage_analysis must be done before the first call of the calculation function \\ref rocsparse_extract_stage_compute."]
pub type rocsparse_extract_stage_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of extract stages.\n\n \\details\n The analysis \\ref rocsparse_extract_stage_analysis must be done before the first call of the calculation function \\ref rocsparse_extract_stage_compute."]
pub use self::rocsparse_extract_stage_ as rocsparse_extract_stage;
#[doc = "< Asynchronous ITILU0 algorithm with in-place storage."]
pub const rocsparse_itilu0_alg__rocsparse_itilu0_alg_default: rocsparse_itilu0_alg_ = 0;
pub const rocsparse_itilu0_alg__rocsparse_itilu0_alg_async_inplace: rocsparse_itilu0_alg_ = 1;
pub const rocsparse_itilu0_alg__rocsparse_itilu0_alg_async_split: rocsparse_itilu0_alg_ = 2;
pub const rocsparse_itilu0_alg__rocsparse_itilu0_alg_sync_split: rocsparse_itilu0_alg_ = 3;
pub const rocsparse_itilu0_alg__rocsparse_itilu0_alg_sync_split_fusion: rocsparse_itilu0_alg_ = 4;
#[doc = " \\ingroup types_module\n \\brief List of Iterative ILU0 algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_itilu0_alg types that are used to perform\n the iterative ILU0 algorithm."]
pub type rocsparse_itilu0_alg_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of Iterative ILU0 algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_itilu0_alg types that are used to perform\n the iterative ILU0 algorithm."]
pub use self::rocsparse_itilu0_alg_ as rocsparse_itilu0_alg;
#[doc = "< Compute a stopping criteria."]
pub const rocsparse_itilu0_option__rocsparse_itilu0_option_verbose: rocsparse_itilu0_option_ = 1;
#[doc = "< Compute a stopping criteria."]
pub const rocsparse_itilu0_option__rocsparse_itilu0_option_stopping_criteria:
rocsparse_itilu0_option_ = 2;
#[doc = "< Compute correction."]
pub const rocsparse_itilu0_option__rocsparse_itilu0_option_compute_nrm_correction:
rocsparse_itilu0_option_ = 4;
#[doc = "< Compute residual."]
pub const rocsparse_itilu0_option__rocsparse_itilu0_option_compute_nrm_residual:
rocsparse_itilu0_option_ = 8;
#[doc = "< Log convergence history."]
pub const rocsparse_itilu0_option__rocsparse_itilu0_option_convergence_history:
rocsparse_itilu0_option_ = 16;
#[doc = "< Use internal coordinate format."]
pub const rocsparse_itilu0_option__rocsparse_itilu0_option_coo_format: rocsparse_itilu0_option_ =
32;
#[doc = " \\ingroup types_module\n \\brief List of iterative ILU0 options.\n\n \\details\n This is a list of supported \\ref rocsparse_itilu0_option options that are used to perform\n the iterative ILU0 algorithm."]
pub type rocsparse_itilu0_option_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of iterative ILU0 options.\n\n \\details\n This is a list of supported \\ref rocsparse_itilu0_option options that are used to perform\n the iterative ILU0 algorithm."]
pub use self::rocsparse_itilu0_option_ as rocsparse_itilu0_option;
pub const rocsparse_gtsv_interleaved_alg__rocsparse_gtsv_interleaved_alg_default:
rocsparse_gtsv_interleaved_alg_ = 0;
pub const rocsparse_gtsv_interleaved_alg__rocsparse_gtsv_interleaved_alg_thomas:
rocsparse_gtsv_interleaved_alg_ = 1;
pub const rocsparse_gtsv_interleaved_alg__rocsparse_gtsv_interleaved_alg_lu:
rocsparse_gtsv_interleaved_alg_ = 2;
pub const rocsparse_gtsv_interleaved_alg__rocsparse_gtsv_interleaved_alg_qr:
rocsparse_gtsv_interleaved_alg_ = 3;
#[doc = " \\ingroup types_module\n \\brief List of interleaved gtsv algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_gtsv_interleaved_alg types that are used to perform\n interleaved tridiagonal solve."]
pub type rocsparse_gtsv_interleaved_alg_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of interleaved gtsv algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_gtsv_interleaved_alg types that are used to perform\n interleaved tridiagonal solve."]
pub use self::rocsparse_gtsv_interleaved_alg_ as rocsparse_gtsv_interleaved_alg;
#[doc = "< Returns the required buffer size."]
pub const rocsparse_check_spmat_stage__rocsparse_check_spmat_stage_buffer_size:
rocsparse_check_spmat_stage_ = 0;
#[doc = "< Performs check."]
pub const rocsparse_check_spmat_stage__rocsparse_check_spmat_stage_compute:
rocsparse_check_spmat_stage_ = 1;
#[doc = " \\ingroup types_module\n \\brief List of check matrix stages.\n\n \\details\n This is a list of possible stages during check matrix computation. The typical order is\n \\ref rocsparse_check_spmat_stage_buffer_size, then \\ref rocsparse_check_spmat_stage_compute."]
pub type rocsparse_check_spmat_stage_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of check matrix stages.\n\n \\details\n This is a list of possible stages during check matrix computation. The typical order is\n \\ref rocsparse_check_spmat_stage_buffer_size, then \\ref rocsparse_check_spmat_stage_compute."]
pub use self::rocsparse_check_spmat_stage_ as rocsparse_check_spmat_stage;
#[doc = "< Select algorithm for input on a SpMV descriptor."]
pub const rocsparse_spmv_input__rocsparse_spmv_input_alg: rocsparse_spmv_input_ = 0;
#[doc = "< Select matrix transpose operation for input on a SpMV descriptor."]
pub const rocsparse_spmv_input__rocsparse_spmv_input_operation: rocsparse_spmv_input_ = 1;
#[doc = "< Select scalar datatype for input on a SpMV descriptor."]
pub const rocsparse_spmv_input__rocsparse_spmv_input_scalar_datatype: rocsparse_spmv_input_ = 2;
#[doc = "< Select compute datatype for input on a SpMV descriptor."]
pub const rocsparse_spmv_input__rocsparse_spmv_input_compute_datatype: rocsparse_spmv_input_ = 3;
#[doc = "< Configure usage of starting block IDs for non-zero split."]
pub const rocsparse_spmv_input__rocsparse_spmv_input_nnz_use_starting_block_ids:
rocsparse_spmv_input_ = 4;
#[doc = "< Enable/disable extra vectors computation for SpMV descriptor."]
pub const rocsparse_spmv_input__rocsparse_spmv_input_enable_extra: rocsparse_spmv_input_ = 5;
#[doc = " \\ingroup types_module\n \\brief List of inputs to the SpMV descriptor.\n\n \\details\n This is a list of possible inputs to the SpMV descriptor."]
pub type rocsparse_spmv_input_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of inputs to the SpMV descriptor.\n\n \\details\n This is a list of possible inputs to the SpMV descriptor."]
pub use self::rocsparse_spmv_input_ as rocsparse_spmv_input;
#[doc = "< Analysis of the data."]
pub const rocsparse_v2_spmv_stage__rocsparse_v2_spmv_stage_analysis: rocsparse_v2_spmv_stage_ = 0;
#[doc = "< Performs the actual SpMV computation."]
pub const rocsparse_v2_spmv_stage__rocsparse_v2_spmv_stage_compute: rocsparse_v2_spmv_stage_ = 1;
#[doc = " \\ingroup types_module\n \\brief List of SpMV-Version2 stages.\n\n \\details\n This is a list of possible stages during SpMV-Version2 computation."]
pub type rocsparse_v2_spmv_stage_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of SpMV-Version2 stages.\n\n \\details\n This is a list of possible stages during SpMV-Version2 computation."]
pub use self::rocsparse_v2_spmv_stage_ as rocsparse_v2_spmv_stage;
#[doc = "< Returns the required buffer size."]
pub const rocsparse_spmv_stage__rocsparse_spmv_stage_buffer_size: rocsparse_spmv_stage_ = 1;
#[doc = "< Preprocess data."]
pub const rocsparse_spmv_stage__rocsparse_spmv_stage_preprocess: rocsparse_spmv_stage_ = 2;
#[doc = "< Performs the actual SpMV computation."]
pub const rocsparse_spmv_stage__rocsparse_spmv_stage_compute: rocsparse_spmv_stage_ = 3;
#[doc = " \\ingroup types_module\n \\brief List of SpMV stages.\n\n \\details\n This is a list of possible stages during SpMV computation. The typical order is\n \\ref rocsparse_spmv_stage_buffer_size, \\ref rocsparse_spmv_stage_preprocess, and \\ref rocsparse_spmv_stage_compute."]
pub type rocsparse_spmv_stage_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of SpMV stages.\n\n \\details\n This is a list of possible stages during SpMV computation. The typical order is\n \\ref rocsparse_spmv_stage_buffer_size, \\ref rocsparse_spmv_stage_preprocess, and \\ref rocsparse_spmv_stage_compute."]
pub use self::rocsparse_spmv_stage_ as rocsparse_spmv_stage;
#[doc = "< Default SpMV algorithm for the given format."]
pub const rocsparse_spmv_alg__rocsparse_spmv_alg_default: rocsparse_spmv_alg_ = 0;
#[doc = "< COO SpMV algorithm 1 (segmented) for COO matrices."]
pub const rocsparse_spmv_alg__rocsparse_spmv_alg_coo: rocsparse_spmv_alg_ = 1;
#[doc = "< CSR SpMV algorithm 1 (adaptive) for CSR matrices."]
pub const rocsparse_spmv_alg__rocsparse_spmv_alg_csr_adaptive: rocsparse_spmv_alg_ = 2;
#[doc = "< CSR SpMV algorithm 2 (rowsplit) for CSR matrices."]
pub const rocsparse_spmv_alg__rocsparse_spmv_alg_csr_rowsplit: rocsparse_spmv_alg_ = 3;
#[doc = "< ELL SpMV algorithm for ELL matrices."]
pub const rocsparse_spmv_alg__rocsparse_spmv_alg_ell: rocsparse_spmv_alg_ = 4;
#[doc = "< COO SpMV algorithm 2 (atomic) for COO matrices."]
pub const rocsparse_spmv_alg__rocsparse_spmv_alg_coo_atomic: rocsparse_spmv_alg_ = 5;
#[doc = "< BSR SpMV algorithm 1 for BSR matrices."]
pub const rocsparse_spmv_alg__rocsparse_spmv_alg_bsr: rocsparse_spmv_alg_ = 6;
#[doc = "< CSR SpMV algorithm 3 (LRB) for CSR matrices."]
pub const rocsparse_spmv_alg__rocsparse_spmv_alg_csr_lrb: rocsparse_spmv_alg_ = 7;
#[doc = "< CSR SpMV algorithm 4 (nnzsplit) for CSR matrices."]
pub const rocsparse_spmv_alg__rocsparse_spmv_alg_csr_nnzsplit: rocsparse_spmv_alg_ = 8;
#[doc = "< SLICED ELL SpMV algorithm for SLICED ELL matrices."]
pub const rocsparse_spmv_alg__rocsparse_spmv_alg_sell: rocsparse_spmv_alg_ = 9;
pub const rocsparse_spmv_alg__rocsparse_spmv_alg_csr_stream: rocsparse_spmv_alg_ = 3;
#[doc = " \\ingroup types_module\n \\brief List of SpMV algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_spmv_alg types that are used to perform\n matrix vector product."]
pub type rocsparse_spmv_alg_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of SpMV algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_spmv_alg types that are used to perform\n matrix vector product."]
pub use self::rocsparse_spmv_alg_ as rocsparse_spmv_alg;
#[doc = "< Default SpSV algorithm for the given format."]
pub const rocsparse_spsv_alg__rocsparse_spsv_alg_default: rocsparse_spsv_alg_ = 0;
#[doc = " \\ingroup types_module\n \\brief List of SpSV algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_spsv_alg types that are used to perform\n triangular solve."]
pub type rocsparse_spsv_alg_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of SpSV algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_spsv_alg types that are used to perform\n triangular solve."]
pub use self::rocsparse_spsv_alg_ as rocsparse_spsv_alg;
#[doc = "< Returns the required buffer size."]
pub const rocsparse_spsv_stage__rocsparse_spsv_stage_buffer_size: rocsparse_spsv_stage_ = 1;
#[doc = "< Preprocess data."]
pub const rocsparse_spsv_stage__rocsparse_spsv_stage_preprocess: rocsparse_spsv_stage_ = 2;
#[doc = "< Performs the actual SpSV computation."]
pub const rocsparse_spsv_stage__rocsparse_spsv_stage_compute: rocsparse_spsv_stage_ = 3;
#[doc = " \\ingroup types_module\n \\brief List of SpSV stages.\n\n \\details\n This is a list of possible stages during SpSV computation. The typical order is\n \\ref rocsparse_spsv_stage_buffer_size, \\ref rocsparse_spsv_stage_preprocess, and \\ref rocsparse_spsv_stage_compute."]
pub type rocsparse_spsv_stage_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of SpSV stages.\n\n \\details\n This is a list of possible stages during SpSV computation. The typical order is\n \\ref rocsparse_spsv_stage_buffer_size, \\ref rocsparse_spsv_stage_preprocess, and \\ref rocsparse_spsv_stage_compute."]
pub use self::rocsparse_spsv_stage_ as rocsparse_spsv_stage;
#[doc = "< Default SpITSV algorithm for the given format."]
pub const rocsparse_spitsv_alg__rocsparse_spitsv_alg_default: rocsparse_spitsv_alg_ = 0;
#[doc = " \\ingroup types_module\n \\brief List of SpITSV algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_spitsv_alg types that are used to perform\n triangular solve."]
pub type rocsparse_spitsv_alg_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of SpITSV algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_spitsv_alg types that are used to perform\n triangular solve."]
pub use self::rocsparse_spitsv_alg_ as rocsparse_spitsv_alg;
#[doc = "< Returns the required buffer size."]
pub const rocsparse_spitsv_stage__rocsparse_spitsv_stage_buffer_size: rocsparse_spitsv_stage_ = 1;
#[doc = "< Preprocess data."]
pub const rocsparse_spitsv_stage__rocsparse_spitsv_stage_preprocess: rocsparse_spitsv_stage_ = 2;
#[doc = "< Performs the actual SpITSV computation."]
pub const rocsparse_spitsv_stage__rocsparse_spitsv_stage_compute: rocsparse_spitsv_stage_ = 3;
#[doc = " \\ingroup types_module\n \\brief List of SpITSV stages.\n\n \\details\n This is a list of possible stages during SpITSV computation. The typical order is\n \\ref rocsparse_spitsv_stage_buffer_size, \\ref rocsparse_spitsv_stage_preprocess, and \\ref rocsparse_spitsv_stage_compute."]
pub type rocsparse_spitsv_stage_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of SpITSV stages.\n\n \\details\n This is a list of possible stages during SpITSV computation. The typical order is\n \\ref rocsparse_spitsv_stage_buffer_size, \\ref rocsparse_spitsv_stage_preprocess, and \\ref rocsparse_spitsv_stage_compute."]
pub use self::rocsparse_spitsv_stage_ as rocsparse_spitsv_stage;
#[doc = "< Default SpSM algorithm for the given format."]
pub const rocsparse_spsm_alg__rocsparse_spsm_alg_default: rocsparse_spsm_alg_ = 0;
#[doc = " \\ingroup types_module\n \\brief List of SpSM algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_spsm_alg types that are used to perform\n triangular solve."]
pub type rocsparse_spsm_alg_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of SpSM algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_spsm_alg types that are used to perform\n triangular solve."]
pub use self::rocsparse_spsm_alg_ as rocsparse_spsm_alg;
#[doc = "< Returns the required buffer size."]
pub const rocsparse_spsm_stage__rocsparse_spsm_stage_buffer_size: rocsparse_spsm_stage_ = 1;
#[doc = "< Preprocess data."]
pub const rocsparse_spsm_stage__rocsparse_spsm_stage_preprocess: rocsparse_spsm_stage_ = 2;
#[doc = "< Performs the actual SpSM computation."]
pub const rocsparse_spsm_stage__rocsparse_spsm_stage_compute: rocsparse_spsm_stage_ = 3;
#[doc = " \\ingroup types_module\n \\brief List of SpSM stages.\n\n \\details\n This is a list of possible stages during SpSM computation. The typical order is\n \\ref rocsparse_spsm_stage_buffer_size, \\ref rocsparse_spsm_stage_preprocess, and \\ref rocsparse_spsm_stage_compute."]
pub type rocsparse_spsm_stage_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of SpSM stages.\n\n \\details\n This is a list of possible stages during SpSM computation. The typical order is\n \\ref rocsparse_spsm_stage_buffer_size, \\ref rocsparse_spsm_stage_preprocess, and \\ref rocsparse_spsm_stage_compute."]
pub use self::rocsparse_spsm_stage_ as rocsparse_spsm_stage;
#[doc = "< Default SpMM algorithm for the given format."]
pub const rocsparse_spmm_alg__rocsparse_spmm_alg_default: rocsparse_spmm_alg_ = 0;
#[doc = "< SpMM algorithm for the CSR format using row split and shared memory."]
pub const rocsparse_spmm_alg__rocsparse_spmm_alg_csr: rocsparse_spmm_alg_ = 1;
#[doc = "< SpMM algorithm for the COO format using segmented scan."]
pub const rocsparse_spmm_alg__rocsparse_spmm_alg_coo_segmented: rocsparse_spmm_alg_ = 2;
#[doc = "< SpMM algorithm for the COO format using atomics."]
pub const rocsparse_spmm_alg__rocsparse_spmm_alg_coo_atomic: rocsparse_spmm_alg_ = 3;
#[doc = "< SpMM algorithm for the CSR format using row split and shfl."]
pub const rocsparse_spmm_alg__rocsparse_spmm_alg_csr_row_split: rocsparse_spmm_alg_ = 4;
#[doc = "< SpMM algorithm for CSR format using the nnz split algorithm. This is the same as \\p rocsparse_spmm_alg_csr_nnz_split."]
pub const rocsparse_spmm_alg__rocsparse_spmm_alg_csr_merge: rocsparse_spmm_alg_ = 5;
#[doc = "< SpMM algorithm for the COO format using segmented scan and atomics."]
pub const rocsparse_spmm_alg__rocsparse_spmm_alg_coo_segmented_atomic: rocsparse_spmm_alg_ = 6;
#[doc = "< SpMM algorithm for the Blocked ELL format."]
pub const rocsparse_spmm_alg__rocsparse_spmm_alg_bell: rocsparse_spmm_alg_ = 7;
#[doc = "< SpMM algorithm for the BSR format."]
pub const rocsparse_spmm_alg__rocsparse_spmm_alg_bsr: rocsparse_spmm_alg_ = 8;
#[doc = "< SpMM algorithm for the CSR format using the merge path algorithm."]
pub const rocsparse_spmm_alg__rocsparse_spmm_alg_csr_merge_path: rocsparse_spmm_alg_ = 9;
pub const rocsparse_spmm_alg__rocsparse_spmm_alg_csr_nnz_split: rocsparse_spmm_alg_ = 5;
#[doc = " \\ingroup types_module\n \\brief List of SpMM algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_spmm_alg types that are used to perform\n matrix vector product."]
pub type rocsparse_spmm_alg_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of SpMM algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_spmm_alg types that are used to perform\n matrix vector product."]
pub use self::rocsparse_spmm_alg_ as rocsparse_spmm_alg;
#[doc = "< Default sddmm algorithm for the given format."]
pub const rocsparse_sddmm_alg__rocsparse_sddmm_alg_default: rocsparse_sddmm_alg_ = 0;
#[doc = "< Sddmm algorithm using dense blas operations."]
pub const rocsparse_sddmm_alg__rocsparse_sddmm_alg_dense: rocsparse_sddmm_alg_ = 1;
#[doc = " \\ingroup types_module\n \\brief List of sddmm algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_sddmm_alg types that are used to perform\n matrix vector product."]
pub type rocsparse_sddmm_alg_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of sddmm algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_sddmm_alg types that are used to perform\n matrix vector product."]
pub use self::rocsparse_sddmm_alg_ as rocsparse_sddmm_alg;
pub const rocsparse_sparse_to_dense_alg__rocsparse_sparse_to_dense_alg_default:
rocsparse_sparse_to_dense_alg_ = 0;
#[doc = " \\ingroup types_module\n \\brief List of sparse-to-dense algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_sparse_to_dense_alg types that are used to perform\n sparse-to-dense conversion."]
pub type rocsparse_sparse_to_dense_alg_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of sparse-to-dense algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_sparse_to_dense_alg types that are used to perform\n sparse-to-dense conversion."]
pub use self::rocsparse_sparse_to_dense_alg_ as rocsparse_sparse_to_dense_alg;
pub const rocsparse_dense_to_sparse_alg__rocsparse_dense_to_sparse_alg_default:
rocsparse_dense_to_sparse_alg_ = 0;
#[doc = " \\ingroup types_module\n \\brief List of dense-to-sparse algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_dense_to_sparse_alg types that are used to perform\n dense-to-sparse conversion."]
pub type rocsparse_dense_to_sparse_alg_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of dense-to-sparse algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_dense_to_sparse_alg types that are used to perform\n dense-to-sparse conversion."]
pub use self::rocsparse_dense_to_sparse_alg_ as rocsparse_dense_to_sparse_alg;
#[doc = "< Returns the required buffer size."]
pub const rocsparse_spmm_stage__rocsparse_spmm_stage_buffer_size: rocsparse_spmm_stage_ = 1;
#[doc = "< Preprocess data."]
pub const rocsparse_spmm_stage__rocsparse_spmm_stage_preprocess: rocsparse_spmm_stage_ = 2;
#[doc = "< Performs the actual SpMM computation."]
pub const rocsparse_spmm_stage__rocsparse_spmm_stage_compute: rocsparse_spmm_stage_ = 3;
#[doc = " \\ingroup types_module\n \\brief List of SpMM stages.\n\n \\details\n This is a list of possible stages during SpMM computation. The typical order is\n \\ref rocsparse_spmm_stage_buffer_size, \\ref rocsparse_spmm_stage_preprocess, and \\ref rocsparse_spmm_stage_compute."]
pub type rocsparse_spmm_stage_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of SpMM stages.\n\n \\details\n This is a list of possible stages during SpMM computation. The typical order is\n \\ref rocsparse_spmm_stage_buffer_size, \\ref rocsparse_spmm_stage_preprocess, and \\ref rocsparse_spmm_stage_compute."]
pub use self::rocsparse_spmm_stage_ as rocsparse_spmm_stage;
#[doc = "< Returns the required buffer size."]
pub const rocsparse_spgemm_stage__rocsparse_spgemm_stage_buffer_size: rocsparse_spgemm_stage_ = 1;
#[doc = "< Computes the number of non-zero entries."]
pub const rocsparse_spgemm_stage__rocsparse_spgemm_stage_nnz: rocsparse_spgemm_stage_ = 2;
#[doc = "< Performs the actual SpGEMM computation."]
pub const rocsparse_spgemm_stage__rocsparse_spgemm_stage_compute: rocsparse_spgemm_stage_ = 3;
#[doc = "< Performs the actual SpGEMM symbolic computation."]
pub const rocsparse_spgemm_stage__rocsparse_spgemm_stage_symbolic: rocsparse_spgemm_stage_ = 4;
#[doc = "< Performs the actual SpGEMM numeric computation."]
pub const rocsparse_spgemm_stage__rocsparse_spgemm_stage_numeric: rocsparse_spgemm_stage_ = 5;
#[doc = " \\ingroup types_module\n \\brief List of SpGEMM stages.\n\n \\details\n This is a list of possible stages during SpGEMM computation. The typical order is\n \\ref rocsparse_spgemm_stage_buffer_size, \\ref rocsparse_spgemm_stage_nnz, and \\ref rocsparse_spgemm_stage_compute."]
pub type rocsparse_spgemm_stage_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of SpGEMM stages.\n\n \\details\n This is a list of possible stages during SpGEMM computation. The typical order is\n \\ref rocsparse_spgemm_stage_buffer_size, \\ref rocsparse_spgemm_stage_nnz, and \\ref rocsparse_spgemm_stage_compute."]
pub use self::rocsparse_spgemm_stage_ as rocsparse_spgemm_stage;
#[doc = "< Default SpGEMM algorithm for the given format."]
pub const rocsparse_spgemm_alg__rocsparse_spgemm_alg_default: rocsparse_spgemm_alg_ = 0;
#[doc = " \\ingroup types_module\n \\brief List of SpGEMM algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_spgemm_alg types that are used to perform a\n sparse matrix sparse matrix product."]
pub type rocsparse_spgemm_alg_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of SpGEMM algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_spgemm_alg types that are used to perform a\n sparse matrix sparse matrix product."]
pub use self::rocsparse_spgemm_alg_ as rocsparse_spgemm_alg;
#[doc = "< No singularity detected."]
pub const rocsparse_singularity__rocsparse_singularity_none: rocsparse_singularity_ = 0;
#[doc = "< The sparsity pattern inherently prevents a full rank, for example, a missing diagonal element."]
pub const rocsparse_singularity__rocsparse_singularity_symbolic: rocsparse_singularity_ = 1;
#[doc = "< An exact zero was encountered during numerical calculation."]
pub const rocsparse_singularity__rocsparse_singularity_numeric_exact: rocsparse_singularity_ = 2;
#[doc = "< A near zero was encountered during numerical calculation, that is, within a given tolerance."]
pub const rocsparse_singularity__rocsparse_singularity_numeric_near: rocsparse_singularity_ = 3;
#[doc = " \\ingroup types_module\n \\brief List of singularity types encountered in triangular solves and incomplete factorizations."]
pub type rocsparse_singularity_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of singularity types encountered in triangular solves and incomplete factorizations."]
pub use self::rocsparse_singularity_ as rocsparse_singularity;
#[doc = "< Default SpTRSV algorithm for the given format."]
pub const rocsparse_sptrsv_alg__rocsparse_sptrsv_alg_default: rocsparse_sptrsv_alg_ = 0;
#[doc = " \\ingroup types_module\n \\brief List of SpTRSV algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_sptrsv_alg types that are used to perform\n triangular solve."]
pub type rocsparse_sptrsv_alg_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of SpTRSV algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_sptrsv_alg types that are used to perform\n triangular solve."]
pub use self::rocsparse_sptrsv_alg_ as rocsparse_sptrsv_alg;
#[doc = "< Analysis."]
pub const rocsparse_sptrsv_stage__rocsparse_sptrsv_stage_analysis: rocsparse_sptrsv_stage_ = 0;
#[doc = "< Performs the actual SpTRSV computation."]
pub const rocsparse_sptrsv_stage__rocsparse_sptrsv_stage_compute: rocsparse_sptrsv_stage_ = 1;
#[doc = " \\ingroup types_module\n \\brief List of SpTRSV stages.\n\n \\details\n This is a list of possible stages during SpTRSV computation."]
pub type rocsparse_sptrsv_stage_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of SpTRSV stages.\n\n \\details\n This is a list of possible stages during SpTRSV computation."]
pub use self::rocsparse_sptrsv_stage_ as rocsparse_sptrsv_stage;
#[doc = "< Select algorithm \\ref rocsparse_sptrsv_alg for input on a SpTRSV descriptor."]
pub const rocsparse_sptrsv_input__rocsparse_sptrsv_input_alg: rocsparse_sptrsv_input_ = 0;
#[doc = "< Select matrix operation \\ref rocsparse_operation for input on a SpTRSV descriptor."]
pub const rocsparse_sptrsv_input__rocsparse_sptrsv_input_operation: rocsparse_sptrsv_input_ = 1;
#[doc = "< Select scalar datatype \\ref rocsparse_datatype for input on a SpTRSV descriptor."]
pub const rocsparse_sptrsv_input__rocsparse_sptrsv_input_scalar_datatype: rocsparse_sptrsv_input_ =
2;
#[doc = "< Select compute datatype \\ref rocsparse_datatype for input on a SpTRSV descriptor."]
pub const rocsparse_sptrsv_input__rocsparse_sptrsv_input_compute_datatype: rocsparse_sptrsv_input_ =
3;
#[doc = "< Select scalar alpha pointer for input on a SpTRSV descriptor."]
pub const rocsparse_sptrsv_input__rocsparse_sptrsv_input_scalar_alpha: rocsparse_sptrsv_input_ = 4;
#[doc = "< Select the analysis policy \\ref rocsparse_analysis_policy for input on a SpTRSV descriptor."]
pub const rocsparse_sptrsv_input__rocsparse_sptrsv_input_analysis_policy: rocsparse_sptrsv_input_ =
5;
#[doc = " \\ingroup types_module\n \\brief List of inputs to the SpTRSV descriptor.\n\n \\details\n This is a list of possible inputs to the SpTRSV descriptor."]
pub type rocsparse_sptrsv_input_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of inputs to the SpTRSV descriptor.\n\n \\details\n This is a list of possible inputs to the SpTRSV descriptor."]
pub use self::rocsparse_sptrsv_input_ as rocsparse_sptrsv_input;
#[doc = "< Get zero pivot \\p int64_t based position for output from the SpTRSV descriptor."]
pub const rocsparse_sptrsv_output__rocsparse_sptrsv_output_zero_pivot_position:
rocsparse_sptrsv_output_ = 0;
#[doc = "< Get the type of \\ref rocsparse_singularity detected during SpTRSV calculation for output from the SpTRSV descriptor."]
pub const rocsparse_sptrsv_output__rocsparse_sptrsv_output_singularity: rocsparse_sptrsv_output_ =
1;
#[doc = "< Get the singularity \\p int64_t based position for output from the SpTRSV descriptor."]
pub const rocsparse_sptrsv_output__rocsparse_sptrsv_output_singularity_position:
rocsparse_sptrsv_output_ = 2;
#[doc = " \\ingroup types_module\n \\brief List of outputs to SpTRSV descriptor.\n\n \\details\n This is a list of possible outputs to the SpTRSV descriptor."]
pub type rocsparse_sptrsv_output_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of outputs to SpTRSV descriptor.\n\n \\details\n This is a list of possible outputs to the SpTRSV descriptor."]
pub use self::rocsparse_sptrsv_output_ as rocsparse_sptrsv_output;
#[doc = "< Default SpTRSM algorithm for the given format."]
pub const rocsparse_sptrsm_alg__rocsparse_sptrsm_alg_default: rocsparse_sptrsm_alg_ = 0;
#[doc = " \\ingroup types_module\n \\brief List of SpTRSM algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_sptrsm_alg types that are used to perform\n triangular solve."]
pub type rocsparse_sptrsm_alg_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of SpTRSM algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_sptrsm_alg types that are used to perform\n triangular solve."]
pub use self::rocsparse_sptrsm_alg_ as rocsparse_sptrsm_alg;
#[doc = "< Analysis."]
pub const rocsparse_sptrsm_stage__rocsparse_sptrsm_stage_analysis: rocsparse_sptrsm_stage_ = 0;
#[doc = "< Performs the actual SpTRSM computation."]
pub const rocsparse_sptrsm_stage__rocsparse_sptrsm_stage_compute: rocsparse_sptrsm_stage_ = 1;
#[doc = " \\ingroup types_module\n \\brief List of SpTRSM stages.\n\n \\details\n This is a list of possible stages during SpTRSM computation."]
pub type rocsparse_sptrsm_stage_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of SpTRSM stages.\n\n \\details\n This is a list of possible stages during SpTRSM computation."]
pub use self::rocsparse_sptrsm_stage_ as rocsparse_sptrsm_stage;
#[doc = "< Select algorithm \\ref rocsparse_sptrsm_alg for input on a SpTRSM descriptor."]
pub const rocsparse_sptrsm_input__rocsparse_sptrsm_input_alg: rocsparse_sptrsm_input_ = 0;
#[doc = "< Select matrix A operation \\ref rocsparse_operation for input on a SpTRSM descriptor."]
pub const rocsparse_sptrsm_input__rocsparse_sptrsm_input_operation_A: rocsparse_sptrsm_input_ = 1;
#[doc = "< Select matrix X operation \\ref rocsparse_operation for input on a SpTRSM descriptor."]
pub const rocsparse_sptrsm_input__rocsparse_sptrsm_input_operation_X: rocsparse_sptrsm_input_ = 2;
#[doc = "< Select compute datatype \\ref rocsparse_datatype for input on a SpTRSM descriptor."]
pub const rocsparse_sptrsm_input__rocsparse_sptrsm_input_compute_datatype: rocsparse_sptrsm_input_ =
3;
#[doc = "< Select scalar datatype \\ref rocsparse_datatype for input on a SpTRSM descriptor."]
pub const rocsparse_sptrsm_input__rocsparse_sptrsm_input_scalar_datatype: rocsparse_sptrsm_input_ =
4;
#[doc = "< Select scalar alpha pointer for input on a SpTRSM descriptor. This datatype is used as the compute type."]
pub const rocsparse_sptrsm_input__rocsparse_sptrsm_input_scalar_alpha: rocsparse_sptrsm_input_ = 5;
#[doc = "< Select the analysis policy \\ref rocsparse_analysis_policy for input on a SpTRSM descriptor."]
pub const rocsparse_sptrsm_input__rocsparse_sptrsm_input_analysis_policy: rocsparse_sptrsm_input_ =
6;
#[doc = " \\ingroup types_module\n \\brief List of inputs to the SpTRSM descriptor.\n\n \\details\n This is a list of possible inputs to the SpTRSM descriptor."]
pub type rocsparse_sptrsm_input_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of inputs to the SpTRSM descriptor.\n\n \\details\n This is a list of possible inputs to the SpTRSM descriptor."]
pub use self::rocsparse_sptrsm_input_ as rocsparse_sptrsm_input;
#[doc = "< Get zero pivot \\p int64_t based position for output from the SpTRSM descriptor and synchronously return zero_pivot."]
pub const rocsparse_sptrsm_output__rocsparse_sptrsm_output_zero_pivot_position:
rocsparse_sptrsm_output_ = 0;
#[doc = " \\ingroup types_module\n \\brief List of outputs to SpTRSM descriptor.\n\n \\details\n This is a list of possible outputs to the SpTRSM descriptor."]
pub type rocsparse_sptrsm_output_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of outputs to SpTRSM descriptor.\n\n \\details\n This is a list of possible outputs to the SpTRSM descriptor."]
pub use self::rocsparse_sptrsm_output_ as rocsparse_sptrsm_output;
pub const rocsparse_spic0_alg__rocsparse_spic0_alg_default: rocsparse_spic0_alg_ = 0;
#[doc = " \\ingroup types_module\n \\brief List of SpIC0 algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_spic0_alg types that are used to perform the incomplete Cholesky factorization\n of level 0."]
pub type rocsparse_spic0_alg_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of SpIC0 algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_spic0_alg types that are used to perform the incomplete Cholesky factorization\n of level 0."]
pub use self::rocsparse_spic0_alg_ as rocsparse_spic0_alg;
#[doc = "< Analysis."]
pub const rocsparse_spic0_stage__rocsparse_spic0_stage_analysis: rocsparse_spic0_stage_ = 0;
#[doc = "< Performs the actual SpIC0 computation."]
pub const rocsparse_spic0_stage__rocsparse_spic0_stage_compute: rocsparse_spic0_stage_ = 1;
#[doc = " \\ingroup types_module\n \\brief List of SpIC0 stages.\n\n \\details\n This is a list of possible stages during SpIC0 computation."]
pub type rocsparse_spic0_stage_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of SpIC0 stages.\n\n \\details\n This is a list of possible stages during SpIC0 computation."]
pub use self::rocsparse_spic0_stage_ as rocsparse_spic0_stage;
#[doc = "< Select algorithm \\ref rocsparse_spic0_alg for input on a SpIC0 descriptor."]
pub const rocsparse_spic0_input__rocsparse_spic0_input_alg: rocsparse_spic0_input_ = 0;
#[doc = "< Select the analysis policy \\ref rocsparse_analysis_policy for input on a SpIC0 descriptor."]
pub const rocsparse_spic0_input__rocsparse_spic0_input_analysis_policy: rocsparse_spic0_input_ = 1;
#[doc = "< Select compute datatype \\ref rocsparse_datatype for input on a SpIC0 descriptor."]
pub const rocsparse_spic0_input__rocsparse_spic0_input_compute_datatype: rocsparse_spic0_input_ = 2;
#[doc = "< Enable diagonal boosting for input on a SpIC0 descriptor."]
pub const rocsparse_spic0_input__rocsparse_spic0_input_boost_enable: rocsparse_spic0_input_ = 3;
#[doc = "< Select diagonal boosting tolerance on a SpIC0 descriptor."]
pub const rocsparse_spic0_input__rocsparse_spic0_input_boost_tolerance: rocsparse_spic0_input_ = 4;
#[doc = "< Select diagonal boosting value on a SpIC0 descriptor."]
pub const rocsparse_spic0_input__rocsparse_spic0_input_boost_value: rocsparse_spic0_input_ = 5;
#[doc = "< Select singularity tolerance for input on a SpIC0 descriptor."]
pub const rocsparse_spic0_input__rocsparse_spic0_input_singularity_tolerance:
rocsparse_spic0_input_ = 6;
#[doc = " \\ingroup types_module\n \\brief List of inputs to the SpIC0 descriptor.\n\n \\details\n This is a list of possible inputs to the SpIC0 descriptor."]
pub type rocsparse_spic0_input_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of inputs to the SpIC0 descriptor.\n\n \\details\n This is a list of possible inputs to the SpIC0 descriptor."]
pub use self::rocsparse_spic0_input_ as rocsparse_spic0_input;
#[doc = "< Get the type of \\ref rocsparse_singularity detected during SpIC0 calculation for output from the SpIC0 descriptor."]
pub const rocsparse_spic0_output__rocsparse_spic0_output_singularity: rocsparse_spic0_output_ = 0;
#[doc = "< Get the singularity \\p int64_t based position for output from the SpIC0 descriptor."]
pub const rocsparse_spic0_output__rocsparse_spic0_output_singularity_position:
rocsparse_spic0_output_ = 1;
#[doc = " \\ingroup types_module\n \\brief List of outputs to SpIC0 descriptor.\n\n \\details\n This is a list of possible outputs to the SpIC0 descriptor."]
pub type rocsparse_spic0_output_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of outputs to SpIC0 descriptor.\n\n \\details\n This is a list of possible outputs to the SpIC0 descriptor."]
pub use self::rocsparse_spic0_output_ as rocsparse_spic0_output;
pub const rocsparse_spilu0_alg__rocsparse_spilu0_alg_default: rocsparse_spilu0_alg_ = 0;
#[doc = " \\ingroup types_module\n \\brief List of SpILU0 algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_spilu0_alg types that are used to perform the incomplete LU factorization\n of level 0."]
pub type rocsparse_spilu0_alg_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of SpILU0 algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_spilu0_alg types that are used to perform the incomplete LU factorization\n of level 0."]
pub use self::rocsparse_spilu0_alg_ as rocsparse_spilu0_alg;
#[doc = "< Analysis."]
pub const rocsparse_spilu0_stage__rocsparse_spilu0_stage_analysis: rocsparse_spilu0_stage_ = 0;
#[doc = "< Performs the actual SpILU0 computation."]
pub const rocsparse_spilu0_stage__rocsparse_spilu0_stage_compute: rocsparse_spilu0_stage_ = 1;
#[doc = " \\ingroup types_module\n \\brief List of SpILU0 stages.\n\n \\details\n This is a list of possible stages during SpILU0 computation."]
pub type rocsparse_spilu0_stage_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of SpILU0 stages.\n\n \\details\n This is a list of possible stages during SpILU0 computation."]
pub use self::rocsparse_spilu0_stage_ as rocsparse_spilu0_stage;
#[doc = "< Select algorithm \\ref rocsparse_spilu0_alg for input on a SpILU0 descriptor."]
pub const rocsparse_spilu0_input__rocsparse_spilu0_input_alg: rocsparse_spilu0_input_ = 0;
#[doc = "< Select the analysis policy \\ref rocsparse_analysis_policy for input on a SpILU0 descriptor."]
pub const rocsparse_spilu0_input__rocsparse_spilu0_input_analysis_policy: rocsparse_spilu0_input_ =
1;
#[doc = "< Select compute datatype \\ref rocsparse_datatype for input on a SpILU0 descriptor."]
pub const rocsparse_spilu0_input__rocsparse_spilu0_input_compute_datatype: rocsparse_spilu0_input_ =
2;
#[doc = "< Enable diagonal boosting for input on a SpILU0 descriptor."]
pub const rocsparse_spilu0_input__rocsparse_spilu0_input_boost_enable: rocsparse_spilu0_input_ = 3;
#[doc = "< Select diagonal boosting tolerance on a SpILU0 descriptor."]
pub const rocsparse_spilu0_input__rocsparse_spilu0_input_boost_tolerance: rocsparse_spilu0_input_ =
4;
#[doc = "< Select diagonal boosting value on a SpILU0 descriptor."]
pub const rocsparse_spilu0_input__rocsparse_spilu0_input_boost_value: rocsparse_spilu0_input_ = 5;
#[doc = "< Select singularity tolerance for input on a SpILU0 descriptor."]
pub const rocsparse_spilu0_input__rocsparse_spilu0_input_singularity_tolerance:
rocsparse_spilu0_input_ = 6;
#[doc = " \\ingroup types_module\n \\brief List of inputs to the SpILU0 descriptor.\n\n \\details\n This is a list of possible inputs to the SpILU0 descriptor."]
pub type rocsparse_spilu0_input_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of inputs to the SpILU0 descriptor.\n\n \\details\n This is a list of possible inputs to the SpILU0 descriptor."]
pub use self::rocsparse_spilu0_input_ as rocsparse_spilu0_input;
#[doc = "< Get the type of \\ref rocsparse_singularity detected during SpILU0 calculation for output from the SpILU0 descriptor."]
pub const rocsparse_spilu0_output__rocsparse_spilu0_output_singularity: rocsparse_spilu0_output_ =
0;
#[doc = "< Get the singularity \\p int64_t based position for output from the SpILU0 descriptor."]
pub const rocsparse_spilu0_output__rocsparse_spilu0_output_singularity_position:
rocsparse_spilu0_output_ = 1;
#[doc = " \\ingroup types_module\n \\brief List of outputs to the SpILU0 descriptor.\n\n \\details\n This is a list of possible outputs to the SpILU0 descriptor."]
pub type rocsparse_spilu0_output_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of outputs to the SpILU0 descriptor.\n\n \\details\n This is a list of possible outputs to the SpILU0 descriptor."]
pub use self::rocsparse_spilu0_output_ as rocsparse_spilu0_output;
#[doc = "< Computes number of non-zero entries."]
pub const rocsparse_spgeam_stage__rocsparse_spgeam_stage_analysis: rocsparse_spgeam_stage_ = 1;
#[doc = "< Performs the actual SpGEAM computation."]
pub const rocsparse_spgeam_stage__rocsparse_spgeam_stage_compute: rocsparse_spgeam_stage_ = 2;
pub const rocsparse_spgeam_stage__rocsparse_spgeam_stage_symbolic_analysis:
rocsparse_spgeam_stage_ = 3;
pub const rocsparse_spgeam_stage__rocsparse_spgeam_stage_symbolic_compute: rocsparse_spgeam_stage_ =
4;
pub const rocsparse_spgeam_stage__rocsparse_spgeam_stage_numeric_analysis: rocsparse_spgeam_stage_ =
5;
pub const rocsparse_spgeam_stage__rocsparse_spgeam_stage_numeric_compute: rocsparse_spgeam_stage_ =
6;
#[doc = " \\ingroup types_module\n \\brief List of SpGEAM stages.\n\n \\details\n This is a list of possible stages during SpGEAM computation. The typical order is\n \\p rocsparse_spgeam_stage_buffer_size, \\p rocsparse_spgeam_stage_analysis, and \\p rocsparse_spgeam_stage_compute."]
pub type rocsparse_spgeam_stage_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of SpGEAM stages.\n\n \\details\n This is a list of possible stages during SpGEAM computation. The typical order is\n \\p rocsparse_spgeam_stage_buffer_size, \\p rocsparse_spgeam_stage_analysis, and \\p rocsparse_spgeam_stage_compute."]
pub use self::rocsparse_spgeam_stage_ as rocsparse_spgeam_stage;
#[doc = "< Select algorithm for input on a SpGEAM descriptor."]
pub const rocsparse_spgeam_input__rocsparse_spgeam_input_alg: rocsparse_spgeam_input_ = 0;
#[doc = "< Select scalar data type for input on a SpGEAM descriptor."]
pub const rocsparse_spgeam_input__rocsparse_spgeam_input_scalar_datatype: rocsparse_spgeam_input_ =
1;
#[doc = "< Select compute data type for input on a SpGEAM descriptor."]
pub const rocsparse_spgeam_input__rocsparse_spgeam_input_compute_datatype: rocsparse_spgeam_input_ =
2;
#[doc = "< Select A matrix transpose operation for input on a SpGEAM descriptor."]
pub const rocsparse_spgeam_input__rocsparse_spgeam_input_operation_A: rocsparse_spgeam_input_ = 3;
#[doc = "< Select B matrix transpose operation for input on a SpGEAM descriptor."]
pub const rocsparse_spgeam_input__rocsparse_spgeam_input_operation_B: rocsparse_spgeam_input_ = 4;
#[doc = "< Select scalar multiplier alpha for input on a SpGEAM descriptor."]
pub const rocsparse_spgeam_input__rocsparse_spgeam_input_scalar_alpha: rocsparse_spgeam_input_ = 5;
#[doc = "< Select scalar multiplier beta for input on a SpGEAM descriptor."]
pub const rocsparse_spgeam_input__rocsparse_spgeam_input_scalar_beta: rocsparse_spgeam_input_ = 6;
#[doc = " \\ingroup types_module\n \\brief List of inputs to the SpGEAM descriptor.\n\n \\details\n This is a list of possible inputs to the SpGEAM descriptor."]
pub type rocsparse_spgeam_input_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of inputs to the SpGEAM descriptor.\n\n \\details\n This is a list of possible inputs to the SpGEAM descriptor."]
pub use self::rocsparse_spgeam_input_ as rocsparse_spgeam_input;
#[doc = "< Select nnz count for output from the SpGEAM descriptor."]
pub const rocsparse_spgeam_output__rocsparse_spgeam_output_nnz: rocsparse_spgeam_output_ = 0;
#[doc = " \\ingroup types_module\n \\brief List of outputs to SpGEAM descriptor.\n\n \\details\n This is a list of possible outputs to the SpGEAM descriptor."]
pub type rocsparse_spgeam_output_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of outputs to SpGEAM descriptor.\n\n \\details\n This is a list of possible outputs to the SpGEAM descriptor."]
pub use self::rocsparse_spgeam_output_ as rocsparse_spgeam_output;
#[doc = "< Default SpGEAM algorithm for the given format."]
pub const rocsparse_spgeam_alg__rocsparse_spgeam_alg_default: rocsparse_spgeam_alg_ = 0;
#[doc = " \\ingroup types_module\n \\brief List of SpGEAM algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_spgeam_alg types that are used to perform\n sparse matrix sparse matrix product."]
pub type rocsparse_spgeam_alg_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of SpGEAM algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_spgeam_alg types that are used to perform\n sparse matrix sparse matrix product."]
pub use self::rocsparse_spgeam_alg_ as rocsparse_spgeam_alg;
#[doc = "< Default gpsv algorithm."]
pub const rocsparse_gpsv_interleaved_alg__rocsparse_gpsv_interleaved_alg_default:
rocsparse_gpsv_interleaved_alg_ = 0;
#[doc = "< QR algorithm."]
pub const rocsparse_gpsv_interleaved_alg__rocsparse_gpsv_interleaved_alg_qr:
rocsparse_gpsv_interleaved_alg_ = 1;
#[doc = " \\ingroup types_module\n \\brief List of gpsv algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_gpsv_interleaved_alg types that are used to solve\n pentadiagonal linear systems."]
pub type rocsparse_gpsv_interleaved_alg_ = ::std::os::raw::c_uint;
#[doc = " \\ingroup types_module\n \\brief List of gpsv algorithms.\n\n \\details\n This is a list of supported \\ref rocsparse_gpsv_interleaved_alg types that are used to solve\n pentadiagonal linear systems."]
pub use self::rocsparse_gpsv_interleaved_alg_ as rocsparse_gpsv_interleaved_alg;
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Create a rocSPARSE handle.\n\n \\details\n \\p rocsparse_create_handle creates the rocSPARSE library context. It must be\n initialized before any other rocSPARSE API function is invoked and must be passed to\n all subsequent library function calls. The handle should be destroyed at the end\n using rocsparse_destroy_handle().\n\n @param[out]\n handle the pointer to the handle to the rocSPARSE library context.\n\n \\retval rocsparse_status_success the initialization succeeded.\n \\retval rocsparse_status_invalid_handle \\p handle pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred."]
pub fn rocsparse_create_handle(handle: *mut rocsparse_handle) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Destroy a rocSPARSE handle.\n\n \\details\n \\p rocsparse_destroy_handle destroys the rocSPARSE library context and releases all\n resources used by the rocSPARSE library.\n\n @param[in]\n handle the handle to the rocSPARSE library context.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle \\p handle is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred."]
pub fn rocsparse_destroy_handle(handle: rocsparse_handle) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Destroy a rocSPARSE error descriptor.\n\n \\details\n \\p rocsparse_destroy_error destroys the rocSPARSE error descriptor.\n\n @param[in]\n error the pointer to the rocSPARSE error descriptor, which can be a null pointer.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_internal_error an internal error occurred."]
pub fn rocsparse_destroy_error(error: rocsparse_error) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Error message from a rocSPARSE error descriptor.\n\n \\details\n \\p rocsparse_error_message returns a C-style string that provides details for the error.\n\n @param[in]\n error the error to the rocSPARSE error descriptor.\n\n @return an error message from a rocSPARSE error descriptor.\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_internal_error an internal error occurred."]
pub fn rocsparse_error_get_message(error: rocsparse_error) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Return the string representation of a rocSPARSE status code enum name.\n\n \\details\n \\p rocsparse_get_status_name takes a rocSPARSE status as input and returns the string representation of this status.\n If the status is not recognized, the function returns \"Unrecognized status code\".\n\n @param[in]\n status a rocSPARSE status.\n\n \\retval pointer to null-terminated string."]
pub fn rocsparse_get_status_name(status: rocsparse_status) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Return the rocSPARSE status code description as a string.\n\n \\details\n \\p rocsparse_get_status_description takes a rocSPARSE status as input and returns the status description as a string.\n If the status is not recognized, the function returns \"Unrecognized status code\"\n\n @param[in]\n status a rocSPARSE status.\n\n \\retval pointer to null-terminated string."]
pub fn rocsparse_get_status_description(
status: rocsparse_status,
) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Specify user-defined HIP stream.\n\n \\details\n \\p rocsparse_set_stream specifies the stream to be used by the rocSPARSE library\n context and all subsequent function calls.\n\n @param[inout]\n handle the handle to the rocSPARSE library context.\n @param[in]\n stream the stream to be used by the rocSPARSE library context.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle \\p handle is invalid.\n\n \\par Example\n This example illustrates how a user-defined stream can be used in rocSPARSE.\n \\code{.c}\n // Create rocSPARSE handle\n rocsparse_handle handle;\n rocsparse_create_handle(&handle);\n\n // Create stream\n hipStream_t stream;\n hipStreamCreate(&stream);\n\n // Set stream to rocSPARSE handle\n rocsparse_set_stream(handle, stream);\n\n // Do some work\n // ...\n\n // Clean up\n rocsparse_destroy_handle(handle);\n hipStreamDestroy(stream);\n \\endcode"]
pub fn rocsparse_set_stream(handle: rocsparse_handle, stream: hipStream_t) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the current stream from the library context.\n\n \\details\n \\p rocsparse_get_stream gets the rocSPARSE library context stream which will\n be used for all subsequent function calls.\n\n @param[in]\n handle the handle to the rocSPARSE library context.\n @param[out]\n stream the stream currently used by the rocSPARSE library context.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle \\p handle is invalid."]
pub fn rocsparse_get_stream(
handle: rocsparse_handle,
stream: *mut hipStream_t,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Specify the pointer mode.\n\n \\details\n \\p rocsparse_set_pointer_mode specifies the pointer mode to be used by the rocSPARSE\n library context and all subsequent function calls. For example, many rocSPARSE routines take\n \\f$\\alpha\\f$ and \\f$\\beta\\f$ pointers as parameters. These can be either host memory pointers\n or device memory pointers, depending on what the pointer mode is set to. By default, all values are passed\n using host pointer mode. Valid pointer modes are \\ref rocsparse_pointer_mode_host\n or \\ref rocsparse_pointer_mode_device.\n\n @param[in]\n handle the handle to the rocSPARSE library context.\n @param[in]\n pointer_mode the pointer mode to be used by the rocSPARSE library context.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle \\p handle is invalid."]
pub fn rocsparse_set_pointer_mode(
handle: rocsparse_handle,
pointer_mode: rocsparse_pointer_mode,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the current pointer mode from the library context.\n\n \\details\n \\p rocsparse_get_pointer_mode gets the rocSPARSE library context pointer mode which\n will be used for all subsequent function calls.\n\n @param[in]\n handle the handle to the rocSPARSE library context.\n @param[out]\n pointer_mode the pointer mode that is currently used by the rocSPARSE library\n context.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle \\p handle is invalid."]
pub fn rocsparse_get_pointer_mode(
handle: rocsparse_handle,
pointer_mode: *mut rocsparse_pointer_mode,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get rocSPARSE version\n\n \\details\n \\p rocsparse_get_version gets the rocSPARSE library version number.\n - patch = version % 100\n - minor = version / 100 % 1000\n - major = version / 100000\n\n @param[in]\n handle the handle to the rocSPARSE library context.\n @param[out]\n version the version number of the rocSPARSE library.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle \\p handle is invalid.\n \\par Example\n \\code{.c}\n rocsparse_handle handle;\n rocsparse_create_handle(&handle);\n rocsparse_get_version(handle, &rocsparse_ver);\n rocsparse_destroy_handle(handle);\n \\endcode"]
pub fn rocsparse_get_version(
handle: rocsparse_handle,
version: *mut ::std::os::raw::c_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the rocSPARSE git revision.\n\n \\details\n \\p rocsparse_get_git_rev gets the rocSPARSE library git commit revision (SHA-1).\n\n @param[in]\n handle the handle to the rocSPARSE library context.\n @param[out]\n rev the git commit revision (SHA-1).\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle \\p handle is invalid.\n \\par Example\n \\code{.c}\n rocsparse_handle handle;\n rocsparse_create_handle(&handle);\n rocsparse_get_git_rev(handle, rocsparse_rev);\n rocsparse_destroy_handle(handle);\n \\endcode"]
pub fn rocsparse_get_git_rev(
handle: rocsparse_handle,
rev: *mut ::std::os::raw::c_char,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Create a matrix descriptor.\n \\details\n \\p rocsparse_create_mat_descr creates a matrix descriptor. It initializes\n \\ref rocsparse_matrix_type to \\ref rocsparse_matrix_type_general, \\ref rocsparse_fill_mode\n to \\ref rocsparse_fill_mode_lower, \\ref rocsparse_diag_type to \\ref rocsparse_diag_type_non_unit,\n \\ref rocsparse_index_base to \\ref rocsparse_index_base_zero, and \\ref rocsparse_storage_mode\n to \\ref rocsparse_storage_mode_sorted. It should be destroyed at the end using\n \\ref rocsparse_destroy_mat_descr().\n\n The matrix type, fill mode, diag type, index base, and storage mode can be set using the\n \\ref rocsparse_set_mat_type, \\ref rocsparse_set_mat_fill_mode, \\ref rocsparse_set_mat_diag_type,\n \\ref rocsparse_set_mat_index_base, and \\ref rocsparse_set_mat_storage_mode APIs respectively.\n\n @param[out]\n descr the pointer to the matrix descriptor.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p descr pointer is invalid."]
pub fn rocsparse_create_mat_descr(descr: *mut rocsparse_mat_descr) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Copy a matrix descriptor.\n \\details\n \\p rocsparse_copy_mat_descr copies a matrix descriptor. Both source and destination\n matrix descriptors must be initialized prior to calling \\p rocsparse_copy_mat_descr.\n\n @param[out]\n dest the pointer to the destination matrix descriptor.\n @param[in]\n src the pointer to the source matrix descriptor.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p src or \\p dest pointer is invalid."]
pub fn rocsparse_copy_mat_descr(
dest: rocsparse_mat_descr,
src: rocsparse_mat_descr,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Destroy a matrix descriptor.\n\n \\details\n \\p rocsparse_destroy_mat_descr destroys a matrix descriptor and releases all\n resources used by the descriptor.\n\n @param[in]\n descr the matrix descriptor.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p descr is invalid."]
pub fn rocsparse_destroy_mat_descr(descr: rocsparse_mat_descr) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Specify the index base of a matrix descriptor.\n\n \\details\n \\p rocsparse_set_mat_index_base sets the index base of a matrix descriptor. Valid\n options are \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n\n @param[inout]\n descr the matrix descriptor.\n @param[in]\n base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p descr pointer is invalid.\n \\retval rocsparse_status_invalid_value \\p base is invalid."]
pub fn rocsparse_set_mat_index_base(
descr: rocsparse_mat_descr,
base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the index base of a matrix descriptor.\n\n \\details\n \\p rocsparse_get_mat_index_base returns the index base of a matrix descriptor.\n\n @param[in]\n descr the matrix descriptor.\n\n \\returns \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one."]
pub fn rocsparse_get_mat_index_base(descr: rocsparse_mat_descr) -> rocsparse_index_base;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Specify the matrix type of a matrix descriptor.\n\n \\details\n \\p rocsparse_set_mat_type sets the matrix type of a matrix descriptor. Valid\n matrix types are \\ref rocsparse_matrix_type_general,\n \\ref rocsparse_matrix_type_symmetric, \\ref rocsparse_matrix_type_hermitian, or\n \\ref rocsparse_matrix_type_triangular.\n\n @param[inout]\n descr the matrix descriptor.\n @param[in]\n type \\ref rocsparse_matrix_type_general, \\ref rocsparse_matrix_type_symmetric,\n \\ref rocsparse_matrix_type_hermitian, or\n \\ref rocsparse_matrix_type_triangular.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p descr pointer is invalid.\n \\retval rocsparse_status_invalid_value \\p type is invalid."]
pub fn rocsparse_set_mat_type(
descr: rocsparse_mat_descr,
type_: rocsparse_matrix_type,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the matrix type of a matrix descriptor.\n\n \\details\n \\p rocsparse_get_mat_type returns the matrix type of a matrix descriptor.\n\n @param[in]\n descr the matrix descriptor.\n\n \\returns \\ref rocsparse_matrix_type_general, \\ref rocsparse_matrix_type_symmetric,\n \\ref rocsparse_matrix_type_hermitian, or\n \\ref rocsparse_matrix_type_triangular."]
pub fn rocsparse_get_mat_type(descr: rocsparse_mat_descr) -> rocsparse_matrix_type;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Specify the matrix fill mode of a matrix descriptor.\n\n \\details\n \\p rocsparse_set_mat_fill_mode sets the matrix fill mode of a matrix descriptor.\n Valid fill modes are \\ref rocsparse_fill_mode_lower or\n \\ref rocsparse_fill_mode_upper.\n\n @param[inout]\n descr the matrix descriptor.\n @param[in]\n fill_mode \\ref rocsparse_fill_mode_lower or \\ref rocsparse_fill_mode_upper.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p descr pointer is invalid.\n \\retval rocsparse_status_invalid_value \\p fill_mode is invalid."]
pub fn rocsparse_set_mat_fill_mode(
descr: rocsparse_mat_descr,
fill_mode: rocsparse_fill_mode,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the matrix fill mode of a matrix descriptor.\n\n \\details\n \\p rocsparse_get_mat_fill_mode returns the matrix fill mode of a matrix descriptor.\n\n @param[in]\n descr the matrix descriptor.\n\n \\returns \\ref rocsparse_fill_mode_lower or \\ref rocsparse_fill_mode_upper."]
pub fn rocsparse_get_mat_fill_mode(descr: rocsparse_mat_descr) -> rocsparse_fill_mode;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Specify the matrix diagonal type of a matrix descriptor.\n\n \\details\n \\p rocsparse_set_mat_diag_type sets the matrix diagonal type of a matrix\n descriptor. Valid diagonal types are \\ref rocsparse_diag_type_unit or\n \\ref rocsparse_diag_type_non_unit.\n\n @param[inout]\n descr the matrix descriptor.\n @param[in]\n diag_type \\ref rocsparse_diag_type_unit or \\ref rocsparse_diag_type_non_unit.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p descr pointer is invalid.\n \\retval rocsparse_status_invalid_value \\p diag_type is invalid."]
pub fn rocsparse_set_mat_diag_type(
descr: rocsparse_mat_descr,
diag_type: rocsparse_diag_type,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the matrix diagonal type of a matrix descriptor.\n\n \\details\n \\p rocsparse_get_mat_diag_type returns the matrix diagonal type of a matrix\n descriptor.\n\n @param[in]\n descr the matrix descriptor.\n\n \\returns \\ref rocsparse_diag_type_unit or \\ref rocsparse_diag_type_non_unit."]
pub fn rocsparse_get_mat_diag_type(descr: rocsparse_mat_descr) -> rocsparse_diag_type;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Specify the matrix storage mode of a matrix descriptor.\n\n \\details\n \\p rocsparse_set_mat_storage_mode sets the matrix storage mode of a matrix descriptor.\n Valid fill modes are \\ref rocsparse_storage_mode_sorted or\n \\ref rocsparse_storage_mode_unsorted.\n\n @param[inout]\n descr the matrix descriptor.\n @param[in]\n storage_mode \\ref rocsparse_storage_mode_sorted or\n \\ref rocsparse_storage_mode_unsorted.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p descr pointer is invalid.\n \\retval rocsparse_status_invalid_value \\p storage_mode is invalid."]
pub fn rocsparse_set_mat_storage_mode(
descr: rocsparse_mat_descr,
storage_mode: rocsparse_storage_mode,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the matrix storage mode of a matrix descriptor.\n\n \\details\n \\p rocsparse_get_mat_storage_mode returns the matrix storage mode of a matrix descriptor.\n\n @param[in]\n descr the matrix descriptor.\n\n \\returns \\ref rocsparse_storage_mode_sorted or \\ref rocsparse_storage_mode_unsorted."]
pub fn rocsparse_get_mat_storage_mode(descr: rocsparse_mat_descr) -> rocsparse_storage_mode;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Create a \\p HYB matrix structure\n\n \\details\n \\p rocsparse_create_hyb_mat creates a structure that holds the matrix in \\p HYB\n storage format. It should be destroyed at the end using rocsparse_destroy_hyb_mat().\n\n @param[inout]\n hyb the pointer to the hybrid matrix.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p hyb pointer is invalid."]
pub fn rocsparse_create_hyb_mat(hyb: *mut rocsparse_hyb_mat) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Copy a \\p HYB matrix structure.\n\n \\details\n \\p rocsparse_copy_hyb_mat copies a matrix info structure. Both source and destination\n matrix info structure must be initialized prior to calling \\p rocsparse_copy_hyb_mat.\n\n @param[out]\n dest the pointer to the destination matrix info structure.\n @param[in]\n src the pointer to the source matrix info structure.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p hyb pointer is invalid."]
pub fn rocsparse_copy_hyb_mat(
dest: rocsparse_hyb_mat,
src: rocsparse_hyb_mat,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Destroy a \\p HYB matrix structure.\n\n \\details\n \\p rocsparse_destroy_hyb_mat destroys a \\p HYB structure.\n\n @param[in]\n hyb the hybrid matrix structure.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p hyb pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred."]
pub fn rocsparse_destroy_hyb_mat(hyb: rocsparse_hyb_mat) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Create a matrix info structure.\n\n \\details\n \\p rocsparse_create_mat_info creates a structure that holds the matrix info data\n that is gathered during the analysis routines available. It should be destroyed\n at the end using rocsparse_destroy_mat_info().\n\n @param[inout]\n info the pointer to the info structure.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p info pointer is invalid."]
pub fn rocsparse_create_mat_info(info: *mut rocsparse_mat_info) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Copy a matrix info structure.\n \\details\n \\p rocsparse_copy_mat_info copies a matrix info structure. Both source and destination\n matrix info structure must be initialized prior to calling \\p rocsparse_copy_mat_info.\n\n @param[out]\n dest the pointer to the destination matrix info structure.\n @param[in]\n src the pointer to the source matrix info structure.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p src or \\p dest pointer is invalid."]
pub fn rocsparse_copy_mat_info(
dest: rocsparse_mat_info,
src: rocsparse_mat_info,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Destroy a matrix info structure\n\n \\details\n \\p rocsparse_destroy_mat_info destroys a matrix info structure.\n\n @param[in]\n info the info structure.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p info pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred."]
pub fn rocsparse_destroy_mat_info(info: rocsparse_mat_info) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Create a color info structure\n\n \\details\n \\p rocsparse_create_color_info creates a structure that holds the color info data\n that is gathered during the analysis routines. It should be destroyed\n at the end using rocsparse_destroy_color_info().\n\n @param[inout]\n info the pointer to the info structure.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p info pointer is invalid."]
pub fn rocsparse_create_color_info(info: *mut rocsparse_color_info) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Copy a color info structure.\n \\details\n \\p rocsparse_copy_color_info copies a color info structure. Both source and destination\n color info structure must be initialized prior to calling \\p rocsparse_copy_color_info.\n\n @param[out]\n dest the pointer to the destination color info structure.\n @param[in]\n src the pointer to the source color info structure.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p src or \\p dest pointer is invalid."]
pub fn rocsparse_copy_color_info(
dest: rocsparse_color_info,
src: rocsparse_color_info,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Destroy a color info structure.\n\n \\details\n \\p rocsparse_destroy_color_info destroys a color info structure.\n\n @param[in]\n info the info structure.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p info pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred."]
pub fn rocsparse_destroy_color_info(info: rocsparse_color_info) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Create a sparse vector descriptor.\n \\details\n \\p rocsparse_create_spvec_descr creates a sparse vector descriptor. It should be\n destroyed at the end using rocsparse_destroy_mat_descr().\n\n @param[out]\n descr the pointer to the sparse vector descriptor.\n @param[in]\n size size of the sparse vector.\n @param[in]\n nnz number of non-zeros in sparse vector.\n @param[in]\n indices indices of the sparse vector where non-zeros occur. Must be an array of length \\p nnz.\n @param[in]\n values non-zero values in the sparse vector. Must be an array of length \\p nnz.\n @param[in]\n idx_type \\ref rocsparse_indextype_i32 or \\ref rocsparse_indextype_i64.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n data_type \\ref rocsparse_datatype_f32_r, \\ref rocsparse_datatype_f64_r,\n \\ref rocsparse_datatype_f32_c, or \\ref rocsparse_datatype_f64_c.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr, \\p indices, or \\p values is invalid.\n \\retval rocsparse_status_invalid_size if \\p size or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_value if \\p idx_type, \\p idx_base, or \\p data_type is invalid.\n/\n/**@{"]
pub fn rocsparse_create_spvec_descr(
descr: *mut rocsparse_spvec_descr,
size: i64,
nnz: i64,
indices: *mut ::std::os::raw::c_void,
values: *mut ::std::os::raw::c_void,
idx_type: rocsparse_indextype,
idx_base: rocsparse_index_base,
data_type: rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_create_const_spvec_descr(
descr: *mut rocsparse_const_spvec_descr,
size: i64,
nnz: i64,
indices: *const ::std::os::raw::c_void,
values: *const ::std::os::raw::c_void,
idx_type: rocsparse_indextype,
idx_base: rocsparse_index_base,
data_type: rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Destroy a sparse vector descriptor.\n\n \\details\n \\p rocsparse_destroy_spvec_descr destroys a sparse vector descriptor and releases all\n resources used by the descriptor.\n\n @param[in]\n descr the matrix descriptor.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p descr is invalid."]
pub fn rocsparse_destroy_spvec_descr(descr: rocsparse_const_spvec_descr) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the fields of the sparse vector descriptor.\n \\details\n \\p rocsparse_spvec_get gets the fields of the sparse vector descriptor.\n\n @param[in]\n descr the pointer to the sparse vector descriptor.\n @param[out]\n size size of the sparse vector.\n @param[out]\n nnz number of non-zeros in sparse vector.\n @param[out]\n indices indices of the sparse vector where non-zeros occur. Must be an array of length \\p nnz.\n @param[out]\n values non-zero values in the sparse vector. Must be an array of length \\p nnz.\n @param[out]\n idx_type \\ref rocsparse_indextype_i32 or \\ref rocsparse_indextype_i64.\n @param[out]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[out]\n data_type \\ref rocsparse_datatype_f32_r, \\ref rocsparse_datatype_f64_r,\n \\ref rocsparse_datatype_f32_c, or \\ref rocsparse_datatype_f64_c.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr, \\p indices, or \\p values is invalid.\n \\retval rocsparse_status_invalid_size if \\p size or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_value if \\p idx_type, \\p idx_base, or \\p data_type is invalid.\n/\n/**@{"]
pub fn rocsparse_spvec_get(
descr: rocsparse_spvec_descr,
size: *mut i64,
nnz: *mut i64,
indices: *mut *mut ::std::os::raw::c_void,
values: *mut *mut ::std::os::raw::c_void,
idx_type: *mut rocsparse_indextype,
idx_base: *mut rocsparse_index_base,
data_type: *mut rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_const_spvec_get(
descr: rocsparse_const_spvec_descr,
size: *mut i64,
nnz: *mut i64,
indices: *mut *const ::std::os::raw::c_void,
values: *mut *const ::std::os::raw::c_void,
idx_type: *mut rocsparse_indextype,
idx_base: *mut rocsparse_index_base,
data_type: *mut rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the index base stored in the sparse vector descriptor.\n\n @param[in]\n descr the pointer to the sparse vector descriptor.\n @param[out]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr is invalid.\n \\retval rocsparse_status_invalid_value if \\p idx_base is invalid."]
pub fn rocsparse_spvec_get_index_base(
descr: rocsparse_const_spvec_descr,
idx_base: *mut rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the values array stored in the sparse vector descriptor\n\n @param[in]\n descr the pointer to the sparse vector descriptor.\n @param[out]\n values non-zero values in the sparse vector. Must be an array of length \\p nnz.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr or \\p values is invalid.\n/\n/**@{"]
pub fn rocsparse_spvec_get_values(
descr: rocsparse_spvec_descr,
values: *mut *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_const_spvec_get_values(
descr: rocsparse_const_spvec_descr,
values: *mut *const ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Set the values array in the sparse vector descriptor.\n\n @param[inout]\n descr the pointer to the sparse vector descriptor.\n @param[in]\n values non-zero values in the sparse vector. Must be an array of length \\p nnz.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr or \\p values is invalid."]
pub fn rocsparse_spvec_set_values(
descr: rocsparse_spvec_descr,
values: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Create a sparse COO matrix descriptor.\n \\details\n \\p rocsparse_create_coo_descr creates a sparse COO matrix descriptor. It should be\n destroyed at the end using \\p rocsparse_destroy_spmat_descr.\n\n @param[out]\n descr the pointer to the sparse COO matrix descriptor.\n @param[in]\n rows number of rows in the COO matrix.\n @param[in]\n cols number of columns in the COO matrix\n @param[in]\n nnz number of non-zeros in the COO matrix.\n @param[in]\n coo_row_ind row indices of the COO matrix. Must be an array of length \\p nnz.\n @param[in]\n coo_col_ind column indices of the COO matrix. Must be an array of length \\p nnz.\n @param[in]\n coo_val values of the COO matrix. Must be an array of length \\p nnz.\n @param[in]\n idx_type \\ref rocsparse_indextype_i32 or \\ref rocsparse_indextype_i64.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n data_type \\ref rocsparse_datatype_f32_r, \\ref rocsparse_datatype_f64_r,\n \\ref rocsparse_datatype_f32_c, or \\ref rocsparse_datatype_f64_c.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr, \\p coo_row_ind, \\p coo_col_ind, or \\p coo_val is invalid.\n \\retval rocsparse_status_invalid_size if \\p rows, \\p cols, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_value if \\p idx_type, \\p idx_base, or \\p data_type is invalid.\n/\n/**@{"]
pub fn rocsparse_create_coo_descr(
descr: *mut rocsparse_spmat_descr,
rows: i64,
cols: i64,
nnz: i64,
coo_row_ind: *mut ::std::os::raw::c_void,
coo_col_ind: *mut ::std::os::raw::c_void,
coo_val: *mut ::std::os::raw::c_void,
idx_type: rocsparse_indextype,
idx_base: rocsparse_index_base,
data_type: rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_create_const_coo_descr(
descr: *mut rocsparse_const_spmat_descr,
rows: i64,
cols: i64,
nnz: i64,
coo_row_ind: *const ::std::os::raw::c_void,
coo_col_ind: *const ::std::os::raw::c_void,
coo_val: *const ::std::os::raw::c_void,
idx_type: rocsparse_indextype,
idx_base: rocsparse_index_base,
data_type: rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Create a sparse COO AoS matrix descriptor.\n \\details\n \\p rocsparse_create_coo_aos_descr creates a sparse COO AoS matrix descriptor. It should be\n destroyed at the end using \\p rocsparse_destroy_spmat_descr.\n\n @param[out]\n descr the pointer to the sparse COO AoS matrix descriptor.\n @param[in]\n rows number of rows in the COO AoS matrix.\n @param[in]\n cols number of columns in the COO AoS matrix\n @param[in]\n nnz number of non-zeros in the COO AoS matrix.\n @param[in]\n coo_ind <row, column> indices of the COO AoS matrix. Must be an array of length \\p nnz.\n @param[in]\n coo_val values of the COO AoS matrix. Must be an array of length \\p nnz.\n @param[in]\n idx_type \\ref rocsparse_indextype_i32 or \\ref rocsparse_indextype_i64.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n data_type \\ref rocsparse_datatype_f32_r, \\ref rocsparse_datatype_f64_r,\n \\ref rocsparse_datatype_f32_c, or \\ref rocsparse_datatype_f64_c.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr, \\p coo_ind, or \\p coo_val is invalid.\n \\retval rocsparse_status_invalid_size if \\p rows, \\p cols, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_value if \\p idx_type, \\p idx_base, or \\p data_type is invalid."]
pub fn rocsparse_create_coo_aos_descr(
descr: *mut rocsparse_spmat_descr,
rows: i64,
cols: i64,
nnz: i64,
coo_ind: *mut ::std::os::raw::c_void,
coo_val: *mut ::std::os::raw::c_void,
idx_type: rocsparse_indextype,
idx_base: rocsparse_index_base,
data_type: rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Create a sparse BSR matrix descriptor.\n \\details\n \\p rocsparse_create_bsr_descr creates a sparse BSR matrix descriptor. It should be\n destroyed at the end using \\p rocsparse_destroy_spmat_descr.\n\n @param[out]\n descr the pointer to the sparse BSR matrix descriptor.\n @param[in]\n brows number of block rows in the BSR matrix.\n @param[in]\n bcols number of block columns in the BSR matrix.\n @param[in]\n bnnz number of non-zero blocks in the BSR matrix.\n @param[in]\n block_dir direction of the internal block storage.\n @param[in]\n block_dim dimension of the blocks.\n @param[in]\n bsr_row_ptr row offsets of the BSR matrix (must be array of length \\p brows+1 ).\n @param[in]\n bsr_col_ind column indices of the BSR matrix (must be array of length \\p bnnz ).\n @param[in]\n bsr_val values of the BSR matrix (must be array of length \\p bnnz * \\p block_dim * \\p block_dim ).\n @param[in]\n row_ptr_type \\ref rocsparse_indextype_i32 or \\ref rocsparse_indextype_i64.\n @param[in]\n col_ind_type \\ref rocsparse_indextype_i32 or \\ref rocsparse_indextype_i64.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n data_type \\ref rocsparse_datatype_f32_r, \\ref rocsparse_datatype_f64_r,\n \\ref rocsparse_datatype_f32_c, or \\ref rocsparse_datatype_f64_c.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr, \\p bsr_row_ptr, \\p bsr_col_ind, or \\p bsr_val is invalid.\n \\retval rocsparse_status_invalid_size if \\p brows, \\p bcols, \\p bnnz, or \\p block_dim is invalid.\n \\retval rocsparse_status_invalid_value if \\p row_ptr_type, \\p col_ind_type, \\p idx_base, \\p data_type, or \\p block_dir is invalid.\n/\n/**@{"]
pub fn rocsparse_create_bsr_descr(
descr: *mut rocsparse_spmat_descr,
brows: i64,
bcols: i64,
bnnz: i64,
block_dir: rocsparse_direction,
block_dim: i64,
bsr_row_ptr: *mut ::std::os::raw::c_void,
bsr_col_ind: *mut ::std::os::raw::c_void,
bsr_val: *mut ::std::os::raw::c_void,
row_ptr_type: rocsparse_indextype,
col_ind_type: rocsparse_indextype,
idx_base: rocsparse_index_base,
data_type: rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_create_const_bsr_descr(
descr: *mut rocsparse_const_spmat_descr,
brows: i64,
bcols: i64,
bnnz: i64,
block_dir: rocsparse_direction,
block_dim: i64,
bsr_row_ptr: *const ::std::os::raw::c_void,
bsr_col_ind: *const ::std::os::raw::c_void,
bsr_val: *const ::std::os::raw::c_void,
row_ptr_type: rocsparse_indextype,
col_ind_type: rocsparse_indextype,
idx_base: rocsparse_index_base,
data_type: rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Create a sparse CSR matrix descriptor.\n \\details\n \\p rocsparse_create_csr_descr creates a sparse CSR matrix descriptor. It should be\n destroyed at the end using \\p rocsparse_destroy_spmat_descr.\n\n @param[out]\n descr the pointer to the sparse CSR matrix descriptor.\n @param[in]\n rows number of rows in the CSR matrix.\n @param[in]\n cols number of columns in the CSR matrix\n @param[in]\n nnz number of non-zeros in the CSR matrix.\n @param[in]\n csr_row_ptr row offsets of the CSR matrix. Must be an array of length \\p rows+1.\n @param[in]\n csr_col_ind column indices of the CSR matrix. Must be an array of length \\p nnz.\n @param[in]\n csr_val values of the CSR matrix. Must be an array of length \\p nnz.\n @param[in]\n row_ptr_type \\ref rocsparse_indextype_i32 or \\ref rocsparse_indextype_i64.\n @param[in]\n col_ind_type \\ref rocsparse_indextype_i32 or \\ref rocsparse_indextype_i64.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n data_type \\ref rocsparse_datatype_f32_r, \\ref rocsparse_datatype_f64_r,\n \\ref rocsparse_datatype_f32_c, or \\ref rocsparse_datatype_f64_c.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr, \\p csr_row_ptr, \\p csr_col_ind, or \\p csr_val is invalid.\n \\retval rocsparse_status_invalid_size if \\p rows, \\p cols, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_value if \\p row_ptr_type, \\p col_ind_type, \\p idx_base, or \\p data_type is invalid.\n/\n/**@{"]
pub fn rocsparse_create_csr_descr(
descr: *mut rocsparse_spmat_descr,
rows: i64,
cols: i64,
nnz: i64,
csr_row_ptr: *mut ::std::os::raw::c_void,
csr_col_ind: *mut ::std::os::raw::c_void,
csr_val: *mut ::std::os::raw::c_void,
row_ptr_type: rocsparse_indextype,
col_ind_type: rocsparse_indextype,
idx_base: rocsparse_index_base,
data_type: rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_create_const_csr_descr(
descr: *mut rocsparse_const_spmat_descr,
rows: i64,
cols: i64,
nnz: i64,
csr_row_ptr: *const ::std::os::raw::c_void,
csr_col_ind: *const ::std::os::raw::c_void,
csr_val: *const ::std::os::raw::c_void,
row_ptr_type: rocsparse_indextype,
col_ind_type: rocsparse_indextype,
idx_base: rocsparse_index_base,
data_type: rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Create a sparse CSC matrix descriptor.\n \\details\n \\p rocsparse_create_csc_descr creates a sparse CSC matrix descriptor. It should be\n destroyed at the end using \\p rocsparse_destroy_spmat_descr.\n\n @param[out]\n descr the pointer to the sparse CSC matrix descriptor.\n @param[in]\n rows number of rows in the CSC matrix.\n @param[in]\n cols number of columns in the CSC matrix.\n @param[in]\n nnz number of non-zeros in the CSC matrix.\n @param[in]\n csc_col_ptr column offsets of the CSC matrix. Must be an array of length \\p cols+1.\n @param[in]\n csc_row_ind row indices of the CSC matrix. Must be an array of length \\p nnz.\n @param[in]\n csc_val values of the CSC matrix. Must be an array of length \\p nnz.\n @param[in]\n col_ptr_type \\ref rocsparse_indextype_i32 or \\ref rocsparse_indextype_i64.\n @param[in]\n row_ind_type \\ref rocsparse_indextype_i32 or \\ref rocsparse_indextype_i64.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n data_type \\ref rocsparse_datatype_f32_r, \\ref rocsparse_datatype_f64_r,\n \\ref rocsparse_datatype_f32_c, or \\ref rocsparse_datatype_f64_c.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr, \\p csc_col_ptr, \\p csc_row_ind, or \\p csc_val is invalid.\n \\retval rocsparse_status_invalid_size if \\p rows, \\p cols, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_value if \\p col_ptr_type, \\p row_ind_type, \\p idx_base, or \\p data_type is invalid.\n/\n/**@{"]
pub fn rocsparse_create_csc_descr(
descr: *mut rocsparse_spmat_descr,
rows: i64,
cols: i64,
nnz: i64,
csc_col_ptr: *mut ::std::os::raw::c_void,
csc_row_ind: *mut ::std::os::raw::c_void,
csc_val: *mut ::std::os::raw::c_void,
col_ptr_type: rocsparse_indextype,
row_ind_type: rocsparse_indextype,
idx_base: rocsparse_index_base,
data_type: rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_create_const_csc_descr(
descr: *mut rocsparse_const_spmat_descr,
rows: i64,
cols: i64,
nnz: i64,
csc_col_ptr: *const ::std::os::raw::c_void,
csc_row_ind: *const ::std::os::raw::c_void,
csc_val: *const ::std::os::raw::c_void,
col_ptr_type: rocsparse_indextype,
row_ind_type: rocsparse_indextype,
idx_base: rocsparse_index_base,
data_type: rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Create a sparse ELL matrix descriptor.\n \\details\n \\p rocsparse_create_ell_descr creates a sparse ELL matrix descriptor. It should be\n destroyed at the end using \\p rocsparse_destroy_spmat_descr.\n\n @param[out]\n descr the pointer to the sparse ELL matrix descriptor.\n @param[in]\n rows number of rows in the ELL matrix.\n @param[in]\n cols number of columns in the ELL matrix.\n @param[in]\n ell_col_ind column indices of the ELL matrix. Must be an array of length \\p rows*ell_width.\n @param[in]\n ell_val values of the ELL matrix. Must be an array of length \\p rows*ell_width.\n @param[in]\n ell_width width of the ELL matrix.\n @param[in]\n idx_type \\ref rocsparse_indextype_i32 or \\ref rocsparse_indextype_i64.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n data_type \\ref rocsparse_datatype_f32_r, \\ref rocsparse_datatype_f64_r,\n \\ref rocsparse_datatype_f32_c, or \\ref rocsparse_datatype_f64_c.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr, \\p ell_col_ind, or \\p ell_val is invalid.\n \\retval rocsparse_status_invalid_size if \\p rows, \\p cols, \\p ell_width is invalid.\n \\retval rocsparse_status_invalid_value if \\p idx_type, \\p idx_base, or \\p data_type is invalid."]
pub fn rocsparse_create_ell_descr(
descr: *mut rocsparse_spmat_descr,
rows: i64,
cols: i64,
ell_col_ind: *mut ::std::os::raw::c_void,
ell_val: *mut ::std::os::raw::c_void,
ell_width: i64,
idx_type: rocsparse_indextype,
idx_base: rocsparse_index_base,
data_type: rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Create a sparse blocked ELL matrix descriptor.\n \\details\n \\p rocsparse_create_bell_descr creates a sparse blocked ELL matrix descriptor. It should be\n destroyed at the end using \\p rocsparse_destroy_spmat_descr.\n\n Currently the only routine that supports the Blocked ELL format is \\ref rocsparse_spmm.\n\n @param[out]\n descr the pointer to the sparse blocked ELL matrix descriptor.\n @param[in]\n rows number of rows in the blocked ELL matrix.\n @param[in]\n cols number of columns in the blocked ELL matrix\n @param[in]\n ell_block_dir \\ref rocsparse_direction_row or \\ref rocsparse_direction_column.\n @param[in]\n ell_block_dim block dimension of the sparse blocked ELL matrix.\n @param[in]\n ell_cols column indices of the blocked ELL matrix. Must be an array of length \\p rows*ell_width.\n @param[in]\n ell_col_ind column indices of the blocked ELL matrix. Must be an array of length \\p rows*ell_width.\n @param[in]\n ell_val values of the blocked ELL matrix. Must be an array of length \\p rows*ell_width.\n @param[in]\n idx_type \\ref rocsparse_indextype_i32 or \\ref rocsparse_indextype_i64.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n data_type \\ref rocsparse_datatype_f32_r, \\ref rocsparse_datatype_f64_r,\n \\ref rocsparse_datatype_f32_c, or \\ref rocsparse_datatype_f64_c.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr, \\p ell_cols, \\p ell_col_ind, or \\p ell_val is invalid.\n \\retval rocsparse_status_invalid_size if \\p rows or \\p cols is invalid.\n \\retval rocsparse_status_invalid_value if \\p idx_type, \\p idx_base, or \\p data_type is invalid.\n/\n/**@{"]
pub fn rocsparse_create_bell_descr(
descr: *mut rocsparse_spmat_descr,
rows: i64,
cols: i64,
ell_block_dir: rocsparse_direction,
ell_block_dim: i64,
ell_cols: i64,
ell_col_ind: *mut ::std::os::raw::c_void,
ell_val: *mut ::std::os::raw::c_void,
idx_type: rocsparse_indextype,
idx_base: rocsparse_index_base,
data_type: rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_create_const_bell_descr(
descr: *mut rocsparse_const_spmat_descr,
rows: i64,
cols: i64,
ell_block_dir: rocsparse_direction,
ell_block_dim: i64,
ell_cols: i64,
ell_col_ind: *const ::std::os::raw::c_void,
ell_val: *const ::std::os::raw::c_void,
idx_type: rocsparse_indextype,
idx_base: rocsparse_index_base,
data_type: rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Create a sparse sliced ELL matrix descriptor.\n \\details\n \\p rocsparse_create_sell_descr creates a sparse sliced ELL matrix descriptor. It should be\n destroyed at the end using \\p rocsparse_destroy_spmat_descr.\n\n Currently the only routine that supports the sliced ELL format is \\ref rocsparse_spmv.\n\n @param[out]\n descr the pointer to the sparse sliced ELL matrix descriptor.\n @param[in]\n rows number of rows in the sliced ELL matrix.\n @param[in]\n cols number of columns in the sliced ELL matrix.\n @param[in]\n nnz number of non-zeros in the sliced ELL matrix.\n @param[in]\n sell_slice_size slice size in the sliced ELL matrix.\n @param[in]\n sell_colval_size size of the column and value arrays in the sliced ELL matrix.\n @param[in]\n sell_slice_offsets slice offsets into column and value matrix. Must be an array of length \\p nslices+1 where \\p nslice=m/sell_slice_size.\n @param[in]\n sell_col_ind column indices of the sliced ELL matrix. Must be an array of length \\p sell_colval_size.\n @param[in]\n sell_val values of the sliced ELL matrix. Must be an array of length \\p sell_colval_size.\n @param[in]\n sell_slice_offsets_type \\ref rocsparse_indextype_i32 or \\ref rocsparse_indextype_i64.\n @param[in]\n sell_col_ind_type \\ref rocsparse_indextype_i32 or \\ref rocsparse_indextype_i64.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n data_type \\ref rocsparse_datatype_f32_r, \\ref rocsparse_datatype_f64_r,\n \\ref rocsparse_datatype_f32_c, or \\ref rocsparse_datatype_f64_c.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr, \\p sell_slice_offsets, \\p sell_col_ind, or \\p sell_val is invalid.\n \\retval rocsparse_status_invalid_size if \\p rows, \\p cols, \\p nnz, \\p sell_slice_size, or \\p sell_colval_size is invalid.\n \\retval rocsparse_status_invalid_value if \\p idx_type, \\p idx_base, or \\p data_type is invalid.\n/\n/**@{"]
pub fn rocsparse_create_sell_descr(
descr: *mut rocsparse_spmat_descr,
rows: i64,
cols: i64,
nnz: i64,
sell_slice_size: i64,
sell_colval_size: i64,
sell_slice_offsets: *mut ::std::os::raw::c_void,
sell_col_ind: *mut ::std::os::raw::c_void,
sell_val: *mut ::std::os::raw::c_void,
sell_slice_offsets_type: rocsparse_indextype,
sell_col_ind_type: rocsparse_indextype,
idx_base: rocsparse_index_base,
data_type: rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_create_const_sell_descr(
descr: *mut rocsparse_const_spmat_descr,
rows: i64,
cols: i64,
nnz: i64,
sell_slice_size: i64,
sell_colval_size: i64,
sell_slice_offsets: *const ::std::os::raw::c_void,
sell_col_ind: *const ::std::os::raw::c_void,
sell_val: *const ::std::os::raw::c_void,
sell_slice_offsets_type: rocsparse_indextype,
sell_col_ind_type: rocsparse_indextype,
idx_base: rocsparse_index_base,
data_type: rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Destroy a sparse matrix descriptor.\n\n \\details\n \\p rocsparse_destroy_spmat_descr destroys a sparse matrix descriptor and releases all\n resources used by the descriptor.\n\n Currently the only routine that supports the Blocked ELL format is \\ref rocsparse_spmm.\n\n @param[in]\n descr the matrix descriptor.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p descr is invalid."]
pub fn rocsparse_destroy_spmat_descr(descr: rocsparse_const_spmat_descr) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Sparse matrix to sparse matrix conversion.\n\n \\details\n \\p rocsparse_create_sparse_to_sparse_descr creates the descriptor of the sparse_to_sparse algorithm.\n\n @param[out]\n descr pointer to the descriptor of the sparse_to_sparse algorithm.\n @param[in]\n source source sparse matrix descriptor.\n @param[in]\n target target sparse matrix descriptor.\n @param[in]\n alg algorithm for the sparse_to_sparse computation.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_value if any required enumeration is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p source, or \\p target\n pointer is invalid."]
pub fn rocsparse_create_sparse_to_sparse_descr(
descr: *mut rocsparse_sparse_to_sparse_descr,
source: rocsparse_const_spmat_descr,
target: rocsparse_spmat_descr,
alg: rocsparse_sparse_to_sparse_alg,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Sparse matrix to sparse matrix conversion.\n\n \\details\n \\p rocsparse_sparse_to_sparse_permissive allows the routine to allocate an intermediate sparse matrix\n to perform the conversion. By default, the routine is not permissive.\n @param[in]\n descr descriptor of the sparse_to_sparse algorithm.\n \\retval rocsparse_status_success the operation completed successfully."]
pub fn rocsparse_sparse_to_sparse_permissive(
descr: rocsparse_sparse_to_sparse_descr,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Sparse matrix to sparse matrix conversion.\n\n \\details\n \\p rocsparse_destroy_sparse_to_sparse_descr destroys the descriptor of the sparse_to_sparse algorithm.\n\n @param[in]\n descr descriptor of the sparse_to_sparse algorithm.\n \\retval rocsparse_status_success the operation completed successfully."]
pub fn rocsparse_destroy_sparse_to_sparse_descr(
descr: rocsparse_sparse_to_sparse_descr,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Sparse matrix extraction.\n\n \\details\n \\p rocsparse_create_extract_descr creates the descriptor of the extract algorithm.\n\n @param[out]\n descr pointer to the descriptor of the extract algorithm.\n @param[in]\n source source sparse matrix descriptor.\n @param[in]\n target target sparse matrix descriptor.\n @param[in]\n alg algorithm for the extract computation.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_value if any required enumeration is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p source, or \\p target\n pointer is invalid."]
pub fn rocsparse_create_extract_descr(
descr: *mut rocsparse_extract_descr,
source: rocsparse_const_spmat_descr,
target: rocsparse_spmat_descr,
alg: rocsparse_extract_alg,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Sparse matrix extraction.\n\n \\details\n \\p rocsparse_destroy_extract_descr destroys the descriptor of the \\ref rocsparse_extract routine.\n\n @param[in]\n descr descriptor of the extract routine.\n \\retval rocsparse_status_success the operation completed successfully."]
pub fn rocsparse_destroy_extract_descr(descr: rocsparse_extract_descr) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Sparse matrix SpGEAM routine descriptor creation.\n\n \\details\n \\p rocsparse_create_spgeam_descr creates the descriptor of the \\ref rocsparse_spgeam_buffer_size and\n \\ref rocsparse_spgeam routines.\n\n @param[out]\n descr pointer to the descriptor of the SpGEAM routine.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p descr pointer is invalid."]
pub fn rocsparse_create_spgeam_descr(descr: *mut rocsparse_spgeam_descr) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Destroy a sparse matrix SpGEAM.\n\n \\details\n \\p rocsparse_destroy_spgeam_descr destroys the descriptor of the \\ref rocsparse_spgeam_buffer_size and\n \\ref rocsparse_spgeam routines.\n\n @param[in]\n descr descriptor of the SpGEAM routine.\n \\retval rocsparse_status_success the operation completed successfully."]
pub fn rocsparse_destroy_spgeam_descr(descr: rocsparse_spgeam_descr) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Set the requested \\ref rocsparse_spgeam_input data in the SpGEAM descriptor.\n\n @param[in]\n handle the pointer to the handle to the rocSPARSE library context.\n @param[inout]\n descr the pointer to the SpGEAM descriptor.\n @param[in]\n input one of the values from \\ref rocsparse_spgeam_input.\n @param[in]\n data input data.\n @param[in]\n data_size_in_bytes input data size.\n @param[out]\n p_error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if an error descriptor is not required.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr or \\p data is invalid.\n \\retval rocsparse_status_invalid_value if \\p input is invalid.\n \\retval rocsparse_status_invalid_size if \\p data_size_in_bytes is invalid."]
pub fn rocsparse_spgeam_set_input(
handle: rocsparse_handle,
descr: rocsparse_spgeam_descr,
input: rocsparse_spgeam_input,
data: *const ::std::os::raw::c_void,
data_size_in_bytes: usize,
p_error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the requested \\ref rocsparse_spgeam_output data from the SpGEAM descriptor.\n\n @param[in]\n handle the pointer to the handle to the rocSPARSE library context.\n @param[inout]\n descr the pointer to the SpGEAM descriptor.\n @param[in]\n output \\ref rocsparse_spgeam_output_nnz.\n @param[in]\n data output data.\n @param[in]\n data_size_in_bytes output data size.\n @param[out]\n error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if an error descriptor is not required.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr or \\p data is invalid.\n \\retval rocsparse_status_invalid_value if \\p output is invalid.\n \\retval rocsparse_status_invalid_size if \\p data_size_in_bytes is invalid."]
pub fn rocsparse_spgeam_get_output(
handle: rocsparse_handle,
descr: rocsparse_spgeam_descr,
output: rocsparse_spgeam_output,
data: *mut ::std::os::raw::c_void,
data_size_in_bytes: usize,
error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Sparse matrix SpMV routine descriptor creation.\n\n \\details\n \\p rocsparse_create_spmv_descr creates the descriptor of the \\ref rocsparse_v2_spmv_buffer_size and\n \\ref rocsparse_v2_spmv routines.\n\n @param[out]\n descr pointer to the descriptor of the SpMV routine.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p descr pointer is invalid."]
pub fn rocsparse_create_spmv_descr(descr: *mut rocsparse_spmv_descr) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Destroy a sparse matrix SpMV routine descriptor.\n\n \\details\n \\p rocsparse_destroy_spmv_descr destroys the descriptor of the \\ref rocsparse_v2_spmv_buffer_size and\n \\ref rocsparse_v2_spmv routines.\n\n @param[in]\n descr descriptor of the v2_spmv routine.\n \\retval rocsparse_status_success the operation completed successfully."]
pub fn rocsparse_destroy_spmv_descr(descr: rocsparse_spmv_descr) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Set the requested \\ref rocsparse_spmv_input data in the SpMV descriptor.\n\n @param[in]\n handle the pointer to the handle to the rocSPARSE library context.\n @param[inout]\n descr the pointer to the SpMV descriptor.\n @param[in]\n input one possible value of \\ref rocsparse_spmv_input.\n @param[in]\n in input value.\n @param[in]\n size_in_bytes input value size in bytes.\n @param[out]\n error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if an error descriptor is not required.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr or \\p in is invalid.\n \\retval rocsparse_status_invalid_value if \\p input is invalid.\n \\retval rocsparse_status_invalid_size if \\p size_in_bytes is zero."]
pub fn rocsparse_spmv_set_input(
handle: rocsparse_handle,
descr: rocsparse_spmv_descr,
input: rocsparse_spmv_input,
in_: *const ::std::os::raw::c_void,
size_in_bytes: usize,
error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Sparse matrix sptrsv routine descriptor creation.\n\n \\details\n \\p rocsparse_create_sptrsv_descr creates the descriptor of the \\ref rocsparse_sptrsv_buffer_size and\n \\ref rocsparse_sptrsv routines.\n\n @param[in]\n handle the handle to the rocSPARSE library context.\n @param[out]\n p_sptrsv_descr pointer to the descriptor of the sptrsv routine.\n @param[out]\n p_error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if an error descriptor is not required.\n\n \\retval rocsparse_status_invalid_handle \\p handle pointer is invalid.\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p descr pointer is invalid."]
pub fn rocsparse_sptrsv_descr_create(
handle: rocsparse_handle,
p_sptrsv_descr: *mut rocsparse_sptrsv_descr,
p_error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Destroy a sparse matrix sptrsv routine descriptor.\n\n \\details\n \\p rocsparse_destroy_sptrsv_descr destroys the descriptor of the \\ref rocsparse_sptrsv_buffer_size and\n \\ref rocsparse_sptrsv routines.\n\n @param[in]\n handle the handle to the rocSPARSE library context.\n @param[in]\n sptrsv_descr descriptor of the sptrsv routine.\n @param[out]\n p_error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if an error descriptor is not required.\n\n \\retval rocsparse_status_invalid_handle \\p handle pointer is invalid.\n \\retval rocsparse_status_success the operation completed successfully."]
pub fn rocsparse_sptrsv_descr_destroy(
handle: rocsparse_handle,
sptrsv_descr: rocsparse_sptrsv_descr,
p_error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Sparse matrix sptrsv routine descriptor creation.\n\n \\details\n \\p rocsparse_create_sptrsv_descr creates the descriptor of the \\ref rocsparse_sptrsv_buffer_size and\n \\ref rocsparse_sptrsv routines.\n\n @param[out]\n descr pointer to the descriptor of the sptrsv routine.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p descr pointer is invalid."]
pub fn rocsparse_create_sptrsv_descr(descr: *mut rocsparse_sptrsv_descr) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Destroy a sparse matrix sptrsv routine descriptor.\n\n \\details\n \\p rocsparse_destroy_sptrsv_descr destroys the descriptor of the \\ref rocsparse_sptrsv_buffer_size and\n \\ref rocsparse_sptrsv routines.\n\n @param[in]\n descr descriptor of the sptrsv routine.\n \\retval rocsparse_status_success the operation completed successfully."]
pub fn rocsparse_destroy_sptrsv_descr(descr: rocsparse_sptrsv_descr) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Set the requested \\ref rocsparse_sptrsv_input data in the sptrsv descriptor.\n\n @param[in]\n handle the pointer to the handle to the rocSPARSE library context.\n @param[inout]\n descr the pointer to the sptrsv descriptor.\n @param[in]\n input value of \\ref rocsparse_sptrsv_input.\n @param[in]\n data input data.\n @param[in]\n data_size_in_bytes input data size in bytes.\n @param[out]\n p_error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if an error descriptor is not required.\n\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr or \\p data is invalid.\n \\retval rocsparse_status_invalid_value if \\p input is invalid.\n \\retval rocsparse_status_invalid_size if \\p data_size_in_bytes is invalid."]
pub fn rocsparse_sptrsv_set_input(
handle: rocsparse_handle,
descr: rocsparse_sptrsv_descr,
input: rocsparse_sptrsv_input,
data: *const ::std::os::raw::c_void,
data_size_in_bytes: usize,
p_error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the requested \\ref rocsparse_sptrsv_output data from the sptrsv descriptor.\n\n @param[in]\n handle the pointer to the handle to the rocSPARSE library context.\n @param[inout]\n descr the pointer to the sptrsv descriptor.\n @param[in]\n output value of \\ref rocsparse_sptrsv_output.\n @param[out]\n data output data.\n @param[in]\n data_size_in_bytes output data size in bytes.\n @param[out]\n p_error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if an error descriptor is not required.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr or \\p data is invalid.\n \\retval rocsparse_status_invalid_value if \\p output is invalid.\n \\retval rocsparse_status_invalid_size if \\p data_size_in_bytes is invalid."]
pub fn rocsparse_sptrsv_get_output(
handle: rocsparse_handle,
descr: rocsparse_sptrsv_descr,
output: rocsparse_sptrsv_output,
data: *mut ::std::os::raw::c_void,
data_size_in_bytes: usize,
p_error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Sparse matrix sptrsm routine descriptor creation.\n\n \\details\n \\p rocsparse_create_sptrsm_descr creates the descriptor of the \\ref rocsparse_sptrsm_buffer_size and\n \\ref rocsparse_sptrsm routines.\n\n @param[out]\n descr pointer to the descriptor of the sptrsm routine.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p descr pointer is invalid."]
pub fn rocsparse_create_sptrsm_descr(descr: *mut rocsparse_sptrsm_descr) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Destroy sparse matrix sptrsm routine descriptor.\n\n \\details\n \\p rocsparse_destroy_sptrsm_descr destroys the descriptor of the \\ref rocsparse_sptrsm_buffer_size and\n \\ref rocsparse_sptrsm routines.\n\n @param[in]\n descr descriptor of the sptrsm routine.\n \\retval rocsparse_status_success the operation completed successfully."]
pub fn rocsparse_destroy_sptrsm_descr(descr: rocsparse_sptrsm_descr) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Set the requested \\ref rocsparse_sptrsm_input data in the sptrsm descriptor.\n\n @param[in]\n handle the pointer to the handle to the rocSPARSE library context.\n @param[inout]\n descr the pointer to the sptrsm descriptor.\n @param[in]\n input value of \\ref rocsparse_sptrsm_input.\n @param[in]\n data input data.\n @param[in]\n data_size input data size.\n @param[out]\n p_error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if an error descriptor is not required.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr or \\p data is invalid.\n \\retval rocsparse_status_invalid_value if \\p input is invalid.\n \\retval rocsparse_status_invalid_size if \\p data_size is invalid."]
pub fn rocsparse_sptrsm_set_input(
handle: rocsparse_handle,
descr: rocsparse_sptrsm_descr,
input: rocsparse_sptrsm_input,
data: *const ::std::os::raw::c_void,
data_size: usize,
p_error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the requested \\ref rocsparse_sptrsm_output data from the sptrsm descriptor.\n\n @param[in]\n handle the pointer to the handle to the rocSPARSE library context.\n @param[inout]\n descr the pointer to the sptrsm descriptor.\n @param[in]\n output value of \\ref rocsparse_sptrsm_output.\n @param[out]\n data output data.\n @param[in]\n data_size_in_bytes output data size in bytes.\n @param[out]\n p_error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if an error descriptor is not required.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr or \\p data is invalid.\n \\retval rocsparse_status_invalid_value if \\p output is invalid.\n \\retval rocsparse_status_invalid_size if \\p data_size_in_bytes is invalid."]
pub fn rocsparse_sptrsm_get_output(
handle: rocsparse_handle,
descr: rocsparse_sptrsm_descr,
output: rocsparse_sptrsm_output,
data: *mut ::std::os::raw::c_void,
data_size_in_bytes: usize,
p_error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Create SpIC0 descriptor.\n\n \\details\n \\p rocsparse_spic0_descr_create creates the descriptor of the configuration of the sparse Incomplete Cholesky of level 0.\n @param[in]\n handle the handle to the rocSPARSE library context.\n @param[out]\n p_spic0_descr pointer to the descriptor of the Spic0 routine.\n @param[out]\n p_error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if an error descriptor is not required.\n\n \\retval rocsparse_status_invalid_handle \\p handle pointer is invalid.\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p descr pointer is invalid."]
pub fn rocsparse_spic0_descr_create(
handle: rocsparse_handle,
p_spic0_descr: *mut rocsparse_spic0_descr,
p_error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Destroy SpIC0 descriptor.\n\n \\details\n \\p rocsparse_spic0_descr_destroy destroys the descriptor of the configuration of the sparse Incomplete Cholesky of level 0.\n\n @param[in]\n handle the handle to the rocSPARSE library context.\n @param[in]\n spic0_descr descriptor of the spic0 routine.\n @param[out]\n p_error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if an error descriptor is not required.\n \\retval rocsparse_status_invalid_handle \\p handle pointer is invalid.\n \\retval rocsparse_status_success the operation completed successfully."]
pub fn rocsparse_spic0_descr_destroy(
handle: rocsparse_handle,
spic0_descr: rocsparse_spic0_descr,
p_error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Set the requested \\ref rocsparse_spic0_input data in the SpIC0 descriptor.\n\n \\note\n - \\ref rocsparse_spic0_input_alg is \\ref rocsparse_spic0_alg. It can only be set before applying any phase.\n - \\ref rocsparse_spic0_input_compute_datatype is \\ref rocsparse_datatype. It can only be set before applying any phase. For now, it must be of value type of A.\n - \\ref rocsparse_spic0_input_analysis_policy is \\ref rocsparse_analysis_policy. It can only be set before applying any phase.\n - \\ref rocsparse_spic0_input_singularity_tolerance is a device/host double pointer. Its device mode is determined from the \\ref rocsparse_handle.\n - \\ref rocsparse_spic0_input_boost_enable is an \\p int32_t.\n - \\ref rocsparse_spic0_input_boost_value is a pointer to a scalar of value type A. Its device mode is determined from the \\ref rocsparse_handle.\n - \\ref rocsparse_spic0_input_boost_tolerance is a double pointer. Its device mode is determined from the \\ref rocsparse_handle.\n\n @param[in]\n handle the pointer to the handle to the rocSPARSE library context.\n @param[inout]\n spic0_descr the pointer to the SpIC0 descriptor.\n @param[in]\n spic0_input value of \\ref rocsparse_spic0_input.\n @param[in]\n input input data.\n @param[in]\n input_size_in_bytes input data size in bytes.\n @param[out]\n p_error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if an error descriptor is not required.\n\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr or \\p data is invalid.\n \\retval rocsparse_status_invalid_value if \\p input is invalid.\n \\retval rocsparse_status_invalid_size if \\p data_size_in_bytes is invalid."]
pub fn rocsparse_spic0_set_input(
handle: rocsparse_handle,
spic0_descr: rocsparse_spic0_descr,
spic0_input: rocsparse_spic0_input,
input: *const ::std::os::raw::c_void,
input_size_in_bytes: usize,
p_error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the requested \\ref rocsparse_spic0_output data from the SpIC0 descriptor.\n \\note\n - \\ref rocsparse_spic0_output_singularity is \\ref rocsparse_singularity. It will be considered as an array of size \\p batch_count.\n - \\ref rocsparse_spic0_output_singularity_position is \\p int64_t. It will be considered as an array of size \\p batch_count.\n @param[in]\n handle the pointer to the handle to the rocSPARSE library context.\n @param[inout]\n spic0_descr the pointer to the SpIC0 descriptor.\n @param[in]\n spic0_output value of \\ref rocsparse_spic0_output.\n @param[out]\n output output data\n @param[in]\n output_size_in_bytes output data size in bytes.\n @param[out]\n p_error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if an error descriptor is not required.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr or \\p data is invalid.\n \\retval rocsparse_status_invalid_value if \\p output is invalid.\n \\retval rocsparse_status_invalid_size if \\p data_size_in_bytes is invalid."]
pub fn rocsparse_spic0_get_output(
handle: rocsparse_handle,
spic0_descr: rocsparse_spic0_descr,
spic0_output: rocsparse_spic0_output,
output: *mut ::std::os::raw::c_void,
output_size_in_bytes: usize,
p_error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Create SpILU0 descriptor.\n\n \\details\n \\p rocsparse_spilu0_descr_create creates the descriptor of the configuration of the sparse Incomplete LU of level 0.\n\n @param[in]\n handle the handle to the rocSPARSE library context.\n @param[out]\n p_spilu0_descr pointer to the descriptor of the Spilu0 routine.\n @param[out]\n p_error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if an error descriptor is not required.\n\n \\retval rocsparse_status_invalid_handle \\p handle pointer is invalid.\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p descr pointer is invalid."]
pub fn rocsparse_spilu0_descr_create(
handle: rocsparse_handle,
p_spilu0_descr: *mut rocsparse_spilu0_descr,
p_error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Destroy SpILU0 descriptor.\n\n \\details\n \\p rocsparse_spilu0_descr_destroy destroys the descriptor of the configuration of the sparse Incomplete LU of level 0.\n\n @param[in]\n handle the handle to the rocSPARSE library context.\n @param[in]\n spilu0_descr descriptor of the spilu0 routine.\n @param[out]\n p_error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if an error descriptor is not required.\n \\retval rocsparse_status_invalid_handle \\p handle pointer is invalid.\n \\retval rocsparse_status_success the operation completed successfully."]
pub fn rocsparse_spilu0_descr_destroy(
handle: rocsparse_handle,
spilu0_descr: rocsparse_spilu0_descr,
p_error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Set the requested \\ref rocsparse_spilu0_input data in the SpILU0 descriptor.\n\n \\note\n - \\ref rocsparse_spilu0_input_alg is \\ref rocsparse_spilu0_alg. It can only be set before applying any phase.\n - \\ref rocsparse_spilu0_input_compute_datatype is \\ref rocsparse_datatype. It can only be set before applying any phase. For now, it must be of value type of A.\n - \\ref rocsparse_spilu0_input_analysis_policy is \\ref rocsparse_analysis_policy. It can only be set before applying any phase.\n - \\ref rocsparse_spilu0_input_singularity_tolerance is a device/host double pointer. Its device mode is determined from the \\ref rocsparse_handle. No batched tolerances can be specified.\n - \\ref rocsparse_spilu0_input_boost_enable is a host \\p int32_t. Set to 1 to enable and 0 to disable.\n - \\ref rocsparse_spilu0_input_boost_value is a pointer to a scalar of value type of A. Its device mode is determined from the \\ref rocsparse_handle. No batched boost values can be specified.\n - \\ref rocsparse_spilu0_input_boost_tolerance is a double pointer. Its device mode is determined from the \\ref rocsparse_handle. No batched boost tolerances can be specified.\n\n @param[in]\n handle the pointer to the handle to the rocSPARSE library context.\n @param[inout]\n spilu0_descr the pointer to the SpILU0 descriptor.\n @param[in]\n spilu0_input value of \\ref rocsparse_spilu0_input.\n @param[in]\n input input data.\n @param[in]\n input_size_in_bytes input data size in bytes.\n @param[out]\n p_error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if an error descriptor is not required.\n\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr or \\p data is invalid.\n \\retval rocsparse_status_invalid_value if \\p input is invalid.\n \\retval rocsparse_status_invalid_size if \\p data_size_in_bytes is invalid."]
pub fn rocsparse_spilu0_set_input(
handle: rocsparse_handle,
spilu0_descr: rocsparse_spilu0_descr,
spilu0_input: rocsparse_spilu0_input,
input: *const ::std::os::raw::c_void,
input_size_in_bytes: usize,
p_error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the requested \\ref rocsparse_spilu0_output data from the SpILU0 descriptor.\n \\note\n - \\ref rocsparse_spilu0_output_singularity is \\ref rocsparse_singularity. It will be considered as an array of size \\p batch_count.\n - \\ref rocsparse_spilu0_output_singularity_position is int64_t. It will be considered as an array of size \\p batch_count.\n @param[in]\n handle the pointer to the handle to the rocSPARSE library context.\n @param[inout]\n spilu0_descr the pointer to the SpILU0 descriptor.\n @param[in]\n spilu0_output value of \\ref rocsparse_spilu0_output.\n @param[out]\n output output data.\n @param[in]\n output_size_in_bytes output data size in bytes.\n @param[out]\n p_error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if an error descriptor is not required.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr or \\p data is invalid.\n \\retval rocsparse_status_invalid_value if \\p output is invalid.\n \\retval rocsparse_status_invalid_size if \\p data_size_in_bytes is invalid."]
pub fn rocsparse_spilu0_get_output(
handle: rocsparse_handle,
spilu0_descr: rocsparse_spilu0_descr,
spilu0_output: rocsparse_spilu0_output,
output: *mut ::std::os::raw::c_void,
output_size_in_bytes: usize,
p_error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the fields of the sparse COO matrix descriptor.\n \\details\n \\p rocsparse_coo_get gets the fields of the sparse COO matrix descriptor.\n\n @param[in]\n descr the pointer to the sparse COO matrix descriptor.\n @param[out]\n rows number of rows in the sparse COO matrix.\n @param[out]\n cols number of columns in the sparse COO matrix.\n @param[out]\n nnz number of non-zeros in sparse COO matrix.\n @param[out]\n coo_row_ind row indices of the COO matrix. Must be an array of length \\p nnz.\n @param[out]\n coo_col_ind column indices of the COO matrix. Must be an array of length \\p nnz.\n @param[out]\n coo_val values of the COO matrix. Must be an array of length \\p nnz.\n @param[out]\n idx_type \\ref rocsparse_indextype_i32 or \\ref rocsparse_indextype_i64.\n @param[out]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[out]\n data_type \\ref rocsparse_datatype_f32_r, \\ref rocsparse_datatype_f64_r,\n \\ref rocsparse_datatype_f32_c, or \\ref rocsparse_datatype_f64_c.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr, \\p coo_row_ind, \\p coo_col_ind, or \\p coo_val is invalid.\n \\retval rocsparse_status_invalid_size if \\p rows, \\p cols, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_value if \\p idx_type, \\p idx_base, or \\p data_type is invalid.\n/\n/**@{"]
pub fn rocsparse_coo_get(
descr: rocsparse_spmat_descr,
rows: *mut i64,
cols: *mut i64,
nnz: *mut i64,
coo_row_ind: *mut *mut ::std::os::raw::c_void,
coo_col_ind: *mut *mut ::std::os::raw::c_void,
coo_val: *mut *mut ::std::os::raw::c_void,
idx_type: *mut rocsparse_indextype,
idx_base: *mut rocsparse_index_base,
data_type: *mut rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_const_coo_get(
descr: rocsparse_const_spmat_descr,
rows: *mut i64,
cols: *mut i64,
nnz: *mut i64,
coo_row_ind: *mut *const ::std::os::raw::c_void,
coo_col_ind: *mut *const ::std::os::raw::c_void,
coo_val: *mut *const ::std::os::raw::c_void,
idx_type: *mut rocsparse_indextype,
idx_base: *mut rocsparse_index_base,
data_type: *mut rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the fields of the sparse COO AoS matrix descriptor.\n \\details\n \\p rocsparse_coo_aos_get gets the fields of the sparse COO AoS matrix descriptor.\n\n @param[in]\n descr the pointer to the sparse COO AoS matrix descriptor.\n @param[out]\n rows number of rows in the sparse COO AoS matrix.\n @param[out]\n cols number of columns in the sparse COO AoS matrix.\n @param[out]\n nnz number of non-zeros in the sparse COO AoS matrix.\n @param[out]\n coo_ind <row, columns> indices of the COO AoS matrix. Must be an array of length \\p nnz.\n @param[out]\n coo_val values of the COO AoS matrix. Must be an array of length \\p nnz.\n @param[out]\n idx_type \\ref rocsparse_indextype_i32 or \\ref rocsparse_indextype_i64.\n @param[out]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[out]\n data_type \\ref rocsparse_datatype_f32_r, \\ref rocsparse_datatype_f64_r,\n \\ref rocsparse_datatype_f32_c, or \\ref rocsparse_datatype_f64_c.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr, \\p coo_ind, or \\p coo_val is invalid.\n \\retval rocsparse_status_invalid_size if \\p rows, \\p cols, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_value if \\p idx_type, \\p idx_base, or \\p data_type is invalid.\n/\n/**@{"]
pub fn rocsparse_coo_aos_get(
descr: rocsparse_spmat_descr,
rows: *mut i64,
cols: *mut i64,
nnz: *mut i64,
coo_ind: *mut *mut ::std::os::raw::c_void,
coo_val: *mut *mut ::std::os::raw::c_void,
idx_type: *mut rocsparse_indextype,
idx_base: *mut rocsparse_index_base,
data_type: *mut rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_const_coo_aos_get(
descr: rocsparse_const_spmat_descr,
rows: *mut i64,
cols: *mut i64,
nnz: *mut i64,
coo_ind: *mut *const ::std::os::raw::c_void,
coo_val: *mut *const ::std::os::raw::c_void,
idx_type: *mut rocsparse_indextype,
idx_base: *mut rocsparse_index_base,
data_type: *mut rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = "@}*/\n/*! \\ingroup aux_module\n \\brief Get the fields of the sparse CSR matrix descriptor.\n \\details\n \\p rocsparse_csr_get gets the fields of the sparse CSR matrix descriptor.\n\n @param[in]\n descr the pointer to the sparse CSR matrix descriptor.\n @param[out]\n rows number of rows in the CSR matrix.\n @param[out]\n cols number of columns in the CSR matrix.\n @param[out]\n nnz number of non-zeros in the CSR matrix.\n @param[out]\n csr_row_ptr row offsets of the CSR matrix. Must be an array of length \\p rows+1.\n @param[out]\n csr_col_ind column indices of the CSR matrix. Must be an array of length \\p nnz.\n @param[out]\n csr_val values of the CSR matrix. Must be an array of length \\p nnz.\n @param[out]\n row_ptr_type \\ref rocsparse_indextype_i32 or \\ref rocsparse_indextype_i64.\n @param[out]\n col_ind_type \\ref rocsparse_indextype_i32 or \\ref rocsparse_indextype_i64.\n @param[out]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[out]\n data_type \\ref rocsparse_datatype_f32_r, \\ref rocsparse_datatype_f64_r,\n \\ref rocsparse_datatype_f32_c, or \\ref rocsparse_datatype_f64_c.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr, \\p csr_row_ptr, \\p csr_col_ind, or \\p csr_val is invalid.\n \\retval rocsparse_status_invalid_size if \\p rows, \\p cols, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_value if \\p row_ptr_type, \\p col_ind_type, \\p idx_base, or \\p data_type is invalid.\n/\n/**@{"]
pub fn rocsparse_csr_get(
descr: rocsparse_spmat_descr,
rows: *mut i64,
cols: *mut i64,
nnz: *mut i64,
csr_row_ptr: *mut *mut ::std::os::raw::c_void,
csr_col_ind: *mut *mut ::std::os::raw::c_void,
csr_val: *mut *mut ::std::os::raw::c_void,
row_ptr_type: *mut rocsparse_indextype,
col_ind_type: *mut rocsparse_indextype,
idx_base: *mut rocsparse_index_base,
data_type: *mut rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_const_csr_get(
descr: rocsparse_const_spmat_descr,
rows: *mut i64,
cols: *mut i64,
nnz: *mut i64,
csr_row_ptr: *mut *const ::std::os::raw::c_void,
csr_col_ind: *mut *const ::std::os::raw::c_void,
csr_val: *mut *const ::std::os::raw::c_void,
row_ptr_type: *mut rocsparse_indextype,
col_ind_type: *mut rocsparse_indextype,
idx_base: *mut rocsparse_index_base,
data_type: *mut rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the fields of the sparse CSC matrix descriptor.\n \\details\n \\p rocsparse_csc_get gets the fields of the sparse CSC matrix descriptor.\n\n @param[in]\n descr the pointer to the sparse CSC matrix descriptor.\n @param[out]\n rows number of rows in the CSC matrix.\n @param[out]\n cols number of columns in the CSC matrix\n @param[out]\n nnz number of non-zeros in the CSC matrix.\n @param[out]\n csc_col_ptr column offsets of the CSC matrix. Must be an array of length \\p cols+1.\n @param[out]\n csc_row_ind row indices of the CSC matrix. Must be an array of length \\p nnz.\n @param[out]\n csc_val values of the CSC matrix. Must be an array of length \\p nnz.\n @param[out]\n col_ptr_type \\ref rocsparse_indextype_i32 or \\ref rocsparse_indextype_i64.\n @param[out]\n row_ind_type \\ref rocsparse_indextype_i32 or \\ref rocsparse_indextype_i64.\n @param[out]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[out]\n data_type \\ref rocsparse_datatype_f32_r, \\ref rocsparse_datatype_f64_r,\n \\ref rocsparse_datatype_f32_c, or \\ref rocsparse_datatype_f64_c.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr, \\p csc_col_ptr, \\p csc_row_ind, or \\p csr_val is invalid.\n \\retval rocsparse_status_invalid_size if \\p rows, \\p cols, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_value if \\p col_ptr_type, \\p row_ind_type, \\p idx_base, or \\p data_type is invalid.\n/\n/**@{"]
pub fn rocsparse_csc_get(
descr: rocsparse_spmat_descr,
rows: *mut i64,
cols: *mut i64,
nnz: *mut i64,
csc_col_ptr: *mut *mut ::std::os::raw::c_void,
csc_row_ind: *mut *mut ::std::os::raw::c_void,
csc_val: *mut *mut ::std::os::raw::c_void,
col_ptr_type: *mut rocsparse_indextype,
row_ind_type: *mut rocsparse_indextype,
idx_base: *mut rocsparse_index_base,
data_type: *mut rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_const_csc_get(
descr: rocsparse_const_spmat_descr,
rows: *mut i64,
cols: *mut i64,
nnz: *mut i64,
csc_col_ptr: *mut *const ::std::os::raw::c_void,
csc_row_ind: *mut *const ::std::os::raw::c_void,
csc_val: *mut *const ::std::os::raw::c_void,
col_ptr_type: *mut rocsparse_indextype,
row_ind_type: *mut rocsparse_indextype,
idx_base: *mut rocsparse_index_base,
data_type: *mut rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the fields of the sparse ELL matrix descriptor.\n \\details\n \\p rocsparse_ell_get gets the fields of the sparse ELL matrix descriptor.\n\n @param[in]\n descr the pointer to the sparse ELL matrix descriptor.\n @param[out]\n rows number of rows in the ELL matrix.\n @param[out]\n cols number of columns in the ELL matrix.\n @param[out]\n ell_col_ind column indices of the ELL matrix. Must be an array of length \\p rows*ell_width.\n @param[out]\n ell_val values of the ELL matrix. Must be an array of length \\p rows*ell_width.\n @param[out]\n ell_width width of the ELL matrix.\n @param[out]\n idx_type \\ref rocsparse_indextype_i32 or \\ref rocsparse_indextype_i64.\n @param[out]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[out]\n data_type \\ref rocsparse_datatype_f32_r, \\ref rocsparse_datatype_f64_r,\n \\ref rocsparse_datatype_f32_c, or \\ref rocsparse_datatype_f64_c.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr, \\p ell_col_ind, or \\p ell_val is invalid.\n \\retval rocsparse_status_invalid_size if \\p rows, \\p cols, or \\p ell_width is invalid.\n \\retval rocsparse_status_invalid_value if \\p idx_type, \\p idx_base, or \\p data_type is invalid.\n/\n/**@{"]
pub fn rocsparse_ell_get(
descr: rocsparse_spmat_descr,
rows: *mut i64,
cols: *mut i64,
ell_col_ind: *mut *mut ::std::os::raw::c_void,
ell_val: *mut *mut ::std::os::raw::c_void,
ell_width: *mut i64,
idx_type: *mut rocsparse_indextype,
idx_base: *mut rocsparse_index_base,
data_type: *mut rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_const_ell_get(
descr: rocsparse_const_spmat_descr,
rows: *mut i64,
cols: *mut i64,
ell_col_ind: *mut *const ::std::os::raw::c_void,
ell_val: *mut *const ::std::os::raw::c_void,
ell_width: *mut i64,
idx_type: *mut rocsparse_indextype,
idx_base: *mut rocsparse_index_base,
data_type: *mut rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the fields of the sparse blocked ELL matrix descriptor.\n \\details\n \\p rocsparse_bell_get gets the fields of the sparse blocked ELL matrix descriptor.\n\n @param[in]\n descr the pointer to the sparse blocked ELL matrix descriptor.\n @param[out]\n rows number of rows in the blocked ELL matrix.\n @param[out]\n cols number of columns in the blocked ELL matrix.\n @param[out]\n ell_block_dir \\ref rocsparse_direction_row or \\ref rocsparse_direction_column.\n @param[out]\n ell_block_dim block dimension of the sparse blocked ELL matrix.\n @param[out]\n ell_cols column indices of the blocked ELL matrix. Must be an array of length \\p rows*ell_width.\n @param[out]\n ell_col_ind column indices of the blocked ELL matrix. Must be an array of length \\p rows*ell_width.\n @param[out]\n ell_val values of the blocked ELL matrix. Must be an array of length \\p rows*ell_width.\n @param[out]\n idx_type \\ref rocsparse_indextype_i32 or \\ref rocsparse_indextype_i64.\n @param[out]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[out]\n data_type \\ref rocsparse_datatype_f32_r, \\ref rocsparse_datatype_f64_r,\n \\ref rocsparse_datatype_f32_c, or \\ref rocsparse_datatype_f64_c.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr, \\p ell_cols, \\p ell_col_ind, or \\p ell_val is invalid.\n \\retval rocsparse_status_invalid_size if \\p rows, \\p cols, or \\p ell_block_dim is invalid.\n \\retval rocsparse_status_invalid_value if \\p ell_block_dir, \\p idx_type, \\p idx_base, or \\p data_type is invalid.\n/\n/**@{"]
pub fn rocsparse_bell_get(
descr: rocsparse_spmat_descr,
rows: *mut i64,
cols: *mut i64,
ell_block_dir: *mut rocsparse_direction,
ell_block_dim: *mut i64,
ell_cols: *mut i64,
ell_col_ind: *mut *mut ::std::os::raw::c_void,
ell_val: *mut *mut ::std::os::raw::c_void,
idx_type: *mut rocsparse_indextype,
idx_base: *mut rocsparse_index_base,
data_type: *mut rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_const_bell_get(
descr: rocsparse_const_spmat_descr,
rows: *mut i64,
cols: *mut i64,
ell_block_dir: *mut rocsparse_direction,
ell_block_dim: *mut i64,
ell_cols: *mut i64,
ell_col_ind: *mut *const ::std::os::raw::c_void,
ell_val: *mut *const ::std::os::raw::c_void,
idx_type: *mut rocsparse_indextype,
idx_base: *mut rocsparse_index_base,
data_type: *mut rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the fields of the sparse sliced ELL matrix descriptor.\n \\details\n \\p rocsparse_sell_get gets the fields of the sparse sliced ELL matrix descriptor.\n\n @param[in]\n descr the pointer to the sparse sliced ELL matrix descriptor.\n @param[out]\n rows number of rows in the sliced ELL matrix.\n @param[out]\n cols number of columns in the sliced ELL matrix.\n @param[out]\n nnz number of non-zeros in the sliced ELL matrix.\n @param[out]\n sell_slice_size slice size in the sliced ELL matrix.\n @param[out]\n sell_colval_size actual number of elements stored in the sliced ELL matrix.\n @param[out]\n sell_slice_offsets slice offsets array in the sliced ELL matrix. Must be an array of length \\p nslices + 1\n where \\p nslices=(rows-1)/sell_slice_size+1.\n @param[out]\n sell_col_ind column indices of the sliced ELL matrix. Must be an array of length \\p sell_colval_size.\n @param[out]\n sell_val values of the sliced ELL matrix. Must be an array of length \\p sell_colval_size.\n @param[out]\n sell_slice_offsets_type \\ref rocsparse_indextype_i32 or \\ref rocsparse_indextype_i64.\n @param[out]\n sell_col_ind_type \\ref rocsparse_indextype_i32 or \\ref rocsparse_indextype_i64.\n @param[out]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[out]\n data_type \\ref rocsparse_datatype_f32_r, \\ref rocsparse_datatype_f64_r,\n \\ref rocsparse_datatype_f32_c, or \\ref rocsparse_datatype_f64_c.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr, \\p sell_slice_offsets, \\p sell_col_ind, or \\p sell_val is invalid.\n \\retval rocsparse_status_invalid_size if \\p rows, \\p cols, \\p nnz, \\p sell_colval_size, or \\p sell_slice_size is invalid.\n \\retval rocsparse_status_invalid_value if \\p sell_slice_offsets_type, \\p sell_col_ind_type, \\p idx_base, or \\p data_type is invalid.\n/\n/**@{"]
pub fn rocsparse_sell_get(
descr: rocsparse_spmat_descr,
rows: *mut i64,
cols: *mut i64,
nnz: *mut i64,
sell_slice_size: *mut i64,
sell_colval_size: *mut i64,
sell_slice_offsets: *mut *mut ::std::os::raw::c_void,
sell_col_ind: *mut *mut ::std::os::raw::c_void,
sell_val: *mut *mut ::std::os::raw::c_void,
sell_slice_offsets_type: *mut rocsparse_indextype,
sell_col_ind_type: *mut rocsparse_indextype,
idx_base: *mut rocsparse_index_base,
data_type: *mut rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_const_sell_get(
descr: rocsparse_const_spmat_descr,
rows: *mut i64,
cols: *mut i64,
nnz: *mut i64,
sell_slice_size: *mut i64,
sell_colval_size: *mut i64,
sell_slice_offsets: *mut *const ::std::os::raw::c_void,
sell_col_ind: *mut *const ::std::os::raw::c_void,
sell_val: *mut *const ::std::os::raw::c_void,
sell_slice_offsets_type: *mut rocsparse_indextype,
sell_col_ind_type: *mut rocsparse_indextype,
idx_base: *mut rocsparse_index_base,
data_type: *mut rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the fields of the sparse BSR matrix descriptor.\n \\details\n \\p rocsparse_bsr_get gets the fields of the sparse BSR matrix descriptor.\n\n @param[in]\n descr the pointer to the sparse BSR matrix descriptor.\n @param[out]\n brows number of block rows in the BSR matrix.\n @param[out]\n bcols number of block columns in the BSR matrix.\n @param[out]\n bnnz number of non-zero blocks in the BSR matrix.\n @param[out]\n block_dir storage layout of the dense block matrices.\n @param[out]\n block_dim block dimension.\n @param[out]\n bsr_row_ptr row offsets of the BSR matrix. Must be an array of length \\p brows+1.\n @param[out]\n bsr_col_ind column indices of the BSR matrix. Must be an array of length \\p bnnz.\n @param[out]\n bsr_val values of the BSR matrix (must be array of length \\p bnnz * \\p block_dim * \\p block_dim ).\n @param[out]\n row_ptr_type \\ref rocsparse_indextype_i32 or \\ref rocsparse_indextype_i64.\n @param[out]\n col_ind_type \\ref rocsparse_indextype_i32 or \\ref rocsparse_indextype_i64.\n @param[out]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[out]\n data_type \\ref rocsparse_datatype_f32_r, \\ref rocsparse_datatype_f64_r,\n \\ref rocsparse_datatype_f32_c, or \\ref rocsparse_datatype_f64_c.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr, \\p brows, \\p bcols, \\p bnnz,\n \\p block_dir, \\p block_dim, \\p bsr_row_ptr, \\p bsr_col_ind, \\p bsr_val,\n \\p row_ptr_type, \\p col_ind_type, \\p idx_base, or \\p data_type is invalid.\n \\retval rocsparse_status_not_initialized if \\p descr has not been initialized.\n/\n/**@{"]
pub fn rocsparse_bsr_get(
descr: rocsparse_spmat_descr,
brows: *mut i64,
bcols: *mut i64,
bnnz: *mut i64,
block_dir: *mut rocsparse_direction,
block_dim: *mut i64,
bsr_row_ptr: *mut *mut ::std::os::raw::c_void,
bsr_col_ind: *mut *mut ::std::os::raw::c_void,
bsr_val: *mut *mut ::std::os::raw::c_void,
row_ptr_type: *mut rocsparse_indextype,
col_ind_type: *mut rocsparse_indextype,
idx_base: *mut rocsparse_index_base,
data_type: *mut rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_const_bsr_get(
descr: rocsparse_const_spmat_descr,
brows: *mut i64,
bcols: *mut i64,
bnnz: *mut i64,
block_dir: *mut rocsparse_direction,
block_dim: *mut i64,
bsr_row_ptr: *mut *const ::std::os::raw::c_void,
bsr_col_ind: *mut *const ::std::os::raw::c_void,
bsr_val: *mut *const ::std::os::raw::c_void,
row_ptr_type: *mut rocsparse_indextype,
col_ind_type: *mut rocsparse_indextype,
idx_base: *mut rocsparse_index_base,
data_type: *mut rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Set the row indices, column indices, and values array in the sparse COO matrix descriptor.\n\n @param[inout]\n descr the pointer to the sparse vector descriptor.\n @param[in]\n coo_row_ind row indices of the COO matrix. Must be an array of length \\p nnz.\n @param[in]\n coo_col_ind column indices of the COO matrix. Must be an array of length \\p nnz.\n @param[in]\n coo_val values of the COO matrix. Must be an array of length \\p nnz.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr, \\p coo_row_ind, \\p coo_col_ind, or \\p coo_val is invalid."]
pub fn rocsparse_coo_set_pointers(
descr: rocsparse_spmat_descr,
coo_row_ind: *mut ::std::os::raw::c_void,
coo_col_ind: *mut ::std::os::raw::c_void,
coo_val: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Set the <row, column> indices and values array in the sparse COO AoS matrix descriptor.\n\n @param[inout]\n descr the pointer to the sparse vector descriptor.\n @param[in]\n coo_ind <row, column> indices of the COO matrix. Must be an array of length \\p nnz.\n @param[in]\n coo_val values of the COO matrix. Must be an array of length \\p nnz.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr, \\p coo_ind, or \\p coo_val is invalid."]
pub fn rocsparse_coo_aos_set_pointers(
descr: rocsparse_spmat_descr,
coo_ind: *mut ::std::os::raw::c_void,
coo_val: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Set the row offsets, column indices, and values array in the sparse CSR matrix descriptor.\n\n @param[inout]\n descr the pointer to the sparse vector descriptor.\n @param[in]\n csr_row_ptr row offsets of the CSR matrix. Must be an array of length \\p rows+1.\n @param[in]\n csr_col_ind column indices of the CSR matrix. Must be an array of length \\p nnz.\n @param[in]\n csr_val values of the CSR matrix. Must be an array of length \\p nnz.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr, \\p coo_ind, or \\p coo_val is invalid."]
pub fn rocsparse_csr_set_pointers(
descr: rocsparse_spmat_descr,
csr_row_ptr: *mut ::std::os::raw::c_void,
csr_col_ind: *mut ::std::os::raw::c_void,
csr_val: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Set the column offsets, row indices, and values array in the sparse CSC matrix descriptor.\n\n @param[inout]\n descr the pointer to the sparse vector descriptor.\n @param[in]\n csc_col_ptr column offsets of the CSC matrix. Must be an array of length \\p cols+1.\n @param[in]\n csc_row_ind row indices of the CSC matrix. Must be an array of length \\p nnz.\n @param[in]\n csc_val values of the CSC matrix. Must be an array of length \\p nnz.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr, \\p csc_col_ptr, \\p csc_row_ind, or \\p csc_val is invalid."]
pub fn rocsparse_csc_set_pointers(
descr: rocsparse_spmat_descr,
csc_col_ptr: *mut ::std::os::raw::c_void,
csc_row_ind: *mut ::std::os::raw::c_void,
csc_val: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Set the column indices and values array in the sparse ELL matrix descriptor.\n\n @param[inout]\n descr the pointer to the sparse vector descriptor.\n @param[in]\n ell_col_ind column indices of the ELL matrix. Must be an array of length \\p rows*ell_width.\n @param[in]\n ell_val values of the ELL matrix. Must be an array of length \\p rows*ell_width.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr, \\p ell_col_ind, or \\p ell_val is invalid."]
pub fn rocsparse_ell_set_pointers(
descr: rocsparse_spmat_descr,
ell_col_ind: *mut ::std::os::raw::c_void,
ell_val: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Set the row offsets, column indices, and values array in the sparse BSR matrix descriptor\n\n @param[inout]\n descr the pointer to the sparse vector descriptor.\n @param[in]\n bsr_row_ptr row offsets of the BSR matrix. Must be an array of length \\p rows+1.\n @param[in]\n bsr_col_ind column indices of the BSR matrix. Must be an array of length \\p nnzb.\n @param[in]\n bsr_val values of the BSR matrix. Must be an array of length \\p nnzb*block_dim*block_dim.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr, \\p bsr_row_ptr, \\p bsr_col_ind, or \\p bsr_val is invalid."]
pub fn rocsparse_bsr_set_pointers(
descr: rocsparse_spmat_descr,
bsr_row_ptr: *mut ::std::os::raw::c_void,
bsr_col_ind: *mut ::std::os::raw::c_void,
bsr_val: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the number of rows, columns, and non-zeros from the sparse matrix descriptor.\n\n @param[in]\n descr the pointer to the sparse matrix descriptor.\n @param[out]\n rows number of rows in the sparse matrix.\n @param[out]\n cols number of columns in the sparse matrix.\n @param[out]\n nnz number of non-zeros in sparse matrix.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr is invalid.\n \\retval rocsparse_status_invalid_size if \\p rows, \\p cols, or \\p nnz is invalid."]
pub fn rocsparse_spmat_get_size(
descr: rocsparse_const_spmat_descr,
rows: *mut i64,
cols: *mut i64,
nnz: *mut i64,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the sparse matrix format from the sparse matrix descriptor.\n\n @param[in]\n descr the pointer to the sparse matrix descriptor.\n @param[out]\n format \\ref rocsparse_format_coo, \\ref rocsparse_format_coo_aos,\n \\ref rocsparse_format_csr, \\ref rocsparse_format_csc, or\n \\ref rocsparse_format_ell\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr is invalid.\n \\retval rocsparse_status_invalid_value if \\p format is invalid."]
pub fn rocsparse_spmat_get_format(
descr: rocsparse_const_spmat_descr,
format: *mut rocsparse_format,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the sparse matrix index base from the sparse matrix descriptor.\n\n @param[in]\n descr the pointer to the sparse matrix descriptor.\n @param[out]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr is invalid.\n \\retval rocsparse_status_invalid_value if \\p idx_base is invalid."]
pub fn rocsparse_spmat_get_index_base(
descr: rocsparse_const_spmat_descr,
idx_base: *mut rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the values array from the sparse matrix descriptor.\n\n @param[in]\n descr the pointer to the sparse matrix descriptor.\n @param[out]\n values values array of the sparse matrix.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr or \\p values is invalid.\n/\n/**@{"]
pub fn rocsparse_spmat_get_values(
descr: rocsparse_spmat_descr,
values: *mut *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_const_spmat_get_values(
descr: rocsparse_const_spmat_descr,
values: *mut *const ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Set the values array in the sparse matrix descriptor.\n\n @param[inout]\n descr the pointer to the sparse matrix descriptor.\n @param[in]\n values values array of the sparse matrix.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr or \\p values is invalid."]
pub fn rocsparse_spmat_set_values(
descr: rocsparse_spmat_descr,
values: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the number of non-zeros from the sparse matrix descriptor.\n\n \\note The returned number of non-zeros is the number of elements of the array of values of the sparse matrix.\n\n @param[in]\n descr the pointer to the sparse matrix descriptor.\n @param[out]\n nnz the number of non-zeros of the sparse matrix.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr or \\p nnz is invalid."]
pub fn rocsparse_spmat_get_nnz(
descr: rocsparse_const_spmat_descr,
nnz: *mut i64,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Set the number of non-zeros in the sparse matrix descriptor.\n\n \\note In the case of a sparse matrix with the format \\ref rocsparse_format_bsr, \\p nnz is the number of blocks.\n \\note In the case of a sparse matrix with the format \\ref rocsparse_format_ell, the operation will return an error.\n \\note In the case of a sparse matrix with the format \\ref rocsparse_format_bell, the operation will return an error.\n\n @param[in]\n descr the pointer to the sparse matrix descriptor.\n @param[in]\n nnz number of non-zeros of the sparse matrix.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr is invalid.\n \\retval rocsparse_status_invalid_size if \\p nnz is invalid."]
pub fn rocsparse_spmat_set_nnz(descr: rocsparse_spmat_descr, nnz: i64) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the strided batch count from the sparse matrix descriptor.\n\n @param[in]\n descr the pointer to the sparse matrix descriptor.\n @param[out]\n batch_count batch_count of the sparse matrix.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr is invalid.\n \\retval rocsparse_status_invalid_size if \\p batch_count is invalid."]
pub fn rocsparse_spmat_get_strided_batch(
descr: rocsparse_const_spmat_descr,
batch_count: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Set the strided batch count in the sparse matrix descriptor.\n\n @param[in]\n descr the pointer to the sparse matrix descriptor.\n @param[in]\n batch_count batch_count of the sparse matrix.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr is invalid.\n \\retval rocsparse_status_invalid_size if \\p batch_count is invalid."]
pub fn rocsparse_spmat_set_strided_batch(
descr: rocsparse_spmat_descr,
batch_count: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Set the batch count and batch stride in the sparse COO matrix descriptor\n\n @param[inout]\n descr the pointer to the sparse COO matrix descriptor.\n @param[in]\n batch_count batch_count of the sparse COO matrix.\n @param[in]\n batch_stride batch stride of the sparse COO matrix.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr is invalid.\n \\retval rocsparse_status_invalid_size if \\p batch_count or \\p batch_stride is invalid."]
pub fn rocsparse_coo_set_strided_batch(
descr: rocsparse_spmat_descr,
batch_count: rocsparse_int,
batch_stride: i64,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Set the batch count, row offset batch stride, and the column indices batch stride in the sparse CSR matrix descriptor.\n\n @param[inout]\n descr the pointer to the sparse CSR matrix descriptor.\n @param[in]\n batch_count batch_count of the sparse CSR matrix.\n @param[in]\n offsets_batch_stride row offset batch stride of the sparse CSR matrix.\n @param[in]\n columns_values_batch_stride column indices batch stride of the sparse CSR matrix.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr is invalid.\n \\retval rocsparse_status_invalid_size if \\p batch_count, \\p offsets_batch_stride, or \\p columns_values_batch_stride is invalid."]
pub fn rocsparse_csr_set_strided_batch(
descr: rocsparse_spmat_descr,
batch_count: rocsparse_int,
offsets_batch_stride: i64,
columns_values_batch_stride: i64,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Set the batch count, column offset batch stride, and the row indices batch stride in the sparse CSC matrix descriptor.\n\n @param[inout]\n descr the pointer to the sparse CSC matrix descriptor.\n @param[in]\n batch_count batch_count of the sparse CSC matrix.\n @param[in]\n offsets_batch_stride column offset batch stride of the sparse CSC matrix.\n @param[in]\n rows_values_batch_stride row indices batch stride of the sparse CSC matrix.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr is invalid.\n \\retval rocsparse_status_invalid_size if \\p batch_count, \\p offsets_batch_stride, or \\p rows_values_batch_stride is invalid."]
pub fn rocsparse_csc_set_strided_batch(
descr: rocsparse_spmat_descr,
batch_count: rocsparse_int,
offsets_batch_stride: i64,
rows_values_batch_stride: i64,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the requested attribute data from the sparse matrix descriptor.\n\n @param[in]\n descr the pointer to the sparse matrix descriptor.\n @param[in]\n attribute \\ref rocsparse_spmat_fill_mode, \\ref rocsparse_spmat_diag_type,\n \\ref rocsparse_spmat_matrix_type, or \\ref rocsparse_spmat_storage_mode.\n @param[out]\n data attribute data.\n @param[in]\n data_size attribute data size.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr or \\p data is invalid.\n \\retval rocsparse_status_invalid_value if \\p attribute is invalid.\n \\retval rocsparse_status_invalid_size if \\p data_size is invalid."]
pub fn rocsparse_spmat_get_attribute(
descr: rocsparse_const_spmat_descr,
attribute: rocsparse_spmat_attribute,
data: *mut ::std::os::raw::c_void,
data_size: usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Set the requested attribute data in the sparse matrix descriptor.\n\n @param[inout]\n descr the pointer to the sparse matrix descriptor.\n @param[in]\n attribute \\ref rocsparse_spmat_fill_mode, \\ref rocsparse_spmat_diag_type,\n \\ref rocsparse_spmat_matrix_type, or \\ref rocsparse_spmat_storage_mode.\n @param[in]\n data attribute data.\n @param[in]\n data_size attribute data size.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr or \\p data is invalid.\n \\retval rocsparse_status_invalid_value if \\p attribute is invalid.\n \\retval rocsparse_status_invalid_size if \\p data_size is invalid."]
pub fn rocsparse_spmat_set_attribute(
descr: rocsparse_spmat_descr,
attribute: rocsparse_spmat_attribute,
data: *const ::std::os::raw::c_void,
data_size: usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Create a dense vector descriptor.\n \\details\n \\p rocsparse_create_dnvec_descr creates a dense vector descriptor. It should be\n destroyed at the end using rocsparse_destroy_dnvec_descr().\n\n @param[out]\n descr the pointer to the dense vector descriptor.\n @param[in]\n size size of the dense vector.\n @param[in]\n values non-zero values in the dense vector. Must be an array of length \\p size.\n @param[in]\n data_type \\ref rocsparse_datatype_f32_r, \\ref rocsparse_datatype_f64_r,\n \\ref rocsparse_datatype_f32_c, or \\ref rocsparse_datatype_f64_c.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr or \\p values is invalid.\n \\retval rocsparse_status_invalid_size if \\p size is invalid.\n \\retval rocsparse_status_invalid_value if \\p data_type is invalid.\n/\n/**@{"]
pub fn rocsparse_create_dnvec_descr(
descr: *mut rocsparse_dnvec_descr,
size: i64,
values: *mut ::std::os::raw::c_void,
data_type: rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_create_const_dnvec_descr(
descr: *mut rocsparse_const_dnvec_descr,
size: i64,
values: *const ::std::os::raw::c_void,
data_type: rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Destroy a dense vector descriptor.\n\n \\details\n \\p rocsparse_destroy_dnvec_descr destroys a dense vector descriptor and releases all\n resources used by the descriptor.\n\n @param[in]\n descr the matrix descriptor.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p descr is invalid."]
pub fn rocsparse_destroy_dnvec_descr(descr: rocsparse_const_dnvec_descr) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the fields of the dense vector descriptor.\n \\details\n \\p rocsparse_dnvec_get gets the fields of the dense vector descriptor.\n\n @param[in]\n descr the pointer to the dense vector descriptor.\n @param[out]\n size size of the dense vector.\n @param[out]\n values non-zero values in the dense vector. Must be an array of length \\p size.\n @param[out]\n data_type \\ref rocsparse_datatype_f32_r, \\ref rocsparse_datatype_f64_r,\n \\ref rocsparse_datatype_f32_c, or \\ref rocsparse_datatype_f64_c.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr or \\p values is invalid.\n \\retval rocsparse_status_invalid_size if \\p size is invalid.\n \\retval rocsparse_status_invalid_value if \\p data_type is invalid.\n/\n/**@{"]
pub fn rocsparse_dnvec_get(
descr: rocsparse_dnvec_descr,
size: *mut i64,
values: *mut *mut ::std::os::raw::c_void,
data_type: *mut rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_const_dnvec_get(
descr: rocsparse_const_dnvec_descr,
size: *mut i64,
values: *mut *const ::std::os::raw::c_void,
data_type: *mut rocsparse_datatype,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the values array from a dense vector descriptor.\n\n @param[in]\n descr the matrix descriptor.\n @param[out]\n values non-zero values in the dense vector. Must be an array of length \\p size.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p descr or \\p values is invalid.\n/\n/**@{"]
pub fn rocsparse_dnvec_get_values(
descr: rocsparse_dnvec_descr,
values: *mut *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_const_dnvec_get_values(
descr: rocsparse_const_dnvec_descr,
values: *mut *const ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Set the values array in a dense vector descriptor.\n\n @param[inout]\n descr the matrix descriptor.\n @param[in]\n values non-zero values in the dense vector. Must be an array of length \\p size.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p descr or \\p values is invalid."]
pub fn rocsparse_dnvec_set_values(
descr: rocsparse_dnvec_descr,
values: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Create a dense matrix descriptor.\n \\details\n \\p rocsparse_create_dnmat_descr creates a dense matrix descriptor. It should be\n destroyed at the end using rocsparse_destroy_dnmat_descr().\n\n @param[out]\n descr the pointer to the dense matrix descriptor.\n @param[in]\n rows number of rows in the dense matrix.\n @param[in]\n cols number of columns in the dense matrix.\n @param[in]\n ld leading dimension of the dense matrix.\n @param[in]\n values non-zero values in the dense vector. Must be an array of length\n \\p ld*rows if \\p order=rocsparse_order_column or \\p ld*cols if \\p order=rocsparse_order_row.\n @param[in]\n data_type \\ref rocsparse_datatype_f32_r, \\ref rocsparse_datatype_f64_r,\n \\ref rocsparse_datatype_f32_c, or \\ref rocsparse_datatype_f64_c.\n @param[in]\n order \\ref rocsparse_order_row or \\ref rocsparse_order_column.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr or \\p values is invalid.\n \\retval rocsparse_status_invalid_size if \\p rows, \\p cols, or \\p ld is invalid.\n \\retval rocsparse_status_invalid_value if \\p data_type or \\p order is invalid.\n/\n/**@{"]
pub fn rocsparse_create_dnmat_descr(
descr: *mut rocsparse_dnmat_descr,
rows: i64,
cols: i64,
ld: i64,
values: *mut ::std::os::raw::c_void,
data_type: rocsparse_datatype,
order: rocsparse_order,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_create_const_dnmat_descr(
descr: *mut rocsparse_const_dnmat_descr,
rows: i64,
cols: i64,
ld: i64,
values: *const ::std::os::raw::c_void,
data_type: rocsparse_datatype,
order: rocsparse_order,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Destroy a dense matrix descriptor.\n\n \\details\n \\p rocsparse_destroy_dnmat_descr destroys a dense matrix descriptor and releases all\n resources used by the descriptor.\n\n @param[in]\n descr the matrix descriptor.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p descr is invalid."]
pub fn rocsparse_destroy_dnmat_descr(descr: rocsparse_const_dnmat_descr) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the fields of the dense matrix descriptor.\n\n @param[in]\n descr the pointer to the dense matrix descriptor.\n @param[out]\n rows number of rows in the dense matrix.\n @param[out]\n cols number of columns in the dense matrix.\n @param[out]\n ld leading dimension of the dense matrix.\n @param[out]\n values non-zero values in the dense matrix. Must be an array of length\n \\p ld*rows if \\p order=rocsparse_order_column or \\p ld*cols if \\p order=rocsparse_order_row.\n @param[out]\n data_type \\ref rocsparse_datatype_f32_r, \\ref rocsparse_datatype_f64_r,\n \\ref rocsparse_datatype_f32_c, or \\ref rocsparse_datatype_f64_c.\n @param[out]\n order \\ref rocsparse_order_row or \\ref rocsparse_order_column.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr or \\p values is invalid.\n \\retval rocsparse_status_invalid_size if \\p rows, \\p cols, or \\p ld is invalid.\n \\retval rocsparse_status_invalid_value if \\p data_type or \\p order is invalid.\n/\n/**@{"]
pub fn rocsparse_dnmat_get(
descr: rocsparse_dnmat_descr,
rows: *mut i64,
cols: *mut i64,
ld: *mut i64,
values: *mut *mut ::std::os::raw::c_void,
data_type: *mut rocsparse_datatype,
order: *mut rocsparse_order,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_const_dnmat_get(
descr: rocsparse_const_dnmat_descr,
rows: *mut i64,
cols: *mut i64,
ld: *mut i64,
values: *mut *const ::std::os::raw::c_void,
data_type: *mut rocsparse_datatype,
order: *mut rocsparse_order,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the values array from the dense matrix descriptor.\n\n @param[in]\n descr the pointer to the dense matrix descriptor.\n @param[out]\n values non-zero values in the dense matrix. Must be an array of length\n \\p ld*rows if \\p order=rocsparse_order_column or \\p ld*cols if \\p order=rocsparse_order_row.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr or \\p values is invalid.\n/\n/**@{"]
pub fn rocsparse_dnmat_get_values(
descr: rocsparse_dnmat_descr,
values: *mut *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_const_dnmat_get_values(
descr: rocsparse_const_dnmat_descr,
values: *mut *const ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Set the values array in a dense matrix descriptor.\n\n @param[inout]\n descr the matrix descriptor.\n @param[in]\n values non-zero values in the dense matrix. Must be an array of length\n \\p ld*rows if \\p order=rocsparse_order_column or \\p ld*cols if \\p order=rocsparse_order_row.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer \\p descr or \\p values is invalid."]
pub fn rocsparse_dnmat_set_values(
descr: rocsparse_dnmat_descr,
values: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the batch count and batch stride from the dense matrix descriptor.\n\n @param[in]\n descr the pointer to the dense matrix descriptor.\n @param[out]\n batch_count the batch count in the dense matrix.\n @param[out]\n batch_stride the batch stride in the dense matrix.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr is invalid.\n \\retval rocsparse_status_invalid_size if \\p batch_count or \\p batch_stride is invalid."]
pub fn rocsparse_dnmat_get_strided_batch(
descr: rocsparse_const_dnmat_descr,
batch_count: *mut rocsparse_int,
batch_stride: *mut i64,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Set the batch count and batch stride in the dense matrix descriptor.\n\n @param[inout]\n descr the pointer to the dense matrix descriptor.\n @param[in]\n batch_count the batch count in the dense matrix.\n @param[in]\n batch_stride the batch stride in the dense matrix.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr is invalid.\n \\retval rocsparse_status_invalid_size if \\p batch_count or \\p batch_stride is invalid."]
pub fn rocsparse_dnmat_set_strided_batch(
descr: rocsparse_dnmat_descr,
batch_count: rocsparse_int,
batch_stride: i64,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Get the batch count and batch stride from the dense vector descriptor.\n\n @param[in]\n descr the pointer to the dense vector descriptor.\n @param[out]\n batch_count the batch count in the dense vector.\n @param[out]\n batch_stride the batch stride in the dense vector.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr is invalid.\n \\retval rocsparse_status_invalid_size if \\p batch_count or \\p batch_stride is invalid."]
pub fn rocsparse_dnvec_get_strided_batch(
descr: rocsparse_const_dnvec_descr,
batch_count: *mut rocsparse_int,
batch_stride: *mut i64,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Set the batch count and batch stride in the dense vector descriptor.\n\n @param[inout]\n descr the pointer to the dense vector descriptor.\n @param[in]\n batch_count the batch count in the dense vector.\n @param[in]\n batch_stride the batch stride in the dense vector.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_pointer if \\p descr is invalid.\n \\retval rocsparse_status_invalid_size if \\p batch_count or \\p batch_stride is invalid."]
pub fn rocsparse_dnvec_set_strided_batch(
descr: rocsparse_dnvec_descr,
batch_count: rocsparse_int,
batch_stride: i64,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Enable debug kernel launch.\n \\details If the debug kernel launch is enabled, then HIP errors are checked before and\n after every kernel launch.\n \\note This routine ignores the environment variable \\p ROCSPARSE_DEBUG_KERNEL_LAUNCH."]
pub fn rocsparse_enable_debug_kernel_launch();
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Disable debug kernel launch.\n \\note This routine ignores the environment variable \\p ROCSPARSE_DEBUG_KERNEL_LAUNCH."]
pub fn rocsparse_disable_debug_kernel_launch();
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\details Query whether debugging for kernel launch has been enabled. See \\ref rocsparse_enable_debug_kernel_launch.\n \\return 1 if enabled, 0 otherwise."]
pub fn rocsparse_state_debug_kernel_launch() -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Enable debug arguments.\n \\details If the debug arguments is enabled, then messages are displayed when errors occur during argument checking.\n It provides information to the user depending on the verbosity setup for\n \\ref rocsparse_enable_debug_arguments_verbose, \\ref rocsparse_disable_debug_arguments_verbose, and \\ref rocsparse_state_debug_arguments_verbose.\n \\note This routine ignores the environment variable \\p ROCSPARSE_DEBUG_ARGUMENTS.\n \\note This routine enables debug arguments verbose with \\ref rocsparse_enable_debug_arguments_verbose."]
pub fn rocsparse_enable_debug_arguments();
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Disable debug arguments.\n \\note This routine ignores the environment variable \\p ROCSPARSE_DEBUG_ARGUMENTS.\n \\note This routine disables debug arguments."]
pub fn rocsparse_disable_debug_arguments();
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\details Query whether debugging arguments have been enabled. See \\ref rocsparse_enable_debug_arguments.\n \\return 1 if enabled, 0 otherwise."]
pub fn rocsparse_state_debug_arguments() -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Enable debug arguments verbose.\n \\details If the debug arguments (verbose) is enabled, then messages are displayed when errors occur during argument checking.\n It provides information to the user depending on the verbosity setup.\n \\note This routine ignores the environment variable \\p ROCSPARSE_DEBUG_ARGUMENTS_VERBOSE."]
pub fn rocsparse_enable_debug_arguments_verbose();
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Disable debug arguments verbose mode.\n \\note This routine ignores the environment variable \\p ROCSPARSE_DEBUG_ARGUMENTS_VERBOSE."]
pub fn rocsparse_disable_debug_arguments_verbose();
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\details Query whether debugging arguments in verbose mode has been enabled. See \\ref rocsparse_enable_debug_arguments_verbose.\n \\return 1 if enabled, 0 otherwise."]
pub fn rocsparse_state_debug_arguments_verbose() -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Enable debug.\n \\details If the debug is enabled, then code traces are generated when unsuccessful status returns occur. It provides information to the user depending on the verbosity setup\n (\\ref rocsparse_enable_debug_verbose, \\ref rocsparse_disable_debug_verbose, and \\ref rocsparse_state_debug_verbose).\n \\note This routine ignores the environment variable ROCSPARSE_DEBUG.\n \\note \\ref rocsparse_enable_debug_verbose and \\ref rocsparse_enable_debug_arguments are called."]
pub fn rocsparse_enable_debug();
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Disable debug.\n \\note This routine disables debug arguments with \\ref rocsparse_disable_debug_arguments.\n \\note This routine ignores the environment variable \\p ROCSPARSE_DEBUG."]
pub fn rocsparse_disable_debug();
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\details Query whether debug has been enabled. See \\ref rocsparse_enable_debug.\n \\return 1 if enabled, 0 otherwise."]
pub fn rocsparse_state_debug() -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Enable debug warnings\n \\details When the debug warnings are enabled, some specific warnings are printed during execution.\n \\note This routine ignores the environment variable \\p ROCSPARSE_DEBUG_WARNINGS."]
pub fn rocsparse_enable_debug_warnings();
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Disable debug warnings\n \\note This routine ignores the environment variable \\p ROCSPARSE_DEBUG_WARNINGS."]
pub fn rocsparse_disable_debug_warnings();
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Enable debug verbose.\n \\details Debug in verbose mode displays a stack of code traces showing where the code handles an unsuccessful status.\n \\note This routine enables debug arguments in verbose mode with \\ref rocsparse_enable_debug_arguments_verbose.\n \\note This routine ignores the environment variable \\p ROCSPARSE_DEBUG_VERBOSE."]
pub fn rocsparse_enable_debug_verbose();
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Disable debug verbose.\n \\note This routine disables debug arguments verbose with \\ref rocsparse_disable_debug_arguments.\n \\note This routine ignores the environment variable \\p ROCSPARSE_DEBUG_VERBOSE."]
pub fn rocsparse_disable_debug_verbose();
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\details Query whether debug has been enabled in verbose mode. See \\ref rocsparse_enable_debug_verbose.\n \\return 1 if enabled, 0 otherwise."]
pub fn rocsparse_state_debug_verbose() -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Enable debug to force host asserts.\n \\details Debug for force host assert forces the evaluation of asserts on the host when the compiler directive \\p NDEBUG is used."]
pub fn rocsparse_enable_debug_force_host_assert();
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\brief Disable debug to force host asserts."]
pub fn rocsparse_disable_debug_force_host_assert();
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\details Query whether the debug command to force host asserts has been enabled. See \\ref rocsparse_enable_debug_force_host_assert.\n \\return 1 if enabled, 0 otherwise."]
pub fn rocsparse_state_debug_force_host_assert() -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief Convert a sparse BSR matrix into a sparse CSR matrix.\n\n \\details\n \\p rocsparse_bsr2csr converts a BSR matrix into a CSR matrix. It is assumed\n that \\p csr_val, \\p csr_col_ind, and \\p csr_row_ptr are allocated. The allocation size\n for \\p csr_row_ptr is \\p m+1 where:\n \\f[\n m = mb * block\\_dim \\\\\n n = nb * block\\_dim\n \\f]\n Allocation for \\p csr_val and \\p csr_col_ind is computed by the\n the number of blocks in the BSR matrix multiplied by the block dimension squared:\n \\f[\n nnz = nnzb * block\\_dim * block\\_dim\n \\f]\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir the storage format of the blocks, \\ref rocsparse_direction_row or \\ref rocsparse_direction_column.\n @param[in]\n mb number of block rows in the sparse BSR matrix.\n @param[in]\n nb number of block columns in the sparse BSR matrix.\n @param[in]\n bsr_descr descriptor of the sparse BSR matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n bsr_val array of \\p nnzb*block_dim*block_dim containing the values of the sparse BSR matrix.\n @param[in]\n bsr_row_ptr array of \\p mb+1 elements that point to the start of every block row of the\n sparse BSR matrix.\n @param[in]\n bsr_col_ind array of \\p nnzb elements containing the block column indices of the sparse BSR matrix.\n @param[in]\n block_dim size of the blocks in the sparse BSR matrix.\n @param[in]\n csr_descr descriptor of the sparse CSR matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[out]\n csr_val array of \\p nnzb*block_dim*block_dim elements containing the values of the sparse CSR matrix.\n @param[out]\n csr_row_ptr array of \\p m+1 where \\p m=mb*block_dim elements that point to the start of every row of the\n sparse CSR matrix.\n @param[out]\n csr_col_ind array of \\p nnzb*block_dim*block_dim elements containing the column indices of the sparse CSR matrix.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nb, or \\p block_dim is invalid.\n \\retval rocsparse_status_invalid_pointer \\p bsr_val,\n \\p bsr_row_ptr, \\p bsr_col_ind, \\p csr_val, \\p csr_row_ptr, or\n \\p csr_col_ind pointer is invalid.\n\n \\par Example\n This example converts a BSR matrix into an CSR matrix.\n \\snippet example_rocsparse_bsr2csr.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sbsr2csr(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
bsr_descr: rocsparse_mat_descr,
bsr_val: *const f32,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_val: *mut f32,
csr_row_ptr: *mut rocsparse_int,
csr_col_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dbsr2csr(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
bsr_descr: rocsparse_mat_descr,
bsr_val: *const f64,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_val: *mut f64,
csr_row_ptr: *mut rocsparse_int,
csr_col_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cbsr2csr(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
bsr_descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_float_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_val: *mut rocsparse_float_complex,
csr_row_ptr: *mut rocsparse_int,
csr_col_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zbsr2csr(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
bsr_descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_double_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_val: *mut rocsparse_double_complex,
csr_row_ptr: *mut rocsparse_int,
csr_col_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief Pads a value to the diagonal of the last block (if the last block is a diagonal block) in the sparse BSR matrix\n when the matrix expands outside \\p m x \\p m.\n\n \\details When converting from a CSR matrix to a BSR matrix, the resulting BSR matrix will be larger when \\p m < \\p mb * \\p block_dim.\n In these situations, the CSR to BSR conversion will expand the BSR matrix to have zeros when outside \\p m x \\p m. This routine\n converts the resulting BSR matrix to one that has a value on the last diagonal blocks diagonal if this last block is a diagonal\n block in the BSR matrix.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse BSR matrix.\n @param[in]\n mb number of block rows of the sparse BSR matrix.\n @param[in]\n nnzb number of non-zero blocks of the sparse BSR matrix.\n @param[in]\n block_dim block dimension of the sparse BSR matrix.\n @param[in]\n value scalar value that is set on the diagonal of the last block when the matrix expands outside of \\p m x \\p m.\n @param[in]\n bsr_descr descriptor of the sparse BSR matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[inout]\n bsr_val array of \\p nnzb blocks of the sparse BSR matrix.\n @param[in]\n bsr_row_ptr array of \\p mb+1 elements that point to the start of every block row of\n the sparse BSR matrix.\n @param[in]\n bsr_col_ind array of \\p nnzb elements containing the block column indices of the sparse\n BSR matrix.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p mb, \\p nnzb, or \\p block_dim is\n invalid.\n \\retval rocsparse_status_invalid_pointer \\p bsr_descr, \\p bsr_val,\n \\p bsr_row_ind, or \\p bsr_col_ind pointer is invalid.\n/\n/**@{"]
pub fn rocsparse_sbsrpad_value(
handle: rocsparse_handle,
m: rocsparse_int,
mb: rocsparse_int,
nnzb: rocsparse_int,
block_dim: rocsparse_int,
value: f32,
bsr_descr: rocsparse_mat_descr,
bsr_val: *mut f32,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dbsrpad_value(
handle: rocsparse_handle,
m: rocsparse_int,
mb: rocsparse_int,
nnzb: rocsparse_int,
block_dim: rocsparse_int,
value: f64,
bsr_descr: rocsparse_mat_descr,
bsr_val: *mut f64,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cbsrpad_value(
handle: rocsparse_handle,
m: rocsparse_int,
mb: rocsparse_int,
nnzb: rocsparse_int,
block_dim: rocsparse_int,
value: rocsparse_float_complex,
bsr_descr: rocsparse_mat_descr,
bsr_val: *mut rocsparse_float_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zbsrpad_value(
handle: rocsparse_handle,
m: rocsparse_int,
mb: rocsparse_int,
nnzb: rocsparse_int,
block_dim: rocsparse_int,
value: rocsparse_double_complex,
bsr_descr: rocsparse_mat_descr,
bsr_val: *mut rocsparse_double_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief Convert a sparse COO matrix into a sparse CSR matrix.\n\n \\details\n \\p rocsparse_coo2csr converts the COO array containing the row indices into a\n CSR array of row offsets that point to the start of every row.\n It is assumed that the COO row index array is sorted.\n\n \\p rocsparse_coo2csr can also be used to convert a COO array containing the column\n indices into a CSC array of column offsets that point to the start of every column.\n In this case it is assumed that the COO column index array is sorted instead.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n coo_row_ind array of \\p nnz elements containing the row indices of the sparse COO\n matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[out]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p coo_row_ind or \\p csr_row_ptr\n pointer is invalid.\n\n \\par Example\n This example converts a COO matrix into a CSR matrix.\n \\snippet example_rocsparse_coo2csr.cpp doc example"]
pub fn rocsparse_coo2csr(
handle: rocsparse_handle,
coo_row_ind: *const rocsparse_int,
nnz: rocsparse_int,
m: rocsparse_int,
csr_row_ptr: *mut rocsparse_int,
idx_base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief\n This function converts the sparse matrix in COO format into a column-oriented dense matrix.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the column-oriented dense matrix \\p A.\n @param[in]\n n number of columns of the column-oriented dense matrix \\p A.\n @param[in]\n nnz number of non-zero entries of the sparse COO matrix.\n @param[in]\n descr the descriptor of the column-oriented dense matrix \\p A. The supported matrix type is\n \\ref rocsparse_matrix_type_general and also any valid value of the \\ref rocsparse_index_base.\n @param[in]\n coo_val array of \\p nnz non-zero elements of matrix \\p A.\n @param[in]\n coo_row_ind integer array of \\p nnz row indices of the non-zero elements of matrix \\p A.\n @param[in]\n coo_col_ind integer array of \\p nnz column indices of the non-zero elements of matrix \\p A.\n @param[out]\n A array of dimensions (\\p ld, \\p n).\n\n @param[out]\n ld leading dimension of column-oriented dense matrix \\p A.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, \\p nnz, or \\p ld is invalid.\n \\retval rocsparse_status_invalid_pointer \\p A, \\p coo_val, \\p coo_col_ind, or \\p coo_row_ind\n pointer is invalid.\n\n \\par Example\n \\snippet example_rocsparse_coo2dense.cpp doc example\n/\n/**@{"]
pub fn rocsparse_scoo2dense(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
coo_val: *const f32,
coo_row_ind: *const rocsparse_int,
coo_col_ind: *const rocsparse_int,
A: *mut f32,
ld: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcoo2dense(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
coo_val: *const f64,
coo_row_ind: *const rocsparse_int,
coo_col_ind: *const rocsparse_int,
A: *mut f64,
ld: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccoo2dense(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
coo_val: *const rocsparse_float_complex,
coo_row_ind: *const rocsparse_int,
coo_col_ind: *const rocsparse_int,
A: *mut rocsparse_float_complex,
ld: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcoo2dense(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
coo_val: *const rocsparse_double_complex,
coo_row_ind: *const rocsparse_int,
coo_col_ind: *const rocsparse_int,
A: *mut rocsparse_double_complex,
ld: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\details\n \\p rocsparse_coosort_buffer_size returns the size of the temporary storage buffer that is\n required by \\ref rocsparse_coosort_by_row() and \\ref rocsparse_coosort_by_column(). The\n temporary storage buffer has to be allocated by the user.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse COO matrix.\n @param[in]\n n number of columns of the sparse COO matrix.\n @param[in]\n nnz number of non-zero entries of the sparse COO matrix.\n @param[in]\n coo_row_ind array of \\p nnz elements containing the row indices of the sparse\n COO matrix.\n @param[in]\n coo_col_ind array of \\p nnz elements containing the column indices of the sparse\n COO matrix.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n \\ref rocsparse_coosort_by_row() and \\ref rocsparse_coosort_by_column().\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p coo_row_ind, \\p coo_col_ind, or\n \\p buffer_size pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred."]
pub fn rocsparse_coosort_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
coo_row_ind: *const rocsparse_int,
coo_col_ind: *const rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief Sort a sparse COO matrix by row.\n\n \\details\n \\p rocsparse_coosort_by_row sorts a matrix in COO format by row. The sorted\n permutation vector \\p perm can be used to obtain the sorted \\p coo_val array. In this\n case, \\p perm must be initialized as the identity permutation. See\n \\ref rocsparse_create_identity_permutation().\n\n \\p rocsparse_coosort_by_row requires an extra temporary storage buffer that has to be\n allocated by the user. Storage buffer size can be determined by\n \\ref rocsparse_coosort_buffer_size().\n\n \\note\n \\p perm can be \\p NULL if a sorted permutation vector is not required.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse COO matrix.\n @param[in]\n n number of columns of the sparse COO matrix.\n @param[in]\n nnz number of non-zero entries of the sparse COO matrix.\n @param[inout]\n coo_row_ind array of \\p nnz elements containing the row indices of the sparse\n COO matrix.\n @param[inout]\n coo_col_ind array of \\p nnz elements containing the column indices of the sparse\n COO matrix.\n @param[inout]\n perm array of \\p nnz integers containing the unsorted map indices, which can be\n \\p NULL.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user. The size is returned by\n \\ref rocsparse_coosort_buffer_size().\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p coo_row_ind, \\p coo_col_ind, or\n \\p temp_buffer pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n\n \\par Example\n The following example sorts a \\f$3 \\times 3\\f$ COO matrix by row indices.\n \\snippet example_rocsparse_coosort_by_row.cpp doc example"]
pub fn rocsparse_coosort_by_row(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
coo_row_ind: *mut rocsparse_int,
coo_col_ind: *mut rocsparse_int,
perm: *mut rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief Sort a sparse COO matrix by column.\n\n \\details\n \\p rocsparse_coosort_by_column sorts a matrix in COO format by column. The sorted\n permutation vector \\p perm can be used to obtain the sorted \\p coo_val array. In this\n case, \\p perm must be initialized as the identity permutation. See\n \\ref rocsparse_create_identity_permutation().\n\n \\p rocsparse_coosort_by_column requires an extra temporary storage buffer that has to be\n allocated by the user. Storage buffer size can be determined by\n \\ref rocsparse_coosort_buffer_size().\n\n \\note\n \\p perm can be \\p NULL if a sorted permutation vector is not required.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse COO matrix.\n @param[in]\n n number of columns of the sparse COO matrix.\n @param[in]\n nnz number of non-zero entries of the sparse COO matrix.\n @param[inout]\n coo_row_ind array of \\p nnz elements containing the row indices of the sparse\n COO matrix.\n @param[inout]\n coo_col_ind array of \\p nnz elements containing the column indices of the sparse\n COO matrix.\n @param[inout]\n perm array of \\p nnz integers containing the unsorted map indices, which can be\n \\p NULL.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user. The size is returned by\n \\ref rocsparse_coosort_buffer_size().\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p coo_row_ind, \\p coo_col_ind, or\n \\p temp_buffer pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n\n \\par Example\n The following example sorts a \\f$3 \\times 3\\f$ COO matrix by column indices.\n \\snippet example_rocsparse_coosort_by_col.cpp doc example"]
pub fn rocsparse_coosort_by_column(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
coo_row_ind: *mut rocsparse_int,
coo_col_ind: *mut rocsparse_int,
perm: *mut rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief\n This function converts the sparse matrix in CSC format into a column-oriented dense matrix.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the column-oriented dense matrix \\p A.\n @param[in]\n n number of columns of the column-oriented dense matrix \\p A.\n @param[in]\n descr the descriptor of the column-oriented dense matrix \\p A. The supported matrix type is\n \\ref rocsparse_matrix_type_general and also any valid value of the \\ref rocsparse_index_base.\n @param[in]\n csc_val array of nnz ( = \\p csc_col_ptr[n] - \\p csc_col_ptr[0] ) non-zero elements of matrix \\p A.\n @param[in]\n csc_col_ptr integer array of \\p n+1 elements that contains the start of every column and the end of the last\n column plus one.\n @param[in]\n csc_row_ind integer array of nnz ( = \\p csc_col_ptr[n] - \\p csc_col_ptr[0] ) column indices of the non-zero\n elements of matrix \\p A.\n @param[out]\n A array of dimensions (\\p ld, \\p n).\n @param[out]\n ld leading dimension of column-oriented dense matrix \\p A.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p ld is invalid.\n \\retval rocsparse_status_invalid_pointer \\p A, \\p csc_val, \\p csc_col_ptr, or \\p csc_row_ind\n pointer is invalid.\n\n \\par Example\n \\snippet example_rocsparse_csc2dense.cpp doc example\n/\n/**@{"]
pub fn rocsparse_scsc2dense(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr: rocsparse_mat_descr,
csc_val: *const f32,
csc_col_ptr: *const rocsparse_int,
csc_row_ind: *const rocsparse_int,
A: *mut f32,
ld: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsc2dense(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr: rocsparse_mat_descr,
csc_val: *const f64,
csc_col_ptr: *const rocsparse_int,
csc_row_ind: *const rocsparse_int,
A: *mut f64,
ld: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsc2dense(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr: rocsparse_mat_descr,
csc_val: *const rocsparse_float_complex,
csc_col_ptr: *const rocsparse_int,
csc_row_ind: *const rocsparse_int,
A: *mut rocsparse_float_complex,
ld: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsc2dense(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr: rocsparse_mat_descr,
csc_val: *const rocsparse_double_complex,
csc_col_ptr: *const rocsparse_int,
csc_row_ind: *const rocsparse_int,
A: *mut rocsparse_double_complex,
ld: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\details\n \\p rocsparse_cscsort_buffer_size returns the size of the temporary storage buffer\n required by \\ref rocsparse_cscsort(). The temporary storage buffer must be allocated by\n the user.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse CSC matrix.\n @param[in]\n n number of columns of the sparse CSC matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSC matrix.\n @param[in]\n csc_col_ptr array of \\p n+1 elements that point to the start of every column of\n the sparse CSC matrix.\n @param[in]\n csc_row_ind array of \\p nnz elements containing the row indices of the sparse\n CSC matrix.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n \\ref rocsparse_cscsort().\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p csc_col_ptr, \\p csc_row_ind, or\n \\p buffer_size pointer is invalid."]
pub fn rocsparse_cscsort_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
csc_col_ptr: *const rocsparse_int,
csc_row_ind: *const rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief Sort a sparse CSC matrix.\n\n \\details\n \\p rocsparse_cscsort sorts a matrix in CSC format. The sorted permutation vector\n \\p perm can be used to obtain the sorted \\p csc_val array. In this case, \\p perm must be\n initialized as the identity permutation. For more information, see \\ref rocsparse_create_identity_permutation().\n\n \\p rocsparse_cscsort requires an extra temporary storage buffer that has to be allocated by\n the user. The storage buffer size can be determined by \\ref rocsparse_cscsort_buffer_size().\n\n \\note\n \\p perm can be \\p NULL if a sorted permutation vector is not required.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse CSC matrix.\n @param[in]\n n number of columns of the sparse CSC matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSC matrix.\n @param[in]\n descr descriptor of the sparse CSC matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n csc_col_ptr array of \\p n+1 elements that point to the start of every column of\n the sparse CSC matrix.\n @param[inout]\n csc_row_ind array of \\p nnz elements containing the row indices of the sparse\n CSC matrix.\n @param[inout]\n perm array of \\p nnz integers containing the unsorted map indices, which can be\n \\p NULL.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user. The size is returned by\n \\ref rocsparse_cscsort_buffer_size().\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p csc_col_ptr, \\p csc_row_ind,\n or \\p temp_buffer pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n The following example sorts a \\f$3 \\times 3\\f$ CSC matrix.\n \\snippet example_rocsparse_cscsort.cpp doc example"]
pub fn rocsparse_cscsort(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csc_col_ptr: *const rocsparse_int,
csc_row_ind: *mut rocsparse_int,
perm: *mut rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\details\n This function takes a sparse CSR matrix as input and computes the block row offset array, \\p bsr_row_ptr,\n and the total number of non-zero blocks, \\p bsr_nnz, that will result from converting the CSR format input\n matrix to a BSR format output matrix. This function is the first step in the conversion and is used in\n conjunction with \\ref rocsparse_scsr2bsr \"rocsparse_Xcsr2bsr()\".\n\n \\note\n The routine supports asynchronous execution if the pointer mode is set to device.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n\n @param[in]\n dir direction that specifies whether to count non-zero elements by \\ref rocsparse_direction_row or by\n \\ref rocsparse_direction_column.\n\n @param[in]\n m number of rows of the sparse CSR matrix.\n\n @param[in]\n n number of columns of the sparse CSR matrix.\n\n @param[in]\n csr_descr descriptor of the sparse CSR matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n csr_row_ptr integer array containing \\p m+1 elements that point to the start of each row of the CSR matrix.\n\n @param[in]\n csr_col_ind integer array of the column indices for each non-zero element in the CSR matrix.\n\n @param[in]\n block_dim the block dimension of the BSR matrix. Between 1 and min(m, n).\n\n @param[in]\n bsr_descr descriptor of the sparse BSR matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[out]\n bsr_row_ptr integer array containing \\p mb+1 elements that point to the start of each block row of the BSR matrix.\n\n @param[out]\n bsr_nnz total number of non-zero elements in device or host memory.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p block_dim is invalid.\n \\retval rocsparse_status_invalid_pointer \\p csr_row_ptr, \\p csr_col_ind, \\p bsr_row_ptr, or \\p bsr_nnz\n pointer is invalid."]
pub fn rocsparse_csr2bsr_nnz(
handle: rocsparse_handle,
dir: rocsparse_direction,
m: rocsparse_int,
n: rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
bsr_descr: rocsparse_mat_descr,
bsr_row_ptr: *mut rocsparse_int,
bsr_nnz: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief Convert a sparse CSR matrix into a sparse BSR matrix.\n\n \\details\n \\p rocsparse_csr2bsr converts a CSR matrix into a BSR matrix. It is assumed\n that \\p bsr_val, \\p bsr_col_ind, and \\p bsr_row_ptr are allocated. The allocation size\n for \\p bsr_row_ptr is computed as \\p mb+1, where \\p mb is the number of block rows\n and \\p nb is the number of block columns in the BSR matrix:\n \\f[\n mb = (m + block\\_dim - 1) / block\\_dim \\\\\n nb = (n + block\\_dim - 1) / block\\_dim\n \\f]\n The allocation size for \\p bsr_val and \\p bsr_col_ind is computed using \\ref rocsparse_csr2bsr_nnz(),\n which also fills in \\p bsr_row_ptr.\n\n Converting from a sparse CSR matrix to a sparse BSR matrix requires two steps. First,\n allocate the \\p bsr_row_ptr array to have length \\p mb+1 and pass this to the function\n \\ref rocsparse_csr2bsr_nnz. This will fill the \\p bsr_row_ptr array and also compute the total\n number of non-zero blocks in the BSR matrix. Now that the total number of non-zero blocks is known,\n allocate the \\p bsr_col_ind and \\p bsr_val arrays. Finally, call\n \\p rocsparse_csr2bsr to complete the conversion. See the example below.\n\n \\p rocsparse_csr2bsr requires extra temporary storage that is allocated internally if \\p block_dim>16.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir the storage format of the blocks, \\ref rocsparse_direction_row or \\ref rocsparse_direction_column.\n @param[in]\n m number of rows in the sparse CSR matrix.\n @param[in]\n n number of columns in the sparse CSR matrix.\n @param[in]\n csr_descr descriptor of the sparse CSR matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n csr_val array of \\p nnz elements containing the values of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse CSR matrix.\n @param[in]\n block_dim size of the blocks in the sparse BSR matrix.\n @param[in]\n bsr_descr descriptor of the sparse BSR matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[out]\n bsr_val array of \\p nnzb*block_dim*block_dim containing the values of the sparse BSR matrix.\n @param[out]\n bsr_row_ptr array of \\p mb+1 elements that point to the start of every block row of the\n sparse BSR matrix.\n @param[out]\n bsr_col_ind array of \\p nnzb elements containing the block column indices of the sparse BSR matrix.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p block_dim is invalid.\n \\retval rocsparse_status_invalid_pointer \\p bsr_val,\n \\p bsr_row_ptr, \\p bsr_col_ind, \\p csr_val, \\p csr_row_ptr, or\n \\p csr_col_ind pointer is invalid.\n\n \\par Example\n This example converts a CSR matrix into an BSR matrix.\n \\snippet example_rocsparse_csr2bsr.cpp doc example\n/\n/**@{"]
pub fn rocsparse_scsr2bsr(
handle: rocsparse_handle,
dir: rocsparse_direction,
m: rocsparse_int,
n: rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
bsr_descr: rocsparse_mat_descr,
bsr_val: *mut f32,
bsr_row_ptr: *mut rocsparse_int,
bsr_col_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsr2bsr(
handle: rocsparse_handle,
dir: rocsparse_direction,
m: rocsparse_int,
n: rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
bsr_descr: rocsparse_mat_descr,
bsr_val: *mut f64,
bsr_row_ptr: *mut rocsparse_int,
bsr_col_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsr2bsr(
handle: rocsparse_handle,
dir: rocsparse_direction,
m: rocsparse_int,
n: rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_val: *const rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
bsr_descr: rocsparse_mat_descr,
bsr_val: *mut rocsparse_float_complex,
bsr_row_ptr: *mut rocsparse_int,
bsr_col_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsr2bsr(
handle: rocsparse_handle,
dir: rocsparse_direction,
m: rocsparse_int,
n: rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_val: *const rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
bsr_descr: rocsparse_mat_descr,
bsr_val: *mut rocsparse_double_complex,
bsr_row_ptr: *mut rocsparse_int,
bsr_col_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief Convert a sparse CSR matrix into a sparse COO matrix.\n\n \\details\n \\p rocsparse_csr2coo converts the CSR array containing the row offsets that point\n to the start of every row into a COO array of row indices.\n\n \\p rocsparse_csr2coo can also be used to convert a CSC array containing the column offsets\n into a COO array of column indices.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row\n of the sparse CSR matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[out]\n coo_row_ind array of \\p nnz elements containing the row indices of the sparse COO\n matrix.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p csr_row_ptr or \\p coo_row_ind\n pointer is invalid.\n \\retval rocsparse_status_arch_mismatch the device is not supported.\n\n \\par Example\n This example converts a CSR matrix into a COO matrix.\n \\snippet example_rocsparse_csr2coo.cpp doc example"]
pub fn rocsparse_csr2coo(
handle: rocsparse_handle,
csr_row_ptr: *const rocsparse_int,
nnz: rocsparse_int,
m: rocsparse_int,
coo_row_ind: *mut rocsparse_int,
idx_base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\details\n \\p rocsparse_csr2csc_buffer_size returns the size of the temporary storage buffer\n required by \\ref rocsparse_scsr2csc \"rocsparse_Xcsr2csc()\".\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n n number of columns of the sparse CSR matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix.\n @param[in]\n copy_values \\ref rocsparse_action_symbolic or \\ref rocsparse_action_numeric.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n \\ref rocsparse_scsr2csc \"rocsparse_Xcsr2csc()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p csr_row_ptr, \\p csr_col_ind, or\n \\p buffer_size pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred."]
pub fn rocsparse_csr2csc_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
copy_values: rocsparse_action,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief Convert a sparse CSR matrix into a sparse CSC matrix.\n\n \\details\n \\p rocsparse_csr2csc converts a CSR matrix into a CSC matrix. The resulting matrix can also\n be seen as the transpose of the input matrix. \\p rocsparse_csr2csc can also be used to convert\n a CSC matrix into a CSR matrix.\n\n The conversion of a sparse matrix from CSR to CSC format involves two steps. First,\n call \\ref rocsparse_csr2csc_buffer_size to determine the size of the required\n tempory storage buffer. Then allocate this buffer. Secondly, call\n \\p rocsparse_csr2csc to complete the conversion. After the conversion is complete,\n free the temporary buffer.\n\n Both \\ref rocsparse_csr2csc_buffer_size and \\p rocsparse_csr2csc take a \\ref rocsparse_action\n parameter as input. This \\p copy_values parameter decides whether \\p csc_row_ind and \\p csc_val\n are filled during conversion (\\ref rocsparse_action_numeric) or whether only \\p csc_row_ind is filled\n (\\ref rocsparse_action_symbolic). Using \\ref rocsparse_action_symbolic can be useful, for example, if only\n the sparsity pattern is required.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n n number of columns of the sparse CSR matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix.\n @param[in]\n csr_val array of \\p nnz elements of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix.\n @param[out]\n csc_val array of \\p nnz elements of the sparse CSC matrix.\n @param[out]\n csc_row_ind array of \\p nnz elements containing the row indices of the sparse CSC\n matrix.\n @param[out]\n csc_col_ptr array of \\p n+1 elements that point to the start of every column of the\n sparse CSC matrix.\n @param[in]\n copy_values \\ref rocsparse_action_symbolic or \\ref rocsparse_action_numeric.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user. The size is returned by\n rocsparse_csr2csc_buffer_size().\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p csr_val, \\p csr_row_ptr,\n \\p csr_col_ind, \\p csc_val, \\p csc_row_ind, \\p csc_col_ptr, or\n \\p temp_buffer pointer is invalid.\n \\retval rocsparse_status_arch_mismatch the device is not supported.\n \\retval rocsparse_status_internal_error an internal error occurred.\n\n \\par Example\n This example computes the transpose of a CSR matrix.\n \\code{.c}\n // 1 2 0 3 0\n // A = 0 4 5 0 0\n // 6 0 0 7 8\n\n rocsparse_int m_A = 3;\n rocsparse_int n_A = 5;\n rocsparse_int nnz_A = 8;\n\n csr_row_ptr_A[m_A + 1] = {0, 3, 5, 8}; // device memory\n csr_col_ind_A[nnz_A] = {0, 1, 3, 1, 2, 0, 3, 4}; // device memory\n csr_val_A[nnz_A] = {1, 2, 3, 4, 5, 6, 7, 8}; // device memory\n\n // Allocate memory for transposed CSR matrix\n rocsparse_int m_T = n_A;\n rocsparse_int n_T = m_A;\n rocsparse_int nnz_T = nnz_A;\n\n rocsparse_int* csr_row_ptr_T;\n rocsparse_int* csr_col_ind_T;\n float* csr_val_T;\n\n hipMalloc((void**)&csr_row_ptr_T, sizeof(rocsparse_int) * (m_T + 1));\n hipMalloc((void**)&csr_col_ind_T, sizeof(rocsparse_int) * nnz_T);\n hipMalloc((void**)&csr_val_T, sizeof(float) * nnz_T);\n\n // Obtain the temporary buffer size\n size_t buffer_size;\n rocsparse_csr2csc_buffer_size(handle,\n m_A,\n n_A,\n nnz_A,\n csr_row_ptr_A,\n csr_col_ind_A,\n rocsparse_action_numeric,\n &buffer_size);\n\n // Allocate temporary buffer\n void* temp_buffer;\n hipMalloc(&temp_buffer, buffer_size);\n\n rocsparse_scsr2csc(handle,\n m_A,\n n_A,\n nnz_A,\n csr_val_A,\n csr_row_ptr_A,\n csr_col_ind_A,\n csr_val_T,\n csr_col_ind_T,\n csr_row_ptr_T,\n rocsparse_action_numeric,\n rocsparse_index_base_zero,\n temp_buffer);\n \\endcode\n\n \\par Example\n This example computes the symbolic transpose of A\n \\snippet example_rocsparse_csr2csc.cpp doc example\n/\n/**@{"]
pub fn rocsparse_scsr2csc(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
csc_val: *mut f32,
csc_row_ind: *mut rocsparse_int,
csc_col_ptr: *mut rocsparse_int,
copy_values: rocsparse_action,
idx_base: rocsparse_index_base,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsr2csc(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
csc_val: *mut f64,
csc_row_ind: *mut rocsparse_int,
csc_col_ptr: *mut rocsparse_int,
copy_values: rocsparse_action,
idx_base: rocsparse_index_base,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsr2csc(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
csr_val: *const rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
csc_val: *mut rocsparse_float_complex,
csc_row_ind: *mut rocsparse_int,
csc_col_ptr: *mut rocsparse_int,
copy_values: rocsparse_action,
idx_base: rocsparse_index_base,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsr2csc(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
csr_val: *const rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
csc_val: *mut rocsparse_double_complex,
csc_row_ind: *mut rocsparse_int,
csc_col_ptr: *mut rocsparse_int,
copy_values: rocsparse_action,
idx_base: rocsparse_index_base,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief Convert a sparse CSR matrix into a compressed sparse CSR matrix.\n\n \\details\n \\p rocsparse_csr2csr_compress converts a CSR matrix into a compressed CSR matrix by\n removing entries in the input CSR matrix that are below a non-negative threshold \\p tol.\n\n Compressing a CSR matrix involves two steps. First, use\n \\ref rocsparse_snnz_compress \"rocsparse_Xnnz_compress()\" to determine how many entries will\n be in the final compressed CSR matrix. Then call \\p rocsparse_csr2csr_compress to finish\n the compression and fill in the column indices and values arrays of the compressed CSR matrix.\n\n \\note\n In the case of complex matrices, only the magnitude of the real part of \\p tol is used.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n n number of columns of the sparse CSR matrix.\n @param[in]\n descr_A matrix descriptor for the CSR matrix.\n @param[in]\n csr_val_A array of \\p nnz_A elements of the sparse CSR matrix.\n @param[in]\n csr_row_ptr_A array of \\p m+1 elements that point to the start of every row of the\n uncompressed sparse CSR matrix.\n @param[in]\n csr_col_ind_A array of \\p nnz_A elements containing the column indices of the uncompressed\n sparse CSR matrix.\n @param[in]\n nnz_A number of elements in the column indices and values arrays of the uncompressed\n sparse CSR matrix.\n @param[in]\n nnz_per_row array of length \\p m containing the number of entries that will be kept per row in\n the final compressed CSR matrix.\n @param[out]\n csr_val_C array of \\p nnz_C elements of the compressed sparse CSC matrix.\n @param[out]\n csr_row_ptr_C array of \\p m+1 elements that point to the start of every column of the compressed\n sparse CSR matrix.\n @param[out]\n csr_col_ind_C array of \\p nnz_C elements containing the row indices of the compressed\n sparse CSR matrix.\n @param[in]\n tol the non-negative tolerance used for compression. If \\p tol is complex, then only the magnitude\n of the real part is used. Entries in the input uncompressed CSR array that are below the tolerance\n are removed in the output-compressed CSR matrix.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p nnz_A is invalid.\n \\retval rocsparse_status_invalid_value \\p tol is invalid.\n \\retval rocsparse_status_invalid_pointer \\p csr_val_A, \\p csr_row_ptr_A,\n \\p csr_col_ind_A, \\p csr_val_C, \\p csr_row_ptr_C, \\p csr_col_ind_C, or\n \\p nnz_per_row pointer is invalid.\n\n \\par Example\n This example demonstrates how to compress a CSR matrix.\n \\snippet example_rocsparse_csr2csr_compress.cpp doc example\n/\n/**@{"]
pub fn rocsparse_scsr2csr_compress(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr_A: rocsparse_mat_descr,
csr_val_A: *const f32,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
nnz_A: rocsparse_int,
nnz_per_row: *const rocsparse_int,
csr_val_C: *mut f32,
csr_row_ptr_C: *mut rocsparse_int,
csr_col_ind_C: *mut rocsparse_int,
tol: f32,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsr2csr_compress(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr_A: rocsparse_mat_descr,
csr_val_A: *const f64,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
nnz_A: rocsparse_int,
nnz_per_row: *const rocsparse_int,
csr_val_C: *mut f64,
csr_row_ptr_C: *mut rocsparse_int,
csr_col_ind_C: *mut rocsparse_int,
tol: f64,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsr2csr_compress(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr_A: rocsparse_mat_descr,
csr_val_A: *const rocsparse_float_complex,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
nnz_A: rocsparse_int,
nnz_per_row: *const rocsparse_int,
csr_val_C: *mut rocsparse_float_complex,
csr_row_ptr_C: *mut rocsparse_int,
csr_col_ind_C: *mut rocsparse_int,
tol: rocsparse_float_complex,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsr2csr_compress(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr_A: rocsparse_mat_descr,
csr_val_A: *const rocsparse_double_complex,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
nnz_A: rocsparse_int,
nnz_per_row: *const rocsparse_int,
csr_val_C: *mut rocsparse_double_complex,
csr_row_ptr_C: *mut rocsparse_int,
csr_col_ind_C: *mut rocsparse_int,
tol: rocsparse_double_complex,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief\n This function converts the sparse matrix in CSR format into a column-oriented dense matrix.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the column-oriented dense matrix \\p A.\n @param[in]\n n number of columns of the column-oriented dense matrix \\p A.\n @param[in]\n descr the descriptor of the column-oriented dense matrix \\p A. The supported matrix type is\n \\ref rocsparse_matrix_type_general and also any valid value of the \\ref rocsparse_index_base.\n @param[in]\n csr_val array of nnz ( = \\p csr_row_ptr[m] - \\p csr_row_ptr[0] ) non-zero elements of matrix \\p A.\n @param[in]\n csr_row_ptr integer array of \\p m+1 elements that contains the start of every row and the end of the last\n row plus one.\n @param[in]\n csr_col_ind integer array of nnz ( = \\p csr_row_ptr[m] - \\p csr_row_ptr[0] ) column indices of the non-zero\n elements of matrix \\p A.\n @param[out]\n A array of dimensions (\\p ld, \\p n).\n @param[out]\n ld leading dimension of column-oriented dense matrix \\p A.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p ld is invalid.\n \\retval rocsparse_status_invalid_pointer \\p A, \\p csr_val, \\p csr_row_ptr, or \\p csr_col_ind\n pointer is invalid.\n\n \\par Example\n \\snippet example_rocsparse_csr2dense.cpp doc example\n/\n/**@{"]
pub fn rocsparse_scsr2dense(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
A: *mut f32,
ld: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsr2dense(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
A: *mut f64,
ld: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsr2dense(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
A: *mut rocsparse_float_complex,
ld: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsr2dense(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
A: *mut rocsparse_double_complex,
ld: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\details\n \\p rocsparse_csr2ell_width computes the maximum of the per row non-zero elements\n over all rows, the \\p ell_width, for a given CSR matrix.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n csr_descr descriptor of the sparse CSR matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix.\n @param[in]\n ell_descr descriptor of the sparse ELL matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[out]\n ell_width pointer to the number of non-zero elements per row in ELL storage\n format.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m is invalid.\n \\retval rocsparse_status_invalid_pointer \\p csr_descr, \\p csr_row_ptr, or\n \\p ell_width pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general."]
pub fn rocsparse_csr2ell_width(
handle: rocsparse_handle,
m: rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_row_ptr: *const rocsparse_int,
ell_descr: rocsparse_mat_descr,
ell_width: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief Convert a sparse CSR matrix into a sparse ELL matrix.\n\n \\details\n \\p rocsparse_csr2ell converts a CSR matrix into an ELL matrix. It is assumed,\n that \\p ell_val and \\p ell_col_ind are allocated. Allocation size is computed by the\n number of rows times the number of ELL non-zero elements per row, such that\n \\f$\\text{nnz}_{\\text{ELL}} = m \\cdot \\text{ell_width}\\f$. The number of ELL\n non-zero elements per row is obtained by rocsparse_csr2ell_width().\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n csr_descr descriptor of the sparse CSR matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n csr_val array containing the values of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix.\n @param[in]\n csr_col_ind array containing the column indices of the sparse CSR matrix.\n @param[in]\n ell_descr descriptor of the sparse ELL matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n ell_width number of non-zero elements per row in ELL storage format.\n @param[out]\n ell_val array of \\p m times \\p ell_width elements of the sparse ELL matrix.\n @param[out]\n ell_col_ind array of \\p m times \\p ell_width elements containing the column indices\n of the sparse ELL matrix.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m or \\p ell_width is invalid.\n \\retval rocsparse_status_invalid_pointer \\p csr_descr, \\p csr_val,\n \\p csr_row_ptr, \\p csr_col_ind, \\p ell_descr, \\p ell_val, or\n \\p ell_col_ind pointer is invalid.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n This example converts a CSR matrix into an ELL matrix.\n \\snippet example_rocsparse_csr2ell.cpp doc example\n/\n/**@{"]
pub fn rocsparse_scsr2ell(
handle: rocsparse_handle,
m: rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
ell_descr: rocsparse_mat_descr,
ell_width: rocsparse_int,
ell_val: *mut f32,
ell_col_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsr2ell(
handle: rocsparse_handle,
m: rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
ell_descr: rocsparse_mat_descr,
ell_width: rocsparse_int,
ell_val: *mut f64,
ell_col_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsr2ell(
handle: rocsparse_handle,
m: rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_val: *const rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
ell_descr: rocsparse_mat_descr,
ell_width: rocsparse_int,
ell_val: *mut rocsparse_float_complex,
ell_col_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsr2ell(
handle: rocsparse_handle,
m: rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_val: *const rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
ell_descr: rocsparse_mat_descr,
ell_width: rocsparse_int,
ell_val: *mut rocsparse_double_complex,
ell_col_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\details\n \\p rocsparse_csr2gebsr_buffer_size returns the size of the temporary buffer that is required\n by \\ref rocsparse_csr2gebsr_nnz and \\ref rocsparse_scsr2gebsr \"rocsparse_Xcsr2gebsr()\". The\n temporary storage buffer must be allocated by the user.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n\n @param[in]\n dir direction that specifies whether to count non-zero elements by \\ref rocsparse_direction_row or by\n \\ref rocsparse_direction_column.\n\n @param[in]\n m number of rows of the sparse CSR matrix.\n\n @param[in]\n n number of columns of the sparse CSR matrix.\n\n @param[in]\n csr_descr descriptor of the sparse CSR matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n\n @param[in]\n csr_val array of \\p nnz elements containing the values of the sparse CSR matrix.\n\n @param[in]\n csr_row_ptr integer array containing \\p m+1 elements that point to the start of each row of the CSR matrix.\n\n @param[in]\n csr_col_ind integer array of the column indices for each non-zero element in the CSR matrix.\n\n @param[in]\n row_block_dim the row block dimension of the general BSR matrix. Between 1 and \\p m.\n\n @param[in]\n col_block_dim the col block dimension of the general BSR matrix. Between 1 and \\p n.\n\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by \\ref rocsparse_csr2gebsr_nnz\n and \\ref rocsparse_scsr2gebsr \"rocsparse_Xcsr2gebsr()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, \\p row_block_dim, or \\p col_block_dim is invalid.\n \\retval rocsparse_status_invalid_pointer \\p csr_val, \\p csr_row_ptr, \\p csr_col_ind, or \\p buffer_size\n pointer is invalid.\n/\n/**@{"]
pub fn rocsparse_scsr2gebsr_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
m: rocsparse_int,
n: rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsr2gebsr_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
m: rocsparse_int,
n: rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsr2gebsr_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
m: rocsparse_int,
n: rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_val: *const rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsr2gebsr_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
m: rocsparse_int,
n: rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_val: *const rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\details\n This function takes a sparse CSR matrix as input and computes the block row offset array, \\p bsr_row_ptr,\n and the total number of non-zero blocks, \\p bsr_nnz_devhost, that will result from converting the CSR format\n input matrix to a general BSR format output matrix. This function is the second step in the conversion and\n is used in conjunction with \\ref rocsparse_scsr2gebsr_buffer_size \"rocsparse_Xcsr2gebsr_buffer_size()\" and\n \\ref rocsparse_scsr2gebsr \"rocsparse_Xcsr2gebsr()\".\n\n \\p rocsparse_csr2gebsr_nnz accepts both host and device pointers for \\p bsr_nnz_devhost, which can be set by\n calling \\ref rocsparse_set_pointer_mode prior to calling \\p rocsparse_csr2gebsr_nnz.\n\n \\note\n This function is blocking with respect to the host.\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir direction that specifies whether to count non-zero elements by \\ref rocsparse_direction_row or by\n \\ref rocsparse_direction_column.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n n number of columns of the sparse CSR matrix.\n @param[in]\n csr_descr descriptor of the sparse CSR matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n csr_row_ptr integer array containing \\p m+1 elements that point to the start of each row of the CSR matrix.\n\n @param[in]\n csr_col_ind integer array of the column indices for each non-zero element in the CSR matrix.\n\n @param[in]\n bsr_descr descriptor of the sparse general BSR matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[out]\n bsr_row_ptr integer array containing \\p mb+1 elements that point to the start of each block row of the\n general BSR matrix.\n @param[in]\n row_block_dim the row block dimension of the general BSR matrix. Between \\f$1\\f$ and \\f$\\min(m, n)\\f$.\n @param[in]\n col_block_dim the col block dimension of the general BSR matrix. Between \\f$1\\f$ and \\f$\\min(m, n)\\f$.\n @param[out]\n bsr_nnz_devhost total number of non-zero elements in device or host memory.\n @param[in]\n temp_buffer buffer allocated by the user. Its size is determined by calling\n \\ref rocsparse_scsr2gebsr_buffer_size \"rocsparse_Xcsr2gebsr_buffer_size()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, \\p row_block_dim, or \\p col_block_dim is invalid.\n \\retval rocsparse_status_invalid_pointer \\p csr_row_ptr, \\p csr_col_ind, \\p bsr_row_ptr, or \\p bsr_nnz_devhost\n pointer is invalid.\n/\n/**@{"]
pub fn rocsparse_csr2gebsr_nnz(
handle: rocsparse_handle,
dir: rocsparse_direction,
m: rocsparse_int,
n: rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
bsr_descr: rocsparse_mat_descr,
bsr_row_ptr: *mut rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
bsr_nnz_devhost: *mut rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief Convert a sparse CSR matrix into a sparse general BSR matrix.\n\n \\details\n \\p rocsparse_csr2gebsr converts a CSR matrix into a general BSR matrix. It is assumed\n that \\p bsr_val, \\p bsr_col_ind, and \\p bsr_row_ptr are allocated. The allocation size\n for \\p bsr_row_ptr is computed as \\p mb+1, where \\p mb is the number of block rows\n and \\p nb is the number of block columns in the general BSR matrix:\n \\f[\n mb = (m + row\\_block\\_dim - 1) / row\\_block\\_dim \\\\\n nb = (n + col\\_block\\_dim - 1) / col\\_block\\_dim\n \\f]\n The allocation size for \\p bsr_val and \\p bsr_col_ind is computed using \\ref rocsparse_csr2bsr_nnz(),\n which also fills in \\p bsr_row_ptr.\n\n Converting from a sparse CSR matrix to a sparse general BSR matrix requires three steps. First,\n call \\ref rocsparse_scsr2gebsr_buffer_size \"rocsparse_Xcsr2gebsr_buffer_size()\"\n to determine the size of the required temporary storage buffer. After this has been determined,\n allocate this buffer. Also now allocate the \\p bsr_row_ptr array to have length\n \\p mb+1 and pass it to the function \\ref rocsparse_csr2gebsr_nnz. This will fill the \\p bsr_row_ptr\n array and also compute the total number of non-zero blocks in the general BSR matrix. Now that the total\n number of non-zero blocks is known, allocate the \\p bsr_col_ind and \\p bsr_val arrays.\n Finally, call \\p rocsparse_csr2gebsr to complete the conversion. See the example below.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir the storage format of the blocks, \\ref rocsparse_direction_row or \\ref rocsparse_direction_column.\n @param[in]\n m number of rows in the sparse CSR matrix.\n @param[in]\n n number of columns in the sparse CSR matrix.\n @param[in]\n csr_descr descriptor of the sparse CSR matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n csr_val array of \\p nnz elements containing the values of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse CSR matrix.\n @param[in]\n bsr_descr descriptor of the sparse BSR matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[out]\n bsr_val array of \\p nnzb* \\p row_block_dim* \\p col_block_dim containing the values of the sparse BSR matrix.\n @param[out]\n bsr_row_ptr array of \\p mb+1 elements that point to the start of every block row of the\n sparse BSR matrix.\n @param[out]\n bsr_col_ind array of \\p nnzb elements containing the block column indices of the sparse BSR matrix.\n @param[in]\n row_block_dim row size of the blocks in the sparse general BSR matrix.\n @param[in]\n col_block_dim col size of the blocks in the sparse general BSR matrix.\n @param[in]\n temp_buffer buffer allocated by the user. Its size is determined by calling\n \\ref rocsparse_scsr2gebsr_buffer_size \"rocsparse_Xcsr2gebsr_buffer_size()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, \\p row_block_dim, or \\p col_block_dim is invalid.\n \\retval rocsparse_status_invalid_pointer \\p bsr_val,\n \\p bsr_row_ptr, \\p bsr_col_ind, \\p csr_val, \\p csr_row_ptr, or\n \\p csr_col_ind pointer is invalid.\n\n \\par Example\n This example converts a CSR matrix into an BSR matrix.\n \\snippet example_rocsparse_csr2gebsr.cpp doc example\n/\n/**@{"]
pub fn rocsparse_scsr2gebsr(
handle: rocsparse_handle,
dir: rocsparse_direction,
m: rocsparse_int,
n: rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
bsr_descr: rocsparse_mat_descr,
bsr_val: *mut f32,
bsr_row_ptr: *mut rocsparse_int,
bsr_col_ind: *mut rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsr2gebsr(
handle: rocsparse_handle,
dir: rocsparse_direction,
m: rocsparse_int,
n: rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
bsr_descr: rocsparse_mat_descr,
bsr_val: *mut f64,
bsr_row_ptr: *mut rocsparse_int,
bsr_col_ind: *mut rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsr2gebsr(
handle: rocsparse_handle,
dir: rocsparse_direction,
m: rocsparse_int,
n: rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_val: *const rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
bsr_descr: rocsparse_mat_descr,
bsr_val: *mut rocsparse_float_complex,
bsr_row_ptr: *mut rocsparse_int,
bsr_col_ind: *mut rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsr2gebsr(
handle: rocsparse_handle,
dir: rocsparse_direction,
m: rocsparse_int,
n: rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_val: *const rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
bsr_descr: rocsparse_mat_descr,
bsr_val: *mut rocsparse_double_complex,
bsr_row_ptr: *mut rocsparse_int,
bsr_col_ind: *mut rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief Convert a sparse CSR matrix into a sparse HYB matrix.\n\n \\details\n \\p rocsparse_csr2hyb converts a CSR matrix into a HYB matrix. It is assumed\n that \\p hyb has been initialized with \\ref rocsparse_create_hyb_mat().\n\n \\note\n This function requires a significant amount of storage for the HYB matrix,\n depending on the matrix structure.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n n number of columns of the sparse CSR matrix.\n @param[in]\n descr descriptor of the sparse CSR matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n csr_val array containing the values of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix.\n @param[in]\n csr_col_ind array containing the column indices of the sparse CSR matrix.\n @param[out]\n hyb sparse matrix in HYB format.\n @param[in]\n user_ell_width width of the ELL part of the HYB matrix (only required if\n \\p partition_type == \\ref rocsparse_hyb_partition_user).\n @param[in]\n partition_type \\ref rocsparse_hyb_partition_auto (recommended),\n \\ref rocsparse_hyb_partition_user, or\n \\ref rocsparse_hyb_partition_max.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p user_ell_width is invalid.\n \\retval rocsparse_status_invalid_value \\p partition_type is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p hyb, \\p csr_val,\n \\p csr_row_ptr, or \\p csr_col_ind pointer is invalid.\n \\retval rocsparse_status_memory_error the buffer for the HYB matrix could not be\n allocated.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n This example converts a CSR matrix into a HYB matrix using user-defined partitioning.\n \\snippet example_rocsparse_csr2hyb.cpp doc example\n/\n/**@{"]
pub fn rocsparse_scsr2hyb(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
hyb: rocsparse_hyb_mat,
user_ell_width: rocsparse_int,
partition_type: rocsparse_hyb_partition,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsr2hyb(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
hyb: rocsparse_hyb_mat,
user_ell_width: rocsparse_int,
partition_type: rocsparse_hyb_partition,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsr2hyb(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
hyb: rocsparse_hyb_mat,
user_ell_width: rocsparse_int,
partition_type: rocsparse_hyb_partition,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsr2hyb(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
hyb: rocsparse_hyb_mat,
user_ell_width: rocsparse_int,
partition_type: rocsparse_hyb_partition,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\details\n \\p rocsparse_csrsort_buffer_size returns the size of the temporary storage buffer\n required by \\ref rocsparse_csrsort(). The temporary storage buffer must be allocated by\n the user.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n n number of columns of the sparse CSR matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n \\ref rocsparse_csrsort().\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p csr_row_ptr, \\p csr_col_ind, or\n \\p buffer_size pointer is invalid."]
pub fn rocsparse_csrsort_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief Sort a sparse CSR matrix\n\n \\details\n \\p rocsparse_csrsort sorts a matrix in CSR format. The sorted permutation vector\n \\p perm can be used to obtain the sorted \\p csr_val array. In this case, \\p perm must be\n initialized as the identity permutation. For more information, see \\ref rocsparse_create_identity_permutation().\n\n \\p rocsparse_csrsort requires an extra temporary storage buffer that has to be allocated by\n the user. The storage buffer size can be determined by \\ref rocsparse_csrsort_buffer_size().\n\n \\note\n \\p perm can be \\p NULL if a sorted permutation vector is not required.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n n number of columns of the sparse CSR matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix.\n @param[in]\n descr descriptor of the sparse CSR matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix.\n @param[inout]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix.\n @param[inout]\n perm array of \\p nnz integers containing the unsorted map indices, which can be\n \\p NULL.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user. The size is returned by\n \\ref rocsparse_csrsort_buffer_size().\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p csr_row_ptr, \\p csr_col_ind,\n or \\p temp_buffer pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n The following example sorts a \\f$3 \\times 3\\f$ CSR matrix.\n \\snippet example_rocsparse_csrsort.cpp doc example"]
pub fn rocsparse_csrsort(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *mut rocsparse_int,
perm: *mut rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief\n This function converts the matrix \\f$A\\f$ in column-oriented dense format into a sparse matrix in COO format.\n All the parameters are assumed to have been preallocated by the user, and the arrays are\n filled in based on \\p nnz_per_rows, which can be pre-computed with \\ref rocsparse_snnz \"rocsparse_Xnnz()\".\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the column-oriented dense matrix \\p A.\n @param[in]\n n number of columns of the column-oriented dense matrix \\p A.\n @param[in]\n descr the descriptor of the column-oriented dense matrix \\p A. The supported matrix type is\n \\ref rocsparse_matrix_type_general and also any valid value of the \\ref rocsparse_index_base.\n @param[in]\n A column-oriented dense matrix of dimensions (\\p ld, \\p n).\n @param[in]\n ld leading dimension of column-oriented dense matrix \\p A.\n @param[in]\n nnz_per_rows array of size \\p n containing the number of non-zero elements per row.\n @param[out]\n coo_val\n array of nnz nonzero elements of matrix \\p A.\n @param[out]\n coo_row_ind integer array of nnz row indices of the non-zero elements of matrix \\p A.\n @param[out]\n coo_col_ind integer array of nnz column indices of the non-zero elements of matrix \\p A.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p ld is invalid.\n \\retval rocsparse_status_invalid_pointer \\p A, \\p nnz_per_rows, \\p coo_val, \\p coo_col_ind, or \\p coo_row_ind\n pointer is invalid.\n\n \\par Example\n \\snippet example_rocsparse_dense2coo.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sdense2coo(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr: rocsparse_mat_descr,
A: *const f32,
ld: rocsparse_int,
nnz_per_rows: *const rocsparse_int,
coo_val: *mut f32,
coo_row_ind: *mut rocsparse_int,
coo_col_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ddense2coo(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr: rocsparse_mat_descr,
A: *const f64,
ld: rocsparse_int,
nnz_per_rows: *const rocsparse_int,
coo_val: *mut f64,
coo_row_ind: *mut rocsparse_int,
coo_col_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cdense2coo(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr: rocsparse_mat_descr,
A: *const rocsparse_float_complex,
ld: rocsparse_int,
nnz_per_rows: *const rocsparse_int,
coo_val: *mut rocsparse_float_complex,
coo_row_ind: *mut rocsparse_int,
coo_col_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zdense2coo(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr: rocsparse_mat_descr,
A: *const rocsparse_double_complex,
ld: rocsparse_int,
nnz_per_rows: *const rocsparse_int,
coo_val: *mut rocsparse_double_complex,
coo_row_ind: *mut rocsparse_int,
coo_col_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief\n\n This function converts the matrix \\f$A\\f$ in column-oriented dense format into a sparse matrix in CSC format.\n All the parameters are assumed to have been preallocated by the user, and the arrays are\n filled in based on \\p nnz_per_columns, which can be pre-computed with \\ref rocsparse_snnz \"rocsparse_Xnnz()\".\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the column-oriented dense matrix \\p A.\n @param[in]\n n number of columns of the column-oriented dense matrix \\p A.\n @param[in]\n descr the descriptor of the column-oriented dense matrix \\p A. The supported matrix type is\n \\ref rocsparse_matrix_type_general and also any valid value of the \\ref rocsparse_index_base.\n @param[in]\n A column-oriented dense matrix of dimensions (\\p ld, \\p n).\n @param[in]\n ld leading dimension of the column-oriented dense matrix \\p A.\n @param[in]\n nnz_per_columns array of size \\p n containing the number of non-zero elements per column.\n @param[out]\n csc_val array of nnz ( = \\p csc_col_ptr[n] - \\p csc_col_ptr[0] ) non-zero elements of matrix \\p A.\n @param[out]\n csc_col_ptr integer array of \\p n+1 elements that contains the start of every column and the end of the last column\n plus one.\n @param[out]\n csc_row_ind integer array of nnz ( = \\p csc_col_ptr[n] - \\p csc_col_ptr[0] ) column indices of the non-zero elements\n of matrix \\p A.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p ld is invalid.\n \\retval rocsparse_status_invalid_pointer \\p A, \\p nnz_per_columns, \\p csc_val, \\p csc_col_ptr, or \\p csc_row_ind\n pointer is invalid.\n\n \\par Example\n \\snippet example_rocsparse_dense2csc.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sdense2csc(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr: rocsparse_mat_descr,
A: *const f32,
ld: rocsparse_int,
nnz_per_columns: *const rocsparse_int,
csc_val: *mut f32,
csc_col_ptr: *mut rocsparse_int,
csc_row_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ddense2csc(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr: rocsparse_mat_descr,
A: *const f64,
ld: rocsparse_int,
nnz_per_columns: *const rocsparse_int,
csc_val: *mut f64,
csc_col_ptr: *mut rocsparse_int,
csc_row_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cdense2csc(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr: rocsparse_mat_descr,
A: *const rocsparse_float_complex,
ld: rocsparse_int,
nnz_per_columns: *const rocsparse_int,
csc_val: *mut rocsparse_float_complex,
csc_col_ptr: *mut rocsparse_int,
csc_row_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zdense2csc(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr: rocsparse_mat_descr,
A: *const rocsparse_double_complex,
ld: rocsparse_int,
nnz_per_columns: *const rocsparse_int,
csc_val: *mut rocsparse_double_complex,
csc_col_ptr: *mut rocsparse_int,
csc_row_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief\n This function converts the matrix \\f$A\\f$ in column-oriented dense format into a sparse matrix in CSR format.\n All the parameters are assumed to have been preallocated by the user, and the arrays are filled in based\n on nnz_per_row, which can be pre-computed with \\ref rocsparse_snnz \"rocsparse_Xnnz()\".\n\n \\note\n This function is blocking with respect to the host.\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the column-oriented dense matrix \\p A.\n @param[in]\n n number of columns of the column-oriented dense dense matrix \\p A.\n @param[in]\n descr the descriptor of the column-oriented dense matrix \\p A. The supported matrix type is\n \\ref rocsparse_matrix_type_general and also any valid value of the \\ref rocsparse_index_base.\n @param[in]\n A column-oriented dense matrix of dimensions (\\p ld, \\p n).\n @param[in]\n ld leading dimension of column-oriented dense matrix \\p A.\n @param[in]\n nnz_per_rows array of size \\p n containing the number of non-zero elements per row.\n @param[out]\n csr_val array of nnz ( = \\p csr_row_ptr[m] - \\p csr_row_ptr[0] ) non-zero elements of matrix \\p A.\n @param[out]\n csr_row_ptr integer array of \\p m+1 elements that contains the start of every row and the end of the last row plus one.\n @param[out]\n csr_col_ind integer array of nnz ( = \\p csr_row_ptr[m] - \\p csr_row_ptr[0] ) column indices of the non-zero elements of\n matrix \\p A.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p ld is invalid.\n \\retval rocsparse_status_invalid_pointer \\p A, \\p nnz_per_rows, \\p csr_val, \\p csr_row_ptr, or \\p csr_col_ind\n pointer is invalid.\n\n \\par Example\n \\snippet example_rocsparse_dense2csr.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sdense2csr(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr: rocsparse_mat_descr,
A: *const f32,
ld: rocsparse_int,
nnz_per_rows: *const rocsparse_int,
csr_val: *mut f32,
csr_row_ptr: *mut rocsparse_int,
csr_col_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ddense2csr(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr: rocsparse_mat_descr,
A: *const f64,
ld: rocsparse_int,
nnz_per_rows: *const rocsparse_int,
csr_val: *mut f64,
csr_row_ptr: *mut rocsparse_int,
csr_col_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cdense2csr(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr: rocsparse_mat_descr,
A: *const rocsparse_float_complex,
ld: rocsparse_int,
nnz_per_rows: *const rocsparse_int,
csr_val: *mut rocsparse_float_complex,
csr_row_ptr: *mut rocsparse_int,
csr_col_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zdense2csr(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr: rocsparse_mat_descr,
A: *const rocsparse_double_complex,
ld: rocsparse_int,
nnz_per_rows: *const rocsparse_int,
csr_val: *mut rocsparse_double_complex,
csr_row_ptr: *mut rocsparse_int,
csr_col_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\details\n This function takes a sparse ELL matrix as input and computes the row offset array, \\p csr_row_ptr,\n and the total number of non-zeros, \\p csr_nnz, that will result from converting the ELL format input\n matrix to a CSR format output matrix. This function is the first step in the conversion and is used in\n conjunction with \\ref rocsparse_sell2csr \"rocsparse_Xell2csr()\". It is assumed that \\p csr_row_ptr has\n been allocated with size \\p m+1.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse ELL matrix.\n @param[in]\n n number of columns of the sparse ELL matrix.\n @param[in]\n ell_descr descriptor of the sparse ELL matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n ell_width number of non-zero elements per row in ELL storage format.\n @param[in]\n ell_col_ind array of \\p m times \\p ell_width elements containing the column indices\n of the sparse ELL matrix.\n @param[in]\n csr_descr descriptor of the sparse CSR matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[out]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix.\n @param[out]\n csr_nnz pointer to the total number of non-zero elements in CSR storage\n format.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p ell_width is invalid.\n \\retval rocsparse_status_invalid_pointer \\p ell_descr, \\p ell_col_ind,\n \\p csr_descr, \\p csr_row_ptr, or \\p csr_nnz pointer is invalid.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general."]
pub fn rocsparse_ell2csr_nnz(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
ell_descr: rocsparse_mat_descr,
ell_width: rocsparse_int,
ell_col_ind: *const rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_row_ptr: *mut rocsparse_int,
csr_nnz: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief Convert a sparse ELL matrix into a sparse CSR matrix.\n\n \\details\n \\p rocsparse_ell2csr converts a ELL matrix into a CSR matrix. It is assumed\n that \\p csr_row_ptr has already been filled and that \\p csr_val and \\p csr_col_ind\n are allocated by the user. The allocation size for \\p csr_row_ptr is computed as\n \\p m+1. The allocation size for \\p csr_val and \\p csr_col_ind is computed using\n \\ref rocsparse_ell2csr_nnz() which also fills in \\p csr_row_ptr.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse ELL matrix.\n @param[in]\n n number of columns of the sparse ELL matrix.\n @param[in]\n ell_descr descriptor of the sparse ELL matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n ell_width number of non-zero elements per row in ELL storage format.\n @param[in]\n ell_val array of \\p m times \\p ell_width elements of the sparse ELL matrix.\n @param[in]\n ell_col_ind array of \\p m times \\p ell_width elements containing the column indices\n of the sparse ELL matrix.\n @param[in]\n csr_descr descriptor of the sparse CSR matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[out]\n csr_val array containing the values of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix.\n @param[out]\n csr_col_ind array containing the column indices of the sparse CSR matrix.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p ell_width is invalid.\n \\retval rocsparse_status_invalid_pointer \\p csr_descr, \\p csr_val,\n \\p csr_row_ptr, \\p csr_col_ind, \\p ell_descr, \\p ell_val, or\n \\p ell_col_ind pointer is invalid.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n This example converts an ELL matrix into a CSR matrix.\n \\snippet example_rocsparse_ell2csr.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sell2csr(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
ell_descr: rocsparse_mat_descr,
ell_width: rocsparse_int,
ell_val: *const f32,
ell_col_ind: *const rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_val: *mut f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dell2csr(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
ell_descr: rocsparse_mat_descr,
ell_width: rocsparse_int,
ell_val: *const f64,
ell_col_ind: *const rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_val: *mut f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cell2csr(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
ell_descr: rocsparse_mat_descr,
ell_width: rocsparse_int,
ell_val: *const rocsparse_float_complex,
ell_col_ind: *const rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_val: *mut rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zell2csr(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
ell_descr: rocsparse_mat_descr,
ell_width: rocsparse_int,
ell_val: *const rocsparse_double_complex,
ell_col_ind: *const rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_val: *mut rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief Convert a sparse general BSR matrix into a sparse CSR matrix.\n\n \\details\n \\p rocsparse_gebsr2csr converts a BSR matrix into a CSR matrix. The input matrix is assumed\n to be allocated such that array \\p bsr_row_ptr has length \\p mb+1, \\p bsr_col_ind has length \\p nnzb, and\n \\p bsr_val has length \\p nnzb*row_block_dim*col_block_dim. The output matrix is assumed to be\n allocated such that array \\p csr_row_ptr has length \\p m+1, \\p csr_col_ind has length \\p nnz, and\n \\p csr_val has length \\p nnz where:\n \\f[\n m = mb * row\\_block\\_dim \\\\\n n = nb * col\\_block\\_dim \\\\\n nnz = nnzb * row\\_block\\_dim * col\\_block\\_dim\n \\f]\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir the storage format of the blocks, \\ref rocsparse_direction_row or \\ref rocsparse_direction_column.\n @param[in]\n mb number of block rows in the sparse general BSR matrix.\n @param[in]\n nb number of block columns in the sparse general BSR matrix.\n @param[in]\n bsr_descr descriptor of the sparse general BSR matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n bsr_val array of \\p nnzb*row_block_dim*col_block_dim containing the values of the sparse BSR matrix.\n @param[in]\n bsr_row_ptr array of \\p mb+1 elements that point to the start of every block row of the\n sparse BSR matrix.\n @param[in]\n bsr_col_ind array of \\p nnzb elements containing the block column indices of the sparse BSR matrix.\n @param[in]\n row_block_dim row size of the blocks in the sparse general BSR matrix.\n @param[in]\n col_block_dim column size of the blocks in the sparse general BSR matrix.\n @param[in]\n csr_descr descriptor of the sparse CSR matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[out]\n csr_val array of \\p nnzb*row_block_dim*col_block_dim elements containing the values of the sparse CSR matrix.\n @param[out]\n csr_row_ptr array of \\p m+1 where \\p m=mb*row_block_dim elements that point to the start of every row of the\n sparse CSR matrix.\n @param[out]\n csr_col_ind array of \\p nnzb*block_dim*block_dim elements containing the column indices of the sparse CSR matrix.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nb, or \\p block_dim is invalid.\n \\retval rocsparse_status_invalid_pointer \\p bsr_val,\n \\p bsr_row_ptr, \\p bsr_col_ind, \\p csr_val, \\p csr_row_ptr, or\n \\p csr_col_ind pointer is invalid.\n\n \\par Example\n This example converts a general BSR matrix into an CSR matrix.\n \\snippet example_rocsparse_gebsr2csr.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sgebsr2csr(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
bsr_descr: rocsparse_mat_descr,
bsr_val: *const f32,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_val: *mut f32,
csr_row_ptr: *mut rocsparse_int,
csr_col_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dgebsr2csr(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
bsr_descr: rocsparse_mat_descr,
bsr_val: *const f64,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_val: *mut f64,
csr_row_ptr: *mut rocsparse_int,
csr_col_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cgebsr2csr(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
bsr_descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_float_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_val: *mut rocsparse_float_complex,
csr_row_ptr: *mut rocsparse_int,
csr_col_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zgebsr2csr(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
bsr_descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_double_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
csr_descr: rocsparse_mat_descr,
csr_val: *mut rocsparse_double_complex,
csr_row_ptr: *mut rocsparse_int,
csr_col_ind: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\details\n \\p rocsparse_gebsr2gebsc_buffer_size returns the size of the temporary storage buffer\n required by \\ref rocsparse_sgebsr2gebsc \"rocsparse_Xgebsr2gebsc()\".\n The temporary storage buffer must be allocated by the user.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n mb number of rows of the sparse general BSR matrix.\n @param[in]\n nb number of columns of the sparse general BSR matrix.\n @param[in]\n nnzb number of non-zero entries of the sparse general BSR matrix.\n @param[in]\n bsr_val array of \\p nnzb*row_block_dim*col_block_dim containing the values of the sparse general BSR matrix.\n @param[in]\n bsr_row_ptr array of \\p mb+1 elements that point to the start of every row of the\n sparse general BSR matrix.\n @param[in]\n bsr_col_ind array of \\p nnzb elements containing the column indices of the sparse\n general BSR matrix.\n @param[in]\n row_block_dim row size of the blocks in the sparse general BSR matrix.\n @param[in]\n col_block_dim col size of the blocks in the sparse general BSR matrix.\n @param[out]\n p_buffer_size number of bytes of the temporary storage buffer required by\n rocsparse_sgebsr2gebsc(), rocsparse_dgebsr2gebsc(), rocsparse_cgebsr2gebsc(), and\n rocsparse_zgebsr2gebsc().\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nb, or \\p nnzb is invalid.\n \\retval rocsparse_status_invalid_pointer \\p bsr_row_ptr, \\p bsr_col_ind, or\n \\p p_buffer_size pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n/\n/**@{"]
pub fn rocsparse_sgebsr2gebsc_buffer_size(
handle: rocsparse_handle,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
bsr_val: *const f32,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
p_buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dgebsr2gebsc_buffer_size(
handle: rocsparse_handle,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
bsr_val: *const f64,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
p_buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cgebsr2gebsc_buffer_size(
handle: rocsparse_handle,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
bsr_val: *const rocsparse_float_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
p_buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zgebsr2gebsc_buffer_size(
handle: rocsparse_handle,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
bsr_val: *const rocsparse_double_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
p_buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief Convert a sparse general BSR matrix into a sparse general BSC matrix.\n\n \\details\n \\p rocsparse_gebsr2gebsc converts a general BSR matrix into a general BSC matrix. The resulting\n matrix can also be seen as the transpose of the input matrix. \\p rocsparse_gebsr2gebsc can also\n be used to convert a general BSC matrix into a general BSR matrix.\n\n The conversion of a sparse matrix from general BSR to general BSC format involves two steps. First,\n call \\ref rocsparse_sgebsr2gebsc_buffer_size \"rocsparse_Xgebsr2gebsc_buffer_size()\" to\n determine the size of the required tempory storage buffer. Then allocate this buffer. Secondly,\n call \\p rocsparse_gebsr2gebsc to complete the conversion. After the conversion is complete, the\n user must free the temporary buffer.\n\n \\p rocsparse_gebsr2gebsc takes a \\ref rocsparse_action parameter as input. This \\p copy_values parameter\n decides whether \\p bsc_row_ind and \\p bsc_val are filled during conversion (\\ref rocsparse_action_numeric)\n or whether only \\p bsc_row_ind is filled (\\ref rocsparse_action_symbolic). Using\n \\ref rocsparse_action_symbolic can be useful, for example, if only the sparsity pattern is required.\n\n \\note\n The resulting matrix can also be seen as the transpose of the input matrix.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n mb number of rows of the sparse general BSR matrix.\n @param[in]\n nb number of columns of the sparse general BSR matrix.\n @param[in]\n nnzb number of non-zero entries of the sparse general BSR matrix.\n @param[in]\n bsr_val array of \\p nnzb * \\p row_block_dim * \\p col_block_dim elements of the sparse general BSR matrix.\n @param[in]\n bsr_row_ptr array of \\p mb+1 elements that point to the start of every row of the\n sparse general BSR matrix.\n @param[in]\n bsr_col_ind array of \\p nnz elements containing the column indices of the sparse\n general BSR matrix.\n @param[in]\n row_block_dim row size of the blocks in the sparse general BSR matrix.\n @param[in]\n col_block_dim col size of the blocks in the sparse general BSR matrix.\n @param[out]\n bsc_val array of \\p nnz elements of the sparse BSC matrix.\n @param[out]\n bsc_row_ind array of \\p nnz elements containing the row indices of the sparse BSC\n matrix.\n @param[out]\n bsc_col_ptr array of \\p nb+1 elements that point to the start of every column of the\n sparse BSC matrix.\n @param[in]\n copy_values \\ref rocsparse_action_symbolic or \\ref rocsparse_action_numeric.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user. The size is returned by\n \\ref rocsparse_sgebsr2gebsc_buffer_size \"rocsparse_Xgebsr2gebsc_buffer_size()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nb, or \\p nnzb is invalid.\n \\retval rocsparse_status_invalid_pointer \\p bsr_val, \\p bsr_row_ptr,\n \\p bsr_col_ind, \\p bsc_val, \\p bsc_row_ind, \\p bsc_col_ptr, or\n \\p temp_buffer pointer is invalid.\n \\retval rocsparse_status_arch_mismatch the device is not supported.\n \\retval rocsparse_status_internal_error an internal error occurred.\n\n \\par Example\n This example computes the transpose of a general BSR matrix.\n \\snippet example_rocsparse_gebsr2gebsc.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sgebsr2gebsc(
handle: rocsparse_handle,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
bsr_val: *const f32,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
bsc_val: *mut f32,
bsc_row_ind: *mut rocsparse_int,
bsc_col_ptr: *mut rocsparse_int,
copy_values: rocsparse_action,
idx_base: rocsparse_index_base,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dgebsr2gebsc(
handle: rocsparse_handle,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
bsr_val: *const f64,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
bsc_val: *mut f64,
bsc_row_ind: *mut rocsparse_int,
bsc_col_ptr: *mut rocsparse_int,
copy_values: rocsparse_action,
idx_base: rocsparse_index_base,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cgebsr2gebsc(
handle: rocsparse_handle,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
bsr_val: *const rocsparse_float_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
bsc_val: *mut rocsparse_float_complex,
bsc_row_ind: *mut rocsparse_int,
bsc_col_ptr: *mut rocsparse_int,
copy_values: rocsparse_action,
idx_base: rocsparse_index_base,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zgebsr2gebsc(
handle: rocsparse_handle,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
bsr_val: *const rocsparse_double_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
bsc_val: *mut rocsparse_double_complex,
bsc_row_ind: *mut rocsparse_int,
bsc_col_ptr: *mut rocsparse_int,
copy_values: rocsparse_action,
idx_base: rocsparse_index_base,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\details\n \\p rocsparse_gebsr2gebsr_buffer_size returns the size of the temporary storage buffer that is required by\n \\ref rocsparse_gebsr2gebsr_nnz() and \\ref rocsparse_sgebsr2gebsr \"rocsparse_Xgebsr2gebsr()\". The temporary\n storage buffer must be allocated by the user.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir the storage format of the blocks, \\ref rocsparse_direction_row or \\ref rocsparse_direction_column.\n @param[in]\n mb number of block rows of the general BSR sparse matrix \\f$A\\f$.\n @param[in]\n nb number of block columns of the general BSR sparse matrix \\f$A\\f$.\n @param[in]\n nnzb number of blocks in the general BSR sparse matrix \\f$A\\f$.\n @param[in]\n descr_A the descriptor of the general BSR sparse matrix \\f$A\\f$. The supported matrix type is\n \\ref rocsparse_matrix_type_general and also any valid value of the \\ref rocsparse_index_base.\n @param[in]\n bsr_val_A array of \\p nnzb*row_block_dim_A*col_block_dim_A containing the values of the sparse general BSR\n matrix \\f$A\\f$.\n @param[in]\n bsr_row_ptr_A array of \\p mb+1 elements that point to the start of every block row of the\n sparse general BSR matrix \\f$A\\f$.\n @param[in]\n bsr_col_ind_A array of \\p nnzb elements containing the block column indices of the sparse general BSR matrix \\f$A\\f$.\n @param[in]\n row_block_dim_A row size of the blocks in the sparse general BSR matrix \\f$A\\f$.\n @param[in]\n col_block_dim_A column size of the blocks in the sparse general BSR matrix \\f$A\\f$.\n @param[in]\n row_block_dim_C row size of the blocks in the sparse general BSR matrix \\f$C\\f$.\n @param[in]\n col_block_dim_C column size of the blocks in the sparse general BSR matrix \\f$C\\f$.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by \\ref rocsparse_gebsr2gebsr_nnz() and\n \\ref rocsparse_sgebsr2gebsr \"rocsparse_Xgebsr2gebsr()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nb, \\p nnzb, \\p row_block_dim_A,\n \\p col_block_dim_A, \\p row_block_dim_C, or \\p col_block_dim_C is invalid.\n \\retval rocsparse_status_invalid_pointer \\p bsr_row_ptr_A, \\p bsr_col_ind_A,\n \\p descr_A, or \\p buffer_size pointer is invalid.\n/\n/**@{"]
pub fn rocsparse_sgebsr2gebsr_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
descr_A: rocsparse_mat_descr,
bsr_val_A: *const f32,
bsr_row_ptr_A: *const rocsparse_int,
bsr_col_ind_A: *const rocsparse_int,
row_block_dim_A: rocsparse_int,
col_block_dim_A: rocsparse_int,
row_block_dim_C: rocsparse_int,
col_block_dim_C: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dgebsr2gebsr_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
descr_A: rocsparse_mat_descr,
bsr_val_A: *const f64,
bsr_row_ptr_A: *const rocsparse_int,
bsr_col_ind_A: *const rocsparse_int,
row_block_dim_A: rocsparse_int,
col_block_dim_A: rocsparse_int,
row_block_dim_C: rocsparse_int,
col_block_dim_C: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cgebsr2gebsr_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
descr_A: rocsparse_mat_descr,
bsr_val_A: *const rocsparse_float_complex,
bsr_row_ptr_A: *const rocsparse_int,
bsr_col_ind_A: *const rocsparse_int,
row_block_dim_A: rocsparse_int,
col_block_dim_A: rocsparse_int,
row_block_dim_C: rocsparse_int,
col_block_dim_C: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zgebsr2gebsr_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
descr_A: rocsparse_mat_descr,
bsr_val_A: *const rocsparse_double_complex,
bsr_row_ptr_A: *const rocsparse_int,
bsr_col_ind_A: *const rocsparse_int,
row_block_dim_A: rocsparse_int,
col_block_dim_A: rocsparse_int,
row_block_dim_C: rocsparse_int,
col_block_dim_C: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\details\n This function takes a sparse general BSR matrix as input and computes the block row offset array, \\p bsr_row_ptr_C,\n and the total number of non-zero blocks, \\p nnz_total_dev_host_ptr, that result from converting the general BSR\n format input matrix to a general BSR format output matrix. The input and output matrices can have different row and\n column block dimensions. \\p rocsparse_gebsr2gebsr_nnz is the second step in the conversion and is used in conjunction with\n \\ref rocsparse_sgebsr2gebsr_buffer_size \"rocsparse_Xgebsr2gebsr_buffer_size()\" and\n \\ref rocsparse_sgebsr2gebsr \"rocsparse_Xgebsr2gebsr()\".\n\n \\p rocsparse_gebsr2gebsr_nnz accepts both host and device pointers for \\p nnz_total_dev_host_ptr, which can be set by\n calling \\ref rocsparse_set_pointer_mode prior to calling \\p rocsparse_gebsr2gebsr_nnz.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir the storage format of the blocks, \\ref rocsparse_direction_row or \\ref rocsparse_direction_column.\n @param[in]\n mb number of block rows of the general BSR sparse matrix \\f$A\\f$.\n @param[in]\n nb number of block columns of the general BSR sparse matrix \\f$A\\f$.\n @param[in]\n nnzb number of blocks in the general BSR sparse matrix \\f$A\\f$.\n @param[in]\n descr_A the descriptor of the general BSR sparse matrix \\f$A\\f$. The supported matrix type is\n \\ref rocsparse_matrix_type_general and also any valid value of the \\ref rocsparse_index_base.\n @param[in]\n bsr_row_ptr_A array of \\p mb+1 elements that point to the start of every block row of the\n sparse general BSR matrix \\f$A\\f$.\n @param[in]\n bsr_col_ind_A array of \\p nnzb elements containing the block column indices of the sparse general BSR matrix \\f$A\\f$.\n @param[in]\n row_block_dim_A row size of the blocks in the sparse general BSR matrix \\f$A\\f$.\n @param[in]\n col_block_dim_A column size of the blocks in the sparse general BSR matrix \\f$A\\f$.\n @param[in]\n descr_C the descriptor of the general BSR sparse matrix \\f$C\\f$. The supported matrix type is\n \\ref rocsparse_matrix_type_general and also any valid value of the \\ref rocsparse_index_base.\n @param[in]\n bsr_row_ptr_C array of \\p mb_C+1 elements that point to the start of every block row of the\n sparse general BSR matrix \\f$C\\f$ where \\p mb_C=(m+row_block_dim_C-1)/row_block_dim_C.\n @param[in]\n row_block_dim_C row size of the blocks in the sparse general BSR matrix \\f$C\\f$.\n @param[in]\n col_block_dim_C column size of the blocks in the sparse general BSR matrix \\f$C\\f$.\n @param[out]\n nnz_total_dev_host_ptr total number of non-zero blocks in general BSR sparse matrix \\f$C\\f$ stored using device or host memory.\n @param[out]\n temp_buffer buffer allocated by the user whose size is determined by calling\n \\ref rocsparse_sgebsr2gebsr_buffer_size \"rocsparse_Xgebsr2gebsr_buffer_size()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nb, \\p nnzb, \\p row_block_dim_A,\n \\p col_block_dim_A, \\p row_block_dim_C, or \\p col_block_dim_C is invalid.\n \\retval rocsparse_status_invalid_pointer \\p bsr_row_ptr_A, \\p bsr_col_ind_A,\n \\p bsr_row_ptr_C, \\p descr_A, \\p descr_C, or \\p temp_buffer pointer is invalid."]
pub fn rocsparse_gebsr2gebsr_nnz(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
descr_A: rocsparse_mat_descr,
bsr_row_ptr_A: *const rocsparse_int,
bsr_col_ind_A: *const rocsparse_int,
row_block_dim_A: rocsparse_int,
col_block_dim_A: rocsparse_int,
descr_C: rocsparse_mat_descr,
bsr_row_ptr_C: *mut rocsparse_int,
row_block_dim_C: rocsparse_int,
col_block_dim_C: rocsparse_int,
nnz_total_dev_host_ptr: *mut rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief\n This function converts the general BSR sparse matrix \\f$A\\f$ to another general BSR sparse matrix \\f$C\\f$.\n\n \\details\n \\p rocsparse_gebsr2gebsr converts a general BSR matrix \\f$A\\f$ into a general BSR matrix \\f$C\\f$. The input\n and output matrices can have different row and column block dimensions. The input matrix \\f$A\\f$ is assumed\n to be allocated such that array \\p bsr_row_ptr_A has length \\p mb+1, \\p bsr_col_ind_A has length \\p nnzb, and\n \\p bsr_val_A has length \\p nnzb*row_block_dim_A*col_block_dim_A. The output matrix \\f$C\\f$ is assumed to be\n allocated such that array \\p bsr_row_ptr_C has length \\p mb_C+1, \\p bsr_col_ind_C has length \\p nnzb_C, and\n \\p bsr_val_C has length \\p nnzb_C*row_block_dim_C*col_block_dim_C where:\n \\f[\n m = mb * row\\_block\\_dim\\_A \\\\\n n = nb * col\\_block\\_dim\\_A\n \\f]\n and\n \\f[\n mb\\_C = (m + row\\_block\\_dim\\_C - 1) / row\\_block\\_dim\\_C \\\\\n nb\\_C = (n + col\\_block\\_dim\\_C - 1) / col\\_block\\_dim\\_C\n \\f]\n The number of non-zero blocks in the output sparse \\f$C\\f$ matrix (i.e. \\p nnzb_C) is computed using\n \\ref rocsparse_gebsr2gebsr_nnz() which also fills in the \\p bsr_row_ptr_C array.\n\n Converting from a sparse general BSR matrix to a sparse general BSR matrix requires three steps. First,\n call \\ref rocsparse_sgebsr2gebsr_buffer_size \"rocsparse_Xgebsr2gebsr_buffer_size()\"\n to determine the size of the required temporary storage buffer. After this has been determined,\n allocate this buffer. Also allocate the \\p bsr_row_ptr_C array to have length\n \\p mb_C+1 and pass it to the function \\ref rocsparse_gebsr2gebsr_nnz. This will fill the \\p bsr_row_ptr_C\n array and also compute the total number of non-zero blocks in the general BSR output \\f$C\\f$ matrix. Now that\n the total number of non-zero blocks is known, allocate the \\p bsr_col_ind_C and \\p bsr_val_C arrays.\n Finally, call \\p rocsparse_gebsr2gebsr to complete the conversion. After the conversion is complete,\n the temporary storage buffer can be deallocated. See the example below.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir the storage format of the blocks, \\ref rocsparse_direction_row or \\ref rocsparse_direction_column.\n @param[in]\n mb number of block rows of the general BSR sparse matrix \\f$A\\f$.\n @param[in]\n nb number of block columns of the general BSR sparse matrix \\f$A\\f$.\n @param[in]\n nnzb number of blocks in the general BSR sparse matrix \\f$A\\f$.\n @param[in]\n descr_A the descriptor of the general BSR sparse matrix \\f$A\\f$. The supported matrix type is\n \\ref rocsparse_matrix_type_general and also any valid value of the \\ref rocsparse_index_base.\n @param[in]\n bsr_val_A array of \\p nnzb*row_block_dim_A*col_block_dim_A containing the values of the sparse general BSR matrix \\f$A\\f$.\n @param[in]\n bsr_row_ptr_A array of \\p mb+1 elements that point to the start of every block row of the\n sparse general BSR matrix \\f$A\\f$.\n @param[in]\n bsr_col_ind_A array of \\p nnzb elements containing the block column indices of the sparse general BSR matrix \\f$A\\f$.\n @param[in]\n row_block_dim_A row size of the blocks in the sparse general BSR matrix \\f$A\\f$.\n @param[in]\n col_block_dim_A column size of the blocks in the sparse general BSR matrix \\f$A\\f$.\n @param[in]\n descr_C the descriptor of the general BSR sparse matrix \\f$C\\f$. The supported matrix type is\n \\ref rocsparse_matrix_type_general and also any valid value of the \\ref rocsparse_index_base.\n @param[in]\n bsr_val_C array of \\p nnzb_C*row_block_dim_C*col_block_dim_C containing the values of the sparse general BSR matrix \\f$C\\f$.\n @param[in]\n bsr_row_ptr_C array of \\p mb_C+1 elements that point to the start of every block row of the\n sparse general BSR matrix \\f$C\\f$.\n @param[in]\n bsr_col_ind_C array of \\p nnzb_C elements containing the block column indices of the sparse general BSR matrix \\f$C\\f$.\n @param[in]\n row_block_dim_C row size of the blocks in the sparse general BSR matrix \\f$C\\f$.\n @param[in]\n col_block_dim_C column size of the blocks in the sparse general BSR matrix \\f$C\\f$.\n @param[out]\n temp_buffer buffer allocated by the user. Its size is determined by calling\n \\ref rocsparse_sgebsr2gebsr_buffer_size \"rocsparse_Xgebsr2gebsr_buffer_size()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nb, \\p nnzb, \\p row_block_dim_A,\n \\p col_block_dim_A, \\p row_block_dim_C, or \\p col_block_dim_C is invalid.\n \\retval rocsparse_status_invalid_pointer \\p bsr_row_ptr_A, \\p bsr_col_ind_A, \\p bsr_val_A,\n \\p bsr_row_ptr_C, \\p bsr_col_ind_C, \\p bsr_val_C, \\p descr_A, \\p descr_C,\n or \\p temp_buffer pointer is invalid.\n\n \\par Example\n This example converts a general BSR matrix into an general BSR matrix.\n \\snippet example_rocsparse_gebsr2gebsr.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sgebsr2gebsr(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
descr_A: rocsparse_mat_descr,
bsr_val_A: *const f32,
bsr_row_ptr_A: *const rocsparse_int,
bsr_col_ind_A: *const rocsparse_int,
row_block_dim_A: rocsparse_int,
col_block_dim_A: rocsparse_int,
descr_C: rocsparse_mat_descr,
bsr_val_C: *mut f32,
bsr_row_ptr_C: *mut rocsparse_int,
bsr_col_ind_C: *mut rocsparse_int,
row_block_dim_C: rocsparse_int,
col_block_dim_C: rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dgebsr2gebsr(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
descr_A: rocsparse_mat_descr,
bsr_val_A: *const f64,
bsr_row_ptr_A: *const rocsparse_int,
bsr_col_ind_A: *const rocsparse_int,
row_block_dim_A: rocsparse_int,
col_block_dim_A: rocsparse_int,
descr_C: rocsparse_mat_descr,
bsr_val_C: *mut f64,
bsr_row_ptr_C: *mut rocsparse_int,
bsr_col_ind_C: *mut rocsparse_int,
row_block_dim_C: rocsparse_int,
col_block_dim_C: rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cgebsr2gebsr(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
descr_A: rocsparse_mat_descr,
bsr_val_A: *const rocsparse_float_complex,
bsr_row_ptr_A: *const rocsparse_int,
bsr_col_ind_A: *const rocsparse_int,
row_block_dim_A: rocsparse_int,
col_block_dim_A: rocsparse_int,
descr_C: rocsparse_mat_descr,
bsr_val_C: *mut rocsparse_float_complex,
bsr_row_ptr_C: *mut rocsparse_int,
bsr_col_ind_C: *mut rocsparse_int,
row_block_dim_C: rocsparse_int,
col_block_dim_C: rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zgebsr2gebsr(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
descr_A: rocsparse_mat_descr,
bsr_val_A: *const rocsparse_double_complex,
bsr_row_ptr_A: *const rocsparse_int,
bsr_col_ind_A: *const rocsparse_int,
row_block_dim_A: rocsparse_int,
col_block_dim_A: rocsparse_int,
descr_C: rocsparse_mat_descr,
bsr_val_C: *mut rocsparse_double_complex,
bsr_row_ptr_C: *mut rocsparse_int,
bsr_col_ind_C: *mut rocsparse_int,
row_block_dim_C: rocsparse_int,
col_block_dim_C: rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\details\n \\p rocsparse_hyb2csr_buffer_size returns the size of the temporary storage buffer\n required by \\ref rocsparse_shyb2csr \"rocsparse_Xhyb2csr()\". The temporary storage\n buffer must be allocated by the user.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n descr descriptor of the sparse HYB matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n hyb sparse matrix in HYB format.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n \\ref rocsparse_shyb2csr \"rocsparse_Xhyb2csr()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p hyb, \\p csr_row_ptr, or\n \\p buffer_size pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general."]
pub fn rocsparse_hyb2csr_buffer_size(
handle: rocsparse_handle,
descr: rocsparse_mat_descr,
hyb: rocsparse_hyb_mat,
csr_row_ptr: *const rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief Convert a sparse HYB matrix into a sparse CSR matrix.\n\n \\details\n \\p rocsparse_hyb2csr converts a HYB matrix into a CSR matrix. This requires a HYB input structure,\n \\ref rocsparse_hyb_mat, which is created using \\ref rocsparse_create_hyb_mat and is filled with data\n using the conversion routine \\ref rocsparse_scsr2hyb \"rocsparse_Xcsr2hyb()\".\n\n Converting back to a sparse CSR matrix from a sparse HYB matrix requires two steps. First, call\n \\ref rocsparse_hyb2csr_buffer_size to determine the size of the required temporary\n storage buffer. After this is determined, allocate this buffer. Finally, call\n \\ref rocsparse_shyb2csr \"rocsparse_Xhyb2csr()\" to complete the conversion.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n descr descriptor of the sparse HYB matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n hyb sparse matrix in HYB format.\n @param[out]\n csr_val array containing the values of the sparse CSR matrix.\n @param[out]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix.\n @param[out]\n csr_col_ind array containing the column indices of the sparse CSR matrix.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user. The size is returned by\n \\ref rocsparse_hyb2csr_buffer_size().\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p hyb, \\p csr_val,\n \\p csr_row_ptr, \\p csr_col_ind, or \\p temp_buffer pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n This example converts a HYB matrix into a CSR matrix.\n \\snippet example_rocsparse_hyb2csr.cpp doc example\n/\n/**@{"]
pub fn rocsparse_shyb2csr(
handle: rocsparse_handle,
descr: rocsparse_mat_descr,
hyb: rocsparse_hyb_mat,
csr_val: *mut f32,
csr_row_ptr: *mut rocsparse_int,
csr_col_ind: *mut rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dhyb2csr(
handle: rocsparse_handle,
descr: rocsparse_mat_descr,
hyb: rocsparse_hyb_mat,
csr_val: *mut f64,
csr_row_ptr: *mut rocsparse_int,
csr_col_ind: *mut rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_chyb2csr(
handle: rocsparse_handle,
descr: rocsparse_mat_descr,
hyb: rocsparse_hyb_mat,
csr_val: *mut rocsparse_float_complex,
csr_row_ptr: *mut rocsparse_int,
csr_col_ind: *mut rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zhyb2csr(
handle: rocsparse_handle,
descr: rocsparse_mat_descr,
hyb: rocsparse_hyb_mat,
csr_val: *mut rocsparse_double_complex,
csr_row_ptr: *mut rocsparse_int,
csr_col_ind: *mut rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief Create the identity map.\n\n \\details\n \\p rocsparse_create_identity_permutation stores the identity map in \\p p, such that\n \\f$p = 0:1:(n-1)\\f$.\n\n \\code{.c}\n for(i = 0; i < n; ++i)\n {\n p[i] = i;\n }\n \\endcode\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n n size of the map \\p p.\n @param[out]\n p array of \\p n integers containing the map.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p n is invalid.\n \\retval rocsparse_status_invalid_pointer \\p p pointer is invalid.\n\n \\par Example\n The following example creates an identity permutation.\n \\snippet example_rocsparse_create_identity_permutation.cpp doc example"]
pub fn rocsparse_create_identity_permutation(
handle: rocsparse_handle,
n: rocsparse_int,
p: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief Inverse a permutation vector.\n\n \\details\n \\p rocsparse_inverse_permutation computes\n\n \\code{.c}\n for(i = 0; i < n; ++i)\n {\n q[p[i]- base] = i + base;\n }\n \\endcode\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n n size of the permutation vector \\p p.\n @param[in]\n p array of \\p n integers containing the permutation vector to inverse.\n @param[out]\n q array of \\p n integers containing the invsrse of the permutation vector.\n @param[in]\n base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p n is invalid.\n \\retval rocsparse_status_invalid_pointer \\p p pointer is invalid or \\p q pointer is invalid.\n \\retval rocsparse_status_invalid_value \\p base is invalid."]
pub fn rocsparse_inverse_permutation(
handle: rocsparse_handle,
n: rocsparse_int,
p: *const rocsparse_int,
q: *mut rocsparse_int,
base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief Create the identity map.\n\n \\details\n \\p rocsparse_set_identity_permutation stores the identity map in \\p p, such that\n \\f$p = 0:1:(n-1)\\f$.\n\n \\code{.c}\n for(i = 0; i < n; ++i)\n {\n p[i] = i;\n }\n \\endcode\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n n size of the map \\p p.\n @param[out]\n p array of \\p n integers containing the map.\n @param[in]\n indextype the integer type of \\p p. Can be \\p rocsparse_indextype_i32 or \\p rocsparse_indextype_i64.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p n is invalid.\n \\retval rocsparse_status_not_implemented if \\p indextype is rocsparse_indextype_u16.\n \\retval rocsparse_status_invalid_pointer \\p p pointer is invalid.\n\n \\par Example\n The following example creates an identity permutation.\n \\code{.c}\n int32_t size = 200;\n\n // Allocate memory to hold the identity map\n int32_t* perm;\n hipMalloc((void**)&perm, sizeof(int32_t) * size);\n\n // Fill perm with the identity permutation\n rocsparse_set_identity_permutation(handle, size, (void*)perm, rocsparse_indextype_i32);\n \\endcode"]
pub fn rocsparse_set_identity_permutation(
handle: rocsparse_handle,
n: i64,
p: *mut ::std::os::raw::c_void,
indextype: rocsparse_indextype,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\details\n This function computes the number of non-zero elements per row or column and the total number of non-zero elements\n in a dense matrix.\n\n \\note\n The routine supports asynchronous execution if the pointer mode is set to device.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir direction that specifies whether to count non-zero elements by \\ref rocsparse_direction_row or by\n \\ref rocsparse_direction_column.\n @param[in]\n m number of rows of the dense matrix \\p A.\n @param[in]\n n number of columns of the dense matrix \\p A.\n @param[in]\n descr the descriptor of the dense matrix \\p A.\n @param[in]\n A array of dimensions (\\p ld, \\p n).\n @param[in]\n ld leading dimension of dense array \\p A.\n @param[out]\n nnz_per_row_columns array of size \\p m or \\p n containing the number of non-zero elements per row or column, respectively.\n @param[out]\n nnz_total_dev_host_ptr total number of non-zero elements in device or host memory.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p ld is invalid.\n \\retval rocsparse_status_invalid_pointer \\p A, \\p nnz_per_row_columns, or \\p nnz_total_dev_host_ptr\n pointer is invalid.\n\n \\par Example\n \\snippet example_rocsparse_nnz.cpp doc example\n/\n/**@{"]
pub fn rocsparse_snnz(
handle: rocsparse_handle,
dir: rocsparse_direction,
m: rocsparse_int,
n: rocsparse_int,
descr: rocsparse_mat_descr,
A: *const f32,
ld: rocsparse_int,
nnz_per_row_columns: *mut rocsparse_int,
nnz_total_dev_host_ptr: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dnnz(
handle: rocsparse_handle,
dir: rocsparse_direction,
m: rocsparse_int,
n: rocsparse_int,
descr: rocsparse_mat_descr,
A: *const f64,
ld: rocsparse_int,
nnz_per_row_columns: *mut rocsparse_int,
nnz_total_dev_host_ptr: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cnnz(
handle: rocsparse_handle,
dir: rocsparse_direction,
m: rocsparse_int,
n: rocsparse_int,
descr: rocsparse_mat_descr,
A: *const rocsparse_float_complex,
ld: rocsparse_int,
nnz_per_row_columns: *mut rocsparse_int,
nnz_total_dev_host_ptr: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_znnz(
handle: rocsparse_handle,
dir: rocsparse_direction,
m: rocsparse_int,
n: rocsparse_int,
descr: rocsparse_mat_descr,
A: *const rocsparse_double_complex,
ld: rocsparse_int,
nnz_per_row_columns: *mut rocsparse_int,
nnz_total_dev_host_ptr: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n Given a sparse CSR matrix and a non-negative tolerance, this function computes how many entries would be left\n in each row of the matrix if elements less than the tolerance were removed. It also computes the total number\n of remaining elements in the matrix.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n\n @param[in]\n m number of rows of the sparse CSR matrix.\n\n @param[in]\n descr_A the descriptor of the sparse CSR matrix.\n\n @param[in]\n csr_val_A array of \\p nnz_A elements of the sparse CSR matrix.\n @param[in]\n csr_row_ptr_A array of \\p m+1 elements that point to the start of every row of the\n uncompressed sparse CSR matrix.\n @param[out]\n nnz_per_row array of length \\p m containing the number of entries that will be kept per row in\n the final compressed CSR matrix.\n @param[out]\n nnz_C number of elements in the column indices and values arrays of the compressed\n sparse CSR matrix. It can be either a host or device pointer.\n @param[in]\n tol the non-negative tolerance used for compression. If \\p tol is complex, then only the magnitude\n of the real part is used. Entries in the input uncompressed CSR array that are below the tolerance\n are removed in the output compressed CSR matrix.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m or \\p n is invalid.\n \\retval rocsparse_status_invalid_value \\p tol is invalid.\n \\retval rocsparse_status_invalid_pointer \\p csr_val_A, \\p csr_row_ptr_A, \\p nnz_per_row, or \\p nnz_C\n pointer is invalid.\n\n \\par Example\n \\snippet example_rocsparse_nnz_compress.cpp doc example\n/\n/**@{"]
pub fn rocsparse_snnz_compress(
handle: rocsparse_handle,
m: rocsparse_int,
descr_A: rocsparse_mat_descr,
csr_val_A: *const f32,
csr_row_ptr_A: *const rocsparse_int,
nnz_per_row: *mut rocsparse_int,
nnz_C: *mut rocsparse_int,
tol: f32,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dnnz_compress(
handle: rocsparse_handle,
m: rocsparse_int,
descr_A: rocsparse_mat_descr,
csr_val_A: *const f64,
csr_row_ptr_A: *const rocsparse_int,
nnz_per_row: *mut rocsparse_int,
nnz_C: *mut rocsparse_int,
tol: f64,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cnnz_compress(
handle: rocsparse_handle,
m: rocsparse_int,
descr_A: rocsparse_mat_descr,
csr_val_A: *const rocsparse_float_complex,
csr_row_ptr_A: *const rocsparse_int,
nnz_per_row: *mut rocsparse_int,
nnz_C: *mut rocsparse_int,
tol: rocsparse_float_complex,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_znnz_compress(
handle: rocsparse_handle,
m: rocsparse_int,
descr_A: rocsparse_mat_descr,
csr_val_A: *const rocsparse_double_complex,
csr_row_ptr_A: *const rocsparse_int,
nnz_per_row: *mut rocsparse_int,
nnz_C: *mut rocsparse_int,
tol: rocsparse_double_complex,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\details\n \\p rocsparse_prune_csr2csr_buffer_size returns the size of the temporary buffer that\n is required by \\ref rocsparse_sprune_csr2csr_nnz \"rocsparse_Xprune_csr2csr_nnz()\" and\n \\ref rocsparse_sprune_csr2csr \"rocsparse_Xprune_csr2csr()\". The temporary storage\n buffer must be allocated by the user.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows in the sparse CSR matrix.\n @param[in]\n n number of columns in the sparse CSR matrix.\n @param[in]\n nnz_A number of non-zeros in the sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_descr_A descriptor of the sparse CSR matrix \\f$A\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n csr_val_A array of \\p nnz_A elements containing the values of the sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_row_ptr_A array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_col_ind_A array of \\p nnz_A elements containing the column indices of the sparse CSR matrix \\f$A\\f$.\n @param[in]\n threshold pointer to the non-negative pruning threshold, which can exist in either host or device memory.\n @param[in]\n csr_descr_C descriptor of the sparse CSR matrix \\f$C\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n csr_val_C array of \\p nnz_C elements containing the values of the sparse CSR matrix \\f$C\\f$.\n @param[in]\n csr_row_ptr_C array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$C\\f$.\n @param[in]\n csr_col_ind_C array of \\p nnz_C elements containing the column indices of the sparse CSR matrix \\f$C\\f$.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n \\ref rocsparse_sprune_csr2csr_nnz \"rocsparse_Xprune_csr2csr_nnz()\" and\n \\ref rocsparse_sprune_csr2csr \"rocsparse_Xprune_csr2csr()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p buffer_size pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n\n/\n/**@{"]
pub fn rocsparse_sprune_csr2csr_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz_A: rocsparse_int,
csr_descr_A: rocsparse_mat_descr,
csr_val_A: *const f32,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
threshold: *const f32,
csr_descr_C: rocsparse_mat_descr,
csr_val_C: *const f32,
csr_row_ptr_C: *const rocsparse_int,
csr_col_ind_C: *const rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dprune_csr2csr_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz_A: rocsparse_int,
csr_descr_A: rocsparse_mat_descr,
csr_val_A: *const f64,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
threshold: *const f64,
csr_descr_C: rocsparse_mat_descr,
csr_val_C: *const f64,
csr_row_ptr_C: *const rocsparse_int,
csr_col_ind_C: *const rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\details\n \\p rocsparse_prune_csr2csr_nnz computes the number of non-zero elements per row and the total\n number of non-zero elements in a sparse CSR matrix after elements less than the threshold are\n pruned from the matrix.\n\n \\note The routine supports asynchronous execution if the pointer mode is set to device.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows in the sparse CSR matrix.\n @param[in]\n n number of columns in the sparse CSR matrix.\n @param[in]\n nnz_A number of non-zeros in the sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_descr_A descriptor of the sparse CSR matrix \\f$A\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n csr_val_A array of \\p nnz_A elements containing the values of the sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_row_ptr_A array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_col_ind_A array of \\p nnz_A elements containing the column indices of the sparse CSR matrix \\f$A\\f$.\n @param[in]\n threshold pointer to the non-negative pruning threshold which can exist in either host or device memory.\n @param[in]\n csr_descr_C descriptor of the sparse CSR matrix \\f$C\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[out]\n csr_row_ptr_C array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$C\\f$.\n @param[out]\n nnz_total_dev_host_ptr total number of non-zero elements in device or host memory.\n @param[out]\n temp_buffer buffer allocated by the user. Its size is determined by calling\n \\ref rocsparse_sprune_csr2csr_buffer_size \"rocsparse_Xprune_csr2csr_buffer_size()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p nnz_A is invalid.\n \\retval rocsparse_status_invalid_pointer \\p threshold, \\p csr_descr_A, \\p csr_descr_C, \\p csr_val_A,\n \\p csr_row_ptr_A, \\p csr_col_ind_A, \\p csr_row_ptr_C, \\p nnz_total_dev_host_ptr,\n or \\p temp_buffer pointer is invalid.\n\n/\n/**@{"]
pub fn rocsparse_sprune_csr2csr_nnz(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz_A: rocsparse_int,
csr_descr_A: rocsparse_mat_descr,
csr_val_A: *const f32,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
threshold: *const f32,
csr_descr_C: rocsparse_mat_descr,
csr_row_ptr_C: *mut rocsparse_int,
nnz_total_dev_host_ptr: *mut rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dprune_csr2csr_nnz(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz_A: rocsparse_int,
csr_descr_A: rocsparse_mat_descr,
csr_val_A: *const f64,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
threshold: *const f64,
csr_descr_C: rocsparse_mat_descr,
csr_row_ptr_C: *mut rocsparse_int,
nnz_total_dev_host_ptr: *mut rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief Convert and prune sparse CSR matrix \\f$A\\f$ into a sparse CSR matrix \\f$C\\f$.\n\n \\details\n This function converts the sparse CSR matrix \\f$A\\f$ into a sparse CSR matrix \\f$C\\f$ by pruning values in \\f$A\\f$\n that are less than a threshold.\n\n The conversion involves three steps. First, call\n \\ref rocsparse_sprune_csr2csr_buffer_size \"rocsparse_Xprune_csr2csr_buffer_size()\"\n to determine the size of the temporary storage buffer. Allocate this buffer as well as the array\n \\p csr_row_ptr_C to have \\p m+1 elements. Then call\n \\ref rocsparse_sprune_csr2csr_nnz \"rocsparse_Xprune_csr2csr_nnz()\", which fills\n in the \\p csr_row_ptr_C array and stores the number of elements that are larger than the pruning threshold\n in \\p nnz_total_dev_host_ptr. Now that the number of non-zeros larger than the pruning threshold is known,\n use this information to allocate the \\p csr_col_ind_C and \\p csr_val_C arrays and then call\n \\p rocsparse_prune_csr2csr to complete the conversion. After the conversion is complete, the temporary storage\n buffer can be freed.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows in the sparse CSR matrix.\n @param[in]\n n number of columns in the sparse CSR matrix.\n @param[in]\n nnz_A number of non-zeros in the sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_descr_A descriptor of the sparse CSR matrix \\f$A\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n csr_val_A array of \\p nnz_A elements containing the values of the sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_row_ptr_A array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_col_ind_A array of \\p nnz_A elements containing the column indices of the sparse CSR matrix \\f$A\\f$.\n @param[in]\n threshold pointer to the non-negative pruning threshold, which can exist in either host or device memory.\n @param[in]\n csr_descr_C descriptor of the sparse CSR matrix \\f$C\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[out]\n csr_val_C array of \\p nnz_C elements containing the values of the sparse CSR matrix \\f$C\\f$.\n @param[in]\n csr_row_ptr_C array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$C\\f$.\n @param[out]\n csr_col_ind_C array of \\p nnz_C elements containing the column indices of the sparse CSR matrix \\f$C\\f$.\n @param[in]\n temp_buffer buffer allocated by the user. Its size is determined by calling\n \\ref rocsparse_sprune_csr2csr_buffer_size \"rocsparse_Xprune_csr2csr_buffer_size()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p nnz_A is invalid.\n \\retval rocsparse_status_invalid_pointer \\p threshold, \\p csr_descr_A, \\p csr_descr_C, \\p csr_val_A,\n \\p csr_row_ptr_A, \\p csr_col_ind_A, \\p csr_val_C, \\p csr_row_ptr_C, \\p csr_col_ind_C,\n or \\p temp_buffer pointer is invalid.\n\n \\par Example\n \\snippet example_rocsparse_prune_csr2csr.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sprune_csr2csr(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz_A: rocsparse_int,
csr_descr_A: rocsparse_mat_descr,
csr_val_A: *const f32,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
threshold: *const f32,
csr_descr_C: rocsparse_mat_descr,
csr_val_C: *mut f32,
csr_row_ptr_C: *const rocsparse_int,
csr_col_ind_C: *mut rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dprune_csr2csr(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz_A: rocsparse_int,
csr_descr_A: rocsparse_mat_descr,
csr_val_A: *const f64,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
threshold: *const f64,
csr_descr_C: rocsparse_mat_descr,
csr_val_C: *mut f64,
csr_row_ptr_C: *const rocsparse_int,
csr_col_ind_C: *mut rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\details\n \\p rocsparse_prune_csr2csr_by_percentage_buffer_size returns the size of the temporary buffer that\n is required by \\ref rocsparse_sprune_csr2csr_nnz_by_percentage \"rocsparse_Xprune_csr2csr_nnz_by_percentage()\"\n and \\ref rocsparse_sprune_csr2csr_by_percentage \"rocsparse_Xprune_csr2csr_by_percentage()\". The temporary\n storage buffer must be allocated by the user.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows in the sparse CSR matrix.\n @param[in]\n n number of columns in the sparse CSR matrix.\n @param[in]\n nnz_A number of non-zeros in the sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_descr_A descriptor of the sparse CSR matrix \\f$A\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n csr_val_A array of \\p nnz_A elements containing the values of the sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_row_ptr_A array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_col_ind_A array of \\p nnz_A elements containing the column indices of the sparse CSR matrix \\f$A\\f$.\n @param[in]\n percentage \\p percentage>=0 and \\p percentage<=100.\n @param[in]\n csr_descr_C descriptor of the sparse CSR matrix \\f$C\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n csr_val_C array of \\p nnz_C elements containing the values of the sparse CSR matrix \\f$C\\f$.\n @param[in]\n csr_row_ptr_C array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$C\\f$.\n @param[in]\n csr_col_ind_C array of \\p nnz_C elements containing the column indices of the sparse CSR matrix \\f$C\\f$.\n @param[in]\n info prune info structure.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n \\ref rocsparse_sprune_csr2csr_nnz_by_percentage \"rocsparse_Xprune_csr2csr_nnz_by_percentage()\" and\n \\ref rocsparse_sprune_csr2csr_by_percentage \"rocsparse_Xprune_csr2csr_by_percentage()\"\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p buffer_size pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n\n/\n/**@{"]
pub fn rocsparse_sprune_csr2csr_by_percentage_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz_A: rocsparse_int,
csr_descr_A: rocsparse_mat_descr,
csr_val_A: *const f32,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
percentage: f32,
csr_descr_C: rocsparse_mat_descr,
csr_val_C: *const f32,
csr_row_ptr_C: *const rocsparse_int,
csr_col_ind_C: *const rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dprune_csr2csr_by_percentage_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz_A: rocsparse_int,
csr_descr_A: rocsparse_mat_descr,
csr_val_A: *const f64,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
percentage: f64,
csr_descr_C: rocsparse_mat_descr,
csr_val_C: *const f64,
csr_row_ptr_C: *const rocsparse_int,
csr_col_ind_C: *const rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\details\n \\p rocsparse_prune_csr2csr_nnz_by_percentage computes the number of non-zero elements per row and the total\n number of non-zero elements in a sparse CSR matrix after a \\p percentage of the smallest magnitude elements\n have been pruned from the sparse CSR input matrix. See\n \\ref rocsparse_sprune_csr2csr_by_percentage \"rocsparse_sprune_csr2csr_by_percentage()\" for a more detailed\n description of how this pruning based on \\p percentage works.\n\n \\note The routine supports asynchronous execution if the pointer mode is set to device.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows in the sparse CSR matrix.\n @param[in]\n n number of columns in the sparse CSR matrix.\n @param[in]\n nnz_A number of non-zeros in the sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_descr_A descriptor of the sparse CSR matrix \\f$A\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n csr_val_A array of \\p nnz_A elements containing the values of the sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_row_ptr_A array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_col_ind_A array of \\p nnz_A elements containing the column indices of the sparse CSR matrix \\f$A\\f$.\n @param[in]\n percentage \\p percentage>=0 and \\p percentage<=100.\n @param[in]\n csr_descr_C descriptor of the sparse CSR matrix \\f$C\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[out]\n csr_row_ptr_C array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$C\\f$.\n @param[out]\n nnz_total_dev_host_ptr total number of non-zero elements in device or host memory.\n @param[in]\n info prune info structure.\n @param[out]\n temp_buffer buffer allocated by the user. Its size is determined by calling\n \\ref rocsparse_sprune_csr2csr_by_percentage_buffer_size \"rocsparse_Xprune_csr2csr_by_percentage_buffer_size()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, \\p nnz_A, or \\p percentage is invalid.\n \\retval rocsparse_status_invalid_pointer \\p csr_descr_A, \\p csr_descr_C, \\p info, \\p csr_val_A,\n \\p csr_row_ptr_A, \\p csr_col_ind_A, \\p csr_row_ptr_C, \\p nnz_total_dev_host_ptr,\n or \\p temp_buffer pointer is invalid.\n\n/\n/**@{"]
pub fn rocsparse_sprune_csr2csr_nnz_by_percentage(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz_A: rocsparse_int,
csr_descr_A: rocsparse_mat_descr,
csr_val_A: *const f32,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
percentage: f32,
csr_descr_C: rocsparse_mat_descr,
csr_row_ptr_C: *mut rocsparse_int,
nnz_total_dev_host_ptr: *mut rocsparse_int,
info: rocsparse_mat_info,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dprune_csr2csr_nnz_by_percentage(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz_A: rocsparse_int,
csr_descr_A: rocsparse_mat_descr,
csr_val_A: *const f64,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
percentage: f64,
csr_descr_C: rocsparse_mat_descr,
csr_row_ptr_C: *mut rocsparse_int,
nnz_total_dev_host_ptr: *mut rocsparse_int,
info: rocsparse_mat_info,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief Convert and prune by percentage a sparse CSR matrix \\f$A\\f$ into a sparse CSR matrix \\f$C\\f$.\n\n \\details\n This function converts the sparse CSR matrix \\f$A\\f$ into a sparse CSR matrix \\f$C\\f$ by pruning values in \\f$A\\f$\n that are less than a threshold. This threshold is determined by using a \\p percentage and the following steps:\n\n <b>Step 1</b>: First, the \\p csr_val_A array is sorted in ascending order using the absolute value of each entry:\n \\f[\n csr\\_val\\_A\\_sorted = sort(abs(csr\\_val\\_A))\n \\f]\n\n <b>Step 2</b>: Next, use the \\p percentage parameter to determine the threshold:\n \\f[\n pos = ceil(nnz\\_A \\times (percentage/100)) - 1 \\\\\n pos = \\min(pos, nnz\\_A - 1) \\\\\n pos = \\max(pos, 0) \\\\\n threshold = csr\\_val\\_A\\_sorted[pos]\n \\f]\n\n <b>Step 3</b>: Finally, use this threshold with the routine\n \\ref rocsparse_sprune_csr2csr \"rocsparse_Xprune_csr2csr()\" to complete the conversion.\n\n The conversion involves three steps. First, call\n \\ref rocsparse_sprune_csr2csr_by_percentage_buffer_size \"rocsparse_Xprune_csr2csr_by_percentage_buffer_size()\"\n to determine the size of the temporary storage buffer. Allocate this buffer as well as the array\n \\p csr_row_ptr_C to have \\p m+1 elements. Then call\n \\ref rocsparse_sprune_csr2csr_nnz_by_percentage \"rocsparse_Xprune_csr2csr_nnz_by_percentage()\" which fills\n in the \\p csr_row_ptr_C array and stores the number of elements that are larger than the pruning threshold\n in \\p nnz_total_dev_host_ptr. Now that the number of non-zeros larger than the pruning threshold is known,\n use this information to allocate the \\p csr_col_ind_C and \\p csr_val_C arrays and then call\n \\p rocsparse_prune_csr2csr_by_percentage to complete the conversion. After the conversion is complete, the\n temporary storage buffer can be freed.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows in the sparse CSR matrix.\n @param[in]\n n number of columns in the sparse CSR matrix.\n @param[in]\n nnz_A number of non-zeros in the sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_descr_A descriptor of the sparse CSR matrix \\f$A\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n csr_val_A array of \\p nnz_A elements containing the values of the sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_row_ptr_A array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_col_ind_A array of \\p nnz_A elements containing the column indices of the sparse CSR matrix \\f$A\\f$.\n @param[in]\n percentage \\p percentage>=0 and \\p percentage<=100.\n @param[in]\n csr_descr_C descriptor of the sparse CSR matrix \\f$C\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[out]\n csr_val_C array of \\p nnz_C elements containing the values of the sparse CSR matrix \\f$C\\f$.\n @param[in]\n csr_row_ptr_C array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$C\\f$.\n @param[out]\n csr_col_ind_C array of \\p nnz_C elements containing the column indices of the sparse CSR matrix \\f$C\\f$.\n @param[in]\n info prune info structure.\n @param[in]\n temp_buffer buffer allocated by the user. Its size is determined by calling\n \\ref rocsparse_sprune_csr2csr_buffer_size \"rocsparse_Xprune_csr2csr_buffer_size()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, \\p nnz_A, or \\p percentage is invalid.\n \\retval rocsparse_status_invalid_pointer \\p csr_descr_A, \\p csr_descr_C, \\p info, \\p csr_val_A,\n \\p csr_row_ptr_A, \\p csr_col_ind_A, \\p csr_val_C, \\p csr_row_ptr_C, \\p csr_col_ind_C,\n or \\p temp_buffer pointer is invalid.\n\n \\par Example\n \\snippet example_rocsparse_prune_csr2csr_by_percentage.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sprune_csr2csr_by_percentage(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz_A: rocsparse_int,
csr_descr_A: rocsparse_mat_descr,
csr_val_A: *const f32,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
percentage: f32,
csr_descr_C: rocsparse_mat_descr,
csr_val_C: *mut f32,
csr_row_ptr_C: *const rocsparse_int,
csr_col_ind_C: *mut rocsparse_int,
info: rocsparse_mat_info,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dprune_csr2csr_by_percentage(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz_A: rocsparse_int,
csr_descr_A: rocsparse_mat_descr,
csr_val_A: *const f64,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
percentage: f64,
csr_descr_C: rocsparse_mat_descr,
csr_val_C: *mut f64,
csr_row_ptr_C: *const rocsparse_int,
csr_col_ind_C: *mut rocsparse_int,
info: rocsparse_mat_info,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\details\n \\p rocsparse_prune_dense2csr_buffer_size returns the size of the temporary buffer that\n is required by \\ref rocsparse_sprune_dense2csr_nnz \"rocsparse_Xprune_dense2csr_nnz()\" and\n \\ref rocsparse_sprune_dense2csr \"rocsparse_Xprune_dense2csr()\". The temporary storage\n buffer must be allocated by the user.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the dense matrix \\p A.\n @param[in]\n n number of columns of the dense matrix \\p A.\n @param[in]\n A array of dimensions (\\p lda, \\p n).\n @param[in]\n lda leading dimension of dense array \\p A.\n @param[in]\n threshold pointer to the pruning non-negative threshold which can exist in either host or device memory.\n @param[in]\n descr the descriptor of the dense matrix \\p A, the supported matrix type is \\ref rocsparse_matrix_type_general and\n also any valid value of the \\ref rocsparse_index_base.\n @param[in]\n csr_val array of nnz ( = \\p csr_row_ptr[m] - \\p csr_row_ptr[0] ) non-zero elements of matrix \\p A.\n @param[in]\n csr_row_ptr integer array of \\p m+1 elements that contains the start of every row and the end of the last row plus one.\n @param[in]\n csr_col_ind integer array of nnz ( = \\p csr_row_ptr[m] - \\p csr_row_ptr[0] ) column indices of the non-zero elements of matrix \\p A.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n \\ref rocsparse_sprune_dense2csr_nnz \"rocsparse_Xprune_dense2csr_nnz()\" and\n \\ref rocsparse_sprune_dense2csr \"rocsparse_Xprune_dense2csr()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p buffer_size pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n/\n/**@{"]
pub fn rocsparse_sprune_dense2csr_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
A: *const f32,
lda: rocsparse_int,
threshold: *const f32,
descr: rocsparse_mat_descr,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dprune_dense2csr_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
A: *const f64,
lda: rocsparse_int,
threshold: *const f64,
descr: rocsparse_mat_descr,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\details\n \\p rocsparse_prune_dense2csr_nnz computes the number of non-zero elements per row and the total\n number of non-zero elements in a sparse CSR matrix after elements less than the threshold are\n pruned from the matrix.\n\n \\note\n The routine supports asynchronous execution if the pointer mode is set to device.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the dense matrix \\p A.\n @param[in]\n n number of columns of the dense matrix \\p A.\n @param[in]\n A array of dimensions (\\p lda, \\p n).\n @param[in]\n lda leading dimension of dense array \\p A.\n @param[in]\n threshold pointer to the pruning non-negative threshold which can exist in either host or device memory.\n @param[in]\n descr the descriptor of the dense matrix \\p A.\n @param[out]\n csr_row_ptr integer array of \\p m+1 elements that contains the start of every row and the end of the last row plus one.\n @param[out]\n nnz_total_dev_host_ptr total number of non-zero elements in device or host memory.\n @param[out]\n temp_buffer buffer allocated by the user. Its size is determined by calling\n \\ref rocsparse_sprune_dense2csr_buffer_size \"rocsparse_Xprune_dense2csr_buffer_size()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p lda is invalid.\n \\retval rocsparse_status_invalid_pointer \\p A, \\p threshold, \\p descr, \\p csr_row_ptr,\n \\p nnz_total_dev_host_ptr, or \\p temp_buffer pointer is invalid.\n/\n/**@{"]
pub fn rocsparse_sprune_dense2csr_nnz(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
A: *const f32,
lda: rocsparse_int,
threshold: *const f32,
descr: rocsparse_mat_descr,
csr_row_ptr: *mut rocsparse_int,
nnz_total_dev_host_ptr: *mut rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dprune_dense2csr_nnz(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
A: *const f64,
lda: rocsparse_int,
threshold: *const f64,
descr: rocsparse_mat_descr,
csr_row_ptr: *mut rocsparse_int,
nnz_total_dev_host_ptr: *mut rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief Convert and prune dense matrix \\f$A\\f$ into a sparse CSR matrix \\f$C\\f$.\n\n \\details\n This function converts the dense matrix \\f$A\\f$ into a sparse CSR matrix \\f$C\\f$ by pruning values in \\f$A\\f$\n that are less than a threshold.\n\n The conversion involves three steps. First, call\n \\ref rocsparse_sprune_dense2csr_buffer_size \"rocsparse_Xprune_dense2csr_buffer_size()\"\n to determine the size of the temporary storage buffer. Allocate this buffer as well as the array\n \\p csr_row_ptr to have \\p m+1 elements. Then call\n \\ref rocsparse_sprune_dense2csr_nnz \"rocsparse_Xprune_dense2csr_nnz()\", which fills\n in the \\p csr_row_ptr array and stores the number of elements that are larger than the pruning \\p threshold\n in \\p nnz_total_dev_host_ptr. Now that the number of non-zeros larger than the pruning \\p threshold is known,\n use this information to allocate the \\p csr_col_ind and \\p csr_val arrays and then call\n \\p rocsparse_prune_dense2csr to complete the conversion. After the conversion is complete, the temporary storage\n buffer can be freed.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the dense matrix \\p A.\n @param[in]\n n number of columns of the dense matrix \\p A.\n @param[in]\n A array of dimensions (\\p lda, \\p n).\n @param[in]\n lda leading dimension of dense array \\p A.\n @param[in]\n threshold pointer to the non-negative pruning threshold, which can exist in either host or device memory.\n @param[in]\n descr the descriptor of the dense matrix \\p A. The supported matrix type is \\ref rocsparse_matrix_type_general and\n also any valid value of the \\ref rocsparse_index_base.\n @param[out]\n csr_val array of nnz ( = \\p csr_row_ptr[m] - \\p csr_row_ptr[0] ) non-zero elements of matrix \\p A.\n @param[in]\n csr_row_ptr integer array of \\p m+1 elements that contains the start of every row and the end of the last row plus one.\n @param[out]\n csr_col_ind integer array of nnz ( = \\p csr_row_ptr[m] - \\p csr_row_ptr[0] ) column indices of the non-zero elements of matrix \\p A.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user. The size is returned by\n \\ref rocsparse_sprune_dense2csr_buffer_size \"rocsparse_Xprune_dense2csr_buffer_size()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p lda is invalid.\n \\retval rocsparse_status_invalid_pointer \\p A, \\p descr, \\p threshold, \\p csr_val,\n \\p csr_row_ptr, \\p csr_col_ind, or \\p temp_buffer pointer is invalid.\n\n \\par Example\n \\snippet example_rocsparse_prune_dense2csr.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sprune_dense2csr(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
A: *const f32,
lda: rocsparse_int,
threshold: *const f32,
descr: rocsparse_mat_descr,
csr_val: *mut f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *mut rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dprune_dense2csr(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
A: *const f64,
lda: rocsparse_int,
threshold: *const f64,
descr: rocsparse_mat_descr,
csr_val: *mut f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *mut rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\details\n \\p rocsparse_prune_dense2csr_by_percentage_buffer_size returns the size of the temporary buffer that\n is required by \\ref rocsparse_sprune_dense2csr_nnz_by_percentage \"rocsparse_Xprune_dense2csr_nnz_by_percentage()\"\n and \\ref rocsparse_sprune_dense2csr_by_percentage \"rocsparse_Xprune_dense2csr_by_percentage()\". The temporary\n storage buffer must be allocated by the user.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the dense matrix \\p A.\n @param[in]\n n number of columns of the dense matrix \\p A.\n @param[in]\n A array of dimensions (\\p lda, \\p n).\n @param[in]\n lda leading dimension of dense array \\p A.\n @param[in]\n percentage \\p percentage>=0 and \\p percentage<=100.\n @param[in]\n descr the descriptor of the dense matrix \\p A. The supported matrix type is \\ref rocsparse_matrix_type_general\n and also any valid value of the \\ref rocsparse_index_base.\n @param[in]\n csr_val array of nnz ( = \\p csr_row_ptr[m] - \\p csr_row_ptr[0] ) non-zero elements of matrix \\p A.\n @param[in]\n csr_row_ptr integer array of \\p m+1 elements that contains the start of every row and the end of the last row plus one.\n @param[in]\n csr_col_ind integer array of nnz ( = \\p csr_row_ptr[m] - \\p csr_row_ptr[0] ) column indices of the non-zero elements of matrix \\p A.\n @param[in]\n info prune information structure.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n \\ref rocsparse_sprune_dense2csr_nnz_by_percentage \"rocsparse_Xprune_dense2csr_nnz_by_percentage()\" and\n \\ref rocsparse_sprune_dense2csr_by_percentage \"rocsparse_Xprune_dense2csr_by_percentage()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p buffer_size pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n/\n/**@{"]
pub fn rocsparse_sprune_dense2csr_by_percentage_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
A: *const f32,
lda: rocsparse_int,
percentage: f32,
descr: rocsparse_mat_descr,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dprune_dense2csr_by_percentage_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
A: *const f64,
lda: rocsparse_int,
percentage: f64,
descr: rocsparse_mat_descr,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\details\n \\p rocsparse_sprune_dense2csr_nnz_by_percentage computes the number of non-zero elements per row and the total\n number of non-zero elements in a sparse CSR matrix after a \\p percentage of the smallest magnitude elements\n have been pruned from the dense input matrix. See\n \\ref rocsparse_sprune_dense2csr_by_percentage \"rocsparse_sprune_dense2csr_by_percentage()\" for a more detailed\n description of how this pruning based on \\p percentage works.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the dense matrix \\p A.\n @param[in]\n n number of columns of the dense matrix \\p A.\n @param[in]\n A array of dimensions (\\p lda, \\p n).\n @param[in]\n lda leading dimension of dense array \\p A.\n @param[in]\n percentage \\p percentage>=0 and \\p percentage<=100.\n @param[in]\n descr the descriptor of the dense matrix \\p A.\n @param[out]\n csr_row_ptr integer array of \\p m+1 elements that contains the start of every row and the end of the last row plus one.\n @param[out]\n nnz_total_dev_host_ptr total number of non-zero elements in device or host memory.\n @param[in]\n info prune information structure.\n @param[out]\n temp_buffer buffer allocated by the user. Its size is determined by calling\n \\ref rocsparse_sprune_dense2csr_by_percentage_buffer_size \"rocsparse_Xprune_dense2csr_by_percentage_buffer_size()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, \\p lda, or \\p percentage is invalid.\n \\retval rocsparse_status_invalid_pointer \\p A, \\p descr, \\p info, \\p csr_row_ptr,\n \\p nnz_total_dev_host_ptr, or \\p temp_buffer pointer is invalid.\n/\n/**@{"]
pub fn rocsparse_sprune_dense2csr_nnz_by_percentage(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
A: *const f32,
lda: rocsparse_int,
percentage: f32,
descr: rocsparse_mat_descr,
csr_row_ptr: *mut rocsparse_int,
nnz_total_dev_host_ptr: *mut rocsparse_int,
info: rocsparse_mat_info,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dprune_dense2csr_nnz_by_percentage(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
A: *const f64,
lda: rocsparse_int,
percentage: f64,
descr: rocsparse_mat_descr,
csr_row_ptr: *mut rocsparse_int,
nnz_total_dev_host_ptr: *mut rocsparse_int,
info: rocsparse_mat_info,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup conv_module\n \\brief\n This function converts the matrix \\f$A\\f$ in dense format into a sparse matrix in CSR format while pruning values\n based on percentage.\n\n \\details\n This function converts the dense column-oriented matrix \\f$A\\f$ into a sparse CSR matrix \\f$C\\f$ by pruning values in \\f$A\\f$\n that are less than a threshold. This threshold is determined by using a \\p percentage and the following steps:\n\n <b>Step 1</b>: First, the \\p A array is sorted in ascending order using the absolute value of each entry:\n \\f[\n A\\_sorted = sort(abs(A))\n \\f]\n\n <b>Step 2</b>: Next, use the \\p percentage parameter to determine the threshold:\n \\f[\n pos = ceil(m \\times n \\times (percentage/100)) - 1 \\\\\n pos = \\min(pos, m \\times n - 1) \\\\\n pos = \\max(pos, 0) \\\\\n threshold = A\\_sorted[pos]\n \\f]\n\n <b>Step 3</b>: Finally, use this threshold with the routine\n \\ref rocsparse_sprune_dense2csr \"rocsparse_Xprune_dense2csr()\" to complete the conversion.\n\n The conversion involves three steps. First, call\n \\ref rocsparse_sprune_dense2csr_by_percentage_buffer_size \"rocsparse_Xprune_dense2csr_by_percentage_buffer_size()\"\n to determine the size of the temporary storage buffer. Allocate this buffer as well as the array\n \\p csr_row_ptr to have \\p m+1 elements. Then call\n \\ref rocsparse_sprune_dense2csr_nnz_by_percentage \"rocsparse_Xprune_dense2csr_nnz_by_percentage()\", which fills\n in the \\p csr_row_ptr array and stores the number of elements that are larger than the pruning threshold\n in \\p nnz_total_dev_host_ptr. Now that the number of non-zeros larger than the pruning threshold is known,\n use this information to allocate the \\p csr_col_ind and \\p csr_val arrays and then call\n \\p rocsparse_prune_dense2csr_by_percentage to complete the conversion. After the conversion is complete, the\n temporary storage buffer can be freed.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the dense matrix \\p A.\n @param[in]\n n number of columns of the dense matrix \\p A.\n @param[in]\n A array of dimensions (\\p lda, \\p n).\n @param[in]\n lda leading dimension of dense array \\p A.\n @param[in]\n percentage \\p percentage>=0 and \\p percentage<=100.\n @param[in]\n descr the descriptor of the dense matrix \\p A. The supported matrix type is \\ref rocsparse_matrix_type_general and\n also any valid value of the \\ref rocsparse_index_base.\n @param[out]\n csr_val array of nnz ( = \\p csr_row_ptr[m] - \\p csr_row_ptr[0] ) non-zero elements of matrix \\p A.\n @param[in]\n csr_row_ptr integer array of \\p m+1 elements that contains the start of every row and the end of the last row plus one.\n @param[out]\n csr_col_ind integer array of nnz ( = \\p csr_row_ptr[m] - \\p csr_row_ptr[0] ) column indices of the non-zero elements of matrix \\p A.\n @param[in]\n info prune information structure.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user. The size is returned by\n \\ref rocsparse_sprune_dense2csr_by_percentage_buffer_size \"rocsparse_Xprune_dense2csr_by_percentage_buffer_size()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, \\p lda, or \\p percentage is invalid.\n \\retval rocsparse_status_invalid_pointer \\p A, \\p descr, \\p info, \\p csr_val,\n \\p csr_row_ptr, \\p csr_col_ind, or \\p temp_buffer pointer is invalid.\n\n \\par Example\n \\snippet example_rocsparse_prune_dense2csr_by_percentage.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sprune_dense2csr_by_percentage(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
A: *const f32,
lda: rocsparse_int,
percentage: f32,
descr: rocsparse_mat_descr,
csr_val: *mut f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *mut rocsparse_int,
info: rocsparse_mat_info,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dprune_dense2csr_by_percentage(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
A: *const f64,
lda: rocsparse_int,
percentage: f64,
descr: rocsparse_mat_descr,
csr_val: *mut f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *mut rocsparse_int,
info: rocsparse_mat_info,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup extra_module\n \\details\n \\p rocsparse_bsrgeam_nnzb computes the total BSR non-zero elements and the BSR row\n offsets that point to the start of every row of the sparse BSR matrix of the\n resulting matrix C. It is assumed that \\p bsr_row_ptr_C has been allocated with\n size \\p mb+1.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n Currently, only \\ref rocsparse_matrix_type_general is supported.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir direction that specifies whether to count non-zero elements by \\ref rocsparse_direction_row or by\n \\ref rocsparse_direction_column in the BSR matrices \\f$A\\f$, \\f$B\\f$, and \\f$C\\f$.\n @param[in]\n mb number of block rows in the sparse BSR matrix \\f$op(A)\\f$ and \\f$C\\f$.\n @param[in]\n nb number of block columns of the sparse BSR matrix \\f$op(B)\\f$ and\n \\f$C\\f$.\n @param[in]\n block_dim the block dimension of the BSR matrix \\f$A\\f$. Between 1 and m where \\p m=mb*block_dim.\n @param[in]\n descr_A descriptor of the sparse BSR matrix \\f$A\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnzb_A number of non-zero block entries of the sparse BSR matrix \\f$A\\f$.\n @param[in]\n bsr_row_ptr_A array of \\p mb+1 elements that point to the start of every block row of the\n sparse BSR matrix \\f$A\\f$.\n @param[in]\n bsr_col_ind_A array of \\p nnzb_A elements containing the column indices of the\n sparse BSR matrix \\f$A\\f$.\n @param[in]\n descr_B descriptor of the sparse BSR matrix \\f$B\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnzb_B number of non-zero block entries of the sparse BSR matrix \\f$B\\f$.\n @param[in]\n bsr_row_ptr_B array of \\p mb+1 elements that point to the start of every block row of the\n sparse BSR matrix \\f$B\\f$.\n @param[in]\n bsr_col_ind_B array of \\p nnzb_B elements containing the block column indices of the\n sparse BSR matrix \\f$B\\f$.\n @param[in]\n descr_C descriptor of the sparse BSR matrix \\f$C\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[out]\n bsr_row_ptr_C array of \\p mb+1 elements that point to the start of every block row of the\n sparse BSR matrix \\f$C\\f$.\n @param[out]\n nnzb_C pointer to the number of non-zero block entries of the sparse BSR\n matrix \\f$C\\f$. \\p nnzb_C can be a host or device pointer.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nb, \\p kb, \\p nnzb_A, or \\p nnzb_B is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr_A, \\p bsr_row_ptr_A,\n \\p bsr_col_ind_A, \\p descr_B, \\p bsr_row_ptr_B, \\p bsr_col_ind_B,\n \\p descr_C, \\p bsr_row_ptr_C, or \\p nnzb_C is invalid.\n \\retval rocsparse_status_not_implemented\n \\p rocsparse_matrix_type != \\ref rocsparse_matrix_type_general."]
pub fn rocsparse_bsrgeam_nnzb(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
block_dim: rocsparse_int,
descr_A: rocsparse_mat_descr,
nnzb_A: rocsparse_int,
bsr_row_ptr_A: *const rocsparse_int,
bsr_col_ind_A: *const rocsparse_int,
descr_B: rocsparse_mat_descr,
nnzb_B: rocsparse_int,
bsr_row_ptr_B: *const rocsparse_int,
bsr_col_ind_B: *const rocsparse_int,
descr_C: rocsparse_mat_descr,
bsr_row_ptr_C: *mut rocsparse_int,
nnzb_C: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup extra_module\n \\brief Sparse matrix sparse matrix addition using the BSR storage format.\n\n \\details\n \\p rocsparse_bsrgeam multiplies the scalar \\f$\\alpha\\f$ with the sparse\n \\f$m \\times n\\f$ matrix \\f$A\\f$, defined in BSR storage format, multiplies the\n scalar \\f$\\beta\\f$ with the sparse \\f$mb \\times nb\\f$ matrix \\f$B\\f$, defined in BSR\n storage format, and adds both resulting matrices to obtain the sparse\n \\f$mb \\times nb\\f$ matrix \\f$C\\f$, defined in BSR storage format, such that\n \\f[\n C := \\alpha \\cdot A + \\beta \\cdot B.\n \\f]\n\n It is assumed that \\p bsr_row_ptr_C has already been filled and that \\p bsr_val_C and\n \\p bsr_col_ind_C are allocated by the user. \\p bsr_row_ptr_C and the allocation size of\n \\p bsr_col_ind_C and \\p bsr_val_C is defined by the number of non-zero block elements of\n the sparse BSR matrix C. Both can be obtained by \\ref rocsparse_bsrgeam_nnzb().\n\n \\note Both scalars \\f$\\alpha\\f$ and \\f$beta\\f$ have to be valid.\n\n \\note Currently, only \\ref rocsparse_matrix_type_general is supported.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir direction that specifies whether to count non-zero elements by \\ref rocsparse_direction_row or by\n \\ref rocsparse_direction_column in the BSR matrices \\f$A\\f$, \\f$B\\f$, and \\f$C\\f$.\n @param[in]\n mb number of rows of the sparse BSR matrix \\f$A\\f$, \\f$B\\f$, and \\f$C\\f$.\n @param[in]\n nb number of columns of the sparse BSR matrix \\f$A\\f$, \\f$B\\f$, and \\f$C\\f$.\n @param[in]\n block_dim the block dimension of the BSR matrix \\f$A\\f$. Between 1 and m where \\p m=mb*block_dim.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n descr_A descriptor of the sparse CSR matrix \\f$A\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnzb_A number of non-zero block entries of the sparse BSR matrix \\f$A\\f$.\n @param[in]\n bsr_val_A array of \\p nnzb_A block elements of the sparse BSR matrix \\f$A\\f$.\n @param[in]\n bsr_row_ptr_A array of \\p mb+1 block elements that point to the start of every block row of the\n sparse BSR matrix \\f$A\\f$.\n @param[in]\n bsr_col_ind_A array of \\p nnzb_A block elements containing the block column indices of the\n sparse BSR matrix \\f$A\\f$.\n @param[in]\n beta scalar \\f$\\beta\\f$.\n @param[in]\n descr_B descriptor of the sparse BSR matrix \\f$B\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnzb_B number of non-zero block entries of the sparse BSR matrix \\f$B\\f$.\n @param[in]\n bsr_val_B array of \\p nnzb_B block elements of the sparse BSR matrix \\f$B\\f$.\n @param[in]\n bsr_row_ptr_B array of \\p mb+1 block elements that point to the start of every block row of the\n sparse BSR matrix \\f$B\\f$.\n @param[in]\n bsr_col_ind_B array of \\p nnzb_B block elements containing the block column indices of the\n sparse BSR matrix \\f$B\\f$.\n @param[in]\n descr_C descriptor of the sparse BSR matrix \\f$C\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[out]\n bsr_val_C array of block elements of the sparse BSR matrix \\f$C\\f$.\n @param[in]\n bsr_row_ptr_C array of \\p mb+1 block elements that point to the start of every block row of the\n sparse BSR matrix \\f$C\\f$.\n @param[out]\n bsr_col_ind_C array of block elements containing the block column indices of the\n sparse BSR matrix \\f$C\\f$.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nb, \\p nnzb_A, or \\p nnzb_B is invalid.\n \\retval rocsparse_status_invalid_pointer \\p alpha, \\p descr_A, \\p bsr_val_A,\n \\p bsr_row_ptr_A, \\p bsr_col_ind_A, \\p beta, \\p descr_B, \\p bsr_val_B,\n \\p bsr_row_ptr_B, \\p bsr_col_ind_B, \\p descr_C, \\p csr_val_C,\n \\p bsr_row_ptr_C, or \\p bsr_col_ind_C is invalid.\n \\retval rocsparse_status_not_implemented\n \\p rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n This example adds two CSR matrices.\n \\snippet example_rocsparse_bsrgeam.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sbsrgeam(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
block_dim: rocsparse_int,
alpha: *const f32,
descr_A: rocsparse_mat_descr,
nnzb_A: rocsparse_int,
bsr_val_A: *const f32,
bsr_row_ptr_A: *const rocsparse_int,
bsr_col_ind_A: *const rocsparse_int,
beta: *const f32,
descr_B: rocsparse_mat_descr,
nnzb_B: rocsparse_int,
bsr_val_B: *const f32,
bsr_row_ptr_B: *const rocsparse_int,
bsr_col_ind_B: *const rocsparse_int,
descr_C: rocsparse_mat_descr,
bsr_val_C: *mut f32,
bsr_row_ptr_C: *const rocsparse_int,
bsr_col_ind_C: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dbsrgeam(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
block_dim: rocsparse_int,
alpha: *const f64,
descr_A: rocsparse_mat_descr,
nnzb_A: rocsparse_int,
bsr_val_A: *const f64,
bsr_row_ptr_A: *const rocsparse_int,
bsr_col_ind_A: *const rocsparse_int,
beta: *const f64,
descr_B: rocsparse_mat_descr,
nnzb_B: rocsparse_int,
bsr_val_B: *const f64,
bsr_row_ptr_B: *const rocsparse_int,
bsr_col_ind_B: *const rocsparse_int,
descr_C: rocsparse_mat_descr,
bsr_val_C: *mut f64,
bsr_row_ptr_C: *const rocsparse_int,
bsr_col_ind_C: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cbsrgeam(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
block_dim: rocsparse_int,
alpha: *const rocsparse_float_complex,
descr_A: rocsparse_mat_descr,
nnzb_A: rocsparse_int,
bsr_val_A: *const rocsparse_float_complex,
bsr_row_ptr_A: *const rocsparse_int,
bsr_col_ind_A: *const rocsparse_int,
beta: *const rocsparse_float_complex,
descr_B: rocsparse_mat_descr,
nnzb_B: rocsparse_int,
bsr_val_B: *const rocsparse_float_complex,
bsr_row_ptr_B: *const rocsparse_int,
bsr_col_ind_B: *const rocsparse_int,
descr_C: rocsparse_mat_descr,
bsr_val_C: *mut rocsparse_float_complex,
bsr_row_ptr_C: *const rocsparse_int,
bsr_col_ind_C: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zbsrgeam(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
block_dim: rocsparse_int,
alpha: *const rocsparse_double_complex,
descr_A: rocsparse_mat_descr,
nnzb_A: rocsparse_int,
bsr_val_A: *const rocsparse_double_complex,
bsr_row_ptr_A: *const rocsparse_int,
bsr_col_ind_A: *const rocsparse_int,
beta: *const rocsparse_double_complex,
descr_B: rocsparse_mat_descr,
nnzb_B: rocsparse_int,
bsr_val_B: *const rocsparse_double_complex,
bsr_row_ptr_B: *const rocsparse_int,
bsr_col_ind_B: *const rocsparse_int,
descr_C: rocsparse_mat_descr,
bsr_val_C: *mut rocsparse_double_complex,
bsr_row_ptr_C: *const rocsparse_int,
bsr_col_ind_C: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup extra_module\n \\details\n \\p rocsparse_bsrgemm_buffer_size returns the size of the temporary storage buffer\n that is required by \\ref rocsparse_bsrgemm_nnzb() and \\ref rocsparse_sbsrgemm \"rocsparse_Xbsrgemm()\".\n The temporary storage buffer must be allocated by the user.\n\n \\note\n This function is blocking with respect to the host.\n \\note\n Currently, only \\p trans_A == \\p trans_B == \\ref rocsparse_operation_none is\n supported.\n \\note\n Currently, only \\ref rocsparse_matrix_type_general is supported.\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir direction that specifies whether to count non-zero elements by \\ref rocsparse_direction_row or by\n \\ref rocsparse_direction_column in the BSR matrices \\f$A\\f$, \\f$B\\f$, \\f$C\\f$, and \\f$D\\f$.\n @param[in]\n trans_A matrix \\f$A\\f$ operation type.\n @param[in]\n trans_B matrix \\f$B\\f$ operation type.\n @param[in]\n mb number of block rows in the sparse BSR matrix \\f$op(A)\\f$ and \\f$C\\f$.\n @param[in]\n nb number of block columns of the sparse BSR matrix \\f$op(B)\\f$ and\n \\f$C\\f$.\n @param[in]\n kb number of block columns of the sparse BSR matrix \\f$op(A)\\f$ and number of\n rows of the sparse BSR matrix \\f$op(B)\\f$.\n @param[in]\n block_dim the block dimension of the BSR matrix \\f$A\\f$, \\f$B\\f$, \\f$C\\f$, and \\f$D\\f$.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n descr_A descriptor of the sparse BSR matrix \\f$A\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnzb_A number of non-zero block entries of the sparse BSR matrix \\f$A\\f$.\n @param[in]\n bsr_row_ptr_A array of \\p mb+1 elements (\\f$op(A) == A\\f$, \\p kb+1 otherwise)\n that point to the start of every block row of the sparse BSR matrix\n \\f$op(A)\\f$.\n @param[in]\n bsr_col_ind_A array of \\p nnzb_A elements containing the block column indices of the\n sparse BSR matrix \\f$A\\f$.\n @param[in]\n descr_B descriptor of the sparse BSR matrix \\f$B\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnzb_B number of non-zero block entries of the sparse BSR matrix \\f$B\\f$.\n @param[in]\n bsr_row_ptr_B array of \\p kb+1 elements (\\f$op(B) == B\\f$, \\p mb+1 otherwise)\n that point to the start of every block row of the sparse BSR matrix\n \\f$op(B)\\f$.\n @param[in]\n bsr_col_ind_B array of \\p nnzb_B elements containing the block column indices of the\n sparse BSR matrix \\f$B\\f$.\n @param[in]\n beta scalar \\f$\\beta\\f$.\n @param[in]\n descr_D descriptor of the sparse BSR matrix \\f$D\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnzb_D number of non-zero block entries of the sparse BSR matrix \\f$D\\f$.\n @param[in]\n bsr_row_ptr_D array of \\p mb+1 elements that point to the start of every block row of the\n sparse BSR matrix \\f$D\\f$.\n @param[in]\n bsr_col_ind_D array of \\p nnzb_D elements containing the block column indices of the sparse\n BSR matrix \\f$D\\f$.\n @param[inout]\n info_C structure that holds metadata for the sparse BSR matrix \\f$C\\f$.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n rocsparse_bsrgemm_nnzb(), rocsparse_sbsrgemm(), rocsparse_dbsrgemm(),\n rocsparse_cbsrgemm(), and rocsparse_zbsrgemm().\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nb, \\p kb, \\p block_dim, \\p nnzb_A, \\p nnzb_B, or\n \\p nnzb_D is invalid.\n \\retval rocsparse_status_invalid_pointer \\p alpha and \\p beta are invalid,\n \\p descr_A, \\p bsr_row_ptr_A, \\p bsr_col_ind_A, \\p descr_B,\n \\p bsr_row_ptr_B, or \\p bsr_col_ind_B are invalid if \\p alpha is valid,\n \\p descr_D, \\p bsr_row_ptr_D, or \\p bsr_col_ind_D is invalid if \\p beta is\n valid, or \\p info_C or \\p buffer_size are invalid.\n \\retval rocsparse_status_not_implemented\n \\p trans_A != \\ref rocsparse_operation_none,\n \\p trans_B != \\ref rocsparse_operation_none, or\n \\p rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n/\n/**@{"]
pub fn rocsparse_sbsrgemm_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
mb: rocsparse_int,
nb: rocsparse_int,
kb: rocsparse_int,
block_dim: rocsparse_int,
alpha: *const f32,
descr_A: rocsparse_mat_descr,
nnzb_A: rocsparse_int,
bsr_row_ptr_A: *const rocsparse_int,
bsr_col_ind_A: *const rocsparse_int,
descr_B: rocsparse_mat_descr,
nnzb_B: rocsparse_int,
bsr_row_ptr_B: *const rocsparse_int,
bsr_col_ind_B: *const rocsparse_int,
beta: *const f32,
descr_D: rocsparse_mat_descr,
nnzb_D: rocsparse_int,
bsr_row_ptr_D: *const rocsparse_int,
bsr_col_ind_D: *const rocsparse_int,
info_C: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dbsrgemm_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
mb: rocsparse_int,
nb: rocsparse_int,
kb: rocsparse_int,
block_dim: rocsparse_int,
alpha: *const f64,
descr_A: rocsparse_mat_descr,
nnzb_A: rocsparse_int,
bsr_row_ptr_A: *const rocsparse_int,
bsr_col_ind_A: *const rocsparse_int,
descr_B: rocsparse_mat_descr,
nnzb_B: rocsparse_int,
bsr_row_ptr_B: *const rocsparse_int,
bsr_col_ind_B: *const rocsparse_int,
beta: *const f64,
descr_D: rocsparse_mat_descr,
nnzb_D: rocsparse_int,
bsr_row_ptr_D: *const rocsparse_int,
bsr_col_ind_D: *const rocsparse_int,
info_C: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cbsrgemm_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
mb: rocsparse_int,
nb: rocsparse_int,
kb: rocsparse_int,
block_dim: rocsparse_int,
alpha: *const rocsparse_float_complex,
descr_A: rocsparse_mat_descr,
nnzb_A: rocsparse_int,
bsr_row_ptr_A: *const rocsparse_int,
bsr_col_ind_A: *const rocsparse_int,
descr_B: rocsparse_mat_descr,
nnzb_B: rocsparse_int,
bsr_row_ptr_B: *const rocsparse_int,
bsr_col_ind_B: *const rocsparse_int,
beta: *const rocsparse_float_complex,
descr_D: rocsparse_mat_descr,
nnzb_D: rocsparse_int,
bsr_row_ptr_D: *const rocsparse_int,
bsr_col_ind_D: *const rocsparse_int,
info_C: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zbsrgemm_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
mb: rocsparse_int,
nb: rocsparse_int,
kb: rocsparse_int,
block_dim: rocsparse_int,
alpha: *const rocsparse_double_complex,
descr_A: rocsparse_mat_descr,
nnzb_A: rocsparse_int,
bsr_row_ptr_A: *const rocsparse_int,
bsr_col_ind_A: *const rocsparse_int,
descr_B: rocsparse_mat_descr,
nnzb_B: rocsparse_int,
bsr_row_ptr_B: *const rocsparse_int,
bsr_col_ind_B: *const rocsparse_int,
beta: *const rocsparse_double_complex,
descr_D: rocsparse_mat_descr,
nnzb_D: rocsparse_int,
bsr_row_ptr_D: *const rocsparse_int,
bsr_col_ind_D: *const rocsparse_int,
info_C: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup extra_module\n \\details\n \\p rocsparse_bsrgemm_nnzb computes the total BSR non-zero block elements and the BSR block row\n offsets that point to the start of every block row of the sparse BSR matrix of the\n resulting multiplied matrix C. It is assumed that \\p bsr_row_ptr_C has been allocated\n with size \\p mb+1.\n The required buffer size can be obtained by\n \\ref rocsparse_sbsrgemm_buffer_size \"rocsparse_Xbsrgemm_buffer_size()\".\n\n \\note\n This function is blocking with respect to the host.\n \\note\n Currently, only \\p trans_A == \\p trans_B == \\ref rocsparse_operation_none is\n supported.\n \\note\n Currently, only \\ref rocsparse_matrix_type_general is supported.\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir direction that specifies whether to count non-zero elements by \\ref rocsparse_direction_row or by\n \\ref rocsparse_direction_column in the BSR matrices \\f$A\\f$, \\f$B\\f$, \\f$C\\f$, and \\f$D\\f$.\n @param[in]\n trans_A matrix \\f$A\\f$ operation type.\n @param[in]\n trans_B matrix \\f$B\\f$ operation type.\n @param[in]\n mb number of block rows in the sparse BSR matrix \\f$op(A)\\f$ and \\f$C\\f$.\n @param[in]\n nb number of block columns of the sparse BSR matrix \\f$op(B)\\f$ and\n \\f$C\\f$.\n @param[in]\n kb number of block columns of the sparse BSR matrix \\f$op(A)\\f$ and number of\n rows of the sparse BSR matrix \\f$op(B)\\f$.\n @param[in]\n block_dim the block dimension of the BSR matrix \\f$A\\f$, \\f$B\\f$, \\f$C\\f$, and \\f$D\\f$.\n @param[in]\n descr_A descriptor of the sparse BSR matrix \\f$A\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnzb_A number of non-zero block entries of the sparse BSR matrix \\f$A\\f$.\n @param[in]\n bsr_row_ptr_A array of \\p mb+1 block elements (\\f$op(A) == A\\f$, \\p kb+1 otherwise)\n that point to the start of every row of the sparse BSR matrix\n \\f$op(A)\\f$.\n @param[in]\n bsr_col_ind_A array of \\p nnzb_A block elements containing the block column indices of the\n sparse BSR matrix \\f$A\\f$.\n @param[in]\n descr_B descriptor of the sparse BSR matrix \\f$B\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnzb_B number of non-zero block entries of the sparse BSR matrix \\f$B\\f$.\n @param[in]\n bsr_row_ptr_B array of \\p kb+1 block elements (\\f$op(B) == B\\f$, \\p mb+1 otherwise)\n that point to the start of every block row of the sparse BSR matrix\n \\f$op(B)\\f$.\n @param[in]\n bsr_col_ind_B array of \\p nnzb_B block elements containing the block column indices of the\n sparse BSR matrix \\f$B\\f$.\n @param[in]\n descr_D descriptor of the sparse BSR matrix \\f$D\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnzb_D number of non-zero block entries of the sparse BSR matrix \\f$D\\f$.\n @param[in]\n bsr_row_ptr_D array of \\p mb+1 block elements that point to the start of every block row of the\n sparse BSR matrix \\f$D\\f$.\n @param[in]\n bsr_col_ind_D array of \\p nnzb_D block elements containing the block column indices of the sparse\n BSR matrix \\f$D\\f$.\n @param[in]\n descr_C descriptor of the sparse BSR matrix \\f$C\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[out]\n bsr_row_ptr_C array of \\p mb+1 block elements that point to the start of every block row of the\n sparse BSR matrix \\f$C\\f$.\n @param[out]\n nnzb_C pointer to the number of non-zero block entries of the sparse BSR\n matrix \\f$C\\f$.\n @param[in]\n info_C structure that holds metadata for the sparse BSR matrix \\f$C\\f$.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user. The size is returned\n by rocsparse_sbsrgemm_buffer_size(),\n rocsparse_dbsrgemm_buffer_size(), rocsparse_cbsrgemm_buffer_size(), or\n rocsparse_zbsrgemm_buffer_size().\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nb, \\p kb, \\p block_dim, \\p nnzb_A, \\p nnzb_B, or\n \\p nnzb_D is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr_A, \\p bsr_row_ptr_A,\n \\p bsr_col_ind_A, \\p descr_B, \\p bsr_row_ptr_B, \\p bsr_col_ind_B,\n \\p descr_D, \\p bsr_row_ptr_D, \\p bsr_col_ind_D, \\p descr_C,\n \\p bsr_row_ptr_C, \\p nnzb_C, \\p info_C, or \\p temp_buffer is invalid.\n \\retval rocsparse_status_memory_error additional buffer for long rows could not be\n allocated.\n \\retval rocsparse_status_not_implemented\n \\p trans_A != \\ref rocsparse_operation_none,\n \\p trans_B != \\ref rocsparse_operation_none, or\n \\p rocsparse_matrix_type != \\ref rocsparse_matrix_type_general."]
pub fn rocsparse_bsrgemm_nnzb(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
mb: rocsparse_int,
nb: rocsparse_int,
kb: rocsparse_int,
block_dim: rocsparse_int,
descr_A: rocsparse_mat_descr,
nnzb_A: rocsparse_int,
bsr_row_ptr_A: *const rocsparse_int,
bsr_col_ind_A: *const rocsparse_int,
descr_B: rocsparse_mat_descr,
nnzb_B: rocsparse_int,
bsr_row_ptr_B: *const rocsparse_int,
bsr_col_ind_B: *const rocsparse_int,
descr_D: rocsparse_mat_descr,
nnzb_D: rocsparse_int,
bsr_row_ptr_D: *const rocsparse_int,
bsr_col_ind_D: *const rocsparse_int,
descr_C: rocsparse_mat_descr,
bsr_row_ptr_C: *mut rocsparse_int,
nnzb_C: *mut rocsparse_int,
info_C: rocsparse_mat_info,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup extra_module\n \\brief Sparse matrix sparse matrix multiplication using the BSR storage format.\n\n \\details\n \\p rocsparse_bsrgemm multiplies the scalar \\f$\\alpha\\f$ with the sparse\n \\f$mb \\times kb\\f$ matrix \\f$A\\f$, defined in BSR storage format, and the sparse\n \\f$kb \\times nb\\f$ matrix \\f$B\\f$, defined in BSR storage format, and adds the result\n to the sparse \\f$mb \\times nb\\f$ matrix \\f$D\\f$ that is multiplied by \\f$\\beta\\f$. The\n final result is stored in the sparse \\f$mb \\times nb\\f$ matrix \\f$C\\f$, defined in BSR\n storage format, such\n that\n \\f[\n C := \\alpha \\cdot op(A) \\cdot op(B) + \\beta \\cdot D,\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans_A == rocsparse_operation_none} \\\\\n A^T, & \\text{if trans_A == rocsparse_operation_transpose} \\\\\n A^H, & \\text{if trans_A == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n and\n \\f[\n op(B) = \\left\\{\n \\begin{array}{ll}\n B, & \\text{if trans_B == rocsparse_operation_none} \\\\\n B^T, & \\text{if trans_B == rocsparse_operation_transpose} \\\\\n B^H, & \\text{if trans_B == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n\n \\note\n This function does not produce deterministic results.\n\n It is assumed that \\p bsr_row_ptr_C has already been filled and that \\p bsr_val_C and\n \\p bsr_col_ind_C are allocated by the user. \\p bsr_row_ptr_C and the allocation size of\n \\p bsr_col_ind_C and \\p bsr_val_C is defined by the number of non-zero elements of\n the sparse BSR matrix C. Both can be obtained by \\ref rocsparse_bsrgemm_nnzb(). The\n required buffer size for the computation can be obtained by\n \\ref rocsparse_sbsrgemm_buffer_size \"rocsparse_Xbsrgemm_buffer_size()\".\n\n \\note If \\f$\\alpha == 0\\f$, then \\f$C = \\beta \\cdot D\\f$ will be computed.\n \\note If \\f$\\beta == 0\\f$, then \\f$C = \\alpha \\cdot op(A) \\cdot op(B)\\f$ will be computed.\n \\note \\f$\\alpha == beta == 0\\f$ is invalid.\n \\note Currently, only \\p trans_A == \\ref rocsparse_operation_none is supported.\n \\note Currently, only \\p trans_B == \\ref rocsparse_operation_none is supported.\n \\note Currently, only \\ref rocsparse_matrix_type_general is supported.\n \\note This function is blocking with respect to the host.\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir direction that specifies whether to count non-zero elements by \\ref rocsparse_direction_row or by\n \\ref rocsparse_direction_column in the BSR matrices \\f$A\\f$, \\f$B\\f$, \\f$C\\f$, and \\f$D\\f$.\n @param[in]\n trans_A matrix \\f$A\\f$ operation type.\n @param[in]\n trans_B matrix \\f$B\\f$ operation type.\n @param[in]\n mb number of block rows of the sparse BSR matrix \\f$op(A)\\f$ and \\f$C\\f$.\n @param[in]\n nb number of block columns of the sparse BSR matrix \\f$op(B)\\f$ and\n \\f$C\\f$.\n @param[in]\n kb number of block columns of the sparse BSR matrix \\f$op(A)\\f$ and number of\n block rows of the sparse BSR matrix \\f$op(B)\\f$.\n @param[in]\n block_dim the block dimension of the BSR matrix \\f$A\\f$, \\f$B\\f$, \\f$C\\f$, and \\f$D\\f$.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n descr_A descriptor of the sparse BSR matrix \\f$A\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnzb_A number of non-zero block entries of the sparse BSR matrix \\f$A\\f$.\n @param[in]\n bsr_val_A array of \\p nnzb_A block elements of the sparse BSR matrix \\f$A\\f$.\n @param[in]\n bsr_row_ptr_A array of \\p mb+1 block elements (\\f$op(A) == A\\f$, \\p kb+1 otherwise)\n that point to the start of every block row of the sparse BSR matrix\n \\f$op(A)\\f$.\n @param[in]\n bsr_col_ind_A array of \\p nnzb_A block elements containing the block column indices of the\n sparse BSR matrix \\f$A\\f$.\n @param[in]\n descr_B descriptor of the sparse BSR matrix \\f$B\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnzb_B number of non-zero block entries of the sparse BSR matrix \\f$B\\f$.\n @param[in]\n bsr_val_B array of \\p nnzb_B block elements of the sparse BSR matrix \\f$B\\f$.\n @param[in]\n bsr_row_ptr_B array of \\p kb+1 block elements (\\f$op(B) == B\\f$, \\p mb+1 otherwise)\n that point to the start of every block row of the sparse BSR matrix\n \\f$op(B)\\f$.\n @param[in]\n bsr_col_ind_B array of \\p nnzb_B block elements containing the block column indices of the\n sparse BSR matrix \\f$B\\f$.\n @param[in]\n beta scalar \\f$\\beta\\f$.\n @param[in]\n descr_D descriptor of the sparse BSR matrix \\f$D\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnzb_D number of non-zero block entries of the sparse BSR matrix \\f$D\\f$.\n @param[in]\n bsr_val_D array of \\p nnzb_D block elements of the sparse BSR matrix \\f$D\\f$.\n @param[in]\n bsr_row_ptr_D array of \\p mb+1 block elements that point to the start of every block row of the\n sparse BSR matrix \\f$D\\f$.\n @param[in]\n bsr_col_ind_D array of \\p nnzb_D block elements containing the block column indices of the\n sparse BSR matrix \\f$D\\f$.\n @param[in]\n descr_C descriptor of the sparse BSR matrix \\f$C\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[out]\n bsr_val_C array of \\p nnzb_C elements of the sparse BSR matrix \\f$C\\f$.\n @param[in]\n bsr_row_ptr_C array of \\p mb+1 block elements that point to the start of every block row of the\n sparse BSR matrix \\f$C\\f$.\n @param[out]\n bsr_col_ind_C array of \\p nnzb_C block elements containing the block column indices of the\n sparse BSR matrix \\f$C\\f$.\n @param[in]\n info_C structure that holds metadata for the sparse BSR matrix \\f$C\\f$.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user. The size is returned\n by rocsparse_sbsrgemm_buffer_size(),\n rocsparse_dbsrgemm_buffer_size(), rocsparse_cbsrgemm_buffer_size(), or\n rocsparse_zbsrgemm_buffer_size().\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nb, \\p kb, \\p block_dim, \\p nnzb_A, \\p nnzb_B, or\n \\p nnzb_D is invalid.\n \\retval rocsparse_status_invalid_pointer \\p alpha and \\p beta are invalid,\n \\p descr_A, \\p bsr_val_A, \\p bsr_row_ptr_A, \\p bsr_col_ind_A, \\p descr_B,\n \\p bsr_val_B, \\p bsr_row_ptr_B, or \\p bsr_col_ind_B are invalid if \\p alpha\n is valid, \\p descr_D, \\p bsr_val_D, \\p bsr_row_ptr_D, or \\p bsr_col_ind_D is\n invalid if \\p beta is valid, or \\p bsr_val_C, \\p bsr_row_ptr_C,\n \\p bsr_col_ind_C, or \\p info_C or \\p temp_buffer are invalid.\n \\retval rocsparse_status_memory_error additional buffer for long rows could not be\n allocated.\n \\retval rocsparse_status_not_implemented\n \\p trans_A != \\ref rocsparse_operation_none,\n \\p trans_B != \\ref rocsparse_operation_none, or\n \\p rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n This example multiplies two BSR matrices with a scalar alpha and adds the result to\n another BSR matrix.\n \\snippet example_rocsparse_bsrgemm.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sbsrgemm(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
mb: rocsparse_int,
nb: rocsparse_int,
kb: rocsparse_int,
block_dim: rocsparse_int,
alpha: *const f32,
descr_A: rocsparse_mat_descr,
nnzb_A: rocsparse_int,
bsr_val_A: *const f32,
bsr_row_ptr_A: *const rocsparse_int,
bsr_col_ind_A: *const rocsparse_int,
descr_B: rocsparse_mat_descr,
nnzb_B: rocsparse_int,
bsr_val_B: *const f32,
bsr_row_ptr_B: *const rocsparse_int,
bsr_col_ind_B: *const rocsparse_int,
beta: *const f32,
descr_D: rocsparse_mat_descr,
nnzb_D: rocsparse_int,
bsr_val_D: *const f32,
bsr_row_ptr_D: *const rocsparse_int,
bsr_col_ind_D: *const rocsparse_int,
descr_C: rocsparse_mat_descr,
bsr_val_C: *mut f32,
bsr_row_ptr_C: *const rocsparse_int,
bsr_col_ind_C: *mut rocsparse_int,
info_C: rocsparse_mat_info,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dbsrgemm(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
mb: rocsparse_int,
nb: rocsparse_int,
kb: rocsparse_int,
block_dim: rocsparse_int,
alpha: *const f64,
descr_A: rocsparse_mat_descr,
nnzb_A: rocsparse_int,
bsr_val_A: *const f64,
bsr_row_ptr_A: *const rocsparse_int,
bsr_col_ind_A: *const rocsparse_int,
descr_B: rocsparse_mat_descr,
nnzb_B: rocsparse_int,
bsr_val_B: *const f64,
bsr_row_ptr_B: *const rocsparse_int,
bsr_col_ind_B: *const rocsparse_int,
beta: *const f64,
descr_D: rocsparse_mat_descr,
nnzb_D: rocsparse_int,
bsr_val_D: *const f64,
bsr_row_ptr_D: *const rocsparse_int,
bsr_col_ind_D: *const rocsparse_int,
descr_C: rocsparse_mat_descr,
bsr_val_C: *mut f64,
bsr_row_ptr_C: *const rocsparse_int,
bsr_col_ind_C: *mut rocsparse_int,
info_C: rocsparse_mat_info,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cbsrgemm(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
mb: rocsparse_int,
nb: rocsparse_int,
kb: rocsparse_int,
block_dim: rocsparse_int,
alpha: *const rocsparse_float_complex,
descr_A: rocsparse_mat_descr,
nnzb_A: rocsparse_int,
bsr_val_A: *const rocsparse_float_complex,
bsr_row_ptr_A: *const rocsparse_int,
bsr_col_ind_A: *const rocsparse_int,
descr_B: rocsparse_mat_descr,
nnzb_B: rocsparse_int,
bsr_val_B: *const rocsparse_float_complex,
bsr_row_ptr_B: *const rocsparse_int,
bsr_col_ind_B: *const rocsparse_int,
beta: *const rocsparse_float_complex,
descr_D: rocsparse_mat_descr,
nnzb_D: rocsparse_int,
bsr_val_D: *const rocsparse_float_complex,
bsr_row_ptr_D: *const rocsparse_int,
bsr_col_ind_D: *const rocsparse_int,
descr_C: rocsparse_mat_descr,
bsr_val_C: *mut rocsparse_float_complex,
bsr_row_ptr_C: *const rocsparse_int,
bsr_col_ind_C: *mut rocsparse_int,
info_C: rocsparse_mat_info,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zbsrgemm(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
mb: rocsparse_int,
nb: rocsparse_int,
kb: rocsparse_int,
block_dim: rocsparse_int,
alpha: *const rocsparse_double_complex,
descr_A: rocsparse_mat_descr,
nnzb_A: rocsparse_int,
bsr_val_A: *const rocsparse_double_complex,
bsr_row_ptr_A: *const rocsparse_int,
bsr_col_ind_A: *const rocsparse_int,
descr_B: rocsparse_mat_descr,
nnzb_B: rocsparse_int,
bsr_val_B: *const rocsparse_double_complex,
bsr_row_ptr_B: *const rocsparse_int,
bsr_col_ind_B: *const rocsparse_int,
beta: *const rocsparse_double_complex,
descr_D: rocsparse_mat_descr,
nnzb_D: rocsparse_int,
bsr_val_D: *const rocsparse_double_complex,
bsr_row_ptr_D: *const rocsparse_int,
bsr_col_ind_D: *const rocsparse_int,
descr_C: rocsparse_mat_descr,
bsr_val_C: *mut rocsparse_double_complex,
bsr_row_ptr_C: *const rocsparse_int,
bsr_col_ind_C: *mut rocsparse_int,
info_C: rocsparse_mat_info,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup extra_module\n \\details\n \\p rocsparse_csrgeam_nnz computes the total CSR non-zero elements and the CSR row\n offsets that point to the start of every row of the sparse CSR matrix of the\n resulting matrix C. It is assumed that \\p csr_row_ptr_C has been allocated with\n size \\p m+1.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n Currently, only \\ref rocsparse_matrix_type_general is supported.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse CSR matrix \\f$A\\f$, \\f$B\\f$, and \\f$C\\f$.\n @param[in]\n n number of columns of the sparse CSR matrix \\f$A\\f$, \\f$B\\f$, and \\f$C\\f$.\n @param[in]\n descr_A descriptor of the sparse CSR matrix \\f$A\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnz_A number of non-zero entries of the sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_row_ptr_A array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_col_ind_A array of \\p nnz_A elements containing the column indices of the\n sparse CSR matrix \\f$A\\f$.\n @param[in]\n descr_B descriptor of the sparse CSR matrix \\f$B\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnz_B number of non-zero entries of the sparse CSR matrix \\f$B\\f$.\n @param[in]\n csr_row_ptr_B array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$B\\f$.\n @param[in]\n csr_col_ind_B array of \\p nnz_B elements containing the column indices of the\n sparse CSR matrix \\f$B\\f$.\n @param[in]\n descr_C descriptor of the sparse CSR matrix \\f$C\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[out]\n csr_row_ptr_C array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$C\\f$.\n @param[out]\n nnz_C pointer to the number of non-zero entries of the sparse CSR\n matrix \\f$C\\f$. \\p nnz_C can be a host or device pointer.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, \\p nnz_A, or \\p nnz_B is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr_A, \\p csr_row_ptr_A,\n \\p csr_col_ind_A, \\p descr_B, \\p csr_row_ptr_B, \\p csr_col_ind_B,\n \\p descr_C, \\p csr_row_ptr_C, or \\p nnz_C is invalid.\n \\retval rocsparse_status_not_implemented\n \\p rocsparse_matrix_type != \\ref rocsparse_matrix_type_general."]
pub fn rocsparse_csrgeam_nnz(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
descr_A: rocsparse_mat_descr,
nnz_A: rocsparse_int,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
descr_B: rocsparse_mat_descr,
nnz_B: rocsparse_int,
csr_row_ptr_B: *const rocsparse_int,
csr_col_ind_B: *const rocsparse_int,
descr_C: rocsparse_mat_descr,
csr_row_ptr_C: *mut rocsparse_int,
nnz_C: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup extra_module\n \\brief Sparse matrix sparse matrix addition using the CSR storage format.\n\n \\details\n \\p rocsparse_csrgeam multiplies the scalar \\f$\\alpha\\f$ with the sparse\n \\f$m \\times n\\f$ matrix \\f$A\\f$, defined in CSR storage format, multiplies the\n scalar \\f$\\beta\\f$ with the sparse \\f$m \\times n\\f$ matrix \\f$B\\f$, defined in CSR\n storage format, and adds both resulting matrices to obtain the sparse\n \\f$m \\times n\\f$ matrix \\f$C\\f$, defined in CSR storage format, such that\n \\f[\n C := \\alpha \\cdot A + \\beta \\cdot B.\n \\f]\n\n It is assumed that \\p csr_row_ptr_C has already been filled and that \\p csr_val_C and\n \\p csr_col_ind_C are allocated by the user. \\p csr_row_ptr_C and the allocation size of\n \\p csr_col_ind_C and \\p csr_val_C is defined by the number of non-zero elements of\n the sparse CSR matrix C. Both can be obtained by \\ref rocsparse_csrgeam_nnz().\n\n \\note Both scalars \\f$\\alpha\\f$ and \\f$beta\\f$ have to be valid.\n\n \\note Currently, only \\ref rocsparse_matrix_type_general is supported.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse CSR matrix \\f$A\\f$, \\f$B\\f$, and \\f$C\\f$.\n @param[in]\n n number of columns of the sparse CSR matrix \\f$A\\f$, \\f$B\\f$, and \\f$C\\f$.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n descr_A descriptor of the sparse CSR matrix \\f$A\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnz_A number of non-zero entries of the sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_val_A array of \\p nnz_A elements of the sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_row_ptr_A array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_col_ind_A array of \\p nnz_A elements containing the column indices of the\n sparse CSR matrix \\f$A\\f$.\n @param[in]\n beta scalar \\f$\\beta\\f$.\n @param[in]\n descr_B descriptor of the sparse CSR matrix \\f$B\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnz_B number of non-zero entries of the sparse CSR matrix \\f$B\\f$.\n @param[in]\n csr_val_B array of \\p nnz_B elements of the sparse CSR matrix \\f$B\\f$.\n @param[in]\n csr_row_ptr_B array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$B\\f$.\n @param[in]\n csr_col_ind_B array of \\p nnz_B elements containing the column indices of the\n sparse CSR matrix \\f$B\\f$.\n @param[in]\n descr_C descriptor of the sparse CSR matrix \\f$C\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[out]\n csr_val_C array of elements of the sparse CSR matrix \\f$C\\f$.\n @param[in]\n csr_row_ptr_C array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$C\\f$.\n @param[out]\n csr_col_ind_C array of elements containing the column indices of the\n sparse CSR matrix \\f$C\\f$.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, \\p nnz_A, or \\p nnz_B is invalid.\n \\retval rocsparse_status_invalid_pointer \\p alpha, \\p descr_A, \\p csr_val_A,\n \\p csr_row_ptr_A, \\p csr_col_ind_A, \\p beta, \\p descr_B, \\p csr_val_B,\n \\p csr_row_ptr_B, \\p csr_col_ind_B, \\p descr_C, \\p csr_val_C,\n \\p csr_row_ptr_C, or \\p csr_col_ind_C is invalid.\n \\retval rocsparse_status_not_implemented\n \\p rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n This example adds two CSR matrices.\n \\snippet example_rocsparse_csrgeam.cpp doc example\n/\n/**@{"]
pub fn rocsparse_scsrgeam(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
alpha: *const f32,
descr_A: rocsparse_mat_descr,
nnz_A: rocsparse_int,
csr_val_A: *const f32,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
beta: *const f32,
descr_B: rocsparse_mat_descr,
nnz_B: rocsparse_int,
csr_val_B: *const f32,
csr_row_ptr_B: *const rocsparse_int,
csr_col_ind_B: *const rocsparse_int,
descr_C: rocsparse_mat_descr,
csr_val_C: *mut f32,
csr_row_ptr_C: *const rocsparse_int,
csr_col_ind_C: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsrgeam(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
alpha: *const f64,
descr_A: rocsparse_mat_descr,
nnz_A: rocsparse_int,
csr_val_A: *const f64,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
beta: *const f64,
descr_B: rocsparse_mat_descr,
nnz_B: rocsparse_int,
csr_val_B: *const f64,
csr_row_ptr_B: *const rocsparse_int,
csr_col_ind_B: *const rocsparse_int,
descr_C: rocsparse_mat_descr,
csr_val_C: *mut f64,
csr_row_ptr_C: *const rocsparse_int,
csr_col_ind_C: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsrgeam(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
alpha: *const rocsparse_float_complex,
descr_A: rocsparse_mat_descr,
nnz_A: rocsparse_int,
csr_val_A: *const rocsparse_float_complex,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
beta: *const rocsparse_float_complex,
descr_B: rocsparse_mat_descr,
nnz_B: rocsparse_int,
csr_val_B: *const rocsparse_float_complex,
csr_row_ptr_B: *const rocsparse_int,
csr_col_ind_B: *const rocsparse_int,
descr_C: rocsparse_mat_descr,
csr_val_C: *mut rocsparse_float_complex,
csr_row_ptr_C: *const rocsparse_int,
csr_col_ind_C: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsrgeam(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
alpha: *const rocsparse_double_complex,
descr_A: rocsparse_mat_descr,
nnz_A: rocsparse_int,
csr_val_A: *const rocsparse_double_complex,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
beta: *const rocsparse_double_complex,
descr_B: rocsparse_mat_descr,
nnz_B: rocsparse_int,
csr_val_B: *const rocsparse_double_complex,
csr_row_ptr_B: *const rocsparse_int,
csr_col_ind_B: *const rocsparse_int,
descr_C: rocsparse_mat_descr,
csr_val_C: *mut rocsparse_double_complex,
csr_row_ptr_C: *const rocsparse_int,
csr_col_ind_C: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup extra_module\n \\details\n \\p rocsparse_csrgemm_buffer_size returns the size of the temporary storage buffer\n that is required by \\ref rocsparse_csrgemm_nnz() and \\ref rocsparse_scsrgemm \"rocsparse_Xcsrgemm()\".\n The temporary storage buffer must be allocated by the user.\n\n \\note\n Note that for matrix products with more than 4096 non-zero entries per row,\n an additional temporary storage buffer is allocated by the algorithm.\n \\note\n Note that for matrix products with more than 8192 intermediate products per\n row, an additional temporary storage buffer is allocated by the algorithm.\n \\note\n Currently, only \\p trans_A == \\p trans_B == \\ref rocsparse_operation_none is\n supported.\n \\note\n Currently, only \\ref rocsparse_matrix_type_general is supported.\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n trans_A matrix \\f$A\\f$ operation type.\n @param[in]\n trans_B matrix \\f$B\\f$ operation type.\n @param[in]\n m number of rows of the sparse CSR matrix \\f$op(A)\\f$ and \\f$C\\f$.\n @param[in]\n n number of columns of the sparse CSR matrix \\f$op(B)\\f$ and\n \\f$C\\f$.\n @param[in]\n k number of columns of the sparse CSR matrix \\f$op(A)\\f$ and number of\n rows of the sparse CSR matrix \\f$op(B)\\f$.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n descr_A descriptor of the sparse CSR matrix \\f$A\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnz_A number of non-zero entries of the sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_row_ptr_A array of \\p m+1 elements (\\f$op(A) == A\\f$, \\p k+1 otherwise)\n that point to the start of every row of the sparse CSR matrix\n \\f$op(A)\\f$.\n @param[in]\n csr_col_ind_A array of \\p nnz_A elements containing the column indices of the\n sparse CSR matrix \\f$A\\f$.\n @param[in]\n descr_B descriptor of the sparse CSR matrix \\f$B\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnz_B number of non-zero entries of the sparse CSR matrix \\f$B\\f$.\n @param[in]\n csr_row_ptr_B array of \\p k+1 elements (\\f$op(B) == B\\f$, \\p m+1 otherwise)\n that point to the start of every row of the sparse CSR matrix\n \\f$op(B)\\f$.\n @param[in]\n csr_col_ind_B array of \\p nnz_B elements containing the column indices of the\n sparse CSR matrix \\f$B\\f$.\n @param[in]\n beta scalar \\f$\\beta\\f$.\n @param[in]\n descr_D descriptor of the sparse CSR matrix \\f$D\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnz_D number of non-zero entries of the sparse CSR matrix \\f$D\\f$.\n @param[in]\n csr_row_ptr_D array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$D\\f$.\n @param[in]\n csr_col_ind_D array of \\p nnz_D elements containing the column indices of the sparse\n CSR matrix \\f$D\\f$.\n @param[inout]\n info_C structure that holds metadata for the sparse CSR matrix \\f$C\\f$.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n \\ref rocsparse_csrgemm_nnz() and \\ref rocsparse_scsrgemm \"rocsparse_Xcsrgemm()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, \\p k, \\p nnz_A, \\p nnz_B, or\n \\p nnz_D is invalid.\n \\retval rocsparse_status_invalid_pointer \\p alpha and \\p beta are invalid,\n \\p descr_A, \\p csr_row_ptr_A, \\p csr_col_ind_A, \\p descr_B,\n \\p csr_row_ptr_B or \\p csr_col_ind_B are invalid if \\p alpha is valid,\n \\p descr_D, \\p csr_row_ptr_D, or \\p csr_col_ind_D is invalid if \\p beta is\n valid, \\p info_C or \\p buffer_size is invalid.\n \\retval rocsparse_status_not_implemented\n \\p trans_A != \\ref rocsparse_operation_none,\n \\p trans_B != \\ref rocsparse_operation_none, or\n \\p rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n/\n/**@{"]
pub fn rocsparse_scsrgemm_buffer_size(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
k: rocsparse_int,
alpha: *const f32,
descr_A: rocsparse_mat_descr,
nnz_A: rocsparse_int,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
descr_B: rocsparse_mat_descr,
nnz_B: rocsparse_int,
csr_row_ptr_B: *const rocsparse_int,
csr_col_ind_B: *const rocsparse_int,
beta: *const f32,
descr_D: rocsparse_mat_descr,
nnz_D: rocsparse_int,
csr_row_ptr_D: *const rocsparse_int,
csr_col_ind_D: *const rocsparse_int,
info_C: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsrgemm_buffer_size(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
k: rocsparse_int,
alpha: *const f64,
descr_A: rocsparse_mat_descr,
nnz_A: rocsparse_int,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
descr_B: rocsparse_mat_descr,
nnz_B: rocsparse_int,
csr_row_ptr_B: *const rocsparse_int,
csr_col_ind_B: *const rocsparse_int,
beta: *const f64,
descr_D: rocsparse_mat_descr,
nnz_D: rocsparse_int,
csr_row_ptr_D: *const rocsparse_int,
csr_col_ind_D: *const rocsparse_int,
info_C: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsrgemm_buffer_size(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
k: rocsparse_int,
alpha: *const rocsparse_float_complex,
descr_A: rocsparse_mat_descr,
nnz_A: rocsparse_int,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
descr_B: rocsparse_mat_descr,
nnz_B: rocsparse_int,
csr_row_ptr_B: *const rocsparse_int,
csr_col_ind_B: *const rocsparse_int,
beta: *const rocsparse_float_complex,
descr_D: rocsparse_mat_descr,
nnz_D: rocsparse_int,
csr_row_ptr_D: *const rocsparse_int,
csr_col_ind_D: *const rocsparse_int,
info_C: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsrgemm_buffer_size(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
k: rocsparse_int,
alpha: *const rocsparse_double_complex,
descr_A: rocsparse_mat_descr,
nnz_A: rocsparse_int,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
descr_B: rocsparse_mat_descr,
nnz_B: rocsparse_int,
csr_row_ptr_B: *const rocsparse_int,
csr_col_ind_B: *const rocsparse_int,
beta: *const rocsparse_double_complex,
descr_D: rocsparse_mat_descr,
nnz_D: rocsparse_int,
csr_row_ptr_D: *const rocsparse_int,
csr_col_ind_D: *const rocsparse_int,
info_C: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup extra_module\n \\brief Sparse matrix sparse matrix multiplication using the CSR storage format.\n\n \\details\n \\p rocsparse_csrgemm_nnz computes the total CSR non-zero elements and the CSR row\n offsets that point to the start of every row of the sparse CSR matrix of the\n resulting multiplied matrix C. It is assumed that \\p csr_row_ptr_C has been allocated\n with size \\p m+1.\n The required buffer size can be obtained by rocsparse_scsrgemm_buffer_size(),\n rocsparse_dcsrgemm_buffer_size(), rocsparse_ccsrgemm_buffer_size(), and\n rocsparse_zcsrgemm_buffer_size(), respectively.\n\n \\note\n Note that for matrix products with more than 8192 intermediate products per\n row, an additional temporary storage buffer is allocated by the algorithm.\n \\note\n This function supports unsorted CSR matrices as input, while output will be sorted.\n Note that matrices B and D can only be unsorted up to 8192 intermediate\n products per row. If this number is exceeded, \\ref rocsparse_status_requires_sorted_storage\n will be returned.\n \\note\n This function is blocking with respect to the host.\n \\note\n Currently, only \\p trans_A == \\p trans_B == \\ref rocsparse_operation_none is\n supported.\n \\note\n Currently, only \\ref rocsparse_matrix_type_general is supported.\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n trans_A matrix \\f$A\\f$ operation type.\n @param[in]\n trans_B matrix \\f$B\\f$ operation type.\n @param[in]\n m number of rows of the sparse CSR matrix \\f$op(A)\\f$ and \\f$C\\f$.\n @param[in]\n n number of columns of the sparse CSR matrix \\f$op(B)\\f$ and\n \\f$C\\f$.\n @param[in]\n k number of columns of the sparse CSR matrix \\f$op(A)\\f$ and number of\n rows of the sparse CSR matrix \\f$op(B)\\f$.\n @param[in]\n descr_A descriptor of the sparse CSR matrix \\f$A\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnz_A number of non-zero entries of the sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_row_ptr_A array of \\p m+1 elements (\\f$op(A) == A\\f$, \\p k+1 otherwise)\n that point to the start of every row of the sparse CSR matrix\n \\f$op(A)\\f$.\n @param[in]\n csr_col_ind_A array of \\p nnz_A elements containing the column indices of the\n sparse CSR matrix \\f$A\\f$.\n @param[in]\n descr_B descriptor of the sparse CSR matrix \\f$B\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnz_B number of non-zero entries of the sparse CSR matrix \\f$B\\f$.\n @param[in]\n csr_row_ptr_B array of \\p k+1 elements (\\f$op(B) == B\\f$, \\p m+1 otherwise)\n that point to the start of every row of the sparse CSR matrix\n \\f$op(B)\\f$.\n @param[in]\n csr_col_ind_B array of \\p nnz_B elements containing the column indices of the\n sparse CSR matrix \\f$B\\f$.\n @param[in]\n descr_D descriptor of the sparse CSR matrix \\f$D\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnz_D number of non-zero entries of the sparse CSR matrix \\f$D\\f$.\n @param[in]\n csr_row_ptr_D array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$D\\f$.\n @param[in]\n csr_col_ind_D array of \\p nnz_D elements containing the column indices of the sparse\n CSR matrix \\f$D\\f$.\n @param[in]\n descr_C descriptor of the sparse CSR matrix \\f$C\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[out]\n csr_row_ptr_C array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$C\\f$.\n @param[out]\n nnz_C pointer to the number of non-zero entries of the sparse CSR\n matrix \\f$C\\f$.\n @param[in]\n info_C structure that holds meta data for the sparse CSR matrix \\f$C\\f$.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user, size is returned\n by rocsparse_scsrgemm_buffer_size(),\n rocsparse_dcsrgemm_buffer_size(), rocsparse_ccsrgemm_buffer_size(), or\n rocsparse_zcsrgemm_buffer_size().\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, \\p k, \\p nnz_A, \\p nnz_B, or\n \\p nnz_D is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr_A, \\p csr_row_ptr_A,\n \\p csr_col_ind_A, \\p descr_B, \\p csr_row_ptr_B, \\p csr_col_ind_B,\n \\p descr_D, \\p csr_row_ptr_D, \\p csr_col_ind_D, \\p descr_C,\n \\p csr_row_ptr_C, \\p nnz_C, \\p info_C, or \\p temp_buffer is invalid.\n \\retval rocsparse_status_memory_error additional buffer for long rows could not be\n allocated.\n \\retval rocsparse_status_not_implemented\n \\p trans_A != \\ref rocsparse_operation_none,\n \\p trans_B != \\ref rocsparse_operation_none, or\n \\p rocsparse_matrix_type != \\ref rocsparse_matrix_type_general."]
pub fn rocsparse_csrgemm_nnz(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
k: rocsparse_int,
descr_A: rocsparse_mat_descr,
nnz_A: rocsparse_int,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
descr_B: rocsparse_mat_descr,
nnz_B: rocsparse_int,
csr_row_ptr_B: *const rocsparse_int,
csr_col_ind_B: *const rocsparse_int,
descr_D: rocsparse_mat_descr,
nnz_D: rocsparse_int,
csr_row_ptr_D: *const rocsparse_int,
csr_col_ind_D: *const rocsparse_int,
descr_C: rocsparse_mat_descr,
csr_row_ptr_C: *mut rocsparse_int,
nnz_C: *mut rocsparse_int,
info_C: rocsparse_mat_info,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup extra_module\n \\brief Sparse matrix sparse matrix multiplication using the CSR storage format.\n\n \\details\n \\p rocsparse_csrgemm multiplies the scalar \\f$\\alpha\\f$ with the sparse\n \\f$m \\times k\\f$ matrix \\f$A\\f$, defined in CSR storage format, and the sparse\n \\f$k \\times n\\f$ matrix \\f$B\\f$, defined in CSR storage format, and adds the result\n to the sparse \\f$m \\times n\\f$ matrix \\f$D\\f$ that is multiplied by \\f$\\beta\\f$. The\n final result is stored in the sparse \\f$m \\times n\\f$ matrix \\f$C\\f$, defined in CSR\n storage format, such\n that\n \\f[\n C := \\alpha \\cdot op(A) \\cdot op(B) + \\beta \\cdot D,\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans_A == rocsparse_operation_none} \\\\\n A^T, & \\text{if trans_A == rocsparse_operation_transpose} \\\\\n A^H, & \\text{if trans_A == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n and\n \\f[\n op(B) = \\left\\{\n \\begin{array}{ll}\n B, & \\text{if trans_B == rocsparse_operation_none} \\\\\n B^T, & \\text{if trans_B == rocsparse_operation_transpose} \\\\\n B^H, & \\text{if trans_B == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n\n \\note\n This function does not produce deterministic results.\n\n It is assumed that \\p csr_row_ptr_C has already been filled and that \\p csr_val_C and\n \\p csr_col_ind_C are allocated by the user. \\p csr_row_ptr_C and the allocation size of\n \\p csr_col_ind_C and \\p csr_val_C are defined by the number of non-zero elements of\n the sparse CSR matrix C. Both can be obtained by using rocsparse_csrgemm_nnz(). The\n required buffer size for the computation can be obtained by\n rocsparse_scsrgemm_buffer_size(), rocsparse_dcsrgemm_buffer_size(),\n rocsparse_ccsrgemm_buffer_size(), and rocsparse_zcsrgemm_buffer_size(), respectively.\n\n \\note If \\f$\\alpha == 0\\f$, then \\f$C = \\beta \\cdot D\\f$ will be computed.\n \\note If \\f$\\beta == 0\\f$, then \\f$C = \\alpha \\cdot op(A) \\cdot op(B)\\f$ will be computed.\n \\note \\f$\\alpha == beta == 0\\f$ is invalid.\n \\note Currently, only \\p trans_A == \\ref rocsparse_operation_none is supported.\n \\note Currently, only \\p trans_B == \\ref rocsparse_operation_none is supported.\n \\note Currently, only \\ref rocsparse_matrix_type_general is supported.\n \\note Note that for matrix products with more than 4096 non-zero entries per\n row, an additional temporary storage buffer is allocated by the algorithm.\n \\note\n This function supports unsorted CSR matrices as input, while output will be sorted.\n Note that matrices B and D can only be unsorted up to 4096 non-zero entries\n per row. If this number is exceeded, \\ref rocsparse_status_requires_sorted_storage\n will be returned.\n \\note\n This function is blocking with respect to the host.\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n trans_A matrix \\f$A\\f$ operation type.\n @param[in]\n trans_B matrix \\f$B\\f$ operation type.\n @param[in]\n m number of rows of the sparse CSR matrix \\f$op(A)\\f$ and \\f$C\\f$.\n @param[in]\n n number of columns of the sparse CSR matrix \\f$op(B)\\f$ and\n \\f$C\\f$.\n @param[in]\n k number of columns of the sparse CSR matrix \\f$op(A)\\f$ and number of\n rows of the sparse CSR matrix \\f$op(B)\\f$.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n descr_A descriptor of the sparse CSR matrix \\f$A\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnz_A number of non-zero entries of the sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_val_A array of \\p nnz_A elements of the sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_row_ptr_A array of \\p m+1 elements (\\f$op(A) == A\\f$, \\p k+1 otherwise)\n that point to the start of every row of the sparse CSR matrix\n \\f$op(A)\\f$.\n @param[in]\n csr_col_ind_A array of \\p nnz_A elements containing the column indices of the\n sparse CSR matrix \\f$A\\f$.\n @param[in]\n descr_B descriptor of the sparse CSR matrix \\f$B\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnz_B number of non-zero entries of the sparse CSR matrix \\f$B\\f$.\n @param[in]\n csr_val_B array of \\p nnz_B elements of the sparse CSR matrix \\f$B\\f$.\n @param[in]\n csr_row_ptr_B array of \\p k+1 elements (\\f$op(B) == B\\f$, \\p m+1 otherwise)\n that point to the start of every row of the sparse CSR matrix\n \\f$op(B)\\f$.\n @param[in]\n csr_col_ind_B array of \\p nnz_B elements containing the column indices of the\n sparse CSR matrix \\f$B\\f$.\n @param[in]\n beta scalar \\f$\\beta\\f$.\n @param[in]\n descr_D descriptor of the sparse CSR matrix \\f$D\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnz_D number of non-zero entries of the sparse CSR matrix \\f$D\\f$.\n @param[in]\n csr_val_D array of \\p nnz_D elements of the sparse CSR matrix \\f$D\\f$.\n @param[in]\n csr_row_ptr_D array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$D\\f$.\n @param[in]\n csr_col_ind_D array of \\p nnz_D elements containing the column indices of the\n sparse CSR matrix \\f$D\\f$.\n @param[in]\n descr_C descriptor of the sparse CSR matrix \\f$C\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[out]\n csr_val_C array of \\p nnz_C elements of the sparse CSR matrix \\f$C\\f$.\n @param[in]\n csr_row_ptr_C array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$C\\f$.\n @param[out]\n csr_col_ind_C array of \\p nnz_C elements containing the column indices of the\n sparse CSR matrix \\f$C\\f$.\n @param[in]\n info_C structure that holds meta data for the sparse CSR matrix \\f$C\\f$.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user, size is returned\n by rocsparse_scsrgemm_buffer_size(),\n rocsparse_dcsrgemm_buffer_size(), rocsparse_ccsrgemm_buffer_size(), or\n rocsparse_zcsrgemm_buffer_size().\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, \\p k, \\p nnz_A, \\p nnz_B, or\n \\p nnz_D is invalid.\n \\retval rocsparse_status_invalid_pointer \\p alpha and \\p beta are invalid,\n \\p descr_A, \\p csr_val_A, \\p csr_row_ptr_A, \\p csr_col_ind_A, \\p descr_B,\n \\p csr_val_B, \\p csr_row_ptr_B, or \\p csr_col_ind_B are invalid if \\p alpha\n is valid, \\p descr_D, \\p csr_val_D, \\p csr_row_ptr_D, or \\p csr_col_ind_D are\n invalid if \\p beta is valid, or \\p csr_val_C, \\p csr_row_ptr_C,\n \\p csr_col_ind_C, \\p info_C, or \\p temp_buffer are invalid.\n \\retval rocsparse_status_memory_error additional buffer for long rows could not be\n allocated.\n \\retval rocsparse_status_not_implemented\n \\p trans_A != \\ref rocsparse_operation_none,\n \\p trans_B != \\ref rocsparse_operation_none, or\n \\p rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n This example multiplies two CSR matrices with a scalar alpha and adds the result to\n another CSR matrix.\n \\code{.c}\n // Initialize scalar multipliers\n float alpha = 2.0f;\n float beta = 1.0f;\n\n // Create matrix descriptors\n rocsparse_mat_descr descr_A;\n rocsparse_mat_descr descr_B;\n rocsparse_mat_descr descr_C;\n rocsparse_mat_descr descr_D;\n\n rocsparse_create_mat_descr(&descr_A);\n rocsparse_create_mat_descr(&descr_B);\n rocsparse_create_mat_descr(&descr_C);\n rocsparse_create_mat_descr(&descr_D);\n\n // Create matrix info structure\n rocsparse_mat_info info_C;\n rocsparse_create_mat_info(&info_C);\n\n // Set pointer mode\n rocsparse_set_pointer_mode(handle, rocsparse_pointer_mode_host);\n\n // Query rocsparse for the required buffer size\n size_t buffer_size;\n\n rocsparse_scsrgemm_buffer_size(handle,\n rocsparse_operation_none,\n rocsparse_operation_none,\n m,\n n,\n k,\n &alpha,\n descr_A,\n nnz_A,\n csr_row_ptr_A,\n csr_col_ind_A,\n descr_B,\n nnz_B,\n csr_row_ptr_B,\n csr_col_ind_B,\n &beta,\n descr_D,\n nnz_D,\n csr_row_ptr_D,\n csr_col_ind_D,\n info_C,\n &buffer_size);\n\n // Allocate buffer\n void* buffer;\n hipMalloc(&buffer, buffer_size);\n\n // Obtain number of total non-zero entries in C and row pointers of C\n rocsparse_int nnz_C;\n hipMalloc((void**)&csr_row_ptr_C, sizeof(rocsparse_int) * (m + 1));\n\n rocsparse_csrgemm_nnz(handle,\n rocsparse_operation_none,\n rocsparse_operation_none,\n m,\n n,\n k,\n descr_A,\n nnz_A,\n csr_row_ptr_A,\n csr_col_ind_A,\n descr_B,\n nnz_B,\n csr_row_ptr_B,\n csr_col_ind_B,\n descr_D,\n nnz_D,\n csr_row_ptr_D,\n csr_col_ind_D,\n descr_C,\n csr_row_ptr_C,\n &nnz_C,\n info_C,\n buffer);\n\n // Compute column indices and values of C\n hipMalloc((void**)&csr_col_ind_C, sizeof(rocsparse_int) * nnz_C);\n hipMalloc((void**)&csr_val_C, sizeof(float) * nnz_C);\n\n rocsparse_scsrgemm(handle,\n rocsparse_operation_none,\n rocsparse_operation_none,\n m,\n n,\n k,\n &alpha,\n descr_A,\n nnz_A,\n csr_val_A,\n csr_row_ptr_A,\n csr_col_ind_A,\n descr_B,\n nnz_B,\n csr_val_B,\n csr_row_ptr_B,\n csr_col_ind_B,\n &beta,\n descr_D,\n nnz_D,\n csr_val_D,\n csr_row_ptr_D,\n csr_col_ind_D,\n descr_C,\n csr_val_C,\n csr_row_ptr_C,\n csr_col_ind_C,\n info_C,\n buffer);\n \\endcode\n/\n/**@{"]
pub fn rocsparse_scsrgemm(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
k: rocsparse_int,
alpha: *const f32,
descr_A: rocsparse_mat_descr,
nnz_A: rocsparse_int,
csr_val_A: *const f32,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
descr_B: rocsparse_mat_descr,
nnz_B: rocsparse_int,
csr_val_B: *const f32,
csr_row_ptr_B: *const rocsparse_int,
csr_col_ind_B: *const rocsparse_int,
beta: *const f32,
descr_D: rocsparse_mat_descr,
nnz_D: rocsparse_int,
csr_val_D: *const f32,
csr_row_ptr_D: *const rocsparse_int,
csr_col_ind_D: *const rocsparse_int,
descr_C: rocsparse_mat_descr,
csr_val_C: *mut f32,
csr_row_ptr_C: *const rocsparse_int,
csr_col_ind_C: *mut rocsparse_int,
info_C: rocsparse_mat_info,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsrgemm(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
k: rocsparse_int,
alpha: *const f64,
descr_A: rocsparse_mat_descr,
nnz_A: rocsparse_int,
csr_val_A: *const f64,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
descr_B: rocsparse_mat_descr,
nnz_B: rocsparse_int,
csr_val_B: *const f64,
csr_row_ptr_B: *const rocsparse_int,
csr_col_ind_B: *const rocsparse_int,
beta: *const f64,
descr_D: rocsparse_mat_descr,
nnz_D: rocsparse_int,
csr_val_D: *const f64,
csr_row_ptr_D: *const rocsparse_int,
csr_col_ind_D: *const rocsparse_int,
descr_C: rocsparse_mat_descr,
csr_val_C: *mut f64,
csr_row_ptr_C: *const rocsparse_int,
csr_col_ind_C: *mut rocsparse_int,
info_C: rocsparse_mat_info,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsrgemm(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
k: rocsparse_int,
alpha: *const rocsparse_float_complex,
descr_A: rocsparse_mat_descr,
nnz_A: rocsparse_int,
csr_val_A: *const rocsparse_float_complex,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
descr_B: rocsparse_mat_descr,
nnz_B: rocsparse_int,
csr_val_B: *const rocsparse_float_complex,
csr_row_ptr_B: *const rocsparse_int,
csr_col_ind_B: *const rocsparse_int,
beta: *const rocsparse_float_complex,
descr_D: rocsparse_mat_descr,
nnz_D: rocsparse_int,
csr_val_D: *const rocsparse_float_complex,
csr_row_ptr_D: *const rocsparse_int,
csr_col_ind_D: *const rocsparse_int,
descr_C: rocsparse_mat_descr,
csr_val_C: *mut rocsparse_float_complex,
csr_row_ptr_C: *const rocsparse_int,
csr_col_ind_C: *mut rocsparse_int,
info_C: rocsparse_mat_info,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsrgemm(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
k: rocsparse_int,
alpha: *const rocsparse_double_complex,
descr_A: rocsparse_mat_descr,
nnz_A: rocsparse_int,
csr_val_A: *const rocsparse_double_complex,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
descr_B: rocsparse_mat_descr,
nnz_B: rocsparse_int,
csr_val_B: *const rocsparse_double_complex,
csr_row_ptr_B: *const rocsparse_int,
csr_col_ind_B: *const rocsparse_int,
beta: *const rocsparse_double_complex,
descr_D: rocsparse_mat_descr,
nnz_D: rocsparse_int,
csr_val_D: *const rocsparse_double_complex,
csr_row_ptr_D: *const rocsparse_int,
csr_col_ind_D: *const rocsparse_int,
descr_C: rocsparse_mat_descr,
csr_val_C: *mut rocsparse_double_complex,
csr_row_ptr_C: *const rocsparse_int,
csr_col_ind_C: *mut rocsparse_int,
info_C: rocsparse_mat_info,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup extra_module\n \\brief Sparse matrix sparse matrix symbolic multiplication using the CSR storage format.\n\n \\details\n \\p rocsparse_csrgemm_symbolic multiplies two sparsity patterns and adds an extra one: \\f[ opA \\cdot op(B) + D \\f]\n with \\f$m \\times k\\f$ matrix \\f$A\\f$, defined in CSR storage format, the sparse\n \\f$k \\times n\\f$ matrix \\f$B\\f$, defined in CSR storage format, and the sparse \\f$m \\times n\\f$ matrix \\f$D\\f$.\n The final result is stored in the sparse \\f$m \\times n\\f$ matrix \\f$C\\f$, defined in CSR\n storage format, such\n that\n \\f[\n C := op(A) \\cdot op(B) + D,\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans_A == rocsparse_operation_none} \\\\\n A^T, & \\text{if trans_A == rocsparse_operation_transpose} \\\\\n A^H, & \\text{if trans_A == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n and\n \\f[\n op(B) = \\left\\{\n \\begin{array}{ll}\n B, & \\text{if trans_B == rocsparse_operation_none} \\\\\n B^T, & \\text{if trans_B == rocsparse_operation_transpose} \\\\\n B^H, & \\text{if trans_B == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n\n It is assumed that \\p csr_row_ptr_C has already been filled and that\n \\p csr_col_ind_C is allocated by the user. \\p csr_row_ptr_C and the allocation size of\n \\p csr_col_ind_C are defined by the number of non-zero elements of\n the sparse CSR matrix C. Both can be obtained by using rocsparse_csrgemm_nnz(). The\n required buffer size for the computation can be obtained by\n rocsparse_scsrgemm_buffer_size(), rocsparse_dcsrgemm_buffer_size(),\n rocsparse_ccsrgemm_buffer_size(), and rocsparse_zcsrgemm_buffer_size(), respectively.\n\n \\note Currently, only \\p trans_A == \\ref rocsparse_operation_none is supported.\n \\note Currently, only \\p trans_B == \\ref rocsparse_operation_none is supported.\n \\note Currently, only \\ref rocsparse_matrix_type_general is supported.\n \\note Note that for matrix products with more than 4096 non-zero entries per\n row, an additional temporary storage buffer is allocated by the algorithm.\n \\note This function is blocking with respect to the host.\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n trans_A matrix \\f$A\\f$ operation type.\n @param[in]\n trans_B matrix \\f$B\\f$ operation type.\n @param[in]\n m number of rows of the sparse CSR matrix \\f$op(A)\\f$ and \\f$C\\f$.\n @param[in]\n n number of columns of the sparse CSR matrix \\f$op(B)\\f$ and\n \\f$C\\f$.\n @param[in]\n k number of columns of the sparse CSR matrix \\f$op(A)\\f$ and number of\n rows of the sparse CSR matrix \\f$op(B)\\f$.\n @param[in]\n descr_A descriptor of the sparse CSR matrix \\f$A\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnz_A number of non-zero entries of the sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_row_ptr_A array of \\p m+1 elements (\\f$op(A) == A\\f$, \\p k+1 otherwise)\n that point to the start of every row of the sparse CSR matrix\n \\f$op(A)\\f$.\n @param[in]\n csr_col_ind_A array of \\p nnz_A elements containing the column indices of the\n sparse CSR matrix \\f$A\\f$.\n @param[in]\n descr_B descriptor of the sparse CSR matrix \\f$B\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnz_B number of non-zero entries of the sparse CSR matrix \\f$B\\f$.\n @param[in]\n csr_row_ptr_B array of \\p k+1 elements (\\f$op(B) == B\\f$, \\p m+1 otherwise)\n that point to the start of every row of the sparse CSR matrix\n \\f$op(B)\\f$.\n @param[in]\n csr_col_ind_B array of \\p nnz_B elements containing the column indices of the\n sparse CSR matrix \\f$B\\f$.\n @param[in]\n descr_D descriptor of the sparse CSR matrix \\f$D\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnz_D number of non-zero entries of the sparse CSR matrix \\f$D\\f$.\n @param[in]\n csr_row_ptr_D array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$D\\f$.\n @param[in]\n csr_col_ind_D array of \\p nnz_D elements containing the column indices of the\n sparse CSR matrix \\f$D\\f$.\n @param[in]\n descr_C descriptor of the sparse CSR matrix \\f$C\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnz_C number of non-zero entries of the sparse CSR matrix \\f$C\\f$.\n @param[in]\n csr_row_ptr_C array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$C\\f$.\n @param[out]\n csr_col_ind_C array of \\p nnz_C elements containing the column indices of the\n sparse CSR matrix \\f$C\\f$.\n @param[in]\n info_C structure that holds metadata for the sparse CSR matrix \\f$C\\f$.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user. The size is returned\n by rocsparse_scsrgemm_buffer_size(),\n rocsparse_dcsrgemm_buffer_size(), rocsparse_ccsrgemm_buffer_size(), or\n rocsparse_zcsrgemm_buffer_size().\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, \\p k, \\p nnz_A, \\p nnz_B, or\n \\p nnz_D is invalid.\n \\retval rocsparse_status_invalid_pointer\n \\p descr_A, \\p csr_row_ptr_A, \\p csr_col_ind_A, \\p descr_B,\n \\p csr_row_ptr_B, \\p csr_col_ind_B, \\p descr_D, \\p csr_row_ptr_D, \\p csr_col_ind_D\n \\p csr_row_ptr_C,\n \\p csr_col_ind_C, \\p info_C, or \\p temp_buffer is invalid.\n \\retval rocsparse_status_memory_error additional buffer for long rows could not be\n allocated.\n \\retval rocsparse_status_not_implemented\n \\p trans_A != \\ref rocsparse_operation_none,\n \\p trans_B != \\ref rocsparse_operation_none, or\n \\p rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n This example multiplies symbolically two CSR matrices and adds the result to\n another CSR matrix.\n \\code{.c}\n // Initialize scalar multipliers\n float alpha = 2.0f;\n float beta = 1.0f;\n\n // Create matrix descriptors\n rocsparse_mat_descr descr_A;\n rocsparse_mat_descr descr_B;\n rocsparse_mat_descr descr_C;\n rocsparse_mat_descr descr_D;\n\n rocsparse_create_mat_descr(&descr_A);\n rocsparse_create_mat_descr(&descr_B);\n rocsparse_create_mat_descr(&descr_C);\n rocsparse_create_mat_descr(&descr_D);\n\n // Create matrix info structure\n rocsparse_mat_info info_C;\n rocsparse_create_mat_info(&info_C);\n\n // Set pointer mode\n rocsparse_set_pointer_mode(handle, rocsparse_pointer_mode_host);\n\n // Query rocsparse for the required buffer size\n size_t buffer_size;\n\n rocsparse_scsrgemm_buffer_size(handle,\n rocsparse_operation_none,\n rocsparse_operation_none,\n m,\n n,\n k,\n &alpha,\n descr_A,\n nnz_A,\n csr_row_ptr_A,\n csr_col_ind_A,\n descr_B,\n nnz_B,\n csr_row_ptr_B,\n csr_col_ind_B,\n &beta,\n descr_D,\n nnz_D,\n csr_row_ptr_D,\n csr_col_ind_D,\n info_C,\n &buffer_size);\n\n // Allocate buffer\n void* buffer;\n hipMalloc(&buffer, buffer_size);\n\n // Obtain number of total non-zero entries in C and row pointers of C\n rocsparse_int nnz_C;\n hipMalloc((void**)&csr_row_ptr_C, sizeof(rocsparse_int) * (m + 1));\n\n rocsparse_csrgemm_nnz(handle,\n rocsparse_operation_none,\n rocsparse_operation_none,\n m,\n n,\n k,\n descr_A,\n nnz_A,\n csr_row_ptr_A,\n csr_col_ind_A,\n descr_B,\n nnz_B,\n csr_row_ptr_B,\n csr_col_ind_B,\n descr_D,\n nnz_D,\n csr_row_ptr_D,\n csr_col_ind_D,\n descr_C,\n csr_row_ptr_C,\n &nnz_C,\n info_C,\n buffer);\n\n // Compute column indices of C\n hipMalloc((void**)&csr_col_ind_C, sizeof(rocsparse_int) * nnz_C);\n\n rocsparse_csrgemm_symbolic(handle,\n rocsparse_operation_none,\n rocsparse_operation_none,\n m,\n n,\n k,\n descr_A,\n nnz_A,\n csr_row_ptr_A,\n csr_col_ind_A,\n descr_B,\n nnz_B,\n csr_row_ptr_B,\n csr_col_ind_B,\n descr_D,\n nnz_D,\n csr_row_ptr_D,\n csr_col_ind_D,\n descr_C,\n nnz_C,\n csr_row_ptr_C,\n csr_col_ind_C,\n info_C,\n buffer);\n \\endcode\n/\n/**@{"]
pub fn rocsparse_csrgemm_symbolic(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
k: rocsparse_int,
descr_A: rocsparse_mat_descr,
nnz_A: rocsparse_int,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
descr_B: rocsparse_mat_descr,
nnz_B: rocsparse_int,
csr_row_ptr_B: *const rocsparse_int,
csr_col_ind_B: *const rocsparse_int,
descr_D: rocsparse_mat_descr,
nnz_D: rocsparse_int,
csr_row_ptr_D: *const rocsparse_int,
csr_col_ind_D: *const rocsparse_int,
descr_C: rocsparse_mat_descr,
nnz_C: rocsparse_int,
csr_row_ptr_C: *const rocsparse_int,
csr_col_ind_C: *mut rocsparse_int,
info_C: rocsparse_mat_info,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup extra_module\n \\brief Sparse matrix sparse matrix numeric multiplication using the CSR storage format.\n\n \\details\n \\p rocsparse_csrgemm_numeric multiplies the scalar \\f$\\alpha\\f$ with the sparse\n \\f$m \\times k\\f$ matrix \\f$A\\f$, defined in CSR storage format, and the sparse\n \\f$k \\times n\\f$ matrix \\f$B\\f$, defined in CSR storage format, and adds the result\n to the sparse \\f$m \\times n\\f$ matrix \\f$D\\f$ that is multiplied by \\f$\\beta\\f$. The\n final result is stored in the sparse \\f$m \\times n\\f$ matrix \\f$C\\f$, predefined in CSR\n storage format, such\n that\n \\f[\n C := \\alpha \\cdot op(A) \\cdot op(B) + \\beta \\cdot D,\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans_A == rocsparse_operation_none} \\\\\n A^T, & \\text{if trans_A == rocsparse_operation_transpose} \\\\\n A^H, & \\text{if trans_A == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n and\n \\f[\n op(B) = \\left\\{\n \\begin{array}{ll}\n B, & \\text{if trans_B == rocsparse_operation_none} \\\\\n B^T, & \\text{if trans_B == rocsparse_operation_transpose} \\\\\n B^H, & \\text{if trans_B == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n\n \\note\n This function does not produce deterministic results.\n\n The symbolic part of the csr matrix C can be obtained by rocsparse_csrgemm_symbolic().\n It is assumed that \\p csr_row_ptr_C and \\p csr_col_ind_C have already been filled and that \\p csr_val_C is allocated by the user. \\p csr_row_ptr_C and the allocation size of\n \\p csr_col_ind_C and \\p csr_val_C are defined by the number of non-zero elements of\n the sparse CSR matrix C. Both can be obtained by rocsparse_csrgemm_nnz(). The\n required buffer size for the computation can be obtained by\n rocsparse_scsrgemm_buffer_size(), rocsparse_dcsrgemm_buffer_size(),\n rocsparse_ccsrgemm_buffer_size(), and rocsparse_zcsrgemm_buffer_size(), respectively.\n\n \\note If \\f$\\alpha == 0\\f$, then \\f$C = \\beta \\cdot D\\f$ will be computed.\n \\note If \\f$\\beta == 0\\f$, then \\f$C = \\alpha \\cdot op(A) \\cdot op(B)\\f$ will be computed.\n \\note \\f$\\alpha == beta == 0\\f$ is invalid.\n \\note Currently, only \\p trans_A == \\ref rocsparse_operation_none is supported.\n \\note Currently, only \\p trans_B == \\ref rocsparse_operation_none is supported.\n \\note Currently, only \\ref rocsparse_matrix_type_general is supported.\n \\note Note that for matrix products with more than 4096 non-zero entries per\n row, an additional temporary storage buffer is allocated by the algorithm.\n \\note This function is blocking with respect to the host.\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n trans_A matrix \\f$A\\f$ operation type.\n @param[in]\n trans_B matrix \\f$B\\f$ operation type.\n @param[in]\n m number of rows of the sparse CSR matrix \\f$op(A)\\f$ and \\f$C\\f$.\n @param[in]\n n number of columns of the sparse CSR matrix \\f$op(B)\\f$ and\n \\f$C\\f$.\n @param[in]\n k number of columns of the sparse CSR matrix \\f$op(A)\\f$ and number of\n rows of the sparse CSR matrix \\f$op(B)\\f$.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n descr_A descriptor of the sparse CSR matrix \\f$A\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnz_A number of non-zero entries of the sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_val_A array of \\p nnz_A elements of the sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_row_ptr_A array of \\p m+1 elements (\\f$op(A) == A\\f$, \\p k+1 otherwise)\n that point to the start of every row of the sparse CSR matrix\n \\f$op(A)\\f$.\n @param[in]\n csr_col_ind_A array of \\p nnz_A elements containing the column indices of the\n sparse CSR matrix \\f$A\\f$.\n @param[in]\n descr_B descriptor of the sparse CSR matrix \\f$B\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnz_B number of non-zero entries of the sparse CSR matrix \\f$B\\f$.\n @param[in]\n csr_val_B array of \\p nnz_B elements of the sparse CSR matrix \\f$B\\f$.\n @param[in]\n csr_row_ptr_B array of \\p k+1 elements (\\f$op(B) == B\\f$, \\p m+1 otherwise)\n that point to the start of every row of the sparse CSR matrix\n \\f$op(B)\\f$.\n @param[in]\n csr_col_ind_B array of \\p nnz_B elements containing the column indices of the\n sparse CSR matrix \\f$B\\f$.\n @param[in]\n beta scalar \\f$\\beta\\f$.\n @param[in]\n descr_D descriptor of the sparse CSR matrix \\f$D\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnz_D number of non-zero entries of the sparse CSR matrix \\f$D\\f$.\n @param[in]\n csr_val_D array of \\p nnz_D elements of the sparse CSR matrix \\f$D\\f$.\n @param[in]\n csr_row_ptr_D array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$D\\f$.\n @param[in]\n csr_col_ind_D array of \\p nnz_D elements containing the column indices of the\n sparse CSR matrix \\f$D\\f$.\n @param[in]\n descr_C descriptor of the sparse CSR matrix \\f$C\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n nnz_C number of non-zero entries of the sparse CSR matrix \\f$C\\f$.\n @param[out]\n csr_val_C array of \\p nnz_C elements of the sparse CSR matrix \\f$C\\f$.\n @param[in]\n csr_row_ptr_C array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$C\\f$.\n @param[in]\n csr_col_ind_C array of \\p nnz_C elements containing the column indices of the\n sparse CSR matrix \\f$C\\f$.\n @param[in]\n info_C structure that holds metadata for the sparse CSR matrix \\f$C\\f$.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user. The size is returned\n by rocsparse_scsrgemm_buffer_size(),\n rocsparse_dcsrgemm_buffer_size(), rocsparse_ccsrgemm_buffer_size(), or\n rocsparse_zcsrgemm_buffer_size().\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, \\p k, \\p nnz_A, \\p nnz_B, or\n \\p nnz_D is invalid.\n \\retval rocsparse_status_invalid_pointer \\p alpha and \\p beta are invalid,\n \\p descr_A, \\p csr_val_A, \\p csr_row_ptr_A, \\p csr_col_ind_A, \\p descr_B,\n \\p csr_val_B, \\p csr_row_ptr_B, or \\p csr_col_ind_B are invalid if \\p alpha\n is valid, \\p descr_D, \\p csr_val_D, \\p csr_row_ptr_D, or \\p csr_col_ind_D is\n invalid if \\p beta is valid, or \\p csr_val_C, \\p csr_row_ptr_C,\n \\p csr_col_ind_C, \\p info_C, or \\p temp_buffer is invalid.\n \\retval rocsparse_status_memory_error additional buffer for long rows could not be\n allocated.\n \\retval rocsparse_status_not_implemented\n \\p trans_A != \\ref rocsparse_operation_none,\n \\p trans_B != \\ref rocsparse_operation_none, or\n \\p rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n This example multiplies two CSR matrices with a scalar alpha and adds the result to\n another CSR matrix.\n \\code{.c}\n // Initialize scalar multipliers\n float alpha = 2.0f;\n float beta = 1.0f;\n\n // Create matrix descriptors\n rocsparse_mat_descr descr_A;\n rocsparse_mat_descr descr_B;\n rocsparse_mat_descr descr_C;\n rocsparse_mat_descr descr_D;\n\n rocsparse_create_mat_descr(&descr_A);\n rocsparse_create_mat_descr(&descr_B);\n rocsparse_create_mat_descr(&descr_C);\n rocsparse_create_mat_descr(&descr_D);\n\n // Create matrix info structure\n rocsparse_mat_info info_C;\n rocsparse_create_mat_info(&info_C);\n\n // Set pointer mode\n rocsparse_set_pointer_mode(handle, rocsparse_pointer_mode_host);\n\n // Query rocsparse for the required buffer size\n size_t buffer_size;\n\n rocsparse_scsrgemm_buffer_size(handle,\n rocsparse_operation_none,\n rocsparse_operation_none,\n m,\n n,\n k,\n &alpha,\n descr_A,\n nnz_A,\n csr_row_ptr_A,\n csr_col_ind_A,\n descr_B,\n nnz_B,\n csr_row_ptr_B,\n csr_col_ind_B,\n &beta,\n descr_D,\n nnz_D,\n csr_row_ptr_D,\n csr_col_ind_D,\n info_C,\n &buffer_size);\n\n // Allocate buffer\n void* buffer;\n hipMalloc(&buffer, buffer_size);\n\n // Obtain number of total non-zero entries in C and row pointers of C\n rocsparse_int nnz_C;\n hipMalloc((void**)&csr_row_ptr_C, sizeof(rocsparse_int) * (m + 1));\n\n rocsparse_csrgemm_nnz(handle,\n rocsparse_operation_none,\n rocsparse_operation_none,\n m,\n n,\n k,\n descr_A,\n nnz_A,\n csr_row_ptr_A,\n csr_col_ind_A,\n descr_B,\n nnz_B,\n csr_row_ptr_B,\n csr_col_ind_B,\n descr_D,\n nnz_D,\n csr_row_ptr_D,\n csr_col_ind_D,\n descr_C,\n csr_row_ptr_C,\n &nnz_C,\n info_C,\n buffer);\n\n // Compute column indices and values of C\n hipMalloc((void**)&csr_col_ind_C, sizeof(rocsparse_int) * nnz_C);\n rocsparse_csrgemm_symbolic(handle,\n rocsparse_operation_none,\n rocsparse_operation_none,\n m,\n n,\n k,\n descr_A,\n nnz_A,\n csr_row_ptr_A,\n csr_col_ind_A,\n descr_B,\n nnz_B,\n csr_row_ptr_B,\n csr_col_ind_B,\n descr_D,\n nnz_D,\n csr_row_ptr_D,\n csr_col_ind_D,\n descr_C,\n nnz_C,\n csr_row_ptr_C,\n csr_col_ind_C,\n info_C,\n buffer);\n hipMalloc((void**)&csr_val_C, sizeof(float) * nnz_C);\n\n rocsparse_scsrgemm_numeric(handle,\n rocsparse_operation_none,\n rocsparse_operation_none,\n m,\n n,\n k,\n &alpha,\n descr_A,\n nnz_A,\n csr_val_A,\n csr_row_ptr_A,\n csr_col_ind_A,\n descr_B,\n nnz_B,\n csr_val_B,\n csr_row_ptr_B,\n csr_col_ind_B,\n &beta,\n descr_D,\n nnz_D,\n csr_val_D,\n csr_row_ptr_D,\n csr_col_ind_D,\n descr_C,\n nnz_C,\n csr_val_C,\n csr_row_ptr_C,\n csr_col_ind_C,\n info_C,\n buffer);\n \\endcode\n/\n/**@{"]
pub fn rocsparse_scsrgemm_numeric(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
k: rocsparse_int,
alpha: *const f32,
descr_A: rocsparse_mat_descr,
nnz_A: rocsparse_int,
csr_val_A: *const f32,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
descr_B: rocsparse_mat_descr,
nnz_B: rocsparse_int,
csr_val_B: *const f32,
csr_row_ptr_B: *const rocsparse_int,
csr_col_ind_B: *const rocsparse_int,
beta: *const f32,
descr_D: rocsparse_mat_descr,
nnz_D: rocsparse_int,
csr_val_D: *const f32,
csr_row_ptr_D: *const rocsparse_int,
csr_col_ind_D: *const rocsparse_int,
descr_C: rocsparse_mat_descr,
nnz_C: rocsparse_int,
csr_val_C: *mut f32,
csr_row_ptr_C: *const rocsparse_int,
csr_col_ind_C: *const rocsparse_int,
info_C: rocsparse_mat_info,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsrgemm_numeric(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
k: rocsparse_int,
alpha: *const f64,
descr_A: rocsparse_mat_descr,
nnz_A: rocsparse_int,
csr_val_A: *const f64,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
descr_B: rocsparse_mat_descr,
nnz_B: rocsparse_int,
csr_val_B: *const f64,
csr_row_ptr_B: *const rocsparse_int,
csr_col_ind_B: *const rocsparse_int,
beta: *const f64,
descr_D: rocsparse_mat_descr,
nnz_D: rocsparse_int,
csr_val_D: *const f64,
csr_row_ptr_D: *const rocsparse_int,
csr_col_ind_D: *const rocsparse_int,
descr_C: rocsparse_mat_descr,
nnz_C: rocsparse_int,
csr_val_C: *mut f64,
csr_row_ptr_C: *const rocsparse_int,
csr_col_ind_C: *const rocsparse_int,
info_C: rocsparse_mat_info,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsrgemm_numeric(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
k: rocsparse_int,
alpha: *const rocsparse_float_complex,
descr_A: rocsparse_mat_descr,
nnz_A: rocsparse_int,
csr_val_A: *const rocsparse_float_complex,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
descr_B: rocsparse_mat_descr,
nnz_B: rocsparse_int,
csr_val_B: *const rocsparse_float_complex,
csr_row_ptr_B: *const rocsparse_int,
csr_col_ind_B: *const rocsparse_int,
beta: *const rocsparse_float_complex,
descr_D: rocsparse_mat_descr,
nnz_D: rocsparse_int,
csr_val_D: *const rocsparse_float_complex,
csr_row_ptr_D: *const rocsparse_int,
csr_col_ind_D: *const rocsparse_int,
descr_C: rocsparse_mat_descr,
nnz_C: rocsparse_int,
csr_val_C: *mut rocsparse_float_complex,
csr_row_ptr_C: *const rocsparse_int,
csr_col_ind_C: *const rocsparse_int,
info_C: rocsparse_mat_info,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsrgemm_numeric(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
k: rocsparse_int,
alpha: *const rocsparse_double_complex,
descr_A: rocsparse_mat_descr,
nnz_A: rocsparse_int,
csr_val_A: *const rocsparse_double_complex,
csr_row_ptr_A: *const rocsparse_int,
csr_col_ind_A: *const rocsparse_int,
descr_B: rocsparse_mat_descr,
nnz_B: rocsparse_int,
csr_val_B: *const rocsparse_double_complex,
csr_row_ptr_B: *const rocsparse_int,
csr_col_ind_B: *const rocsparse_int,
beta: *const rocsparse_double_complex,
descr_D: rocsparse_mat_descr,
nnz_D: rocsparse_int,
csr_val_D: *const rocsparse_double_complex,
csr_row_ptr_D: *const rocsparse_int,
csr_col_ind_D: *const rocsparse_int,
descr_C: rocsparse_mat_descr,
nnz_C: rocsparse_int,
csr_val_C: *mut rocsparse_double_complex,
csr_row_ptr_C: *const rocsparse_int,
csr_col_ind_C: *const rocsparse_int,
info_C: rocsparse_mat_info,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\brief Scale a sparse vector and add it to a scaled dense vector.\n\n \\details\n \\p rocsparse_axpby multiplies the sparse vector \\f$x\\f$ with scalar \\f$\\alpha\\f$ and\n adds the result to the dense vector \\f$y\\f$ that is multiplied with scalar\n \\f$\\beta\\f$, such that\n\n \\f[\n y := \\alpha \\cdot x + \\beta \\cdot y\n \\f]\n\n \\code{.c}\n for(i = 0; i < size; ++i)\n {\n y[i] = beta * y[i]\n }\n for(i = 0; i < nnz; ++i)\n {\n y[x_ind[i]] += alpha * x_val[i]\n }\n \\endcode\n\n \\p rocsparse_axpby supports the following uniform-precision data types for the sparse and dense vectors \\p x and\n \\p y and compute types for the scalars \\f$\\alpha\\f$ and \\f$\\beta\\f$.\n\n \\par Uniform Precisions:\n <table>\n <caption id=\"axpby_uniform\">Uniform Precisions</caption>\n <tr><th>X / Y / compute_type\n <tr><td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_f64_r\n <tr><td>rocsparse_datatype_f32_c\n <tr><td>rocsparse_datatype_f64_c\n </table>\n\n \\par Mixed Precisions:\n <table>\n <caption id=\"axpby_mixed\">Mixed Precisions</caption>\n <tr><th>X / Y <th>compute_type\n <tr><td>rocsparse_datatype_f16_r <td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_bf16_r <td>rocsparse_datatype_f32_r\n </table>\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n \\note\n This routine does not support batched computation.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n x sparse matrix descriptor.\n @param[in]\n beta scalar \\f$\\beta\\f$.\n @param[inout]\n y dense matrix descriptor.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p alpha, \\p x, \\p beta, or \\p y pointer is\n invalid.\n\n \\par Example\n \\snippet example_rocsparse_axpby.cpp doc example"]
pub fn rocsparse_axpby(
handle: rocsparse_handle,
alpha: *const ::std::os::raw::c_void,
x: rocsparse_const_spvec_descr,
beta: *const ::std::os::raw::c_void,
y: rocsparse_dnvec_descr,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\brief Check matrix to see if it is valid.\n\n \\details\n \\p rocsparse_check_spmat checks whether the input matrix is valid.\n\n \\p rocsparse_check_spmat requires two steps to complete. First, call \\p rocsparse_check_spmat\n with the stage parameter set to \\ref rocsparse_check_spmat_stage_buffer_size, which determines the\n size of the temporary buffer needed in the second step. Allocate this buffer and call\n \\p rocsparse_check_spmat with the stage parameter set to \\ref rocsparse_check_spmat_stage_compute,\n which checks the input matrix for errors. Any detected errors in the input matrix are reported in the\n \\p data_status (passed to the function as a host pointer).\n\n \\par Uniform Precisions:\n <table>\n <caption id=\"check_spmat_uniform\">Uniform Precisions</caption>\n <tr><th>A\n <tr><td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_f64_r\n <tr><td>rocsparse_datatype_f32_c\n <tr><td>rocsparse_datatype_f64_c\n </table>\n\n \\note\n This function writes the required allocation size (in bytes) to \\p buffer_size and\n returns without performing the checking operation when \\p stage is equal to\n \\ref rocsparse_check_spmat_stage_buffer_size.\n\n \\note\n The sparse matrix formats currently supported are: \\p rocsparse_format_coo, \\p rocsparse_format_csr,\n \\p rocsparse_format_csc, \\p rocsparse_format_ell, and \\p rocsparse_format_bsr.\n\n \\note check_spmat requires two stages to complete. The first stage\n \\ref rocsparse_check_spmat_stage_buffer_size will return the size of the temporary storage buffer\n that is required for subsequent calls to \\ref rocsparse_check_spmat.\n In the final stage \\ref rocsparse_check_spmat_stage_compute, the actual computation is performed.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n \\note\n This routine does not support batched computation.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n mat matrix descriptor.\n @param[out]\n data_status modified to indicate the status of the data.\n @param[in]\n stage check_matrix stage for the matrix computation.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer. buffer_size is set when\n \\p temp_buffer is nullptr.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user. When a nullptr is passed,\n the required allocation size (in bytes) is written to \\p buffer_size and\n function returns without performing the checking operation.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p mat, \\p buffer_size, \\p temp_buffer, or \\p data_status pointer\n is invalid.\n \\retval rocsparse_status_invalid_value the value of \\p stage is incorrect.\n\n \\par Example\n This example checks whether a matrix is upper triangular. The matrix passed to\n \\ref rocsparse_check_spmat is invalid because it contains an entry in the lower triangular\n part of the matrix.\n \\snippet example_rocsparse_check_spmat.cpp doc example"]
pub fn rocsparse_check_spmat(
handle: rocsparse_handle,
mat: rocsparse_const_spmat_descr,
data_status: *mut rocsparse_data_status,
stage: rocsparse_check_spmat_stage,
buffer_size: *mut usize,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\brief Dense matrix to sparse matrix conversion.\n\n \\details\n \\p rocsparse_dense_to_sparse performs the conversion of a dense matrix to a sparse matrix in CSR, CSC, or COO format.\n\n \\p rocsparse_dense_to_sparse requires multiple steps to complete. First, call \\p rocsparse_dense_to_sparse\n with \\p nullptr passed into \\p temp_buffer:\n \\code{.c}\n // Call dense_to_sparse to get required buffer size\n size_t buffer_size = 0;\n rocsparse_dense_to_sparse(handle,\n matA,\n matB,\n rocsparse_dense_to_sparse_alg_default,\n &buffer_size,\n nullptr);\n \\endcode\n After this is called, the \\p buffer_size will be filled with the size of the required buffer that must be allocated.\n Next, call \\p rocsparse_dense_to_sparse with the newly allocated \\p temp_buffer and \\p nullptr passed into\n \\p buffer_size:\n \\code{.c}\n // Call dense_to_sparse to perform analysis\n rocsparse_dense_to_sparse(handle,\n matA,\n matB,\n rocsparse_dense_to_sparse_alg_default,\n nullptr,\n temp_buffer);\n \\endcode\n This will determine the number of non-zeros that will exist in the sparse matrix, which can be queried using the\n \\ref rocsparse_spmat_get_size routine. With this, allocate the sparse matrix device arrays and\n set them on the sparse matrix descriptor using \\ref rocsparse_csr_set_pointers (CSR format),\n \\ref rocsparse_csc_set_pointers (for CSC format), or \\ref rocsparse_coo_set_pointers (for COO format). Finally, the\n conversion is completed by calling \\p rocsparse_dense_to_sparse with both the \\p buffer_size and \\p temp_buffer :\n \\code{.c}\n // Call dense_to_sparse to complete conversion\n rocsparse_dense_to_sparse(handle,\n matA,\n matB,\n rocsparse_dense_to_sparse_alg_default,\n &buffer_size,\n temp_buffer);\n \\endcode\n Currently, \\p rocsparse_dense_to_sparse only supports the algorithm \\ref rocsparse_dense_to_sparse_alg_default.\n See the full example below.\n\n \\p rocsparse_dense_to_sparse supports \\ref rocsparse_datatype_f16_r, \\ref rocsparse_datatype_bf16_r, \\ref rocsparse_datatype_f32_r,\n \\ref rocsparse_datatype_f64_r, \\ref rocsparse_datatype_f32_c, and \\ref rocsparse_datatype_f64_c for values arrays in the sparse matrix\n (stored in CSR, CSC, or COO format) and the dense matrix. For the row/column offset and row/column index arrays of the sparse matrix,\n \\p rocsparse_dense_to_sparse supports the precisions \\ref rocsparse_indextype_i32 and \\ref rocsparse_indextype_i64.\n\n \\par Uniform Precisions:\n <table>\n <caption id=\"dense_to_sparse_uniform\">Uniform Precisions</caption>\n <tr><th>A / B\n <tr><td>rocsparse_datatype_f16_r\n <tr><td>rocsparse_datatype_bf16_r\n <tr><td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_f64_r\n <tr><td>rocsparse_datatype_f32_c\n <tr><td>rocsparse_datatype_f64_c\n </table>\n\n \\note\n This function writes the required allocation size (in bytes) to \\p buffer_size and\n returns without performing the dense to sparse operation, when a nullptr is passed for\n \\p temp_buffer.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n \\note\n This routine does not support batched computation.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n mat_A dense matrix descriptor.\n @param[in]\n mat_B sparse matrix descriptor.\n @param[in]\n alg algorithm for the dense to sparse computation.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer. buffer_size is set when\n \\p temp_buffer is nullptr.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user. When a nullptr is passed,\n the required allocation size (in bytes) is written to \\p buffer_size and the\n function returns without performing the dense to sparse operation.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p mat_A, \\p mat_B, or \\p buffer_size\n pointer is invalid.\n\n \\par Example\n \\snippet example_rocsparse_dense_to_sparse.cpp doc example"]
pub fn rocsparse_dense_to_sparse(
handle: rocsparse_handle,
mat_A: rocsparse_const_dnmat_descr,
mat_B: rocsparse_spmat_descr,
alg: rocsparse_dense_to_sparse_alg,
buffer_size: *mut usize,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\details\n \\p rocsparse_extract_buffer_size calculates the required buffer size in bytes for a given stage \\p stage.\n This routine is used in conjunction with \\ref rocsparse_extract_nnz and \\ref rocsparse_extract to extract\n a lower or upper triangular sparse matrix from an input sparse matrix. See \\ref rocsparse_extract for more\n details.\n\n \\note\n This routine is asynchronous with respect to the host.\n This routine supports execution in a hipGraph context.\n\n \\note\n This routine does not support batched computation.\n\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n descr descriptor of the extract algorithm.\n @param[in]\n source source sparse matrix descriptor.\n @param[in]\n target target sparse matrix descriptor.\n @param[in]\n stage stage of the extract computation.\n @param[out]\n buffer_size_in_bytes size in bytes of the buffer.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_value if \\p stage is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p source, \\p target, or \\p buffer_size_in_bytes\n pointer is invalid."]
pub fn rocsparse_extract_buffer_size(
handle: rocsparse_handle,
descr: rocsparse_extract_descr,
source: rocsparse_const_spmat_descr,
target: rocsparse_spmat_descr,
stage: rocsparse_extract_stage,
buffer_size_in_bytes: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\details\n \\p rocsparse_extract_nnz returns the number of non-zeros in the extracted matrix. The value is\n available after the analysis phase \\ref rocsparse_extract_stage_analysis has been executed. This routine\n is used in conjunction with \\ref rocsparse_extract_buffer_size and \\ref rocsparse_extract to extract a lower\n or upper triangular sparse matrix from an input sparse matrix. See \\ref rocsparse_extract for more\n details.\n\n \\note\n This routine is asynchronous with respect to the host.\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n descr descriptor of the extract algorithm.\n @param[out]\n nnz the number of non-zeros.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p descr or \\p nnz pointer is invalid."]
pub fn rocsparse_extract_nnz(
handle: rocsparse_handle,
descr: rocsparse_extract_descr,
nnz: *mut i64,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\brief Sparse matrix extraction.\n\n \\details\n \\p rocsparse_extract performs the extraction of the lower or upper part of a sparse matrix into a new matrix.\n\n \\p rocsparse_extract requires multiple steps to complete. First, create the source and target sparse matrix\n descriptors. For example, in the case of CSR matrix format, this might look like:\n \\code{.c}\n // Build Source\n rocsparse_spmat_descr source;\n rocsparse_create_csr_descr(&source,\n M,\n N,\n nnz,\n dsource_row_ptr,\n dsource_col_ind,\n dsource_val,\n rocsparse_indextype_i32,\n rocsparse_indextype_i32,\n rocsparse_index_base_zero,\n rocsparse_datatype_f32_r);\n\n // Build target\n void * dtarget_row_ptr;\n hipMalloc(&dtarget_row_ptr, sizeof(int32_t) * (M + 1));\n rocsparse_spmat_descr target;\n rocsparse_create_csr_descr(&target,\n M,\n N,\n 0,\n dtarget_row_ptr,\n nullptr,\n nullptr,\n rocsparse_indextype_i32,\n rocsparse_indextype_i32,\n rocsparse_index_base_zero,\n rocsparse_datatype_f32_r);\n \\endcode\n Next, create the extraction descriptor and call \\ref rocsparse_extract_buffer_size with the stage\n \\ref rocsparse_extract_stage_analysis to determine the amount of temporary storage required.\n Allocate this temporary storage buffer and pass it to \\p rocsparse_extract with the stage\n \\ref rocsparse_extract_stage_analysis.\n \\code{.c}\n // Create descriptor\n rocsparse_extract_descr descr;\n rocsparse_create_extract_descr(&descr,\n source,\n target,\n rocsparse_extract_alg_default);\n\n // Analysis phase\n size_t buffer_size;\n rocsparse_extract_buffer_size(handle,\n descr,\n source,\n target,\n rocsparse_extract_stage_analysis,\n &buffer_size);\n void* dbuffer = nullptr;\n hipMalloc(&dbuffer, buffer_size);\n rocsparse_extract(handle,\n descr,\n source,\n target,\n rocsparse_extract_stage_analysis,\n buffer_size,\n dbuffer);\n hipFree(dbuffer);\n \\endcode\n Then calls \\ref rocsparse_extract_nnz to determine the number of non-zeros that will exist in the\n target matrix. After this is determined, allocate the column indices and values arrays of the target sparse\n matrix:\n \\code{.c}\n int64_t target_nnz;\n rocsparse_extract_nnz(handle, descr, &target_nnz);\n\n void* dtarget_col_ind,\n void* dtarget_val;\n hipMalloc(&dtarget_col_ind, sizeof(int32_t) * target_nnz);\n hipMalloc(&dtarget_val, sizeof(float) * target_nnz);\n rocsparse_csr_set_pointers(target, dtarget_row_ptr, dtarget_col_ind, dtarget_val);\n \\endcode\n Finally, call \\ref rocsparse_extract_buffer_size with the stage \\ref rocsparse_extract_stage_compute\n to determine the size of the temporary user-allocated storage needed for the computation of the column indices and values\n in the sparse target. Allocate this buffer and complete the conversion by calling \\p rocsparse_extract using\n the \\ref rocsparse_extract_stage_compute stage:\n \\code{.c}\n // Calculation phase\n rocsparse_extract_buffer_size(handle,\n descr,\n source,\n target,\n rocsparse_extract_stage_compute,\n &buffer_size);\n hipMalloc(&dbuffer, buffer_size);\n rocsparse_extract(handle,\n descr,\n source,\n target,\n rocsparse_extract_stage_compute,\n buffer_size,\n dbuffer);\n hipFree(dbuffer);\n \\endcode\n The target row pointer, column indices, and values arrays will now be filled with the upper or lower part of the source matrix.\n\n The source and the target matrices must have the same format (see \\ref rocsparse_format) and the same storage mode (see\n \\ref rocsparse_storage_mode). The attributes of the target matrix, the fill mode \\ref rocsparse_fill_mode, and the diagonal\n type \\ref rocsparse_diag_type are used to parameterize the algorithm. These can be set on the target matrix using\n \\ref rocsparse_spmat_set_attribute. See the full example below.\n\n \\note\n This routine is asynchronous with respect to the host.\n This routine supports execution in a hipGraph context.\n \\note\n Supported formats are \\ref rocsparse_format_csr and \\ref rocsparse_format_csc.\n\n \\note\n This routine does not support batched computation.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n descr descriptor of the extract algorithm.\n @param[in]\n source sparse matrix descriptor.\n @param[in]\n target sparse matrix descriptor.\n @param[in]\n stage stage of the extract computation.\n @param[in]\n buffer_size_in_bytes size in bytes of the \\p buffer.\n @param[in]\n buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_value if \\p stage is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p source, \\p target, or \\p buffer\n pointer is invalid.\n \\par Example\n This example extracts the lower part of CSR matrix into a CSR matrix.\n \\snippet example_rocsparse_extract.cpp doc example"]
pub fn rocsparse_extract(
handle: rocsparse_handle,
descr: rocsparse_extract_descr,
source: rocsparse_const_spmat_descr,
target: rocsparse_spmat_descr,
stage: rocsparse_extract_stage,
buffer_size_in_bytes: usize,
buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\brief Gather elements from a dense vector and store them in a sparse vector.\n\n \\details\n \\p rocsparse_gather gathers the elements from the dense vector \\f$y\\f$ and stores\n them in the sparse vector \\f$x\\f$.\n\n \\code{.c}\n for(i = 0; i < nnz; ++i)\n {\n x_val[i] = y[x_ind[i]];\n }\n \\endcode\n\n \\p rocsparse_gather supports the following uniform-precision data types for the sparse and dense vectors \\p x and\n \\p y.\n\n \\par Uniform Precisions:\n <table>\n <caption id=\"gather_uniform\">Uniform Precisions</caption>\n <tr><th>X / Y\n <tr><td>rocsparse_datatype_i8_r\n <tr><td>rocsparse_datatype_f16_r\n <tr><td>rocsparse_datatype_bf16_r\n <tr><td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_f64_r\n <tr><td>rocsparse_datatype_f32_c\n <tr><td>rocsparse_datatype_f64_c\n </table>\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n \\note\n This routine does not support batched computation.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n y dense vector \\f$y\\f$.\n @param[out]\n x sparse vector \\f$x\\f$.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p x or \\p y pointer is invalid.\n\n \\par Example\n \\snippet example_rocsparse_gather.cpp doc example"]
pub fn rocsparse_gather(
handle: rocsparse_handle,
y: rocsparse_const_dnvec_descr,
x: rocsparse_spvec_descr,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\brief Apply Givens rotation to a dense and a sparse vector.\n\n \\details\n \\p rocsparse_rot applies the Givens rotation matrix \\f$G\\f$ to the sparse vector\n \\f$x\\f$ and the dense vector \\f$y\\f$, where\n \\f[\n G = \\begin{pmatrix} c & s \\\\ -s & c \\end{pmatrix}\n \\f]\n\n \\code{.c}\n for(i = 0; i < nnz; ++i)\n {\n x_tmp = x_val[i];\n y_tmp = y[x_ind[i]];\n\n x_val[i] = c * x_tmp + s * y_tmp;\n y[x_ind[i]] = c * y_tmp - s * x_tmp;\n }\n \\endcode\n\n \\p rocsparse_rot supports the following uniform-precision data types for the sparse and dense vectors \\p x and\n \\p y and compute types for the scalars \\f$c\\f$ and \\f$s\\f$.\n\n \\par Uniform Precisions:\n <table>\n <caption id=\"rot_uniform\">Uniform Precisions</caption>\n <tr><th>X / Y / compute_type\n <tr><td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_f64_r\n <tr><td>rocsparse_datatype_f32_c\n <tr><td>rocsparse_datatype_f64_c\n </table>\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n \\note\n This routine does not support batched computation.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n c pointer to the cosine element of \\f$G\\f$, which can be on host or device.\n @param[in]\n s pointer to the sine element of \\f$G\\f$, which can be on host or device.\n @param[inout]\n x sparse vector \\f$x\\f$.\n @param[inout]\n y dense vector \\f$y\\f$.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p c, \\p s, \\p x, or \\p y pointer is\n invalid.\n \\par Example\n \\snippet example_rocsparse_rot.cpp doc example"]
pub fn rocsparse_rot(
handle: rocsparse_handle,
c: *const ::std::os::raw::c_void,
s: *const ::std::os::raw::c_void,
x: rocsparse_spvec_descr,
y: rocsparse_dnvec_descr,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\brief Scatter elements from a sparse vector into a dense vector.\n\n \\details\n \\p rocsparse_scatter scatters the elements from the sparse vector \\f$x\\f$ into the dense\n vector \\f$y\\f$.\n\n \\code{.c}\n for(i = 0; i < nnz; ++i)\n {\n y[x_ind[i]] = x_val[i];\n }\n \\endcode\n\n \\p rocsparse_scatter supports the following uniform-precision data types for the sparse and dense vectors \\p x and\n \\p y.\n\n \\par Uniform Precisions:\n <table>\n <caption id=\"scatter_uniform\">Uniform Precisions</caption>\n <tr><th>X / Y\n <tr><td>rocsparse_datatype_i8_r\n <tr><td>rocsparse_datatype_f16_r\n <tr><td>rocsparse_datatype_bf16_r\n <tr><td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_f64_r\n <tr><td>rocsparse_datatype_f32_c\n <tr><td>rocsparse_datatype_f64_c\n </table>\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n \\note\n This routine does not support batched computation.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n x sparse vector \\f$x\\f$.\n @param[out]\n y dense vector \\f$y\\f$.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p x or \\p y pointer is invalid.\n\n \\par Example\n \\snippet example_rocsparse_scatter.cpp doc example"]
pub fn rocsparse_scatter(
handle: rocsparse_handle,
x: rocsparse_const_spvec_descr,
y: rocsparse_dnvec_descr,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\details\n \\p rocsparse_sddmm_buffer_size returns the size of the required buffer to execute the SDDMM operation from a given configuration.\n This routine is used in conjunction with \\ref rocsparse_sddmm_preprocess() and \\ref rocsparse_sddmm().\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n opA dense matrix \\f$A\\f$ operation type.\n @param[in]\n opB dense matrix \\f$B\\f$ operation type.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n mat_A dense matrix \\f$A\\f$ descriptor.\n @param[in]\n mat_B dense matrix \\f$B\\f$ descriptor.\n @param[in]\n beta scalar \\f$\\beta\\f$.\n @param[inout]\n mat_C sparse matrix \\f$C\\f$ descriptor.\n @param[in]\n compute_type floating point precision for the SDDMM computation.\n @param[in]\n alg specification of the algorithm to use.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_value the value of \\p opA or \\p opB is incorrect.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p alpha and \\p beta are invalid,\n or the \\p mat_A, \\p mat_B, \\p mat_C, or \\p buffer_size pointer is invalid.\n \\retval rocsparse_status_not_implemented\n \\p opA == \\ref rocsparse_operation_conjugate_transpose or\n \\p opB == \\ref rocsparse_operation_conjugate_transpose."]
pub fn rocsparse_sddmm_buffer_size(
handle: rocsparse_handle,
opA: rocsparse_operation,
opB: rocsparse_operation,
alpha: *const ::std::os::raw::c_void,
mat_A: rocsparse_const_dnmat_descr,
mat_B: rocsparse_const_dnmat_descr,
beta: *const ::std::os::raw::c_void,
mat_C: rocsparse_spmat_descr,
compute_type: rocsparse_datatype,
alg: rocsparse_sddmm_alg,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\details\n \\p rocsparse_sddmm_preprocess executes a part of the algorithm that can be calculated once in the context of multiple\n calls of the \\ref rocsparse_sddmm with the same sparsity pattern.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n opA dense matrix \\f$A\\f$ operation type.\n @param[in]\n opB dense matrix \\f$B\\f$ operation type.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n mat_A dense matrix \\f$A\\f$ descriptor.\n @param[in]\n mat_B dense matrix \\f$B\\f$ descriptor.\n @param[in]\n beta scalar \\f$\\beta\\f$.\n @param[inout]\n mat_C sparse matrix \\f$C\\f$ descriptor.\n @param[in]\n compute_type floating point precision for the SDDMM computation.\n @param[in]\n alg specification of the algorithm to use.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n The size must be greater or equal to the size obtained with \\ref rocsparse_sddmm_buffer_size.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_value the value of \\p opA or \\p opB is incorrect.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p alpha and \\p beta are invalid, or the\n \\p mat_A, \\p mat_B, \\p mat_C, or \\p temp_buffer pointer is invalid.\n \\retval rocsparse_status_not_implemented\n \\p opA == \\ref rocsparse_operation_conjugate_transpose or\n \\p opB == \\ref rocsparse_operation_conjugate_transpose."]
pub fn rocsparse_sddmm_preprocess(
handle: rocsparse_handle,
opA: rocsparse_operation,
opB: rocsparse_operation,
alpha: *const ::std::os::raw::c_void,
mat_A: rocsparse_const_dnmat_descr,
mat_B: rocsparse_const_dnmat_descr,
beta: *const ::std::os::raw::c_void,
mat_C: rocsparse_spmat_descr,
compute_type: rocsparse_datatype,
alg: rocsparse_sddmm_alg,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\brief Sampled Dense-Dense Matrix Multiplication.\n\n \\details\n \\p rocsparse_sddmm multiplies the scalar \\f$\\alpha\\f$ with the dense\n \\f$m \\times k\\f$ matrix \\f$op(A)\\f$, the dense \\f$k \\times n\\f$ matrix \\f$op(B)\\f$, filtered by the sparsity pattern\n of the \\f$m \\times n\\f$ sparse matrix \\f$C\\f$ and adds the result to \\f$C\\f$ scaled by\n \\f$\\beta\\f$. The final result is stored in the sparse \\f$m \\times n\\f$ matrix \\f$C\\f$,\n such that\n \\f[\n C := \\alpha ( op(A) \\cdot op(B) ) \\circ spy(C) + \\beta C,\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if op(A) == rocsparse_operation_none} \\\\\n A^T, & \\text{if op(A) == rocsparse_operation_transpose} \\\\\n \\end{array}\n \\right.\n \\f],\n \\f[\n op(B) = \\left\\{\n \\begin{array}{ll}\n B, & \\text{if op(B) == rocsparse_operation_none} \\\\\n B^T, & \\text{if op(B) == rocsparse_operation_transpose} \\\\\n \\end{array}\n \\right.\n \\f]\n and\n \\f[\n spy(C)_{ij} = \\left\\{\n \\begin{array}{ll}\n 1, & \\text{ if C_{ij} != 0} \\\\\n 0, & \\text{ otherwise} \\\\\n \\end{array}\n \\right.\n \\f]\n\n Computing the above sampled dense-dense multiplication requires three steps to complete. First, call\n \\ref rocsparse_sddmm_buffer_size to determine the size of the required temporary storage buffer. Next,\n allocate this buffer and call \\ref rocsparse_sddmm_preprocess, which performs any analysis of the input matrices\n that might be required. Finally, call \\p rocsparse_sddmm to complete the computation. After all calls to\n \\p rocsparse_sddmm are complete, the temporary buffer can be deallocated.\n\n \\p rocsparse_sddmm supports different algorithms which can provide better performance for different matrices.\n\n <table>\n <caption id=\"sddmm_algorithms\">Algorithms</caption>\n <tr><th>Algorithms <th>Deterministic <th>Preprocessing <th>Notes\n <tr><td>rocsparse_sddmm_alg_default</td> <td>Yes</td> <td>No</td> <td>Uses the sparsity pattern of matrix C to perform a limited set of dot products. </td>\n <tr><td>rocsparse_sddmm_alg_dense</td> <td>Yes</td> <td>No</td> <td>Explicitly converts the matrix C into a dense matrix to perform a dense matrix multiply and add. </td>\n </table>\n\n Currently, \\p rocsparse_sddmm only supports the uniform precisions indicated in the table below. For the sparse matrix \\f$C\\f$, \\p rocsparse_sddmm supports the index types\n \\ref rocsparse_indextype_i32 and \\ref rocsparse_indextype_i64.\n\n \\par Uniform Precisions:\n <table>\n <caption id=\"sddmm_uniform\">Uniform Precisions</caption>\n <tr><th>A / B / C / compute_type\n <tr><td>rocsparse_datatype_f16_r\n <tr><td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_f64_r\n <tr><td>rocsparse_datatype_f32_c\n <tr><td>rocsparse_datatype_f64_c\n </table>\n\n \\par Mixed Precisions:\n <table>\n <caption id=\"sddmm_mixed\">Mixed Precisions</caption>\n <tr><th>A / B <th>C <th>compute_type\n <tr><td>rocsparse_datatype_f16_r <td>rocsparse_datatype_f32_r <td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_f16_r <td>rocsparse_datatype_f16_r <td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_bf16_r <td>rocsparse_datatype_f32_r <td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_bf16_r <td>rocsparse_datatype_bf16_r <td>rocsparse_datatype_f32_r\n </table>\n\n \\note\n The sparse matrix formats currently supported are: \\ref rocsparse_format_csr,\n \\ref rocsparse_format_csc, \\ref rocsparse_format_coo, \\ref rocsparse_format_coo_aos,\n and \\ref rocsparse_format_ell.\n\n \\note \\p opA == \\ref rocsparse_operation_conjugate_transpose is not supported.\n \\note \\p opB == \\ref rocsparse_operation_conjugate_transpose is not supported.\n\n \\note\n This routine supports execution in a hipGraph context only when \\p alg == \\ref rocsparse_sddmm_alg_default.\n\n \\note\n This routine does not support batched computation.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n opA dense matrix \\f$A\\f$ operation type.\n @param[in]\n opB dense matrix \\f$B\\f$ operation type.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n mat_A dense matrix \\f$A\\f$ descriptor.\n @param[in]\n mat_B dense matrix \\f$B\\f$ descriptor.\n @param[in]\n beta scalar \\f$\\beta\\f$.\n @param[inout]\n mat_C sparse matrix \\f$C\\f$ descriptor.\n @param[in]\n compute_type floating point precision for the SDDMM computation.\n @param[in]\n alg specification of the algorithm to use.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n The size must be greater or equal to the size obtained with \\ref rocsparse_sddmm_buffer_size.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_value the value of \\p opA, \\p opB, \\p compute\\_type, or \\p alg is incorrect.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p alpha and \\p beta are invalid, or the\n \\p mat_A, \\p mat_B, \\p mat_C, or \\p temp_buffer pointer is invalid.\n \\retval rocsparse_status_not_implemented\n \\p opA == \\ref rocsparse_operation_conjugate_transpose or\n \\p opB == \\ref rocsparse_operation_conjugate_transpose.\n\n \\par Example\n This example performs a sampled dense-dense matrix product, \\f$C := \\alpha ( A \\cdot B ) \\circ spy(C) + \\beta C\\f$\n where \\f$\\circ\\f$ is the Hadamard product.\n \\snippet example_rocsparse_sddmm.cpp doc example"]
pub fn rocsparse_sddmm(
handle: rocsparse_handle,
opA: rocsparse_operation,
opB: rocsparse_operation,
alpha: *const ::std::os::raw::c_void,
mat_A: rocsparse_const_dnmat_descr,
mat_B: rocsparse_const_dnmat_descr,
beta: *const ::std::os::raw::c_void,
mat_C: rocsparse_spmat_descr,
compute_type: rocsparse_datatype,
alg: rocsparse_sddmm_alg,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\brief Sparse matrix to dense matrix conversion.\n\n \\details\n \\p rocsparse_sparse_to_dense performs the conversion of a sparse matrix in CSR, CSC, or COO format to a dense matrix.\n\n \\p rocsparse_sparse_to_dense requires multiple steps to complete. First, call \\p rocsparse_sparse_to_dense\n with \\p nullptr passed into \\p temp_buffer:\n \\code{.c}\n // Call sparse_to_dense to get required buffer size\n size_t buffer_size = 0;\n rocsparse_sparse_to_dense(handle,\n matA,\n matB,\n rocsparse_sparse_to_dense_alg_default,\n &buffer_size,\n nullptr);\n \\endcode\n After this is called, the \\p buffer_size will be filled with the size of the required buffer that must be allocated.\n Finally, the conversion is completed by calling \\p rocsparse_sparse_to_dense with both the \\p buffer_size and \\p temp_buffer:\n \\code{.c}\n // Call dense_to_sparse to complete conversion\n rocsparse_sparse_to_dense(handle,\n matA,\n matB,\n rocsparse_sparse_to_dense_alg_default,\n &buffer_size,\n temp_buffer);\n \\endcode\n Currently, \\p rocsparse_sparse_to_dense only supports the algorithm \\ref rocsparse_sparse_to_dense_alg_default.\n See the full example below.\n\n \\p rocsparse_sparse_to_dense supports \\ref rocsparse_datatype_f16_r, \\ref rocsparse_datatype_bf16_r, \\ref rocsparse_datatype_f32_r,\n \\ref rocsparse_datatype_f64_r, \\ref rocsparse_datatype_f32_c, and \\ref rocsparse_datatype_f64_c for values arrays in the sparse matrix\n (stored in CSR, CSC, or COO format) and the dense matrix. For the row/column offset and row/column index arrays of the\n sparse matrix, \\p rocsparse_sparse_to_dense supports the precisions \\ref rocsparse_indextype_i32 and\n \\ref rocsparse_indextype_i64.\n\n \\par Uniform Precisions:\n <table>\n <caption id=\"sparse_to_dense_uniform\">Uniform Precisions</caption>\n <tr><th>A / B\n <tr><td>rocsparse_datatype_f16_r\n <tr><td>rocsparse_datatype_bf16_r\n <tr><td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_f64_r\n <tr><td>rocsparse_datatype_f32_c\n <tr><td>rocsparse_datatype_f64_c\n </table>\n\n \\note\n This function writes the required allocation size (in bytes) to \\p buffer_size and\n returns without performing the sparse to dense operation when NULL is passed for\n \\p temp_buffer.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n \\note\n This routine does not support batched computation.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n mat_A sparse matrix descriptor.\n @param[in]\n mat_B dense matrix descriptor.\n @param[in]\n alg algorithm for the sparse to dense computation.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer. buffer_size is set when\n \\p temp_buffer is nullptr.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user. When a nullptr is passed,\n the required allocation size (in bytes) is written to \\p buffer_size and the\n function returns without performing the sparse to dense operation.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p mat_A, \\p mat_B, or \\p buffer_size\n pointer is invalid.\n\n \\par Example\n \\snippet example_rocsparse_sparse_to_dense.cpp doc example"]
pub fn rocsparse_sparse_to_dense(
handle: rocsparse_handle,
mat_A: rocsparse_const_spmat_descr,
mat_B: rocsparse_dnmat_descr,
alg: rocsparse_sparse_to_dense_alg,
buffer_size: *mut usize,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\details\n \\p rocsparse_sparse_to_sparse_buffer_size calculates the required buffer size in bytes for a given stage \\p stage.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n descr descriptor of the sparse_to_sparse algorithm.\n @param[in]\n source source sparse matrix descriptor.\n @param[in]\n target target sparse matrix descriptor.\n @param[in]\n stage stage of the sparse_to_sparse computation.\n @param[out]\n buffer_size_in_bytes size in bytes of the \\p buffer\n\n \\note\n This routine does not support batched computation.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_value if any required enumeration is invalid.\n \\retval rocsparse_status_invalid_pointer \\p mat_A, \\p mat_B, or \\p buffer_size_in_bytes\n pointer is invalid."]
pub fn rocsparse_sparse_to_sparse_buffer_size(
handle: rocsparse_handle,
descr: rocsparse_sparse_to_sparse_descr,
source: rocsparse_const_spmat_descr,
target: rocsparse_spmat_descr,
stage: rocsparse_sparse_to_sparse_stage,
buffer_size_in_bytes: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\brief Sparse matrix to sparse matrix conversion.\n\n \\details\n \\p rocsparse_sparse_to_sparse performs the conversion of a sparse matrix to a sparse matrix.\n\n \\note\n The required allocation size (in bytes) to \\p buffer_size_in_bytes must be obtained from \\ref rocsparse_sparse_to_sparse_buffer_size\n for each stage. The required buffer size can be different between stages.\n\n \\note\n The \\ref rocsparse_format_bell and \\ref rocsparse_format_sell formats are not supported.\n\n \\note\n This routine does not support batched computation.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n descr descriptor of the sparse_to_sparse algorithm.\n @param[in]\n source sparse matrix descriptor.\n @param[in]\n target sparse matrix descriptor.\n @param[in]\n stage stage of the sparse_to_sparse computation.\n @param[in]\n buffer_size_in_bytes size in bytes of the \\p buffer.\n @param[in]\n buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\par Example\n This example converts a CSR matrix into an ELL matrix.\n \\snippet example_rocsparse_sparse_to_sparse.cpp doc example"]
pub fn rocsparse_sparse_to_sparse(
handle: rocsparse_handle,
descr: rocsparse_sparse_to_sparse_descr,
source: rocsparse_const_spmat_descr,
target: rocsparse_spmat_descr,
stage: rocsparse_sparse_to_sparse_stage,
buffer_size_in_bytes: usize,
buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\details\n \\p rocsparse_spgeam_buffer_size returns the size of the required buffer to execute the given stage of the SpGEAM operation.\n This routine is used in conjunction with \\ref rocsparse_spgeam(). See \\ref rocsparse_spgeam for a full description and example.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n descr SpGEAM descriptor.\n @param[in]\n mat_A sparse matrix \\f$A\\f$ descriptor.\n @param[in]\n mat_B sparse matrix \\f$B\\f$ descriptor.\n @param[in]\n mat_C sparse matrix \\f$C\\f$ descriptor.\n @param[in]\n stage SpGEAM stage for the SpGEAM computation.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer.\n @param[out]\n error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if an error descriptor is not required.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p mat_A, \\p mat_B, \\p descr, or \\p buffer_size pointer is invalid."]
pub fn rocsparse_spgeam_buffer_size(
handle: rocsparse_handle,
descr: rocsparse_spgeam_descr,
mat_A: rocsparse_const_spmat_descr,
mat_B: rocsparse_const_spmat_descr,
mat_C: rocsparse_const_spmat_descr,
stage: rocsparse_spgeam_stage,
buffer_size: *mut usize,
error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\brief Sparse matrix sparse matrix addition.\n\n \\details\n \\p rocsparse_spgeam multiplies the scalar \\f$\\alpha\\f$ with the sparse \\f$m \\times n\\f$ CSR matrix \\f$op(A)\\f$\n and adds it to \\f$\\beta\\f$ multiplied by the sparse \\f$m \\times n\\f$ matrix \\f$op(B)\\f$. The final result is\n stored in the sparse \\f$m \\times n\\f$ matrix \\f$C\\f$,\n such that\n \\f[\n C := \\alpha op(A) + \\beta op(B),\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans_A == rocsparse_operation_none}\n \\end{array}\n \\right.\n \\f]\n and\n \\f[\n op(B) = \\left\\{\n \\begin{array}{ll}\n B, & \\text{if trans_B == rocsparse_operation_none}\n \\end{array}\n \\right.\n \\f]\n\n \\p rocsparse_spgeam requires multiple steps to complete. First, create a \\ref rocsparse_spgeam_descr by\n calling \\ref rocsparse_create_spgeam_descr. Set the SpGEAM algorithm (currently only\n \\ref rocsparse_spgeam_alg_default supported) as well as the compute type and the transpose operation type for the sparse\n matrices \\f$op(A)\\f$ and \\f$op(B)\\f$ using \\ref rocsparse_spgeam_set_input. Next, calculate the total non-zeros\n that will exist in the sparse matrix \\f$C\\f$. To do so, call \\ref rocsparse_spgeam_buffer_size with the stage set\n to \\ref rocsparse_spgeam_stage_analysis. This will fill the \\p buffer_size parameter, allowing allocation of this buffer.\n After the buffer has been allocated, call \\p rocsparse_spgeam with the same stage \\ref rocsparse_spgeam_stage_analysis.\n The total non-zeros and the row offset array for \\f$C\\f$ have now been calculated and are stored internally in the\n \\ref rocsparse_spgeam_descr. Now, retrieve the non-zero count using \\ref rocsparse_spgeam_get_output and then\n allocate the \\f$C\\f$ matrix. To complete the computation, repeat the process (this time passing the stage\n \\ref rocsparse_spgeam_stage_compute) by calling \\ref rocsparse_spgeam_buffer_size to determine the required buffer size, then\n allocate the buffer, and finally call \\p rocsparse_spgeam. The user-allocated buffers can be freed after each call to\n \\p rocsparse_spgeam. After the computation is complete and the SpGEAM descriptor is no longer needed, call\n \\ref rocsparse_destroy_spgeam_descr. See the full code example below.\n\n The stage \\ref rocsparse_spgeam_stage_compute computes the symbolic part and the numeric of the resulting matrix C. To perform multiple operations involving matrices of same sparsity patterns but with different numerical values, the symbolic stages (\\ref rocsparse_spgeam_stage_symbolic_analysis and \\ref rocsparse_spgeam_stage_symbolic_compute) and the numeric stages (\\ref rocsparse_spgeam_stage_numeric_analysis and \\ref rocsparse_spgeam_stage_numeric_compute) can be used to separate the symbolic calculation from the numeric calculation.\n\n \\note The stages \\ref rocsparse_spgeam_stage_analysis and \\ref rocsparse_spgeam_stage_compute cannot be mixed with the stages \\ref rocsparse_spgeam_stage_symbolic_analysis, \\ref rocsparse_spgeam_stage_symbolic_compute, \\ref rocsparse_spgeam_stage_numeric_analysis, and \\ref rocsparse_spgeam_stage_numeric_compute.\n \\note The stage \\ref rocsparse_spgeam_stage_analysis must precede the stage \\ref rocsparse_spgeam_stage_compute.\n \\note The stage \\ref rocsparse_spgeam_stage_symbolic_analysis must precede the stage \\ref rocsparse_spgeam_stage_symbolic_compute.\n \\note The stage \\ref rocsparse_spgeam_stage_numeric_analysis must precede the stage \\ref rocsparse_spgeam_stage_numeric_compute.\n \\note The symbolic stages are not required to perform the numeric stages.\n \\note The stage \\ref rocsparse_spgeam_stage_numeric_analysis must be reapplied if the numeric values of the input matrices \\p mat_A and \\p mat_B have changed between subsequent calls of the stage \\ref rocsparse_spgeam_stage_numeric_compute.\n\n \\p rocsparse_spgeam supports multiple combinations of index types, data types, and compute types. The tables below indicate\n the currently supported different index and data types that can be used for the sparse matrices \\f$op(A)\\f$, \\f$op(B)\\f$, and\n \\f$C\\f$, and the compute type for \\f$\\alpha\\f$ and \\f$\\beta\\f$. The advantage of using different index and data types is to save on\n memory bandwidth and storage when a user application allows, while performing the actual computation in a higher precision.\n\n \\note\n This routine does not support batched computation.\n\n \\par Uniform Precisions:\n <table>\n <caption id=\"spgeam_uniform\">Uniform Precisions</caption>\n <tr><th>A / B / C / compute_type\n <tr><td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_f64_r\n <tr><td>rocsparse_datatype_f32_c\n <tr><td>rocsparse_datatype_f64_c\n </table>\n\n \\par Uniform Index Types:\n <table>\n <caption id=\"spgeam_csr_uniform_indextype\">CSR Uniform Index Types</caption>\n <tr><th>CSR Row offset <th>CSR Column indices\n <tr><td>rocsparse_indextype_i32</td> <td>rocsparse_indextype_i32</td>\n <tr><td>rocsparse_indextype_i64</td> <td>rocsparse_indextype_i64</td>\n </table>\n\n \\par Mixed Index Types:\n <table>\n <caption id=\"spgeam_csr_mixed_indextype\">CSR Mixed Index Types</caption>\n <tr><th>CSR Row offset <th>CSR Column indices\n <tr><td>rocsparse_indextype_i64</td> <td>rocsparse_indextype_i32</td>\n </table>\n\n In general, when adding two sparse matrices together, it is possible that the resulting matrix will require\n a larger index representation to store correctly. For example, when adding \\f$A + B\\f$ using\n \\ref rocsparse_indextype_i32 index types for the row pointer and column indices arrays, it might be the case that the row pointer\n of the resulting \\f$C\\f$ matrix would require index type \\ref rocsparse_indextype_i64. This is currently not supported. In this\n scenario, store the \\f$A\\f$, \\f$B\\f$, and \\f$C\\f$ matrices using the higher index precision.\n\n Additionally, all three matrices \\f$A\\f$, \\f$B\\f$, and \\f$C\\f$ must use the same index types. For example, if \\f$A\\f$ uses the\n index type \\ref rocsparse_indextype_i32 for the row offset array and the index type \\ref rocsparse_indextype_i32 for the column\n indices array, then both \\f$B\\f$ and \\f$C\\f$ must also use these same index types for their respective row offset and column index\n arrays. In the scenario where \\f$C\\f$ requires a larger index type for the row offset array, store all three\n matrices using the larger index type \\ref rocsparse_indextype_i64 for the row offsets array.\n\n \\note Currently only CSR format is supported.\n \\note Currently, only \\p trans_A == \\ref rocsparse_operation_none is supported.\n \\note Currently, only \\p trans_B == \\ref rocsparse_operation_none is supported.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n descr SpGEAM descriptor.\n @param[in]\n mat_A sparse matrix \\f$A\\f$ descriptor.\n @param[in]\n mat_B sparse matrix \\f$B\\f$ descriptor.\n @param[out]\n mat_C sparse matrix \\f$C\\f$ descriptor.\n @param[in]\n stage SpGEAM stage for the SpGEAM computation.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer. \\p buffer_size is\n determined by calling \\ref rocsparse_spgeam_buffer_size.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n @param[out]\n error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if an error descriptor is not required.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p mat_A, \\p mat_B, \\p mat_C, \\p descr, or \\p buffer_size pointer is invalid.\n\n \\par First Example\n \\snippet example_rocsparse_spgeam_1.cpp doc example\n\n \\par Second Example\n \\snippet example_rocsparse_spgeam_2.cpp doc example"]
pub fn rocsparse_spgeam(
handle: rocsparse_handle,
descr: rocsparse_spgeam_descr,
mat_A: rocsparse_const_spmat_descr,
mat_B: rocsparse_const_spmat_descr,
mat_C: rocsparse_spmat_descr,
stage: rocsparse_spgeam_stage,
buffer_size: usize,
temp_buffer: *mut ::std::os::raw::c_void,
error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\brief Sparse matrix sparse matrix multiplication.\n\n \\details\n \\p rocsparse_spgemm multiplies the scalar \\f$\\alpha\\f$ with the sparse\n \\f$m \\times k\\f$ matrix \\f$op(A)\\f$ and the sparse \\f$k \\times n\\f$ matrix \\f$op(B)\\f$ and\n adds the result to the sparse \\f$m \\times n\\f$ matrix \\f$D\\f$ that is multiplied by\n \\f$\\beta\\f$. The final result is stored in the sparse \\f$m \\times n\\f$ matrix \\f$C\\f$,\n such that\n \\f[\n C := \\alpha \\cdot op(A) \\cdot op(B) + \\beta \\cdot D,\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans_A == rocsparse_operation_none}\n \\end{array}\n \\right.\n \\f]\n and\n \\f[\n op(B) = \\left\\{\n \\begin{array}{ll}\n B, & \\text{if trans_B == rocsparse_operation_none}\n \\end{array}\n \\right.\n \\f]\n\n \\p rocsparse_spgemm requires three stages to complete. First, pass the \\ref rocsparse_spgemm_stage_buffer_size\n stage to determine the size of the required temporary storage buffer. Next, allocate this buffer and call\n \\p rocsparse_spgemm again with the \\ref rocsparse_spgemm_stage_nnz stage, which will determine the number of non-zeros\n in \\f$C\\f$. This stage will also fill in the row pointer array of \\f$C\\f$. Now that the number of non-zeros in \\f$C\\f$\n is known, allocate space for the column indices and values arrays of \\f$C\\f$. Finally, call\n \\p rocsparse_spgemm with the \\ref rocsparse_spgemm_stage_compute stage to perform the actual computation, which fills in\n the column indices and values arrays of \\f$C\\f$. After all calls to \\p rocsparse_spgemm are complete, the temporary buffer\n can be deallocated.\n\n Alternatively, it is possible to perform sparse matrix products multiple times with matrices having the same sparsity\n pattern with different values. In this scenario, the process begins like before. First, call \\p rocsparse_spgemm\n with stage \\ref rocsparse_spgemm_stage_buffer_size to determine the required buffer size. Then allocate this buffer\n and call \\p rocsparse_spgemm with the stage \\ref rocsparse_spgemm_stage_nnz to determine the number of non-zeros in \\f$C\\f$\n and allocate the \\f$C\\f$ column indices and values arrays. Now, however, call \\p rocsparse_spgemm with the\n \\ref rocsparse_spgemm_stage_symbolic stage, which will fill in the column indices array of \\f$C\\f$ but not the values array.\n It is then possible to repeatedly change the values of \\f$A\\f$, \\f$B\\f$, and \\f$D\\f$ and call \\p rocsparse_spgemm with\n the \\ref rocsparse_spgemm_stage_numeric stage, which fills the values array of \\f$C\\f$. The use of the extra\n \\ref rocsparse_spgemm_stage_symbolic and \\ref rocsparse_spgemm_stage_numeric stages allows users to compute the sparsity pattern\n of \\f$C\\f$ once, but compute the values multiple times.\n\n \\p rocsparse_spgemm supports multiple combinations of data types and compute types. The tables below indicate the currently\n supported different data types that can be used for the sparse matrices \\f$op(A)\\f$, \\f$op(B)\\f$, \\f$C\\f$, and \\f$D\\f$,\n and the compute type for \\f$\\alpha\\f$ and \\f$\\beta\\f$. The advantage of using different data types is to save on\n memory bandwidth and storage when a user application allows, while performing the actual computation in a higher precision.\n\n \\par Uniform Precisions:\n <table>\n <caption id=\"spgemm_uniform\">Uniform Precisions</caption>\n <tr><th>A / B / C / D / compute_type\n <tr><td>rocsparse_datatype_f16_r\n <tr><td>rocsparse_datatype_bf16_r\n <tr><td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_f64_r\n <tr><td>rocsparse_datatype_f32_c\n <tr><td>rocsparse_datatype_f64_c\n </table>\n\n \\p rocsparse_spgemm supports \\ref rocsparse_indextype_i32 and \\ref rocsparse_indextype_i64 index precisions for storing the row\n pointer and column indices arrays of the sparse matrices.\n\n In general, when multiplying two sparse matrices together, it is possible that the resulting matrix will require a\n larger index representation to store correctly. For example, when multiplying \\f$A \\times B\\f$ using\n \\ref rocsparse_indextype_i32 index types for the row pointer and column indices arrays, it might be the case that the row pointer\n of the resulting \\f$C\\f$ matrix would require index precision \\ref rocsparse_indextype_i64. This is currently not supported.\n In this scenario, the \\f$A\\f$ and \\f$B\\f$ matrices need to be stored using the higher index precision.\n\n \\note\n This function does not produce deterministic results.\n\n \\note SpGEMM requires three stages to complete. The first stage,\n \\ref rocsparse_spgemm_stage_buffer_size, will return the size of the temporary storage buffer\n that is required for subsequent calls to \\ref rocsparse_spgemm. The second stage,\n \\ref rocsparse_spgemm_stage_nnz, will determine the number of non-zero elements of the\n resulting \\f$C\\f$ matrix. If the sparsity pattern of \\f$C\\f$ is already known, this\n stage can be skipped. In the final stage, \\ref rocsparse_spgemm_stage_compute, the actual\n computation is performed.\n \\note If \\f$\\alpha == 0\\f$, then \\f$C = \\beta \\cdot D\\f$ will be computed.\n \\note If \\f$\\beta == 0\\f$, then \\f$C = \\alpha \\cdot op(A) \\cdot op(B)\\f$ will be\n computed.\n \\note Currently only CSR and BSR formats are supported.\n \\note If \\ref rocsparse_spgemm_stage_symbolic is selected, then only the symbolic computation is performed.\n \\note If \\ref rocsparse_spgemm_stage_numeric is selected, then only the numeric computation is performed.\n \\note For the \\ref rocsparse_spgemm_stage_symbolic and \\ref rocsparse_spgemm_stage_numeric stages, only the\n CSR matrix format is currently supported.\n \\note \\f$\\alpha == beta == 0\\f$ is invalid.\n \\note It is permissible to pass the same sparse matrix for \\f$C\\f$ and \\f$D\\f$ if both\n matrices have the same sparsity pattern.\n \\note Currently, only \\p trans_A == \\ref rocsparse_operation_none is supported.\n \\note Currently, only \\p trans_B == \\ref rocsparse_operation_none is supported.\n \\note This function is non-blocking and executed asynchronously with respect to the\n host. It can return before the actual computation has finished.\n \\note Note that for rare matrix products with more than 4096 non-zero entries\n per row, an additional temporary storage buffer is allocated by the algorithm.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n \\note\n This routine does not support batched computation.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n trans_A sparse matrix \\f$A\\f$ operation type.\n @param[in]\n trans_B sparse matrix \\f$B\\f$ operation type.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n A sparse matrix \\f$A\\f$ descriptor.\n @param[in]\n B sparse matrix \\f$B\\f$ descriptor.\n @param[in]\n beta scalar \\f$\\beta\\f$.\n @param[in]\n D sparse matrix \\f$D\\f$ descriptor.\n @param[out]\n C sparse matrix \\f$C\\f$ descriptor.\n @param[in]\n compute_type floating point precision for the SpGEMM computation.\n @param[in]\n alg SpGEMM algorithm for the SpGEMM computation.\n @param[in]\n stage SpGEMM stage for the SpGEMM computation.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer. buffer_size is set when\n \\p temp_buffer is nullptr.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user. When a nullptr is passed,\n the required allocation size (in bytes) is written to \\p buffer_size and the\n function returns without performing the SpGEMM operation.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p alpha and \\p beta are invalid, or the\n \\p A, \\p B, \\p D, \\p C, or \\p buffer_size pointer is invalid.\n \\retval rocsparse_status_memory_error additional buffer for long rows could not be\n allocated.\n \\retval rocsparse_status_not_implemented\n \\p trans_A != \\ref rocsparse_operation_none or\n \\p trans_B != \\ref rocsparse_operation_none.\n\n \\par Example\n \\snippet example_rocsparse_spgemm.cpp doc example"]
pub fn rocsparse_spgemm(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
alpha: *const ::std::os::raw::c_void,
A: rocsparse_const_spmat_descr,
B: rocsparse_const_spmat_descr,
beta: *const ::std::os::raw::c_void,
D: rocsparse_const_spmat_descr,
C: rocsparse_spmat_descr,
compute_type: rocsparse_datatype,
alg: rocsparse_spgemm_alg,
stage: rocsparse_spgemm_stage,
buffer_size: *mut usize,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\brief Incomplete Cholesky factorization with 0 fill-ins and no pivoting.\n \\details\n \\p rocsparse_spic0_buffer_size returns the size of the non-persistent buffer\n that is required by \\ref rocsparse_spic0 and must be allocated by the user.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n \\note\n This routine only supports uniform batched computation, that is, the same sparsity pattern but batched values of the matrices.\n\n \\note\n Supported formats are \\ref rocsparse_format_csr and \\ref rocsparse_format_bsr.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n spic0_descr Spic0 descriptor.\n @param[in]\n A descriptor of the matrix to factorize.\n @param[in]\n P descriptor of the factorization. In-place \\p P = \\p A is allowed.\n @param[in]\n spic0_stage stage for the Spic0 computation.\n @param[out]\n p_buffer_size_in_bytes number of bytes of the buffer.\n @param[out]\n p_error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if error descriptor is not required.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_not_implemented the sparse format is invalid or the preconditioner \\p P is not identical to the matrix to factorize \\p A.\n \\retval rocsparse_status_invalid_value the \\p spic0_stage value is invalid.\n \\retval rocsparse_status_invalid_pointer \\p spic0_descr, \\p A, \\p P, or \\p p_buffer_size_in_bytes pointer is invalid."]
pub fn rocsparse_spic0_buffer_size(
handle: rocsparse_handle,
spic0_descr: rocsparse_spic0_descr,
A: rocsparse_const_spmat_descr,
P: rocsparse_const_spmat_descr,
spic0_stage: rocsparse_spic0_stage,
p_buffer_size_in_bytes: *mut usize,
p_error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\brief Incomplete Cholesky factorization with 0 fill-ins and no pivoting.\n\n \\details\n \\p rocsparse_spic0 computes the incomplete Cholesky factorization with 0 fill-ins\n and no pivoting of a sparse \\f$m \\times m\\f$ matrix \\f$A\\f$, such that\n \\f[\n A \\approx LL^T\n \\f]\n where the lower triangular matrix \\f$L\\f$ is computed using:\n \\f[\n L_{ij} = \\left\\{\n \\begin{array}{ll}\n \\sqrt{A_{jj} - \\sum_{k=0}^{j-1}(L_{jk})^{2}}, & \\text{if i == j} \\\\\n \\frac{1}{L_{jj}}(A_{ij} - \\sum_{k=0}^{j-1}L_{ik} \\times L_{jk}), & \\text{if i > j}\n \\end{array}\n \\right.\n \\f]\n for each entry found in the matrix \\f$A\\f$.\n\n Performing the above operation requires two stages, the stage \\ref rocsparse_spic0_stage_analysis and the stage \\ref rocsparse_spic0_stage_compute.\n The stage \\ref rocsparse_spic0_stage_analysis is required to perform the stage \\ref rocsparse_spic0_stage_compute and only needs to be called once for a given sparse matrix \\f$A\\f$, while the stage \\ref rocsparse_spic0_stage_compute can be repeatedly used with different matrices \\f$A\\f$ that have the same sparsity pattern.\n\n \\p rocsparse_spic0 supports the following\n data types for \\p A : \\ref rocsparse_datatype_f32_r, \\ref rocsparse_datatype_f64_r, \\ref rocsparse_datatype_f32_c, and \\ref rocsparse_datatype_f64_c.\n\n \\note The descriptor \\p spic0_descr needs to be configured with \\ref rocsparse_spic0_set_input.\n \\note\n The sparse matrix formats currently supported are \\ref rocsparse_format_csr and \\ref rocsparse_format_bsr.\n\n \\note\n the \\ref rocsparse_spic0_stage_compute stage is non-blocking\n and executed asynchronously with respect to the host. It can return before the actual computation has finished.\n The \\ref rocsparse_spic0_stage_analysis stage is blocking with respect to the host.\n\n \\note\n Only the \\ref rocsparse_spic0_stage_compute stage\n supports execution in a hipGraph context. The \\ref rocsparse_spic0_stage_analysis stage does not support hipGraph.\n\n \\note\n This routine only supports uniform strided batched computation, that is, the same sparsity pattern but strided batched values of the matrices.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n spic0_descr Spic0 descriptor\n @param[in]\n A descriptor of the matrix to factorize.\n @param[out]\n P descriptor of the factorization. In-place \\p P = \\p A is allowed.\n @param[in]\n spic0_stage stage for the Spic0 computation.\n @param[in]\n buffer_size_in_bytes number of bytes of the buffer.\n @param[in]\n buffer buffer allocated by the user.\n @param[out]\n p_error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if an error descriptor is not required.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_not_implemented the sparse format is invalid or the preconditioner \\p P is not identical to the matrix to factorize \\p A.\n \\retval rocsparse_status_invalid_value the \\p spic0_stage value is invalid.\n \\retval rocsparse_status_invalid_pointer \\p spic0_descr, \\p A, \\p P, or \\p buffer_size_in_bytes pointer is invalid.\n\n \\par Example\n \\snippet example_rocsparse_spic0.cpp doc example"]
pub fn rocsparse_spic0(
handle: rocsparse_handle,
spic0_descr: rocsparse_spic0_descr,
A: rocsparse_const_spmat_descr,
P: rocsparse_spmat_descr,
spic0_stage: rocsparse_spic0_stage,
buffer_size_in_bytes: usize,
buffer: *mut ::std::os::raw::c_void,
p_error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\brief Get buffer size for incomplete LU factorization with 0 fill-ins and no pivoting.\n \\details\n \\p rocsparse_spilu0_buffer_size returns the size of the non-persistent buffer\n that is required by \\ref rocsparse_spilu0, and must be allocated by the user.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n \\note\n Supported formats are \\ref rocsparse_format_csr and \\ref rocsparse_format_bsr.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n spilu0_descr Spilu0 descriptor.\n @param[in]\n A descriptor of the matrix to factorize.\n @param[in]\n P descriptor of the factorization.\n @param[in]\n spilu0_stage stage for the Spilu0 computation.\n @param[out]\n p_buffer_size_in_bytes number of bytes of the buffer.\n @param[out]\n p_error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if the user is not interested in obtaining an error descriptor.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_not_implemented the sparse format is invalid or the preconditioner \\p P is not identical to the matrix to factorize \\p A.\n \\retval rocsparse_status_invalid_value the \\p spilu0_stage value is invalid.\n \\retval rocsparse_status_invalid_pointer \\p spilu0_descr, \\p A, \\p P, or \\p p_buffer_size_in_bytes pointer is invalid."]
pub fn rocsparse_spilu0_buffer_size(
handle: rocsparse_handle,
spilu0_descr: rocsparse_spilu0_descr,
A: rocsparse_const_spmat_descr,
P: rocsparse_const_spmat_descr,
spilu0_stage: rocsparse_spilu0_stage,
p_buffer_size_in_bytes: *mut usize,
p_error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\brief Incomplete LU factorization with 0 fill-ins and no pivoting.\n\n \\details\n \\p rocsparse_spilu0 computes the incomplete LU factorization with 0 fill-ins and no\n pivoting of a sparse \\f$m \\times m\\f$ matrix \\f$A\\f$, such that\n \\f[\n A \\approx LU\n \\f]\n where the lower triangular matrix \\f$L\\f$ and the upper triangular matrix \\f$U\\f$ are computed using:\n \\f[\n \\begin{array}{ll}\n L_{ij} = \\frac{1}{U_{jj}}(A_{ij} - \\sum_{k=0}^{j-1}L_{ik} \\times U_{kj}), & \\text{if i > j} \\\\\n U_{ij} = (A_{ij} - \\sum_{k=0}^{j-1}L_{ik} \\times U_{kj}), & \\text{if i <= j}\n \\end{array}\n \\f]\n for each entry found in the matrix \\f$A\\f$.\n\n Performing the above operation requires two stages, the stage \\ref rocsparse_spilu0_stage_analysis and the stage \\ref rocsparse_spilu0_stage_compute.\n The stage \\ref rocsparse_spilu0_stage_analysis is required to perform the stage \\ref rocsparse_spilu0_stage_compute and only needs to be called once for a given sparse matrix \\f$A\\f$, while the stage \\ref rocsparse_spilu0_stage_compute can be repeatedly used with different matrices \\f$A\\f$ that have the same sparsity pattern.\n\n \\p rocsparse_spilu0 supports the following\n data types for \\p A : \\ref rocsparse_datatype_f32_r, \\ref rocsparse_datatype_f64_r, \\ref rocsparse_datatype_f32_c, and \\ref rocsparse_datatype_f64_c.\n\n \\note The descriptor \\p spilu0_descr needs to be configured with \\ref rocsparse_spilu0_set_input.\n \\note The sparse matrix formats currently supported are \\ref rocsparse_format_csr and \\ref rocsparse_format_bsr.\n\n \\note\n the \\ref rocsparse_spilu0_stage_compute stage is non-blocking\n and executed asynchronously with respect to the host. It can return before the actual computation has finished.\n The \\ref rocsparse_spilu0_stage_analysis stage is blocking with respect to the host.\n\n \\note\n Only the \\ref rocsparse_spilu0_stage_compute stage\n supports execution in a hipGraph context. The \\ref rocsparse_spilu0_stage_analysis stage does not support hipGraph.\n\n \\note\n This routine only supports uniform batched computation, that is, same sparsity pattern but batched values of the matrices.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n spilu0_descr Spilu0 descriptor.\n @param[in]\n A descriptor of the matrix to factorize.\n @param[out]\n P descriptor of the factorization.\n @param[in]\n spilu0_stage stage for the Spilu0 computation.\n @param[in]\n buffer_size_in_bytes number of bytes of the buffer.\n @param[in]\n buffer buffer allocated by the user.\n @param[out]\n p_error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if an error descriptor is not required.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_not_implemented the sparse format is invalid or the preconditioner \\p P is not identical to the matrix to factorize \\p A.\n \\retval rocsparse_status_invalid_value the \\p spilu0_stage value is invalid.\n \\retval rocsparse_status_invalid_pointer \\p spilu0_descr, \\p A, \\p P, or \\p buffer_size_in_bytes pointer is invalid.\n\n \\par Example\n \\snippet example_rocsparse_spilu0.cpp doc example"]
pub fn rocsparse_spilu0(
handle: rocsparse_handle,
spilu0_descr: rocsparse_spilu0_descr,
A: rocsparse_const_spmat_descr,
P: rocsparse_spmat_descr,
spilu0_stage: rocsparse_spilu0_stage,
buffer_size_in_bytes: usize,
buffer: *mut ::std::os::raw::c_void,
p_error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\brief Sparse iterative triangular solve.\n\n \\details\n \\p rocsparse_spitsv solves, using the Jacobi iterative method, a sparse triangular linear system of a sparse\n \\f$m \\times m\\f$ matrix, defined in CSR format, a dense solution vector\n \\f$y\\f$ and the right-hand side \\f$x\\f$ that is multiplied by \\f$\\alpha\\f$, such that\n \\f[\n op(A) y = \\alpha x,\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans == rocsparse_operation_none} \\\\\n A^T, & \\text{if trans == rocsparse_operation_transpose} \\\\\n A^H, & \\text{if trans == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n\n The Jacobi method applied to the sparse triangular linear system above gives\n \\f[\n y_{k+1} = y_{k} + D^{-1} ( \\alpha x - (D + T) y_{k} )\n \\f]\n with \\f$A = D + T\\f$, \\f$D\\f$ the diagonal of \\f$A\\f$ and \\f$T\\f$ the strict triangular part of \\f$A\\f$.\n\n The above equation can be also written as\n \\f[\n y_{k+1} = y_{k} + D^{-1} r_k\n \\f]\n where\n \\f[\n r_k = \\alpha x - (D + T) y_k.\n \\f]\n Starting with \\f$y_0 = \\f$ \\p y, the method iterates while \\f$ k \\lt \\f$ \\p host_nmaxiter and until\n \\f[\n \\Vert r_k \\Vert_{\\infty} \\le \\epsilon,\n \\f]\n with \\f$\\epsilon\\f$ = \\p host_tol.\n\n \\p rocsparse_spitsv requires three stages to complete. First, pass the \\ref rocsparse_spitsv_stage_buffer_size\n stage to determine the size of the required temporary storage buffer. Next, allocate this buffer and call\n \\p rocsparse_spitsv again with the \\ref rocsparse_spitsv_stage_preprocess stage, which will preprocess data and store it\n in the temporary buffer. Finally, call \\p rocsparse_spitsv with the \\ref rocsparse_spitsv_stage_compute stage to\n perform the actual computation. After all calls to \\p rocsparse_spitsv are complete, the temporary buffer\n can be deallocated.\n\n \\p rocsparse_spitsv supports \\ref rocsparse_indextype_i32 and \\ref rocsparse_indextype_i64 index precisions for storing the\n row pointer and column indices arrays of the sparse matrix. \\p rocsparse_spitsv supports the following data types for\n \\f$op(A)\\f$, \\f$x\\f$, \\f$y\\f$, and compute types for \\f$\\alpha\\f$:\n\n \\par Uniform Precisions:\n <table>\n <caption id=\"spitsv_uniform\">Uniform Precisions</caption>\n <tr><th>A / X / Y / compute_type\n <tr><td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_f64_r\n <tr><td>rocsparse_datatype_f32_c\n <tr><td>rocsparse_datatype_f64_c\n </table>\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n \\note\n This routine does not support batched computation.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[inout]\n host_nmaxiter maximum number of iteration on input and number of iteration on output. If the output number of iterations is strictly less than the input maximum number of iterations, then the algorithm converged.\n @param[in]\n host_tol if the pointer is null, then the loop will execute \\p nmaxiter[0] iterations. The precision is float for f32-based calculations (including the complex case) and double for f64-based calculations (including the complex case).\n @param[out]\n host_history Optional array to record the norm of the residual before each iteration. The precision is float for f32-based calculations (including the complex case) and double for f64-based calculations (including the complex case).\n @param[in]\n trans matrix operation type.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n mat matrix descriptor.\n @param[in]\n x vector descriptor.\n @param[inout]\n y vector descriptor.\n @param[in]\n compute_type floating point precision for the SpITSV computation.\n @param[in]\n alg SpITSV algorithm for the SpITSV computation.\n @param[in]\n stage SpITSV stage for the SpITSV computation.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user. When a nullptr is passed,\n the required allocation size (in bytes) is written to \\p buffer_size and\n function returns without performing the SpITSV operation.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p alpha, \\p mat, \\p x, \\p y, \\p descr, or\n \\p buffer_size pointer is invalid.\n \\retval rocsparse_status_not_implemented \\p trans, \\p compute_type, \\p stage, or \\p alg is\n currently not supported.\n\n \\par Example\n \\snippet example_rocsparse_spitsv.cpp doc example"]
pub fn rocsparse_spitsv(
handle: rocsparse_handle,
host_nmaxiter: *mut rocsparse_int,
host_tol: *const ::std::os::raw::c_void,
host_history: *mut ::std::os::raw::c_void,
trans: rocsparse_operation,
alpha: *const ::std::os::raw::c_void,
mat: rocsparse_spmat_descr,
x: rocsparse_dnvec_descr,
y: rocsparse_dnvec_descr,
compute_type: rocsparse_datatype,
alg: rocsparse_spitsv_alg,
stage: rocsparse_spitsv_stage,
buffer_size: *mut usize,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\brief Sparse matrix dense matrix multiplication.\n\n \\details\n \\p rocsparse_spmm multiplies the scalar \\f$\\alpha\\f$ with a sparse \\f$m \\times k\\f$ matrix \\f$op(A)\\f$,\n defined in CSR, CSC, COO, BSR, or Blocked ELL storage format, and the dense \\f$k \\times n\\f$ matrix \\f$op(B)\\f$\n and adds the result to the dense \\f$m \\times n\\f$ matrix \\f$C\\f$ that is multiplied by the scalar\n \\f$\\beta\\f$, such that\n \\f[\n C := \\alpha \\cdot op(A) \\cdot op(B) + \\beta \\cdot C,\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans_A == rocsparse_operation_none} \\\\\n A^T, & \\text{if trans_A == rocsparse_operation_transpose} \\\\\n A^H, & \\text{if trans_A == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n and\n \\f[\n op(B) = \\left\\{\n \\begin{array}{ll}\n B, & \\text{if trans_B == rocsparse_operation_none} \\\\\n B^T, & \\text{if trans_B == rocsparse_operation_transpose} \\\\\n B^H, & \\text{if trans_B == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n Both \\f$B\\f$ and \\f$C\\f$ can be in row or column order.\n\n \\p rocsparse_spmm requires three stages to complete. First, pass the \\ref rocsparse_spmm_stage_buffer_size\n stage to determine the size of the required temporary storage buffer. Next, allocate this buffer and call\n \\p rocsparse_spmm again with the \\ref rocsparse_spmm_stage_preprocess stage, which will perform analysis on the sparse\n matrix \\f$op(A)\\f$. Finally, call \\p rocsparse_spmm with the \\ref rocsparse_spmm_stage_compute stage to perform\n the actual computation. The buffer size, buffer allocation, and preprocess stages only need to be called once for a given\n sparse matrix \\f$op(A)\\f$, while the computation stage can be repeatedly used with different \\f$B\\f$ and \\f$C\\f$ matrices.\n After all calls to \\p rocsparse_spmm are complete, the temporary buffer can be deallocated.\n\n As noted above, both \\f$B\\f$ and \\f$C\\f$ can be in row or column order (this includes mixing the order so that \\f$B\\f$ is in\n row order and \\f$C\\f$ in column order and vice versa). For best performance, use row order for both \\f$B\\f$ and \\f$C\\f$ as\n this provides the best memory access.\n\n \\p rocsparse_spmm supports multiple different algorithms. These algorithms have different trade-offs depending on the sparsity\n pattern of the matrix, whether or not the results need to be deterministic, and how many times the sparse-matrix product will\n be performed.\n\n <table>\n <caption id=\"spmm_csr_algorithms\">CSR Algorithms</caption>\n <tr><th>CSR Algorithms <th>Deterministic <th>Preprocessing <th>Notes\n <tr><td>rocsparse_spmm_alg_csr</td> <td>Yes</td> <td>No</td> <td>Default algorithm.</td>\n <tr><td>rocsparse_spmm_alg_csr_row_split</td> <td>Yes</td> <td>No</td> <td>Assigns a fixed number of threads per row, regardless of the number of non-zeros in each row. This can perform well when each row in the matrix has roughly the same number of non-zeros.</td>\n <tr><td>rocsparse_spmm_alg_csr_nnz_split</td> <td>No</td> <td>Yes</td> <td>Distributes work by having each thread block work on a fixed number of non-zeros, regardless of the number of rows that might be involved. This can perform well when the matrix has some rows with few non-zeros and some rows with many non-zeros.</td>\n <tr><td>rocsparse_spmm_alg_csr_merge_path</td> <td>No</td> <td>Yes</td> <td>Attempts to combine the approaches of row-split and non-zero split by having each block work on a fixed amount of work, which can be either non-zeros or rows.</td>\n </table>\n\n <table>\n <caption id=\"spmm_coo_algorithms\">COO Algorithms</caption>\n <tr><th>COO Algorithms <th>Deterministic <th>Preprocessing <th>Notes\n <tr><td>rocsparse_spmm_alg_coo_segmented</td> <td>Yes</td> <td>No</td> <td>Generally not as fast as the atomic algorithm but is deterministic.</td>\n <tr><td>rocsparse_spmm_alg_coo_atomic</td> <td>No</td> <td>No</td> <td>Generally the fastest COO algorithm. This is the default algorithm.</td>\n <tr><td>rocsparse_spmm_alg_coo_segmented_atomic</td> <td>No</td> <td>No</td> <td> </td>\n </table>\n\n <table>\n <caption id=\"spmm_bell_algorithms\">Blocked-ELL Algorithms</caption>\n <tr><th>Blocked ELL Algorithms <th>Deterministic <th>Preprocessing <th>Notes\n <tr><td>rocsparse_spmm_alg_bell</td> <td>Yes</td> <td>No</td> <td></td>\n </table>\n\n <table>\n <caption id=\"spmm_bsr_algorithms\">BSR Algorithms</caption>\n <tr><th>BSR Algorithms <th>Deterministic <th>Preprocessing <th>Notes\n <tr><td>rocsparse_spmm_alg_bsr</td> <td>Yes</td> <td>No</td> <td></td>\n </table>\n\n It is also possible to pass \\ref rocsparse_spmm_alg_default, which will automatically select from the algorithms listed above\n based on the sparse matrix format. In the case of CSR or CSC matrices, this will set the algorithm to be \\ref rocsparse_spmm_alg_csr. In\n the case of blocked ELL matrices, this will set the algorithm to be \\ref rocsparse_spmm_alg_bell. In the case of BSR matrices, this\n will set the algorithm to be \\ref rocsparse_spmm_alg_bsr, and for COO matrices, it will set the algorithm to be\n \\ref rocsparse_spmm_alg_coo_atomic.\n\n When A is transposed, \\p rocsparse_spmm will revert to using \\ref rocsparse_spmm_alg_csr\n for CSR and CSC formats and \\ref rocsparse_spmm_alg_coo_atomic for COO format, regardless of algorithm selected.\n\n \\p rocsparse_spmm supports multiple combinations of data types and compute types. The tables below indicate the currently\n supported different data types that can be used for for the sparse matrix \\f$op(A)\\f$ and the dense matrices \\f$op(B)\\f$ and\n \\f$C\\f$ and the compute type for \\f$\\alpha\\f$ and \\f$\\beta\\f$. The advantage of using different data types is to save on\n memory bandwidth and storage when a user application allows, while performing the actual computation in a higher precision.\n\n \\par Uniform Precisions:\n <table>\n <caption id=\"spmm_uniform\">Uniform Precisions</caption>\n <tr><th>A / B / C / compute_type\n <tr><td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_f64_r\n <tr><td>rocsparse_datatype_f32_c\n <tr><td>rocsparse_datatype_f64_c\n </table>\n\n \\par Mixed precisions:\n <table>\n <caption id=\"spmm_mixed\">Mixed Precisions</caption>\n <tr><th>A / B <th>C <th>compute_type\n <tr><td>rocsparse_datatype_i8_r <td>rocsparse_datatype_i32_r <td>rocsparse_datatype_i32_r\n <tr><td>rocsparse_datatype_i8_r <td>rocsparse_datatype_f32_r <td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_f16_r <td>rocsparse_datatype_f32_r <td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_f16_r <td>rocsparse_datatype_f16_r <td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_bf16_r <td>rocsparse_datatype_f32_r <td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_bf16_r <td>rocsparse_datatype_bf16_r <td>rocsparse_datatype_f32_r\n </table>\n\n \\p rocsparse_spmm supports \\ref rocsparse_indextype_i32 and \\ref rocsparse_indextype_i64 index precisions\n for storing the row pointer and column indices arrays of the sparse matrices.\n\n \\p rocsparse_spmm also supports batched computation for CSR and COO matrices. There are three supported batch modes:\n \\f[\n C_i = A \\times B_i \\\\\n C_i = A_i \\times B \\\\\n C_i = A_i \\times B_i\n \\f]\n\n The batch mode is determined by the batch count and stride passed for each matrix. For example,\n to use the first batch mode (\\f$C_i = A \\times B_i\\f$) with 100 batches for non-transposed \\f$A\\f$,\n \\f$B\\f$, and \\f$C\\f$, pass:\n \\f[\n batch\\_count\\_A=1 \\\\\n batch\\_count\\_B=100 \\\\\n batch\\_count\\_C=100 \\\\\n offsets\\_batch\\_stride\\_A=0 \\\\\n columns\\_values\\_batch\\_stride\\_A=0 \\\\\n batch\\_stride\\_B=k*n \\\\\n batch\\_stride\\_C=m*n\n \\f]\n To use the second batch mode (\\f$C_i = A_i \\times B\\f$), pass:\n \\f[\n batch\\_count\\_A=100 \\\\\n batch\\_count\\_B=1 \\\\\n batch\\_count\\_C=100 \\\\\n offsets\\_batch\\_stride\\_A=m+1 \\\\\n columns\\_values\\_batch\\_stride\\_A=nnz \\\\\n batch\\_stride\\_B=0 \\\\\n batch\\_stride\\_C=m*n\n \\f]\n And to use the third batch mode (\\f$C_i = A_i \\times B_i\\f$), pass:\n \\f[\n batch\\_count\\_A=100 \\\\\n batch\\_count\\_B=100 \\\\\n batch\\_count\\_C=100 \\\\\n offsets\\_batch\\_stride\\_A=m+1 \\\\\n columns\\_values\\_batch\\_stride_A=nnz \\\\\n batch\\_stride_B=k*n \\\\\n batch\\_stride_C=m*n\n \\f]\n See the examples below.\n\n \\note\n None of the algorithms above are deterministic when \\f$A\\f$ is transposed or conjugate transposed.\n\n \\note\n All algorithms perform best when using row ordering for the dense \\f$B\\f$ and \\f$C\\f$ matrices.\n\n \\note\n The sparse matrix formats currently supported are: \\ref rocsparse_format_coo, \\ref rocsparse_format_csr,\n \\ref rocsparse_format_csc, \\ref rocsparse_format_bsr, and \\ref rocsparse_format_bell.\n\n \\note\n Mixed precisions are only supported for BSR, CSR, CSC, and COO matrix formats.\n\n \\note\n Only the \\ref rocsparse_spmm_stage_buffer_size stage and the \\ref rocsparse_spmm_stage_compute stage are non-blocking\n and executed asynchronously with respect to the host. They can return before the actual computation has finished.\n The \\ref rocsparse_spmm_stage_preprocess stage is blocking with respect to the host.\n\n \\note\n Currently, only \\p trans_A == \\ref rocsparse_operation_none is supported for the COO and blocked ELL formats.\n\n \\note\n Only the \\ref rocsparse_spmm_stage_buffer_size stage and the \\ref rocsparse_spmm_stage_compute stage\n support execution in a hipGraph context. The \\ref rocsparse_spmm_stage_preprocess stage does not support hipGraph.\n\n \\note\n Currently, only CSR, CSC, COO, BSR, and blocked ELL sparse formats are supported.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n trans_A matrix operation type.\n @param[in]\n trans_B matrix operation type.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n mat_A matrix descriptor.\n @param[in]\n mat_B matrix descriptor.\n @param[in]\n beta scalar \\f$\\beta\\f$.\n @param[in]\n mat_C matrix descriptor.\n @param[in]\n compute_type floating point precision for the SpMM computation.\n @param[in]\n alg SpMM algorithm for the SpMM computation.\n @param[in]\n stage SpMM stage for the SpMM computation.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user. When the\n \\ref rocsparse_spmm_stage_buffer_size stage is passed in, the required\n allocation size (in bytes) is written to \\p buffer_size and function\n returns without performing the SpMM operation.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p alpha, \\p mat_A, \\p mat_B, \\p mat_C, \\p beta, or\n \\p buffer_size pointer is invalid.\n \\retval rocsparse_status_not_implemented \\p trans_A, \\p trans_B, \\p compute_type, or \\p alg is\n currently not supported.\n \\par Example\n This example performs sparse matrix-dense matrix multiplication, \\f$C := \\alpha \\cdot A \\cdot B + \\beta \\cdot C\\f$\n \\snippet example_rocsparse_spmm.cpp doc example\n\n \\par Example\n An example of the first batch mode (\\f$C_i = A \\times B_i\\f$) is provided below.\n \\snippet example_rocsparse_spmm_batched.cpp doc example\n/\n/**@{"]
pub fn rocsparse_spmm(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
alpha: *const ::std::os::raw::c_void,
mat_A: rocsparse_const_spmat_descr,
mat_B: rocsparse_const_dnmat_descr,
beta: *const ::std::os::raw::c_void,
mat_C: rocsparse_dnmat_descr,
compute_type: rocsparse_datatype,
alg: rocsparse_spmm_alg,
stage: rocsparse_spmm_stage,
buffer_size: *mut usize,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\brief Sparse matrix vector multiplication.\n\n \\details\n \\p rocsparse_spmv multiplies the scalar \\f$\\alpha\\f$ with a sparse \\f$m \\times n\\f$ matrix \\f$op(A)\\f$, defined in CSR,\n CSC, COO, COO (AoS), BSR, or ELL format, with the dense vector \\f$x\\f$ and adds the result to the dense vector \\f$y\\f$\n that is multiplied by the scalar \\f$\\beta\\f$, such that\n \\f[\n y := \\alpha \\cdot op(A) \\cdot x + \\beta \\cdot y,\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans == rocsparse_operation_none} \\\\\n A^T, & \\text{if trans == rocsparse_operation_transpose} \\\\\n A^H, & \\text{if trans == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n\n Performing the above operation involves multiple steps. First, call \\p rocsparse_spmv with the stage parameter set to\n \\ref rocsparse_spmv_stage_buffer_size to determine the size of the required temporary storage buffer. Then allocate this\n buffer and call \\p rocsparse_spmv with the stage parameter set to \\ref rocsparse_spmv_stage_preprocess. Depending on the algorithm\n and sparse matrix format, this will perform analysis on the sparsity pattern of \\f$op(A)\\f$. Finally, complete the operation\n by calling \\p rocsparse_spmv with the stage parmeter set to \\ref rocsparse_spmv_stage_compute. The buffer size, buffer allocation, and\n preprocess stages only need to be called once for a given sparse matrix \\f$op(A)\\f$, while the computation stage can be repeatedly used\n with different \\f$x\\f$ and \\f$y\\f$ vectors. After all calls to \\p rocsparse_spmv are complete, the temporary buffer can be deallocated.\n\n \\p rocsparse_spmv supports multiple different algorithms. These algorithms have different trade-offs depending on the sparsity\n pattern of the matrix, whether or not the results need to be deterministic, and how many times the sparse-vector product will\n be performed.\n\n <table>\n <caption id=\"spmv_csr_algorithms\">CSR/CSC Algorithms</caption>\n <tr><th>Algorithm <th>Deterministic <th>Preprocessing <th>Notes\n <tr><td>rocsparse_spmv_alg_csr_rowsplit</td> <td>Yes</td> <td>No</td> <td>Is best suited for matrices with all rows having a similar number of non-zeros. Can outperform adaptive and LRB algorithms in certain sparsity patterns. Will perform very poorly if some rows have few non-zeros and some rows have many non-zeros.</td>\n <tr><td>rocsparse_spmv_alg_csr_stream</td> <td>Yes</td> <td>No</td> <td>[Deprecated] The old name for rocsparse_spmv_alg_csr_rowsplit.</td>\n <tr><td>rocsparse_spmv_alg_csr_adaptive</td> <td>No</td> <td>Yes</td> <td>Generally the fastest algorithm across all matrix sparsity patterns. This includes matrices that have some rows with many non-zeros and some rows with few non-zeros. Requires lengthy preprocessing that needs to be amortized over many subsequent sparse vector products.</td>\n <tr><td>rocsparse_spmv_alg_csr_lrb</td> <td>No</td> <td>Yes</td> <td>Like the adaptive algorithm, it generally performs well across all matrix sparsity patterns. Generally not as fast as the adaptive algorithm, however, it uses a much faster pre-processing step. Good for when only a small number of sparse vector products will be performed.</td>\n <tr><td>rocsparse_spmv_alg_csr_nnzsplit</td> <td>No</td> <td>Yes</td> <td>Like the adaptive algorithm, it generally performs well across all matrix sparsity patterns. Generally not as fast as the adaptive algorithm but faster than the LRB algorithm. It uses a much faster preprocessing step than LRB. Good when the number of sparse vector products that will be performed is less than one hundred. If more products need to be computed, the adaptive algorithm is probably faster.</td>\n </table>\n\n <table>\n <caption id=\"spmv_coo_algorithms\">COO Algorithms</caption>\n <tr><th>COO Algorithms <th>Deterministic <th>Preprocessing <th>Notes\n <tr><td>rocsparse_spmv_alg_coo</td> <td>Yes</td> <td>Yes</td> <td>Generally not as fast as the atomic algorithm but is deterministic.</td>\n <tr><td>rocsparse_spmv_alg_coo_atomic</td> <td>No</td> <td>No</td> <td>Generally the fastest COO algorithm.</td>\n </table>\n\n <table>\n <caption id=\"spmv_ell_algorithms\">ELL Algorithms</caption>\n <tr><th>ELL Algorithms <th>Deterministic <th>Preprocessing <th>Notes\n <tr><td>rocsparse_spmv_alg_ell</td> <td>Yes</td> <td>No</td> <td></td>\n </table>\n\n <table>\n <caption id=\"spmv_bsr_algorithms\">BSR Algorithms</caption>\n <tr><th>BSR Algorithm <th>Deterministic <th>Preprocessing <th>Notes\n <tr><td>rocsparse_spmv_alg_bsr</td> <td>Yes</td> <td>No</td> <td></td>\n </table>\n\n \\p rocsparse_spmv supports multiple combinations of data types and compute types. The tables below indicate the currently\n supported different data types that can be used for the sparse matrix \\f$op(A)\\f$, the dense vectors \\f$x\\f$ and\n \\f$y\\f$, and the compute type for \\f$\\alpha\\f$ and \\f$\\beta\\f$. The advantage of using different data types is to save on\n memory bandwidth and storage when a user application allows, while performing the actual computation in a higher precision.\n\n \\par Uniform Precisions:\n <table>\n <caption id=\"spmv_uniform\">Uniform Precisions</caption>\n <tr><th>A / X / Y / compute_type\n <tr><td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_f64_r\n <tr><td>rocsparse_datatype_f32_c\n <tr><td>rocsparse_datatype_f64_c\n </table>\n\n \\par Mixed Precisions:\n <table>\n <caption id=\"spmv_mixed\">Mixed Precisions</caption>\n <tr><th>A / X <th>Y <th>compute_type\n <tr><td>rocsparse_datatype_i8_r <td>rocsparse_datatype_i32_r <td>rocsparse_datatype_i32_r\n <tr><td>rocsparse_datatype_i8_r <td>rocsparse_datatype_f32_r <td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_f16_r <td>rocsparse_datatype_f32_r <td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_f16_r <td>rocsparse_datatype_f16_r <td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_bf16_r <td>rocsparse_datatype_f32_r <td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_bf16_r <td>rocsparse_datatype_bf16_r <td>rocsparse_datatype_f32_r\n </table>\n\n \\par Mixed-regular Real Precisions\n <table>\n <caption id=\"spmv_mixed_regular_real\">Mixed-regular Real Precisions</caption>\n <tr><th>A <th>X / Y / compute_type\n <tr><td>rocsparse_datatype_f32_r <td>rocsparse_datatype_f64_r\n <tr><td>rocsparse_datatype_f32_c <td>rocsparse_datatype_f64_c\n </table>\n\n \\par Mixed-regular Complex Precisions\n <table>\n <caption id=\"spmv_mixed_regular_complex\">Mixed-regular Complex Precisions</caption>\n <tr><th>A <th>X / Y / compute_type\n <tr><td>rocsparse_datatype_f32_r <td>rocsparse_datatype_f32_c\n <tr><td>rocsparse_datatype_f64_r <td>rocsparse_datatype_f64_c\n </table>\n\n \\p rocsparse_spmv supports \\ref rocsparse_indextype_i32 and \\ref rocsparse_indextype_i64 index precisions\n for storing the row pointer and column indices arrays of the sparse matrices.\n\n \\note\n None of the algorithms above are deterministic when \\f$A\\f$ is transposed.\n\n \\note\n The sparse matrix formats currently supported are: \\ref rocsparse_format_bsr, \\ref rocsparse_format_coo,\n \\ref rocsparse_format_coo_aos, \\ref rocsparse_format_csr, \\ref rocsparse_format_csc, and \\ref rocsparse_format_ell.\n\n \\note\n Only the \\ref rocsparse_spmv_stage_buffer_size stage and the \\ref rocsparse_spmv_stage_compute stage are non-blocking\n and executed asynchronously with respect to the host. They can return before the actual computation has finished.\n The \\ref rocsparse_spmv_stage_preprocess stage is blocking with respect to the host.\n\n \\note\n Only the \\ref rocsparse_spmv_stage_buffer_size stage and the \\ref rocsparse_spmv_stage_compute stage\n support execution in a hipGraph context. The \\ref rocsparse_spmv_stage_preprocess stage does not support hipGraph.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n trans matrix operation type.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n mat matrix descriptor.\n @param[in]\n x vector descriptor.\n @param[in]\n beta scalar \\f$\\beta\\f$.\n @param[inout]\n y vector descriptor.\n @param[in]\n compute_type floating point precision for the SpMV computation.\n @param[in]\n alg SpMV algorithm for the SpMV computation.\n @param[in]\n stage SpMV stage for the SpMV computation.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer. buffer_size is set when\n \\p temp_buffer is nullptr.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user. When the\n \\ref rocsparse_spmv_stage_buffer_size stage is passed,\n the required allocation size (in bytes) is written to \\p buffer_size and\n function returns without performing the SpMV operation.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context \\p handle was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p alpha, \\p mat, \\p x, \\p beta, \\p y, or\n \\p buffer_size pointer is invalid.\n \\retval rocsparse_status_invalid_value the value of \\p trans, \\p compute_type, \\p alg, or \\p stage is incorrect.\n \\retval rocsparse_status_not_implemented \\p compute_type or \\p alg is\n currently not supported.\n\n \\par Example\n \\snippet example_rocsparse_spmv.cpp doc example"]
pub fn rocsparse_spmv(
handle: rocsparse_handle,
trans: rocsparse_operation,
alpha: *const ::std::os::raw::c_void,
mat: rocsparse_const_spmat_descr,
x: rocsparse_const_dnvec_descr,
beta: *const ::std::os::raw::c_void,
y: rocsparse_dnvec_descr,
compute_type: rocsparse_datatype,
alg: rocsparse_spmv_alg,
stage: rocsparse_spmv_stage,
buffer_size: *mut usize,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\brief Sparse triangular system solve with multiple right-hand sides.\n\n \\details\n \\p rocsparse_spsm solves a triangular linear system of equations defined by a sparse \\f$m \\times m\\f$ square matrix \\f$op(A)\\f$,\n given in CSR or COO storage format, such that\n \\f[\n op(A) \\cdot C = \\alpha \\cdot op(B),\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans == rocsparse_operation_none} \\\\\n A^T, & \\text{if trans == rocsparse_operation_transpose}\n \\end{array}\n \\right.\n \\f]\n and\n \\f[\n op(B) = \\left\\{\n \\begin{array}{ll}\n B, & \\text{if trans_B == rocsparse_operation_none} \\\\\n B^T, & \\text{if trans_B == rocsparse_operation_transpose}\n \\end{array}\n \\right.\n \\f]\n and where \\f$C\\f$ is the dense solution matrix and \\f$B\\f$ is the dense right-hand side matrix. Both \\f$B\\f$\n and \\f$C\\f$ can be in row or column order.\n\n Performing the above operation requires three stages. First, \\p rocsparse_spsm must be called with the stage\n \\ref rocsparse_spsm_stage_buffer_size, which will determine the size of the required temporary storage buffer.\n Then allocate this buffer and call \\p rocsparse_spsm with the stage \\ref rocsparse_spsm_stage_preprocess,\n which will perform analysis on the sparse matrix \\f$op(A)\\f$. Finally, complete the computation by calling\n \\p rocsparse_spsm with the stage \\ref rocsparse_spsm_stage_compute. The buffer size, buffer allocation, and preprocess\n stages only need to be called once for a given sparse triangular matrix \\f$op(A)\\f$, while the computation stage can be\n repeatedly used with different \\f$B\\f$ and \\f$C\\f$ matrices.\n\n As noted above, both \\f$B\\f$ and \\f$C\\f$ can be in row or column order (this includes mixing the order so that \\f$B\\f$ is in\n row order and \\f$C\\f$ in column order and vice versa). Internally, however, rocSPARSE kernels solve the system assuming the\n matrices \\f$B\\f$ and \\f$C\\f$ are in row order, as this provides the best memory access. This means that if the matrix\n \\f$C\\f$ is not in row order and/or the matrix \\f$B\\f$ is not row order (or \\f$B^{T}\\f$ is not column order as this is\n equivalent to being in row order), then internally, memory copies and/or transposing of data might be performed to get them\n into the correct order (possibly using extra buffer size). After the computation is completed, additional memory copies and/or\n transposing of data might be performed to get them back into the user arrays. For the best performance and smallest required\n temporary storage buffers, use row order for the matrix \\f$C\\f$ and row order for the matrix \\f$B\\f$ (or column order if\n \\f$B\\f$ is being transposed).\n\n \\p rocsparse_spsm supports \\ref rocsparse_indextype_i32 and \\ref rocsparse_indextype_i64 index precisions for storing the\n row pointer and column indices arrays of the sparse matrices. \\p rocsparse_spsm supports the following data types for\n \\f$op(A)\\f$, \\f$op(B)\\f$, \\f$C\\f$, and compute types for \\f$\\alpha\\f$:\n\n \\par Uniform Precisions:\n <table>\n <caption id=\"spsm_uniform\">Uniform Precisions</caption>\n <tr><th>A / B / C / compute_type\n <tr><td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_f64_r\n <tr><td>rocsparse_datatype_f32_c\n <tr><td>rocsparse_datatype_f64_c\n </table>\n\n \\note\n The sparse matrix formats currently supported are: \\ref rocsparse_format_coo and \\ref rocsparse_format_csr.\n\n \\note\n Only the \\ref rocsparse_spsm_stage_buffer_size stage and the \\ref rocsparse_spsm_stage_compute stage are non-blocking\n and executed asynchronously with respect to the host. They can return before the actual computation has finished.\n The \\ref rocsparse_spsm_stage_preprocess stage is blocking with respect to the host.\n\n \\note\n Currently, only \\p trans_A == \\ref rocsparse_operation_none and \\p trans_A == \\ref rocsparse_operation_transpose is supported.\n Currently, only \\p trans_B == \\ref rocsparse_operation_none and \\p trans_B == \\ref rocsparse_operation_transpose is supported.\n\n \\note\n Only the \\ref rocsparse_spsm_stage_buffer_size stage and the \\ref rocsparse_spsm_stage_compute stage\n support execution in a hipGraph context. The \\ref rocsparse_spsm_stage_preprocess stage does not support hipGraph.\n\n \\note\n This routine does not support batched computation.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n trans_A matrix operation type for the sparse matrix \\f$op(A)\\f$.\n @param[in]\n trans_B matrix operation type for the dense matrix \\f$op(B)\\f$.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n matA sparse matrix descriptor.\n @param[in]\n matB dense matrix descriptor.\n @param[inout]\n matC dense matrix descriptor.\n @param[in]\n compute_type floating point precision for the SpSM computation.\n @param[in]\n alg SpSM algorithm for the SpSM computation.\n @param[in]\n stage SpSM stage for the SpSM computation.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user. When the\n \\ref rocsparse_spsm_stage_buffer_size stage is passed in,\n the required allocation size (in bytes) is written to \\p buffer_size, and the\n function returns without performing the SpSM operation.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p alpha, \\p matA, \\p matB, \\p matC, \\p descr, or\n \\p buffer_size pointer is invalid.\n \\retval rocsparse_status_not_implemented \\p trans_A, \\p trans_B, \\p compute_type, \\p stage, or \\p alg is\n currently not supported.\n\n \\par Example\n \\snippet example_rocsparse_spsm.cpp doc example"]
pub fn rocsparse_spsm(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
alpha: *const ::std::os::raw::c_void,
matA: rocsparse_const_spmat_descr,
matB: rocsparse_const_dnmat_descr,
matC: rocsparse_dnmat_descr,
compute_type: rocsparse_datatype,
alg: rocsparse_spsm_alg,
stage: rocsparse_spsm_stage,
buffer_size: *mut usize,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\brief Sparse triangular system solve.\n\n \\details\n \\p rocsparse_spsv solves a triangular linear system of equations defined by a sparse \\f$m \\times m\\f$ square matrix \\f$op(A)\\f$,\n given in CSR or COO storage format, such that\n \\f[\n op(A) \\cdot y = \\alpha \\cdot x,\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans == rocsparse_operation_none} \\\\\n A^T, & \\text{if trans == rocsparse_operation_transpose}\n \\end{array}\n \\right.\n \\f]\n and where \\f$y\\f$ is the dense solution vector and \\f$x\\f$ is the dense right-hand side vector.\n\n Performing the above operation requires three stages. First, \\p rocsparse_spsv must be called with the stage\n \\ref rocsparse_spsv_stage_buffer_size, which will determine the size of the required temporary storage buffer.\n The user then allocates this buffer and calls \\p rocsparse_spsv with the stage \\ref rocsparse_spsv_stage_preprocess,\n which will perform analysis on the sparse matrix \\f$op(A)\\f$. Finally, complete the computation by calling\n \\p rocsparse_spsv with the stage \\ref rocsparse_spsv_stage_compute. The buffer size, buffer allocation, and preprocess\n stages only need to be called once for a given sparse matrix \\f$op(A)\\f$, while the computation stage can be repeatedly\n used with different \\f$x\\f$ and \\f$y\\f$ vectors.\n\n \\p rocsparse_spsv supports \\ref rocsparse_indextype_i32 and \\ref rocsparse_indextype_i64 index types for\n storing the row pointer and column indices arrays of the sparse matrices. \\p rocsparse_spsv supports the following\n data types for \\f$op(A)\\f$, \\f$x\\f$, \\f$y\\f$ and compute types for \\f$\\alpha\\f$:\n\n \\par Uniform Precisions:\n <table>\n <caption id=\"spsv_uniform\">Uniform Precisions</caption>\n <tr><th>A / X / Y / compute_type\n <tr><td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_f64_r\n <tr><td>rocsparse_datatype_f32_c\n <tr><td>rocsparse_datatype_f64_c\n </table>\n\n \\note\n The sparse matrix formats currently supported are: \\ref rocsparse_format_coo and \\ref rocsparse_format_csr.\n\n \\note\n Only the \\ref rocsparse_spsv_stage_buffer_size stage and the \\ref rocsparse_spsv_stage_compute stage are non-blocking\n and executed asynchronously with respect to the host. They can return before the actual computation has finished.\n The \\ref rocsparse_spsv_stage_preprocess stage is blocking with respect to the host.\n\n \\note\n Currently, only \\p trans == \\ref rocsparse_operation_none and \\p trans == \\ref rocsparse_operation_transpose is supported.\n\n \\note\n Only the \\ref rocsparse_spsv_stage_buffer_size stage and the \\ref rocsparse_spsv_stage_compute stage\n support execution in a hipGraph context. The \\ref rocsparse_spsv_stage_preprocess stage does not support hipGraph.\n\n \\note\n This routine does not support batched computation.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n trans matrix operation type.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n mat matrix descriptor.\n @param[in]\n x vector descriptor.\n @param[inout]\n y vector descriptor.\n @param[in]\n compute_type floating point precision for the SpSV computation.\n @param[in]\n alg SpSV algorithm for the SpSV computation.\n @param[in]\n stage SpSV stage for the SpSV computation.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user. When the\n \\ref rocsparse_spsv_stage_buffer_size stage is passed,\n the required allocation size (in bytes) is written to \\p buffer_size and the\n function returns without performing the SpSV operation.\n This buffer is non-persistent, and no data is stored in it. Therefore, this memory\n can be freed or reused for other tasks between the analysis phase and the compute phase.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p alpha, \\p mat, \\p x, \\p y, or\n \\p buffer_size pointer is invalid.\n \\retval rocsparse_status_not_implemented \\p trans, \\p compute_type, \\p stage, or \\p alg is\n currently not supported.\n\n \\par Example\n \\snippet example_rocsparse_spsv.cpp doc example"]
pub fn rocsparse_spsv(
handle: rocsparse_handle,
trans: rocsparse_operation,
alpha: *const ::std::os::raw::c_void,
mat: rocsparse_const_spmat_descr,
x: rocsparse_const_dnvec_descr,
y: rocsparse_dnvec_descr,
compute_type: rocsparse_datatype,
alg: rocsparse_spsv_alg,
stage: rocsparse_spsv_stage,
buffer_size: *mut usize,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\details\n \\p rocsparse_sptrsm_buffer_size returns the size of the required buffer to execute the given stage of the SpTrSM operation.\n This routine is used in conjunction with \\ref rocsparse_sptrsm(). See \\ref rocsparse_sptrsm for a full description and example.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n \\note\n This routine does not support batched execution.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n sptrsm_descr SpTrSM descriptor.\n @param[in]\n A sparse matrix descriptor.\n @param[in]\n X dense matrix descriptor.\n @param[in]\n Y dense matrix descriptor.\n @param[in]\n sptrsm_stage stage for the SpTrSM computation.\n @param[out]\n buffer_size_in_bytes number of bytes of the buffer.\n @param[out]\n p_error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if an error descriptor is not required.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_value the \\p sptrsm_stage value is invalid.\n \\retval rocsparse_status_invalid_pointer \\p A, \\p X, \\p Y, \\p sptrsm_descr, or \\p buffer_size_in_bytes pointer is invalid."]
pub fn rocsparse_sptrsm_buffer_size(
handle: rocsparse_handle,
sptrsm_descr: rocsparse_sptrsm_descr,
A: rocsparse_const_spmat_descr,
X: rocsparse_const_dnmat_descr,
Y: rocsparse_const_dnmat_descr,
sptrsm_stage: rocsparse_sptrsm_stage,
buffer_size_in_bytes: *mut usize,
p_error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\brief Sparse triangular system solve with multiple right-hand sides.\n\n \\details\n \\p rocsparse_sptrsm solves a triangular linear system of equations defined by a sparse \\f$m \\times m\\f$ square matrix \\f$op(A)\\f$,\n given in CSR or COO storage format, such that\n \\f[\n op(A) \\cdot Y = \\alpha \\cdot op(X),\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans == rocsparse_operation_none} \\\\\n A^T, & \\text{if trans == rocsparse_operation_transpose}\n \\end{array}\n \\right.\n \\f]\n and\n \\f[\n op(X) = \\left\\{\n \\begin{array}{ll}\n X, & \\text{if trans_B == rocsparse_operation_none} \\\\\n X^T, & \\text{if trans_B == rocsparse_operation_transpose}\n \\end{array}\n \\right.\n \\f]\n and where \\f$Y\\f$ is the dense solution matrix and \\f$X\\f$ is the dense right-hand side matrix. Both \\f$X\\f$\n and \\f$Y\\f$ can be in row or column order.\n\n Performing the above operation requires two stages, the stage \\ref rocsparse_sptrsm_stage_analysis and the stage \\ref rocsparse_sptrsm_stage_compute.\n The stage \\ref rocsparse_sptrsm_stage_analysis is required to perform the stage \\ref rocsparse_sptrsm_stage_compute and only needs to be called once for a given sparse matrix \\f$op(A)\\f$, while the stage \\ref rocsparse_sptrsm_stage_compute can be repeatedly used with different \\f$X\\f$ and \\f$Y\\f$ matrices.\n\n As noted above, both \\f$X\\f$ and \\f$Y\\f$ can be in row or column order (this includes mixing the order so that \\f$X\\f$ is in\n row order and \\f$Y\\f$ in column order and vice versa). Internally, however, rocSPARSE kernels solve the system assuming the\n matrices \\f$X\\f$ and \\f$Y\\f$ are in row order, as this provides the best memory access. This means that if the matrix\n \\f$Y\\f$ is not in row order and/or the matrix \\f$X\\f$ is not in row order (or \\f$X^{T}\\f$ is not in column order as this is\n equivalent to being in row order), then internally, memory copies and/or transposing of data might be performed to get them\n into the correct order (possibly using extra buffer size). After the computation is completed, additional memory copies and/or\n transposing of data might be performed to get them back into the user arrays. For the best performance and smallest required\n temporary storage buffers, use row order for the matrix \\f$Y\\f$ and row order for the matrix \\f$X\\f$ (or column order if\n \\f$X\\f$ is being transposed).\n\n \\p rocsparse_sptrsm supports \\ref rocsparse_indextype_i32 and \\ref rocsparse_indextype_i64 index precisions for storing the\n row pointer and column indices arrays of the sparse matrices. \\p rocsparse_sptrsm supports the following data types for\n \\f$op(A)\\f$, \\f$op(X)\\f$, \\f$Y\\f$, and compute types for \\f$\\alpha\\f$:\n\n \\par Uniform Precisions:\n <table>\n <caption id=\"sptrsm_uniform\">Uniform Precisions</caption>\n <tr><th>A / X / Y / compute_type\n <tr><td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_f64_r\n <tr><td>rocsparse_datatype_f32_c\n <tr><td>rocsparse_datatype_f64_c\n </table>\n\n \\note\n The sparse matrix formats currently supported are: \\ref rocsparse_format_coo and \\ref rocsparse_format_csr.\n\n \\note\n Only the \\ref rocsparse_sptrsm_stage_compute stage is non-blocking\n and executed asynchronously with respect to the host. It can return before the actual computation has finished.\n The \\ref rocsparse_sptrsm_stage_analysis stage is blocking with respect to the host.\n\n \\note\n Currently, only \\p trans_A == \\ref rocsparse_operation_none and \\p trans_A == \\ref rocsparse_operation_transpose are supported.\n Currently, only \\p trans_X == \\ref rocsparse_operation_none and \\p trans_X == \\ref rocsparse_operation_transpose are supported.\n\n \\note\n Only the stage \\ref rocsparse_sptrsm_stage_compute\n supports execution in a hipGraph context. The \\ref rocsparse_sptrsm_stage_analysis stage does not support hipGraph.\n\n \\note\n This routine does not support batched execution.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n sptrsm_descr SpTrSM routine descriptor.\n @param[in]\n A sparse matrix descriptor.\n @param[in]\n X dense matrix descriptor.\n @param[inout]\n Y dense matrix descriptor.\n @param[in]\n sptrsm_stage SpTrSM stage for the SpTrSM computation.\n @param[out]\n buffer_size_in_bytes number of bytes of the temporary storage buffer.\n @param[in]\n buffer temporary storage buffer allocated by the user.\n @param[out]\n p_error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if an error descriptor is not required.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p A, X, \\p Y, \\p sptrsm_descr, or\n \\p buffer_size pointer is invalid.\n \\retval rocsparse_status_not_implemented the configuration of the descriptor \\p sptrsm_descr is currently not supported.\n \\par Example\n \\snippet example_rocsparse_sptrsm.cpp doc example"]
pub fn rocsparse_sptrsm(
handle: rocsparse_handle,
sptrsm_descr: rocsparse_sptrsm_descr,
A: rocsparse_const_spmat_descr,
X: rocsparse_const_dnmat_descr,
Y: rocsparse_dnmat_descr,
sptrsm_stage: rocsparse_sptrsm_stage,
buffer_size_in_bytes: usize,
buffer: *mut ::std::os::raw::c_void,
p_error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\details\n \\p rocsparse_sptrsv_buffer_size returns the size of the required buffer to execute the given stage of the SpTrSV operation.\n This routine is used in conjunction with \\ref rocsparse_sptrsv(). See \\ref rocsparse_sptrsv for a full description and example.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n \\note\n This routine does not support batched computation.\n\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n sptrsv_descr SpTrSV descriptor.\n @param[in]\n spmat_descr sparse matrix descriptor.\n @param[in]\n x dense vector descriptor.\n @param[in]\n y dense vector descriptor.\n @param[in]\n sptrsv_stage stage for the SpTrSV computation.\n @param[out]\n buffer_size_in_bytes number of bytes of the buffer.\n @param[out]\n p_error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if an error descriptor is not required.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_value the \\p sptrsv_stage value is invalid.\n \\retval rocsparse_status_invalid_pointer \\p sptrsv_descr, \\p spmat_descr, \\p x, \\p y, or \\p buffer_size_in_bytes pointer is invalid."]
pub fn rocsparse_sptrsv_buffer_size(
handle: rocsparse_handle,
sptrsv_descr: rocsparse_sptrsv_descr,
spmat_descr: rocsparse_const_spmat_descr,
x: rocsparse_const_dnvec_descr,
y: rocsparse_const_dnvec_descr,
sptrsv_stage: rocsparse_sptrsv_stage,
buffer_size_in_bytes: *mut usize,
p_error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\brief Sparse triangular solve.\n\n \\details\n \\p rocsparse_sptrsv solves a triangular linear system of equations defined by a sparse \\f$m \\times m\\f$ square matrix \\f$op(A)\\f$,\n such that\n \\f[\n op(A) \\cdot y = \\alpha \\cdot x,\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if op == rocsparse_operation_none} \\\\\n A^T, & \\text{if op == rocsparse_operation_transpose} \\\\\n A^H, & \\text{if op == rocsparse_operation_conjugate_transpose} \\\\\n \\end{array}\n \\right.\n \\f]\n and where \\f$y\\f$ is the dense solution vector and \\f$x\\f$ is the dense right-hand side vector.\n\n Performing the above operation requires two stages, the stage \\ref rocsparse_sptrsv_stage_analysis and the stage \\ref rocsparse_sptrsv_stage_compute.\n The stage \\ref rocsparse_sptrsv_stage_analysis is required to perform the stage \\ref rocsparse_sptrsv_stage_compute and only need to be called once for a given sparse matrix \\f$op(A)\\f$, while the stage \\ref rocsparse_sptrsv_stage_compute can be repeatedly used with different \\f$x\\f$ and \\f$y\\f$ vectors.\n\n \\p rocsparse_sptrsv supports the following\n data types for \\f$op(A)\\f$, \\f$x\\f$, \\f$y\\f$, and scalar \\f$\\alpha\\f$:\n\n \\par Uniform Precisions:\n <table>\n <caption id=\"sptrsv_uniform\">Uniform Precisions</caption>\n <tr><th>A / X / Y / scalar\n <tr><td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_f64_r\n <tr><td>rocsparse_datatype_f32_c\n <tr><td>rocsparse_datatype_f64_c\n </table>\n\n \\note The descriptor \\p rocsparse_sptrsv_descr needs to be configured with \\ref rocsparse_sptrsv_set_input.\n \\note\n The sparse matrix formats currently supported are: \\ref rocsparse_format_coo and \\ref rocsparse_format_csr.\n\n \\note\n the \\ref rocsparse_sptrsv_stage_compute stage is non-blocking\n and executed asynchronously with respect to the host. It can return before the actual computation has finished.\n The \\ref rocsparse_sptrsv_stage_analysis stage is blocking with respect to the host.\n\n \\note\n Currently, only \\p trans == \\ref rocsparse_operation_none and \\p trans == \\ref rocsparse_operation_transpose are supported.\n Only the \\ref rocsparse_sptrsv_stage_compute stage\n supports execution in a hipGraph context. The \\ref rocsparse_sptrsv_stage_analysis stage does not support hipGraph.\n\n \\note\n This routine does not support batched computation.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n sptrsv_descr descriptor of the routine.\n @param[in]\n A matrix descriptor.\n @param[in]\n x vector descriptor.\n @param[inout]\n y vector descriptor.\n @param[in]\n sptrsv_stage stage for the SpTRSV computation.\n @param[in]\n buffer_size_in_bytes number of bytes of the buffer.\n @param[in]\n buffer buffer allocated by the user.\n @param[out]\n p_error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if the user is not interested in obtaining an error descriptor.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p sptrsv_descr, \\p A, \\p x, or \\p y is invalid, or \\p buffer is null and \\p buffer_size_in_bytes is non-zero, or \\p buffer is not null and \\p buffer_size_in_bytes is zero.\n \\retval rocsparse_status_invalid_value \\p sptrsv_stage is invalid.\n\n \\par Example\n \\snippet example_rocsparse_sptrsv.cpp doc example"]
pub fn rocsparse_sptrsv(
handle: rocsparse_handle,
sptrsv_descr: rocsparse_sptrsv_descr,
A: rocsparse_const_spmat_descr,
x: rocsparse_const_dnvec_descr,
y: rocsparse_dnvec_descr,
sptrsv_stage: rocsparse_sptrsv_stage,
buffer_size_in_bytes: usize,
buffer: *mut ::std::os::raw::c_void,
p_error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\brief Sparse vector inner dot product.\n\n \\details\n \\p rocsparse_spvv computes the inner dot product of the sparse vector \\f$x\\f$ with the\n dense vector \\f$y\\f$, such that\n \\f[\n \\text{result} := op(x) \\cdot y,\n \\f]\n with\n \\f[\n op(x) = \\left\\{\n \\begin{array}{ll}\n x, & \\text{if trans == rocsparse_operation_none} \\\\\n \\bar{x}, & \\text{if trans == rocsparse_operation_conjugate_transpose} \\\\\n \\end{array}\n \\right.\n \\f]\n\n \\code{.c}\n result = 0;\n for(i = 0; i < nnz; ++i)\n {\n result += x_val[i] * y[x_ind[i]];\n }\n \\endcode\n\n Performing the above operation involves two steps. First, call \\p rocsparse_spvv with \\p temp_buffer set to \\p nullptr,\n which will return the required temporary buffer size in the parameter \\p buffer_size. Then allocate this buffer. Finally,\n complete the computation by calling \\p rocsparse_spvv a second time with the newly allocated buffer. After the\n computation is complete, deallocate the buffer.\n\n \\p rocsparse_spvv supports the following uniform and mixed-precision data types for the sparse and dense vectors \\f$x\\f$ and\n \\f$y\\f$ and compute types for the scalar \\p result.\n\n \\par Uniform Precisions:\n <table>\n <caption id=\"spvv_uniform\">Uniform Precisions</caption>\n <tr><th>X / Y / compute_type\n <tr><td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_f64_r\n <tr><td>rocsparse_datatype_f32_c\n <tr><td>rocsparse_datatype_f64_c\n </table>\n\n \\par Mixed Precisions:\n <table>\n <caption id=\"spvv_mixed\">Mixed Precisions</caption>\n <tr><th>X / Y <th>compute_type / result\n <tr><td>rocsparse_datatype_i8_r <td>rocsparse_datatype_i32_r\n <tr><td>rocsparse_datatype_i8_r <td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_f16_r <td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_bf16_r <td>rocsparse_datatype_f32_r\n </table>\n\n \\note\n This function writes the required allocation size (in bytes) to \\p buffer_size and\n returns without performing the SpVV operation when a nullptr is passed for\n \\p temp_buffer.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n \\note\n This routine does not support batched computation.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n trans sparse vector operation type.\n @param[in]\n x sparse vector descriptor.\n @param[in]\n y dense vector descriptor.\n @param[out]\n result pointer to the result, which can be in host or device memory.\n @param[in]\n compute_type floating point precision for the SpVV computation.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer. buffer_size is set when\n \\p temp_buffer is nullptr.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user. When a nullptr is passed,\n the required allocation size (in bytes) is written to \\p buffer_size and the\n function returns without performing the SpVV operation.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p x, \\p y, \\p result, or \\p buffer_size\n pointer is invalid.\n \\retval rocsparse_status_not_implemented \\p compute_type is currently not\n supported.\n\n \\par Example\n \\snippet example_rocsparse_spvv.cpp doc example"]
pub fn rocsparse_spvv(
handle: rocsparse_handle,
trans: rocsparse_operation,
x: rocsparse_const_spvec_descr,
y: rocsparse_const_dnvec_descr,
result: *mut ::std::os::raw::c_void,
compute_type: rocsparse_datatype,
buffer_size: *mut usize,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\details\n \\p rocsparse_v2_spmv_buffer_size returns the size of the required buffer to execute the given stage of the Version 2 SpMV operation.\n This routine is used in conjunction with \\ref rocsparse_v2_spmv(). See \\ref rocsparse_v2_spmv for a full description and example.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n descr SpMV descriptor.\n @param[in]\n mat sparse matrix descriptor.\n @param[in]\n x dense vector descriptor.\n @param[in]\n y dense vector descriptor.\n @param[in]\n stage Version 2 SpMV stage for the SpMV computation.\n @param[out]\n buffer_size_in_bytes number of bytes of the buffer.\n @param[out]\n error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if an error descriptor is not required.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_value the \\p stage value is invalid.\n \\retval rocsparse_status_invalid_pointer \\p mat, \\p x, \\p y, \\p descr, or \\p buffer_size_in_bytes pointer is invalid."]
pub fn rocsparse_v2_spmv_buffer_size(
handle: rocsparse_handle,
descr: rocsparse_spmv_descr,
mat: rocsparse_const_spmat_descr,
x: rocsparse_const_dnvec_descr,
y: rocsparse_const_dnvec_descr,
stage: rocsparse_v2_spmv_stage,
buffer_size_in_bytes: *mut usize,
error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\brief Sparse matrix vector multiplication.\n\n \\details\n \\p rocsparse_v2_spmv multiplies the scalar \\f$\\alpha\\f$ with a sparse \\f$m \\times n\\f$ matrix \\f$op(A)\\f$ with the dense vector \\f$x\\f$ and adds the result to the dense vector \\f$y\\f$\n that is multiplied by the scalar \\f$\\beta\\f$, such that\n \\f[\n y := \\alpha \\cdot op(A) \\cdot x + \\beta \\cdot y,\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans == rocsparse_operation_none} \\\\\n A^T, & \\text{if trans == rocsparse_operation_transpose} \\\\\n A^H, & \\text{if trans == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n\n \\note The sparse matrix format \\ref rocsparse_format_bell is not supported.\n\n Performing the above operation involves two stages. The first stage is \\ref rocsparse_v2_spmv_stage_analysis. This will perform an analysis\n of the symbolic information of \\f$op(A)\\f$. The second stage is \\ref rocsparse_v2_spmv_stage_compute, which corresponds to the actual calculation.\n The size of the buffer required for each stage is determined by calling the routine \\ref rocsparse_v2_spmv_buffer_size.\n The stage \\ref rocsparse_v2_spmv_stage_analysis only needs to be called once for a given sparse matrix \\f$op(A)\\f$, while the computation stage can be repeatedly used\n with different \\f$x\\f$ and \\f$y\\f$ vectors.\n\n \\note The stage \\ref rocsparse_v2_spmv_stage_analysis is mandatory. An error will be returned if that stage was not executed before the stage \\ref rocsparse_v2_spmv_stage_compute.\n\n \\p rocsparse_v2_spmv supports multiple algorithms. These algorithms have different trade-offs depending on the sparsity pattern of the matrix,\n whether or not the results need to be deterministic, and how many times the sparse-vector product will be performed.\n\n <table>\n <caption id=\"v2_spmv_csr_algorithms\">CSR/CSC Algorithms</caption>\n <tr><th>Algorithm <th>Deterministic <th>Notes\n <tr><td>rocsparse_spmv_alg_csr_rowsplit</td> <td>Yes</td> <td>This is best suited for matrices with all rows having a similar number of non-zeros. Can outperform adaptive and LRB algorithms in certain sparsity patterns. Will perform very poorly if some rows have few non-zeros and some rows have many non-zeros.</td>\n <tr><td>rocsparse_spmv_alg_csr_stream</td> <td>Yes</td> <td>[Deprecated] The old name for rocsparse_spmv_alg_csr_rowsplit.</td>\n <tr><td>rocsparse_spmv_alg_csr_adaptive</td> <td>No</td> <td>Generally the fastest algorithm across all matrix sparsity patterns. This includes matrices that have some rows with many non-zeros and some rows with few non-zeros. Requires lengthy preprocessing that needs to be amortized over many subsequent sparse vector products.</td>\n <tr><td>rocsparse_spmv_alg_csr_lrb</td> <td>No</td> <td>Like the adaptive algorithm, this generally performs well across all matrix sparsity patterns. Generally not as fast as the adaptive algorithm. However, it uses a much faster preprocessing step. Good for when only a small number of sparse vector products will be performed.</td>\n <tr><td>rocsparse_spmv_alg_csr_nnzsplit</td> <td>No</td> <td>Like the adaptive algorithm, this generally performs well across all matrix sparsity patterns. Generally not as fast as the adaptive algorithm but faster than the LRB algorithm. It uses a much faster preprocessing step than LRB. It's good when the number of sparse vector products that will be performed is less than one hundred. If more products need to be computed, the adaptive algorithm is probably faster.</td>\n </table>\n\n <table>\n <caption id=\"v2_spmv_coo_algorithms\">COO Algorithms</caption>\n <tr><th>COO Algorithms <th>Deterministic <th>Notes\n <tr><td>rocsparse_spmv_alg_coo</td> <td>Yes</td> <td>Generally not as fast as the atomic algorithm but is deterministic.</td>\n <tr><td>rocsparse_spmv_alg_coo_atomic</td> <td>No</td> <td>Generally the fastest COO algorithm.</td>\n </table>\n\n <table>\n <caption id=\"v2_spmv_ell_algorithms\">ELL Algorithms</caption>\n <tr><th>ELL Algorithms <th>Deterministic <th>Notes\n <tr><td>rocsparse_spmv_alg_ell</td> <td>Yes</td> <td></td>\n </table>\n\n <table>\n <caption id=\"v2_spmv_sell_algorithms\">Sliced ELL Algorithms</caption>\n <tr><th>Sliced ELL Algorithms <th>Deterministic <th>Notes\n <tr><td>rocsparse_spmv_alg_sell</td> <td>Yes</td> <td></td>\n </table>\n\n <table>\n <caption id=\"v2_spmv_bsr_algorithms\">BSR Algorithms</caption>\n <tr><th>BSR Algorithm <th>Deterministic <th>Notes\n <tr><td>rocsparse_spmv_alg_bsr</td> <td>Yes</td> <td></td>\n </table>\n\n \\p rocsparse_v2_spmv supports multiple combinations of data types and compute types. The tables below indicate the currently\n supported different data types that can be used for the sparse matrix \\f$op(A)\\f$, the dense vectors \\f$x\\f$ and\n \\f$y\\f$, and the compute type for \\f$\\alpha\\f$ and \\f$\\beta\\f$. The advantage of using different data types is to save on\n memory bandwidth and storage when a user application allows, while performing the actual computation in a higher precision.\n\n \\par Uniform Precisions:\n <table>\n <caption id=\"v2_spmv_uniform\">Uniform Precisions</caption>\n <tr><th>A / X / Y / compute_type\n <tr><td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_f64_r\n <tr><td>rocsparse_datatype_f32_c\n <tr><td>rocsparse_datatype_f64_c\n </table>\n\n \\par Mixed Precisions:\n <table>\n <caption id=\"v2_spmv_mixed\">Mixed Precisions</caption>\n <tr><th>A / X <th>Y <th>compute_type\n <tr><td>rocsparse_datatype_i8_r <td>rocsparse_datatype_i32_r <td>rocsparse_datatype_i32_r\n <tr><td>rocsparse_datatype_i8_r <td>rocsparse_datatype_f32_r <td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_f16_r <td>rocsparse_datatype_f32_r <td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_f16_r <td>rocsparse_datatype_f16_r <td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_bf16_r <td>rocsparse_datatype_f32_r <td>rocsparse_datatype_f32_r\n <tr><td>rocsparse_datatype_bf16_r <td>rocsparse_datatype_bf16_r <td>rocsparse_datatype_f32_r\n </table>\n\n \\par Mixed-regular Real Precisions\n <table>\n <caption id=\"v2_spmv_mixed_regular_real\">Mixed-regular Real Precisions</caption>\n <tr><th>A <th>X / Y / compute_type\n <tr><td>rocsparse_datatype_f32_r <td>rocsparse_datatype_f64_r\n <tr><td>rocsparse_datatype_f32_c <td>rocsparse_datatype_f64_c\n </table>\n\n \\par Mixed-regular Complex Precisions\n <table>\n <caption id=\"v2_spmv_mixed_regular_complex\">Mixed-regular Complex Precisions</caption>\n <tr><th>A <th>X / Y / compute_type\n <tr><td>rocsparse_datatype_f32_r <td>rocsparse_datatype_f32_c\n <tr><td>rocsparse_datatype_f64_r <td>rocsparse_datatype_f64_c\n </table>\n\n \\p rocsparse_v2_spmv supports \\ref rocsparse_indextype_i32 and \\ref rocsparse_indextype_i64 index precisions\n for storing the row pointer and column indices arrays of the sparse matrices.\n\n \\note\n None of the algorithms above are deterministic when \\f$A\\f$ is transposed.\n\n \\note\n All the sparse matrix formats are supported except \\ref rocsparse_format_bell.\n\n \\note\n The \\ref rocsparse_v2_spmv_stage_compute stage is non-blocking\n and executed asynchronously with respect to the host. It can return before the actual computation has finished.\n The stage \\ref rocsparse_v2_spmv_stage_analysis is blocking with respect to the host.\n\n \\note\n Only the stage \\ref rocsparse_v2_spmv_stage_compute\n supports execution in a hipGraph context. The \\ref rocsparse_v2_spmv_stage_analysis stage does not support hipGraph.\n\n \\note\n This routine does not support batched computation.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n descr SpMV descriptor.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n mat matrix descriptor.\n @param[in]\n x vector descriptor.\n @param[in]\n beta scalar \\f$\\beta\\f$.\n @param[inout]\n y vector descriptor.\n @param[in]\n stage SpMV stage of the SpMV algorithm.\n @param[in]\n buffer_size_in_bytes size in bytes of the buffer, which must be greater or equal to the buffer size obtained from \\ref rocsparse_v2_spmv_buffer_size.\n @param[in]\n buffer temporary buffer allocated by the user.\n @param[out]\n error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if an error descriptor is not required.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context \\p handle was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p alpha, \\p mat, \\p x, \\p beta, \\p y, or\n \\p buffer pointer is invalid.\n \\retval rocsparse_status_invalid_value the value of \\p stage is invalid.\n \\retval rocsparse_status_not_implemented if \\p alg is not supported or if the mixed precision configuration is not supported.\n\n \\par Example\n \\snippet example_rocsparse_v2_spmv.cpp doc example"]
pub fn rocsparse_v2_spmv(
handle: rocsparse_handle,
descr: rocsparse_spmv_descr,
alpha: *const ::std::os::raw::c_void,
mat: rocsparse_const_spmat_descr,
x: rocsparse_const_dnvec_descr,
beta: *const ::std::os::raw::c_void,
y: rocsparse_dnvec_descr,
stage: rocsparse_v2_spmv_stage,
buffer_size_in_bytes: usize,
buffer: *mut ::std::os::raw::c_void,
error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\brief Set extra scalar and vector parameters for SpMV.\n\n \\details\n \\p rocsparse_spmv_set_extra sets a gamma dnvec vector and z vectors that are\n appended to the SpMV computation. The computation will be:\n \\f$y = \\alpha * op(A) * x + \\beta * y + \\sum_{i=1}^{n} \\gamma_i z_i\\f$\n where \\f$n\\f$ is the number of extra terms set by \\p num_extras.\n\n This feature can be used to implement residual calculations of the form\n \\f$r = b - A * x\\f$ within the SpMV call by setting \\f$\\gamma = 1\\f$ and \\f$z = b\\f$.\n\n \\par Data type Requirements\n The following data type requirements must be satisfied:\n - The \\p gamma_vec data type must match the scalar data type set using\n \\ref rocsparse_spmv_set_input with \\p rocsparse_spmv_input_scalar_datatype.\n - All \\p z_vecs must have the same data type as the compute data type set using\n \\ref rocsparse_spmv_set_input with \\p rocsparse_spmv_input_compute_datatype.\n - The size of \\p gamma_vec must equal \\p num_extras.\n - All \\p z_vecs must have the same size (vector length).\n - Both scalar and compute data types must be set on the descriptor before calling this function.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[inout]\n descr SpMV descriptor.\n @param[in]\n num_extras number of extra terms (gamma/z pairs).\n @param[in]\n gamma_vec dense vector descriptor containing gamma scalars. Must have a data type matching\n the scalar datatype and a size equal to \\p num_extras.\n @param[in]\n z_vecs array of dense vector descriptors for z vectors. All vectors must have a\n data type matching the compute data type and have the same size.\n @param[out]\n p_error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if an error descriptor is not required.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p gamma_vec, or \\p z_vecs is invalid.\n \\retval rocsparse_status_invalid_value invalid parameters, including data type mismatches\n or missing scalar/compute data type configuration.\n \\retval rocsparse_status_invalid_size size mismatches between \\p gamma_vec and \\p num_extras,\n or between \\p z_vecs elements."]
pub fn rocsparse_spmv_set_extra(
handle: rocsparse_handle,
descr: rocsparse_spmv_descr,
num_extras: i64,
gamma_vec: rocsparse_const_dnvec_descr,
z_vecs: *mut rocsparse_const_dnvec_descr,
p_error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup generic_module\n \\brief Clear extra parameters for SpMV.\n\n \\details\n \\p rocsparse_spmv_clear_extra clears the extra parameters set by\n \\ref rocsparse_spmv_set_extra.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[inout]\n descr SpMV descriptor.\n @param[out]\n p_error error descriptor created if the returned status is not \\ref rocsparse_status_success. A null pointer can be passed if an error descriptor is not required.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p descr is invalid."]
pub fn rocsparse_spmv_clear_extra(
handle: rocsparse_handle,
descr: rocsparse_spmv_descr,
p_error: *mut rocsparse_error,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level1_module\n \\brief Scale a sparse vector and add it to a dense vector.\n\n \\details\n \\p rocsparse_axpyi multiplies the sparse vector \\f$x\\f$ with scalar \\f$\\alpha\\f$ and\n adds the result to the dense vector \\f$y\\f$, such that\n\n \\f[\n y := y + \\alpha \\cdot x\n \\f]\n\n \\code{.c}\n for(i = 0; i < nnz; ++i)\n {\n y[x_ind[i]] = y[x_ind[i]] + alpha * x_val[i];\n }\n \\endcode\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n nnz number of non-zero entries of vector \\f$x\\f$.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n x_val array of \\p nnz elements containing the values of \\f$x\\f$.\n @param[in]\n x_ind array of \\p nnz elements containing the indices of the non-zero\n values of \\f$x\\f$.\n @param[inout]\n y array of values in dense format.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_value \\p idx_base is invalid.\n \\retval rocsparse_status_invalid_size \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p alpha, \\p x_val, \\p x_ind, or \\p y pointer\n is invalid.\n\n \\par Example\n \\snippet example_rocsparse_axpyi.cpp doc example\n/\n/**@{"]
pub fn rocsparse_saxpyi(
handle: rocsparse_handle,
nnz: rocsparse_int,
alpha: *const f32,
x_val: *const f32,
x_ind: *const rocsparse_int,
y: *mut f32,
idx_base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_daxpyi(
handle: rocsparse_handle,
nnz: rocsparse_int,
alpha: *const f64,
x_val: *const f64,
x_ind: *const rocsparse_int,
y: *mut f64,
idx_base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_caxpyi(
handle: rocsparse_handle,
nnz: rocsparse_int,
alpha: *const rocsparse_float_complex,
x_val: *const rocsparse_float_complex,
x_ind: *const rocsparse_int,
y: *mut rocsparse_float_complex,
idx_base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zaxpyi(
handle: rocsparse_handle,
nnz: rocsparse_int,
alpha: *const rocsparse_double_complex,
x_val: *const rocsparse_double_complex,
x_ind: *const rocsparse_int,
y: *mut rocsparse_double_complex,
idx_base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level1_module\n \\brief Compute the dot product of a complex conjugate sparse vector with a dense\n vector.\n\n \\details\n \\p rocsparse_dotci computes the dot product of the complex conjugate sparse vector\n \\f$x\\f$ with the dense vector \\f$y\\f$, such that\n \\f[\n \\text{result} := \\bar{x}^H y\n \\f]\n\n \\code{.c}\n result = 0\n for(i = 0; i < nnz; ++i)\n {\n result += conj(x_val[i]) * y[x_ind[i]];\n }\n \\endcode\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n nnz number of non-zero entries of vector \\f$x\\f$.\n @param[in]\n x_val array of \\p nnz values.\n @param[in]\n x_ind array of \\p nnz elements containing the indices of the non-zero\n values of \\f$x\\f$.\n @param[in]\n y array of values in dense format.\n @param[out]\n result pointer to the result, which can be in host or device memory.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_value \\p idx_base is invalid.\n \\retval rocsparse_status_invalid_size \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p x_val, \\p x_ind, \\p y, or \\p result\n pointer is invalid.\n \\retval rocsparse_status_memory_error the buffer for the dot product reduction\n could not be allocated.\n \\retval rocsparse_status_internal_error an internal error occurred.\n/\n/**@{"]
pub fn rocsparse_cdotci(
handle: rocsparse_handle,
nnz: rocsparse_int,
x_val: *const rocsparse_float_complex,
x_ind: *const rocsparse_int,
y: *const rocsparse_float_complex,
result: *mut rocsparse_float_complex,
idx_base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zdotci(
handle: rocsparse_handle,
nnz: rocsparse_int,
x_val: *const rocsparse_double_complex,
x_ind: *const rocsparse_int,
y: *const rocsparse_double_complex,
result: *mut rocsparse_double_complex,
idx_base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level1_module\n \\brief Compute the dot product of a sparse vector with a dense vector.\n\n \\details\n \\p rocsparse_doti computes the dot product of the sparse vector \\f$x\\f$ with the\n dense vector \\f$y\\f$, such that\n \\f[\n \\text{result} := y^T x\n \\f]\n\n \\code{.c}\n result = 0\n for(i = 0; i < nnz; ++i)\n {\n result += x_val[i] * y[x_ind[i]];\n }\n \\endcode\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n nnz number of non-zero entries of vector \\f$x\\f$.\n @param[in]\n x_val array of \\p nnz values.\n @param[in]\n x_ind array of \\p nnz elements containing the indices of the non-zero\n values of \\f$x\\f$.\n @param[in]\n y array of values in dense format.\n @param[out]\n result pointer to the result, which can be in host or device memory.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_value \\p idx_base is invalid.\n \\retval rocsparse_status_invalid_size \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p x_val, \\p x_ind, \\p y, or \\p result\n pointer is invalid.\n \\retval rocsparse_status_memory_error the buffer for the dot product reduction\n could not be allocated.\n \\retval rocsparse_status_internal_error an internal error occurred.\n\n \\par Example\n \\snippet example_rocsparse_doti.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sdoti(
handle: rocsparse_handle,
nnz: rocsparse_int,
x_val: *const f32,
x_ind: *const rocsparse_int,
y: *const f32,
result: *mut f32,
idx_base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ddoti(
handle: rocsparse_handle,
nnz: rocsparse_int,
x_val: *const f64,
x_ind: *const rocsparse_int,
y: *const f64,
result: *mut f64,
idx_base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cdoti(
handle: rocsparse_handle,
nnz: rocsparse_int,
x_val: *const rocsparse_float_complex,
x_ind: *const rocsparse_int,
y: *const rocsparse_float_complex,
result: *mut rocsparse_float_complex,
idx_base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zdoti(
handle: rocsparse_handle,
nnz: rocsparse_int,
x_val: *const rocsparse_double_complex,
x_ind: *const rocsparse_int,
y: *const rocsparse_double_complex,
result: *mut rocsparse_double_complex,
idx_base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level1_module\n \\brief Gather elements from a dense vector and store them in a sparse vector.\n\n \\details\n \\p rocsparse_gthr gathers the elements that are listed in \\p x_ind from the dense\n vector \\f$y\\f$ and stores them in the sparse vector \\f$x\\f$.\n\n \\code{.c}\n for(i = 0; i < nnz; ++i)\n {\n x_val[i] = y[x_ind[i]];\n }\n \\endcode\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n nnz number of non-zero entries of \\f$x\\f$.\n @param[in]\n y array of values in dense format.\n @param[out]\n x_val array of \\p nnz elements containing the values of \\f$x\\f$.\n @param[in]\n x_ind array of \\p nnz elements containing the indices of the non-zero\n values of \\f$x\\f$.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_value \\p idx_base is invalid.\n \\retval rocsparse_status_invalid_size \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p y, \\p x_val, or \\p x_ind pointer is\n invalid.\n\n \\par Example\n \\snippet example_rocsparse_gthr.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sgthr(
handle: rocsparse_handle,
nnz: rocsparse_int,
y: *const f32,
x_val: *mut f32,
x_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dgthr(
handle: rocsparse_handle,
nnz: rocsparse_int,
y: *const f64,
x_val: *mut f64,
x_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cgthr(
handle: rocsparse_handle,
nnz: rocsparse_int,
y: *const rocsparse_float_complex,
x_val: *mut rocsparse_float_complex,
x_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zgthr(
handle: rocsparse_handle,
nnz: rocsparse_int,
y: *const rocsparse_double_complex,
x_val: *mut rocsparse_double_complex,
x_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level1_module\n \\brief Gather and zero out elements from a dense vector and store them in a sparse\n vector.\n\n \\details\n \\p rocsparse_gthrz gathers the elements that are listed in \\p x_ind from the dense\n vector \\f$y\\f$ and stores them in the sparse vector \\f$x\\f$. The gathered elements\n in \\f$y\\f$ are replaced by zero.\n\n \\code{.c}\n for(i = 0; i < nnz; ++i)\n {\n x_val[i] = y[x_ind[i]];\n y[x_ind[i]] = 0;\n }\n \\endcode\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n nnz number of non-zero entries of \\f$x\\f$.\n @param[inout]\n y array of values in dense format.\n @param[out]\n x_val array of \\p nnz elements containing the non-zero values of \\f$x\\f$.\n @param[in]\n x_ind array of \\p nnz elements containing the indices of the non-zero\n values of \\f$x\\f$.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_value \\p idx_base is invalid.\n \\retval rocsparse_status_invalid_size \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p y, \\p x_val, or \\p x_ind pointer is\n invalid.\n/\n/**@{"]
pub fn rocsparse_sgthrz(
handle: rocsparse_handle,
nnz: rocsparse_int,
y: *mut f32,
x_val: *mut f32,
x_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dgthrz(
handle: rocsparse_handle,
nnz: rocsparse_int,
y: *mut f64,
x_val: *mut f64,
x_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cgthrz(
handle: rocsparse_handle,
nnz: rocsparse_int,
y: *mut rocsparse_float_complex,
x_val: *mut rocsparse_float_complex,
x_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zgthrz(
handle: rocsparse_handle,
nnz: rocsparse_int,
y: *mut rocsparse_double_complex,
x_val: *mut rocsparse_double_complex,
x_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level1_module\n \\brief Apply Givens rotation to a dense and a sparse vector.\n\n \\details\n \\p rocsparse_roti applies the Givens rotation matrix \\f$G\\f$ to the sparse vector\n \\f$x\\f$ and the dense vector \\f$y\\f$, where\n \\f[\n G = \\begin{pmatrix} c & s \\\\ -s & c \\end{pmatrix}\n \\f]\n\n \\code{.c}\n for(i = 0; i < nnz; ++i)\n {\n x_tmp = x_val[i];\n y_tmp = y[x_ind[i]];\n\n x_val[i] = c * x_tmp + s * y_tmp;\n y[x_ind[i]] = c * y_tmp - s * x_tmp;\n }\n \\endcode\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n nnz number of non-zero entries of \\f$x\\f$.\n @param[inout]\n x_val array of \\p nnz elements containing the non-zero values of \\f$x\\f$.\n @param[in]\n x_ind array of \\p nnz elements containing the indices of the non-zero\n values of \\f$x\\f$.\n @param[inout]\n y array of values in dense format.\n @param[in]\n c pointer to the cosine element of \\f$G\\f$, can be on the host or device.\n @param[in]\n s pointer to the sine element of \\f$G\\f$, can be on the host or device.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_value \\p idx_base is invalid.\n \\retval rocsparse_status_invalid_size \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p c, \\p s, \\p x_val, \\p x_ind, or \\p y\n pointer is invalid.\n\n \\par Example\n \\snippet example_rocsparse_roti.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sroti(
handle: rocsparse_handle,
nnz: rocsparse_int,
x_val: *mut f32,
x_ind: *const rocsparse_int,
y: *mut f32,
c: *const f32,
s: *const f32,
idx_base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_droti(
handle: rocsparse_handle,
nnz: rocsparse_int,
x_val: *mut f64,
x_ind: *const rocsparse_int,
y: *mut f64,
c: *const f64,
s: *const f64,
idx_base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level1_module\n \\brief Scatter elements from a dense vector across a sparse vector.\n\n \\details\n \\p rocsparse_sctr scatters the elements that are listed in \\p x_ind from the sparse\n vector \\f$x\\f$ into the dense vector \\f$y\\f$. Indices of \\f$y\\f$ that are not listed\n in \\p x_ind remain unchanged.\n\n \\code{.c}\n for(i = 0; i < nnz; ++i)\n {\n y[x_ind[i]] = x_val[i];\n }\n \\endcode\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n nnz number of non-zero entries of \\f$x\\f$.\n @param[in]\n x_val array of \\p nnz elements containing the non-zero values of \\f$x\\f$.\n @param[in]\n x_ind array of \\p nnz elements containing the indices of the non-zero\n values of x.\n @param[inout]\n y array of values in dense format.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_value \\p idx_base is invalid.\n \\retval rocsparse_status_invalid_size \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p x_val, \\p x_ind, or \\p y pointer is\n invalid.\n\n \\par Example\n \\snippet example_rocsparse_sctr.cpp doc example\n/\n/**@{"]
pub fn rocsparse_ssctr(
handle: rocsparse_handle,
nnz: rocsparse_int,
x_val: *const f32,
x_ind: *const rocsparse_int,
y: *mut f32,
idx_base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dsctr(
handle: rocsparse_handle,
nnz: rocsparse_int,
x_val: *const f64,
x_ind: *const rocsparse_int,
y: *mut f64,
idx_base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_csctr(
handle: rocsparse_handle,
nnz: rocsparse_int,
x_val: *const rocsparse_float_complex,
x_ind: *const rocsparse_int,
y: *mut rocsparse_float_complex,
idx_base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zsctr(
handle: rocsparse_handle,
nnz: rocsparse_int,
x_val: *const rocsparse_double_complex,
x_ind: *const rocsparse_int,
y: *mut rocsparse_double_complex,
idx_base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_isctr(
handle: rocsparse_handle,
nnz: rocsparse_int,
x_val: *const rocsparse_int,
x_ind: *const rocsparse_int,
y: *mut rocsparse_int,
idx_base: rocsparse_index_base,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level2_module\n \\details\n \\p rocsparse_bsrmv_analysis performs the analysis step for \\ref rocsparse_sbsrmv \"rocsparse_Xbsrmv()\".\n It is expected that this function will be executed only once for a given sparsity pattern and particular operation\n type. The gathered analysis meta data is stored in the \\ref rocsparse_mat_info object and can be cleared by\n \\ref rocsparse_bsrmv_clear().\n\n If the matrix sparsity pattern changes, the gathered information will become invalid. To perform another\n sparse matrix multiplication with a matrix having a different sparsity pattern, either destroy\n the old \\p info object and create a new one or clear the existing \\p info object using\n \\ref rocsparse_bsrmv_clear(). In both cases, the analysis will need to be called again.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir matrix storage of BSR blocks.\n @param[in]\n trans matrix operation type.\n @param[in]\n mb number of block rows of the sparse BSR matrix.\n @param[in]\n nb number of block columns of the sparse BSR matrix.\n @param[in]\n nnzb number of non-zero blocks of the sparse BSR matrix.\n @param[in]\n descr descriptor of the sparse BSR matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n bsr_val array of \\p nnzb blocks of the sparse BSR matrix.\n @param[in]\n bsr_row_ptr array of \\p mb+1 elements that point to the start of every block row of\n the sparse BSR matrix.\n @param[in]\n bsr_col_ind array of \\p nnzb elements containing the block column indices of the sparse\n BSR matrix.\n @param[in]\n block_dim block dimension of the sparse BSR matrix.\n @param[out]\n info structure that holds the information collected during the analysis step.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nb, or \\p nnzb is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p bsr_val, \\p bsr_row_ptr,\n \\p bsr_col_ind, or \\p info pointer is invalid.\n \\retval rocsparse_status_memory_error the buffer for the gathered information\n could not be allocated.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\p trans != \\ref rocsparse_operation_none or\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n/\n/**@{"]
pub fn rocsparse_sbsrmv_analysis(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans: rocsparse_operation,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const f32,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dbsrmv_analysis(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans: rocsparse_operation,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const f64,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cbsrmv_analysis(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans: rocsparse_operation,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_float_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zbsrmv_analysis(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans: rocsparse_operation,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_double_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level2_module\n \\brief Sparse matrix vector multiplication using the BSR storage format.\n\n \\details\n \\p rocsparse_bsrmv multiplies the scalar \\f$\\alpha\\f$ with a sparse\n \\f$m \\times n\\f$ matrix, defined in BSR storage format, and the dense vector \\f$x\\f$ and adds the\n result to the dense vector \\f$y\\f$ that is multiplied by the scalar \\f$\\beta\\f$, such that\n \\f[\n y := \\alpha \\cdot op(A) \\cdot x + \\beta \\cdot y,\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans == rocsparse_operation_none}\n \\end{array}\n \\right.\n \\f]\n and where \\f$m = mb \\times block\\_dim\\f$ and \\f$n= nb \\times block\\_dim\\f$.\n\n The operation above can be done with or without analysis. Running with analysis might result in better performance\n when computing the matrix vector product but will also incur a performance cost attributed to the additional analysis step.\n For this reason, running with analysis makes sense when a user plans on computing the matrix vector product many times and\n therefore can amortize the analysis cost.\n\n To run the operation above without analysis, call the \\p rocsparse_bsrmv routine while passing\n \\p NULL for the \\p info parameter.\n\n Running the operation with analysis involves two steps. First, create a \\ref rocsparse_mat_info object\n by calling \\ref rocsparse_create_mat_info and then pass this to \\ref rocsparse_sbsrmv_analysis \"rocsparse_Xbsrmv_analysis()\",\n which will perform analysis on the sparsity pattern of the matrix \\f$op(A)\\f$. Then complete the operation by\n calling \\p rocsparse_bsrmv. The creation of the \\p info object and the call to the analysis routine only need to be performed\n once for a given sparsity pattern, while the computation can be performed repeatedly as long as the sparsity pattern has\n not changed. After all calls to \\p rocsparse_bsrmv have been made, the \\p info object can be destroyed with a call to\n \\ref rocsparse_destroy_mat_info.\n\n When running with analysis, users might want to perform multiple sparse matrix\n multiplications, with each sparse matrix having a different sparsity pattern. Instead of creating and destroying multiple\n \\ref rocsparse_mat_info objects for each unique sparsity pattern, the user can instead create the \\p info object once and\n then call \\ref rocsparse_bsrmv_clear, followed by re-running the analysis in between each sparse matrix multiplication.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n Currently, only \\p trans == \\ref rocsparse_operation_none is supported.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir matrix storage of BSR blocks.\n @param[in]\n trans matrix operation type.\n @param[in]\n mb number of block rows of the sparse BSR matrix.\n @param[in]\n nb number of block columns of the sparse BSR matrix.\n @param[in]\n nnzb number of non-zero blocks of the sparse BSR matrix.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n descr descriptor of the sparse BSR matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n bsr_val array of \\p nnzb blocks of the sparse BSR matrix.\n @param[in]\n bsr_row_ptr array of \\p mb+1 elements that point to the start of every block row of\n the sparse BSR matrix.\n @param[in]\n bsr_col_ind array of \\p nnzb elements containing the block column indices of the sparse\n BSR matrix.\n @param[in]\n block_dim block dimension of the sparse BSR matrix.\n @param[in]\n x array of \\p nb*block_dim elements (\\f$op(A) = A\\f$) or \\p mb*block_dim\n elements (\\f$op(A) = A^T\\f$ or \\f$op(A) = A^H\\f$).\n @param[in]\n beta scalar \\f$\\beta\\f$.\n @param[inout]\n y array of \\p mb*block_dim elements (\\f$op(A) = A\\f$) or \\p nb*block_dim\n elements (\\f$op(A) = A^T\\f$ or \\f$op(A) = A^H\\f$).\n @param[out]\n info structure that holds the information collected during the analysis step.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nb, \\p nnzb, or \\p block_dim is\n invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p alpha, \\p bsr_val,\n \\p bsr_row_ind, \\p bsr_col_ind, \\p x, \\p beta, or \\p y pointer is invalid.\n \\retval rocsparse_status_arch_mismatch the device is not supported.\n \\retval rocsparse_status_not_implemented\n \\p trans != \\ref rocsparse_operation_none or\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n This example performs a sparse matrix vector multiplication in BSR format.\n \\snippet example_rocsparse_bsrmv.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sbsrmv(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans: rocsparse_operation,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
alpha: *const f32,
descr: rocsparse_mat_descr,
bsr_val: *const f32,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
x: *const f32,
beta: *const f32,
y: *mut f32,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dbsrmv(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans: rocsparse_operation,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
alpha: *const f64,
descr: rocsparse_mat_descr,
bsr_val: *const f64,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
x: *const f64,
beta: *const f64,
y: *mut f64,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cbsrmv(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans: rocsparse_operation,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
alpha: *const rocsparse_float_complex,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_float_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
x: *const rocsparse_float_complex,
beta: *const rocsparse_float_complex,
y: *mut rocsparse_float_complex,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zbsrmv(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans: rocsparse_operation,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
alpha: *const rocsparse_double_complex,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_double_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
x: *const rocsparse_double_complex,
beta: *const rocsparse_double_complex,
y: *mut rocsparse_double_complex,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level2_module\n \\details\n \\p rocsparse_bsrmv_clear deallocates all memory that was allocated by\n \\ref rocsparse_sbsrmv_analysis \"rocsparse_Xbsrmv_analysis()\". This is especially useful\n if memory is an issue and the analysis data is not required anymore for further computation,\n for example, when switching to another sparse matrix format.\n\n Calling \\p rocsparse_bsrmv_clear is optional. All allocated resources will be\n cleared when the opaque \\ref rocsparse_mat_info object is destroyed using\n \\ref rocsparse_destroy_mat_info().\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[inout]\n info structure that holds the information collected during analysis step.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p info pointer is invalid.\n \\retval rocsparse_status_memory_error the buffer for the gathered information\n could not be deallocated.\n \\retval rocsparse_status_internal_error an internal error occurred."]
pub fn rocsparse_bsrmv_clear(
handle: rocsparse_handle,
info: rocsparse_mat_info,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level2_module\n \\details\n \\p rocsparse_bsrsv_zero_pivot returns \\ref rocsparse_status_zero_pivot if either a\n structural or numerical zero has been found during \\ref rocsparse_sbsrsv_solve \"rocsparse_sbsrsv_solve()\"\n computation. The first zero pivot \\f$j\\f$ at \\f$A_{j,j}\\f$ is stored in \\p position,\n using the same index base as the BSR matrix.\n\n \\p position can be in host or device memory. If no zero pivot has been found,\n \\p position is set to -1 and \\ref rocsparse_status_success is returned instead.\n\n \\note \\p rocsparse_bsrsv_zero_pivot is a blocking function. It might negatively influence\n performance.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[inout]\n position pointer to zero pivot \\f$j\\f$, which can be in host or device memory.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p info or \\p position pointer is\n invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_zero_pivot zero pivot has been found."]
pub fn rocsparse_bsrsv_zero_pivot(
handle: rocsparse_handle,
info: rocsparse_mat_info,
position: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level2_module\n \\details\n \\p rocsparse_bsrsv_buffer_size returns the size of the temporary storage buffer that\n is required by \\ref rocsparse_sbsrsv_analysis \"rocsparse_Xbsrsv_analysis()\" and\n \\ref rocsparse_sbsrsv_solve \"rocsparse_Xbsrsv_solve()\". The temporary storage buffer\n must be allocated by the user.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir matrix storage of BSR blocks.\n @param[in]\n trans matrix operation type.\n @param[in]\n mb number of block rows of the sparse BSR matrix.\n @param[in]\n nnzb number of non-zero blocks of the sparse BSR matrix.\n @param[in]\n descr descriptor of the sparse BSR matrix.\n @param[in]\n bsr_val array of \\p nnzb blocks of the sparse BSR matrix.\n @param[in]\n bsr_row_ptr array of \\p mb+1 elements that point to the start of every block row of\n the sparse BSR matrix.\n @param[in]\n bsr_col_ind array of \\p nnz containing the block column indices of the sparse\n BSR matrix.\n @param[in]\n block_dim block dimension of the sparse BSR matrix.\n @param[out]\n info structure that holds the information collected during the analysis step.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n rocsparse_sbsrsv_analysis(), rocsparse_dbsrsv_analysis(),\n rocsparse_cbsrsv_analysis(), rocsparse_zbsrsv_analysis(),\n rocsparse_sbsrsv_solve(), rocsparse_dbsrsv_solve(),\n rocsparse_cbsrsv_solve(), and rocsparse_zbsrsv_solve().\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nnzb, or \\p block_dim is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p bsr_val, \\p bsr_row_ptr,\n \\p bsr_col_ind, \\p info, or \\p buffer_size pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\p trans == \\ref rocsparse_operation_conjugate_transpose or\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n/\n/**@{"]
pub fn rocsparse_sbsrsv_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans: rocsparse_operation,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const f32,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dbsrsv_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans: rocsparse_operation,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const f64,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cbsrsv_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans: rocsparse_operation,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_float_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zbsrsv_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans: rocsparse_operation,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_double_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level2_module\n \\details\n \\p rocsparse_bsrsv_analysis performs the analysis step for \\ref rocsparse_sbsrsv_solve \"rocsparse_sbsrsv_solve()\".\n It is expected that this function will be executed only once for a given matrix and particular operation type.\n The analysis meta data can be cleared by \\ref rocsparse_bsrsv_clear().\n\n \\p rocsparse_bsrsv_analysis can share its meta data with \\ref rocsparse_sbsrsm_analysis \"rocsparse_Xbsrsm_analysis()\",\n \\ref rocsparse_sbsrilu0_analysis \"rocsparse_Xbsrilu0_analysis()\", and\n \\ref rocsparse_sbsric0_analysis \"rocsparse_Xbsric0_analysis()\". Selecting \\ref rocsparse_analysis_policy_reuse policy\n can greatly improve computation performance of metadata. However, the user needs to ensure that the sparsity\n pattern remains unchanged. Otherwise, \\ref rocsparse_analysis_policy_force has to be used.\n\n \\note\n If the matrix sparsity pattern changes, the gathered information will become invalid.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir matrix storage of BSR blocks.\n @param[in]\n trans matrix operation type.\n @param[in]\n mb number of block rows of the sparse BSR matrix.\n @param[in]\n nnzb number of non-zero blocks of the sparse BSR matrix.\n @param[in]\n descr descriptor of the sparse BSR matrix.\n @param[in]\n bsr_val array of \\p nnzb blocks of the sparse BSR matrix.\n @param[in]\n bsr_row_ptr array of \\p mb+1 elements that point to the start of every block row of\n the sparse BSR matrix.\n @param[in]\n bsr_col_ind array of \\p nnz containing the block column indices of the sparse\n BSR matrix.\n @param[in]\n block_dim block dimension of the sparse BSR matrix.\n @param[out]\n info structure that holds the information collected during\n the analysis step.\n @param[in]\n analysis \\ref rocsparse_analysis_policy_reuse or\n \\ref rocsparse_analysis_policy_force.\n @param[in]\n solve \\ref rocsparse_solve_policy_auto.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nnzb, or \\p block_dim is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p bsr_row_ptr,\n \\p bsr_col_ind, \\p info, or \\p temp_buffer pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\p trans == \\ref rocsparse_operation_conjugate_transpose or\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n/\n/**@{"]
pub fn rocsparse_sbsrsv_analysis(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans: rocsparse_operation,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const f32,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dbsrsv_analysis(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans: rocsparse_operation,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const f64,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cbsrsv_analysis(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans: rocsparse_operation,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_float_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zbsrsv_analysis(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans: rocsparse_operation,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_double_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level2_module\n \\details\n \\p rocsparse_bsrsv_clear deallocates all memory that was allocated by\n \\ref rocsparse_sbsrsv_analysis \"rocsparse_sbsrsv_analysis()\". This is especially useful\n if memory is an issue and the analysis data is not required for further computation, for example,\n when switching to another sparse matrix format. Calling \\p rocsparse_bsrsv_clear is optional.\n All allocated resources will be cleared when the opaque \\ref rocsparse_mat_info struct is\n destroyed using \\ref rocsparse_destroy_mat_info().\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[inout]\n info structure that holds the information collected during the analysis step.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p info pointer is invalid.\n \\retval rocsparse_status_memory_error the buffer holding the meta data could not\n be deallocated.\n \\retval rocsparse_status_internal_error an internal error occurred."]
pub fn rocsparse_bsrsv_clear(
handle: rocsparse_handle,
info: rocsparse_mat_info,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level2_module\n \\brief Sparse triangular solve using the BSR storage format.\n\n \\details\n \\p rocsparse_bsrsv_solve solves a sparse triangular linear system of a sparse\n \\f$m \\times m\\f$ matrix, defined in BSR storage format, a dense solution vector\n \\f$y\\f$, and the right-hand side \\f$x\\f$ that is multiplied by \\f$\\alpha\\f$, such that\n \\f[\n op(A) \\cdot y = \\alpha \\cdot x,\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans == rocsparse_operation_none} \\\\\n A^T, & \\text{if trans == rocsparse_operation_transpose}\n \\end{array}\n \\right.\n \\f]\n\n Performing the above operation requires three steps. First, call\n \\ref rocsparse_sbsrsv_buffer_size \"rocsparse_Xbsrsv_buffer_size()\", which will determine the size of the required\n temporary storage buffer. Then allocate this buffer and call\n \\ref rocsparse_sbsrsv_analysis \"rocsparse_Xbsrsv_analysis()\", which will perform analysis on the sparse matrix\n \\f$op(A)\\f$. Finally, complete the computation by calling \\p rocsparse_bsrsv_solve. The buffer size,\n buffer allocation, and analysis only need to be called once for a given sparse matrix \\f$op(A)\\f$, while the\n computation stage can be repeatedly used with different \\f$x\\f$ and \\f$y\\f$ vectors. After all calls to\n \\p rocsparse_bsrsv_solve are complete, the temporary buffer can be deallocated.\n\n Solving a triangular system involves inverting the diagonal blocks. This means that if the sparse matrix is\n missing the diagonal block (referred to as a structural zero) or the diagonal block is not invertible (referred\n to as a numerical zero), then a solution is not possible. \\p rocsparse_bsrsv_solve tracks the location of the first\n zero pivot (either numerical or structural zero). The zero pivot status can be checked by calling \\ref rocsparse_bsrsv_zero_pivot().\n If \\ref rocsparse_bsrsv_zero_pivot() returns \\ref rocsparse_status_success, then no zero pivot was found and therefore\n the matrix does not have a structural or numerical zero.\n\n The user can specify that the sparse matrix should be interpreted as having identity blocks on the diagonal by setting the diagonal\n type on the descriptor \\p descr to \\ref rocsparse_diag_type_unit using \\ref rocsparse_set_mat_diag_type. If\n \\ref rocsparse_diag_type == \\ref rocsparse_diag_type_unit, no zero pivot will be reported, even if the diagonal block \\f$A_{j,j}\\f$\n for some \\f$j\\f$ is not invertible.\n\n The sparse CSR matrix passed to \\p rocsparse_bsrsv_solve does not actually have to be a triangular matrix. Instead, the\n triangular upper or lower part of the sparse matrix is solved based on \\ref rocsparse_fill_mode set on the descriptor\n \\p descr. If the fill mode is set to \\ref rocsparse_fill_mode_lower, then the lower triangular matrix is solved. If the\n fill mode is set to \\ref rocsparse_fill_mode_upper, then the upper triangular matrix is solved.\n\n \\note\n The sparse BSR matrix has to be sorted.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n Currently, only \\p trans == \\ref rocsparse_operation_none and\n \\p trans == \\ref rocsparse_operation_transpose are supported.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir matrix storage of BSR blocks.\n @param[in]\n trans matrix operation type.\n @param[in]\n mb number of block rows of the sparse BSR matrix.\n @param[in]\n nnzb number of non-zero blocks of the sparse BSR matrix.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n descr descriptor of the sparse BSR matrix.\n @param[in]\n bsr_val array of \\p nnzb blocks of the sparse BSR matrix.\n @param[in]\n bsr_row_ptr array of \\p mb+1 elements that point to the start of every block row of\n the sparse BSR matrix.\n @param[in]\n bsr_col_ind array of \\p nnz containing the block column indices of the sparse\n BSR matrix.\n @param[in]\n block_dim block dimension of the sparse BSR matrix.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[in]\n x array of \\p m elements, holding the right-hand side.\n @param[out]\n y array of \\p m elements, holding the solution.\n @param[in]\n policy \\ref rocsparse_solve_policy_auto.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nnzb, or \\p block_dim is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p alpha, \\p bsr_val,\n \\p bsr_row_ptr, \\p bsr_col_ind, \\p x, or \\p y pointer is invalid.\n \\retval rocsparse_status_arch_mismatch the device is not supported.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\p trans == \\ref rocsparse_operation_conjugate_transpose or\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n Consider the lower triangular \\f$m \\times m\\f$ matrix \\f$L\\f$, stored in BSR\n storage format with unit diagonal. The following example solves \\f$L \\cdot y = x\\f$.\n \\snippet example_rocsparse_bsrsv.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sbsrsv_solve(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans: rocsparse_operation,
mb: rocsparse_int,
nnzb: rocsparse_int,
alpha: *const f32,
descr: rocsparse_mat_descr,
bsr_val: *const f32,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
x: *const f32,
y: *mut f32,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dbsrsv_solve(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans: rocsparse_operation,
mb: rocsparse_int,
nnzb: rocsparse_int,
alpha: *const f64,
descr: rocsparse_mat_descr,
bsr_val: *const f64,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
x: *const f64,
y: *mut f64,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cbsrsv_solve(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans: rocsparse_operation,
mb: rocsparse_int,
nnzb: rocsparse_int,
alpha: *const rocsparse_float_complex,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_float_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
x: *const rocsparse_float_complex,
y: *mut rocsparse_float_complex,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zbsrsv_solve(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans: rocsparse_operation,
mb: rocsparse_int,
nnzb: rocsparse_int,
alpha: *const rocsparse_double_complex,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_double_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
x: *const rocsparse_double_complex,
y: *mut rocsparse_double_complex,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level2_module\n \\brief Sparse matrix vector multiplication with mask operation using the BSR storage format.\n\n \\details\n \\p rocsparse_bsrxmv multiplies the scalar \\f$\\alpha\\f$ with a sparse\n \\f$m \\times n\\f$ modified matrix, defined in BSR storage format, and the dense vector \\f$x\\f$\n and adds the result to the dense vector \\f$y\\f$ that is multiplied by the scalar \\f$\\beta\\f$,\n such that\n \\f[\n y := \\left( \\alpha \\cdot op(A) \\cdot x + \\beta \\cdot y \\right)\\left( \\text{mask} \\right),\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans == rocsparse_operation_none}\n \\end{array}\n \\right.\n \\f]\n and where \\f$m = mb \\times block\\_dim\\f$ and \\f$n = nb \\times block\\_dim\\f$.\n\n The \\f$\\text{mask}\\f$ is defined as an array of block row indices.\n The input sparse matrix is defined with a modified BSR storage format where the beginning and the end of each row\n is defined with two arrays, \\p bsr_row_ptr and \\p bsr_end_ptr (both of size \\p mb), rather the usual \\p bsr_row_ptr of size \\p mb+1.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n Currently, only \\p trans == \\ref rocsparse_operation_none is supported.\n Currently, \\p block_dim==1 is not supported.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir matrix storage of BSR blocks.\n @param[in]\n trans matrix operation type.\n @param[in]\n size_of_mask number of updated block rows of the array \\p y.\n @param[in]\n mb number of block rows of the sparse BSR matrix.\n @param[in]\n nb number of block columns of the sparse BSR matrix.\n @param[in]\n nnzb number of non-zero blocks of the sparse BSR matrix.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n descr descriptor of the sparse BSR matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n bsr_val array of \\p nnzb blocks of the sparse BSR matrix.\n\n @param[in]\n bsr_mask_ptr array of \\p size_of_mask elements that give the indices of the updated block rows.\n\n @param[in]\n bsr_row_ptr array of \\p mb elements that point to the start of every block row of\n the sparse BSR matrix.\n @param[in]\n bsr_end_ptr array of \\p mb elements that point to the end of every block row of\n the sparse BSR matrix.\n @param[in]\n bsr_col_ind array of \\p nnzb elements containing the block column indices of the sparse\n BSR matrix.\n @param[in]\n block_dim block dimension of the sparse BSR matrix.\n @param[in]\n x array of \\p nb*block_dim elements (\\f$op(A) = A\\f$) or \\p mb*block_dim\n elements (\\f$op(A) = A^T\\f$ or \\f$op(A) = A^H\\f$).\n @param[in]\n beta scalar \\f$\\beta\\f$.\n @param[inout]\n y array of \\p mb*block_dim elements (\\f$op(A) = A\\f$) or \\p nb*block_dim\n elements (\\f$op(A) = A^T\\f$ or \\f$op(A) = A^H\\f$).\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nb, \\p nnzb, \\p block_dim, or \\p size_of_mask is\n invalid.\n \\retval rocsparse_status_invalid_value \\p size_of_mask is greater than \\p mb.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p alpha, \\p bsr_val,\n \\p bsr_row_ind, \\p bsr_col_ind, \\p x, \\p beta, or \\p y pointer is invalid.\n \\retval rocsparse_status_arch_mismatch the device is not supported.\n \\retval rocsparse_status_not_implemented\n \\p block_dim==1, \\p trans != \\ref rocsparse_operation_none or\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n/\n/**@{"]
pub fn rocsparse_sbsrxmv(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans: rocsparse_operation,
size_of_mask: rocsparse_int,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
alpha: *const f32,
descr: rocsparse_mat_descr,
bsr_val: *const f32,
bsr_mask_ptr: *const rocsparse_int,
bsr_row_ptr: *const rocsparse_int,
bsr_end_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
x: *const f32,
beta: *const f32,
y: *mut f32,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dbsrxmv(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans: rocsparse_operation,
size_of_mask: rocsparse_int,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
alpha: *const f64,
descr: rocsparse_mat_descr,
bsr_val: *const f64,
bsr_mask_ptr: *const rocsparse_int,
bsr_row_ptr: *const rocsparse_int,
bsr_end_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
x: *const f64,
beta: *const f64,
y: *mut f64,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cbsrxmv(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans: rocsparse_operation,
size_of_mask: rocsparse_int,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
alpha: *const rocsparse_float_complex,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_float_complex,
bsr_mask_ptr: *const rocsparse_int,
bsr_row_ptr: *const rocsparse_int,
bsr_end_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
x: *const rocsparse_float_complex,
beta: *const rocsparse_float_complex,
y: *mut rocsparse_float_complex,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zbsrxmv(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans: rocsparse_operation,
size_of_mask: rocsparse_int,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
alpha: *const rocsparse_double_complex,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_double_complex,
bsr_mask_ptr: *const rocsparse_int,
bsr_row_ptr: *const rocsparse_int,
bsr_end_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
x: *const rocsparse_double_complex,
beta: *const rocsparse_double_complex,
y: *mut rocsparse_double_complex,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level2_module\n \\brief Sparse matrix vector multiplication using the COO storage format.\n\n \\details\n \\p rocsparse_coomv multiplies the scalar \\f$\\alpha\\f$ with a sparse \\f$m \\times n\\f$\n matrix, defined in COO storage format, and the dense vector \\f$x\\f$ and adds the\n result to the dense vector \\f$y\\f$ that is multiplied by the scalar \\f$\\beta\\f$,\n such that\n \\f[\n y := \\alpha \\cdot op(A) \\cdot x + \\beta \\cdot y,\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans == rocsparse_operation_none} \\\\\n A^T, & \\text{if trans == rocsparse_operation_transpose} \\\\\n A^H, & \\text{if trans == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n\n The COO matrix has to be sorted by row indices. This can be achieved by using\n rocsparse_coosort_by_row().\n\n \\code{.c}\n for(i = 0; i < m; ++i)\n {\n y[i] = beta * y[i];\n }\n\n for(i = 0; i < nnz; ++i)\n {\n y[coo_row_ind[i]] += alpha * coo_val[i] * x[coo_col_ind[i]];\n }\n \\endcode\n\n \\note\n This function does not produce deterministic results when A is transposed.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n trans matrix operation type.\n @param[in]\n m number of rows of the sparse COO matrix.\n @param[in]\n n number of columns of the sparse COO matrix.\n @param[in]\n nnz number of non-zero entries of the sparse COO matrix.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n descr descriptor of the sparse COO matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n coo_val array of \\p nnz elements of the sparse COO matrix.\n @param[in]\n coo_row_ind array of \\p nnz elements containing the row indices of the sparse COO\n matrix.\n @param[in]\n coo_col_ind array of \\p nnz elements containing the column indices of the sparse\n COO matrix.\n @param[in]\n x array of \\p n elements (\\f$op(A) = A\\f$) or \\p m elements\n (\\f$op(A) = A^T\\f$ or \\f$op(A) = A^H\\f$).\n @param[in]\n beta scalar \\f$\\beta\\f$.\n @param[inout]\n y array of \\p m elements (\\f$op(A) = A\\f$) or \\p n elements\n (\\f$op(A) = A^T\\f$ or \\f$op(A) = A^H\\f$).\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p alpha, \\p coo_val,\n \\p coo_row_ind, \\p coo_col_ind, \\p x, \\p beta, or \\p y pointer is invalid.\n \\retval rocsparse_status_arch_mismatch the device is not supported.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n This example performs a sparse matrix vector multiplication in COO format.\n \\snippet example_rocsparse_coomv.cpp doc example\n/\n/**@{"]
pub fn rocsparse_scoomv(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
alpha: *const f32,
descr: rocsparse_mat_descr,
coo_val: *const f32,
coo_row_ind: *const rocsparse_int,
coo_col_ind: *const rocsparse_int,
x: *const f32,
beta: *const f32,
y: *mut f32,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcoomv(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
alpha: *const f64,
descr: rocsparse_mat_descr,
coo_val: *const f64,
coo_row_ind: *const rocsparse_int,
coo_col_ind: *const rocsparse_int,
x: *const f64,
beta: *const f64,
y: *mut f64,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccoomv(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
alpha: *const rocsparse_float_complex,
descr: rocsparse_mat_descr,
coo_val: *const rocsparse_float_complex,
coo_row_ind: *const rocsparse_int,
coo_col_ind: *const rocsparse_int,
x: *const rocsparse_float_complex,
beta: *const rocsparse_float_complex,
y: *mut rocsparse_float_complex,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcoomv(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
alpha: *const rocsparse_double_complex,
descr: rocsparse_mat_descr,
coo_val: *const rocsparse_double_complex,
coo_row_ind: *const rocsparse_int,
coo_col_ind: *const rocsparse_int,
x: *const rocsparse_double_complex,
beta: *const rocsparse_double_complex,
y: *mut rocsparse_double_complex,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level2_module\n \\details\n \\p rocsparse_csritsv_zero_pivot returns \\ref rocsparse_status_zero_pivot if either a\n structural or numerical zero has been found during\n \\ref rocsparse_scsritsv_solve \"rocsparse_Xcsritsv_solve()\" and/or\n \\ref rocsparse_scsritsv_analysis \"rocsparse_Xcsritsv_analysis()\" execution. The first zero pivot \\f$j\\f$ at\n \\f$A_{j,j}\\f$ is stored in \\p position, using the same index base as the CSR matrix.\n\n \\p position can be in host or device memory. If no zero pivot has been found,\n \\p position is set to -1 and \\ref rocsparse_status_success is returned instead.\n\n \\note \\p rocsparse_csritsv_zero_pivot is a blocking function. It might negatively influence\n performance.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n descr descriptor of the sparse CSR matrix.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[inout]\n position pointer to zero pivot \\f$j\\f$, which can be in host or device memory.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p info or \\p position pointer is\n invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_zero_pivot zero pivot has been found."]
pub fn rocsparse_csritsv_zero_pivot(
handle: rocsparse_handle,
descr: rocsparse_mat_descr,
info: rocsparse_mat_info,
position: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level2_module\n \\details\n \\p rocsparse_csritsv_buffer_size returns the size of the temporary storage buffer that\n is required by \\ref rocsparse_scsritsv_analysis \"rocsparse_Xcsritsv_analysis()\" and\n \\ref rocsparse_scsritsv_solve \"rocsparse_Xcsritsv_solve()\". The temporary storage buffer\n must be allocated by the user.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n trans matrix operation type.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix.\n @param[in]\n descr descriptor of the sparse CSR matrix.\n @param[in]\n csr_val array of \\p nnz elements of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix.\n @param[out]\n info structure that holds the information collected during the analysis step.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n \\ref rocsparse_scsritsv_analysis \"rocsparse_Xcsritsv_analysis()\" and\n \\ref rocsparse_scsritsv_solve \"rocsparse_Xcsritsv_solve()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p csr_val, \\p csr_row_ptr,\n \\p csr_col_ind, \\p info, or \\p buffer_size pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general and \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_triangular.\n/\n/**@{"]
pub fn rocsparse_scsritsv_buffer_size(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsritsv_buffer_size(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsritsv_buffer_size(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsritsv_buffer_size(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level2_module\n \\details\n \\p rocsparse_csritsv_analysis performs the analysis step for \\ref rocsparse_scsritsv_solve \"rocsparse_Xcsritsv_solve()\".\n It is expected that this function will be executed only once for a given matrix and particular operation type. The\n analysis meta data can be cleared by \\ref rocsparse_csritsv_clear().\n\n Selecting\n \\ref rocsparse_analysis_policy_reuse policy can greatly improve the computation\n performance of metadata. However, the user needs to ensure that the sparsity\n pattern remains unchanged. If this cannot be assured,\n \\ref rocsparse_analysis_policy_force has to be used.\n\n \\note\n If the matrix sparsity pattern changes, the gathered information will become invalid.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n trans matrix operation type.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix.\n @param[in]\n descr descriptor of the sparse CSR matrix.\n @param[in]\n csr_val array of \\p nnz elements of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix.\n @param[out]\n info structure that holds the information collected during\n the analysis step.\n @param[in]\n analysis \\ref rocsparse_analysis_policy_reuse or\n \\ref rocsparse_analysis_policy_force.\n @param[in]\n solve \\ref rocsparse_solve_policy_auto.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p csr_row_ptr,\n \\p csr_col_ind, \\p info, or \\p temp_buffer pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general and \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_triangular.\n/\n/**@{"]
pub fn rocsparse_scsritsv_analysis(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsritsv_analysis(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsritsv_analysis(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsritsv_analysis(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = "@}*/\n/*! \\ingroup level2_module\n \\details\n \\p rocsparse_csritsv_clear deallocates all memory that was allocated by\n \\ref rocsparse_scsritsv_analysis \"rocsparse_Xcsritsv_analysis()\". This is\n especially useful if memory is an issue and the analysis data is not\n required for further computation, for example, when switching to another sparse\n matrix format. Calling \\p rocsparse_csritsv_clear is optional. All allocated\n resources will be cleared when the opaque \\ref rocsparse_mat_info struct is\n destroyed using \\ref rocsparse_destroy_mat_info().\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n descr descriptor of the sparse CSR matrix.\n @param[inout]\n info structure that holds the information collected during the analysis step.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p info pointer is invalid.\n \\retval rocsparse_status_memory_error the buffer holding the meta data could not\n be deallocated.\n \\retval rocsparse_status_internal_error an internal error occurred."]
pub fn rocsparse_csritsv_clear(
handle: rocsparse_handle,
descr: rocsparse_mat_descr,
info: rocsparse_mat_info,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level2_module\n \\brief Sparse iterative triangular solve using the CSR storage format.\n\n \\details\n \\p rocsparse_csritsv_solve solves iteratively, with the use of the Jacobi method, a sparse triangular linear system of a sparse\n \\f$m \\times m\\f$ matrix, defined in CSR storage format, a dense solution vector\n \\f$y\\f$, and the right-hand side \\f$x\\f$ that is multiplied by \\f$\\alpha\\f$, such that\n \\f[\n op(A) y = \\alpha x,\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans == rocsparse_operation_none} \\\\\n A^T, & \\text{if trans == rocsparse_operation_transpose} \\\\\n A^H, & \\text{if trans == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n\n The Jacobi method applied to the sparse triangular linear system above gives\n \\f[\n y_{k+1} = y_{k} + D^{-1} ( \\alpha x - (D + T) y_{k} )\n \\f]\n with \\f$A = D + T\\f$, \\f$D\\f$ the diagonal of \\f$A\\f$ and \\f$T\\f$ the strict triangular part of \\f$A\\f$.\n\n The above equation can be also written as\n \\f[\n y_{k+1} = y_{k} + D^{-1} r_k\n \\f]\n where\n \\f[\n r_k = \\alpha x - (D + T) y_k.\n \\f]\n Starting with \\f$y_0 = \\f$ \\p y, the method iterates if \\f$ 0 \\le k \\lt \\f$ \\p host_nmaxiter and if\n \\f[\n \\Vert r_k \\Vert_{\\infty} \\gt \\epsilon,\n \\f]\n with \\f$\\epsilon\\f$ = \\p host_tol.\n\n \\p rocsparse_csritsv_solve requires a user allocated temporary buffer. Its size is\n returned by \\ref rocsparse_scsritsv_buffer_size \"rocsparse_Xcsritsv_buffer_size()\".\n In addition, analysis metadata is required. It can be obtained by\n \\ref rocsparse_scsritsv_analysis \"rocsparse_Xcsritsv_analysis()\". \\p rocsparse_csritsv_solve\n reports the first zero pivot (either numerical or structural zero).\n The zero pivot status can be checked by calling \\ref rocsparse_csritsv_zero_pivot(). If\n \\ref rocsparse_diag_type == \\ref rocsparse_diag_type_unit, no zero pivot will be\n reported, even if \\f$A_{j,j} = 0\\f$ for some \\f$j\\f$.\n\n \\note\n The sparse CSR matrix has to be sorted. This can be achieved by calling\n rocsparse_csrsort().\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[inout]\n host_nmaxiter maximum number of iterations on input and number of iterations on output. If the output number of iterations is strictly less than the input maximum number of iterations, then the algorithm converged.\n @param[in]\n host_tol if the pointer is null then loop will execute \\p nmaxiter[0] iterations.\n @param[out]\n host_history optional array to record the norm of the residual before each iteration.\n @param[in]\n trans matrix operation type.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n descr descriptor of the sparse CSR matrix.\n @param[in]\n csr_val array of \\p nnz elements of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start\n of every row of the sparse CSR matrix.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[in]\n x array of \\p m elements, holding the right-hand side.\n @param[inout]\n y array of \\p m elements, holding the solution.\n @param[in]\n policy \\ref rocsparse_solve_policy_auto.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p alpha, \\p csr_val,\n \\p csr_row_ptr, \\p csr_col_ind, \\p x, or \\p y pointer is invalid.\n \\retval rocsparse_status_arch_mismatch the device is not supported.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general and \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_triangular.\n\n \\par Example\n Consider the lower triangular \\f$m \\times m\\f$ matrix \\f$L\\f$, stored in CSR\n storage format with unit diagonal. The following example solves \\f$L \\cdot y = x\\f$.\n \\code{.c}\n // Create rocSPARSE handle\n rocsparse_handle handle;\n rocsparse_create_handle(&handle);\n\n // Create matrix descriptor\n rocsparse_mat_descr descr;\n rocsparse_create_mat_descr(&descr);\n rocsparse_set_mat_fill_mode(descr, rocsparse_fill_mode_lower);\n rocsparse_set_mat_diag_type(descr, rocsparse_diag_type_unit);\n\n // Create matrix info structure\n rocsparse_mat_info info;\n rocsparse_create_mat_info(&info);\n\n // Obtain required buffer size\n size_t buffer_size;\n rocsparse_dcsritsv_buffer_size(handle,\n rocsparse_operation_none,\n m,\n nnz,\n descr,\n csr_val,\n csr_row_ptr,\n csr_col_ind,\n info,\n &buffer_size);\n\n // Allocate temporary buffer\n void* temp_buffer;\n hipMalloc(&temp_buffer, buffer_size);\n\n // Perform analysis step\n rocsparse_dcsritsv_analysis(handle,\n rocsparse_operation_none,\n m,\n nnz,\n descr,\n csr_val,\n csr_row_ptr,\n csr_col_ind,\n info,\n rocsparse_analysis_policy_reuse,\n rocsparse_solve_policy_auto,\n temp_buffer);\n\n // Solve Ly = x\n rocsparse_int nmaxiter = 200;\n rocsparse_int host_maxiter = nmaxiter;\n double host_tol = 1.0e-4;\n double host_history[200];\n\n // Initialization of y\n hipMemset(y, 0, sizeof(double) * m);\n\n rocsparse_dcsritsv_solve(handle,\n &host_maxiter,\n &host_tol,\n host_history,\n rocsparse_operation_none,\n m,\n nnz,\n &alpha,\n descr,\n csr_val,\n csr_row_ptr,\n csr_col_ind,\n info,\n x,\n y,\n rocsparse_solve_policy_auto,\n temp_buffer);\n\n if (host_maxiter < nmaxiter)\n {\n printf(\"convergence\\n\");\n }\n else\n {\n printf(\"no convergence\\n\");\n }\n for (int i=0;i<=host_maxiter;++i)\n {\n printf(\"iter = %d, nrm inf residual=%e\\n\", i, host_history[i]);\n }\n\n // No zero pivot should be found, with L having unit diagonal\n\n // Clean up\n hipFree(temp_buffer);\n rocsparse_destroy_mat_info(info);\n rocsparse_destroy_mat_descr(descr);\n rocsparse_destroy_handle(handle);\n \\endcode\n/\n/**@{"]
pub fn rocsparse_scsritsv_solve(
handle: rocsparse_handle,
host_nmaxiter: *mut rocsparse_int,
host_tol: *const f32,
host_history: *mut f32,
trans: rocsparse_operation,
m: rocsparse_int,
nnz: rocsparse_int,
alpha: *const f32,
descr: rocsparse_mat_descr,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
x: *const f32,
y: *mut f32,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsritsv_solve(
handle: rocsparse_handle,
host_nmaxiter: *mut rocsparse_int,
host_tol: *const f64,
host_history: *mut f64,
trans: rocsparse_operation,
m: rocsparse_int,
nnz: rocsparse_int,
alpha: *const f64,
descr: rocsparse_mat_descr,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
x: *const f64,
y: *mut f64,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsritsv_solve(
handle: rocsparse_handle,
host_nmaxiter: *mut rocsparse_int,
host_tol: *const f32,
host_history: *mut f32,
trans: rocsparse_operation,
m: rocsparse_int,
nnz: rocsparse_int,
alpha: *const rocsparse_float_complex,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
x: *const rocsparse_float_complex,
y: *mut rocsparse_float_complex,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsritsv_solve(
handle: rocsparse_handle,
host_nmaxiter: *mut rocsparse_int,
host_tol: *const f64,
host_history: *mut f64,
trans: rocsparse_operation,
m: rocsparse_int,
nnz: rocsparse_int,
alpha: *const rocsparse_double_complex,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
x: *const rocsparse_double_complex,
y: *mut rocsparse_double_complex,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level2_module\n \\brief Sparse iterative triangular solve using the CSR storage format.\n\n \\details\n \\p rocsparse_csritsv_solve_ex solves iteratively, with the use of the Jacobi method, a sparse triangular linear system of a sparse\n \\f$m \\times m\\f$ matrix, defined in CSR storage format, a dense solution vector\n \\f$y\\f$, and the right-hand side \\f$x\\f$ that is multiplied by \\f$\\alpha\\f$, such that\n \\f[\n op(A) y = \\alpha x,\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans == rocsparse_operation_none} \\\\\n A^T, & \\text{if trans == rocsparse_operation_transpose} \\\\\n A^H, & \\text{if trans == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n\n The Jacobi method applied to the sparse triangular linear system above gives\n \\f[\n y_{k+1} = y_{k} + D^{-1} ( \\alpha x - (D + T) y_{k} )\n \\f]\n with \\f$A = D + T\\f$, \\f$D\\f$ the diagonal of \\f$A\\f$ and \\f$T\\f$ the strict triangular part of \\f$A\\f$.\n\n The above equation can be also written as\n \\f[\n y_{k+1} = y_{k} + D^{-1} r_k\n \\f]\n where\n \\f[\n r_k = \\alpha x - (D + T) y_k.\n \\f]\n Starting with \\f$y_0 = \\f$ \\p y, the method iterates if \\f$ 0 \\le k \\lt \\f$ \\p host_nmaxiter and if\n \\f[\n \\Vert r_k \\Vert_{\\infty} \\gt \\epsilon,\n \\f]\n with \\f$\\epsilon\\f$ = \\p host_tol.\n\n The parameter \\p host_nfreeiter is used to control the frequence of the stopping criteria evaluation, potentially improving the performance of the algorithm with less norm calculation. Between each iteration of index \\f$ k \\f$, \\p host_nfreeiter are performed without stopping criteria evaluation. Therefore, if the convergence is obtained at index \\f$ k \\f$, that means \\f$ (k + 1) \\f$ \\p host_nfreeiter \\f$ + k \\f$ iterations have been performed.\n\n \\p rocsparse_csritsv_solve_ex requires a user allocated temporary buffer. Its size is\n returned by \\ref rocsparse_scsritsv_buffer_size \"rocsparse_Xcsritsv_buffer_size()\".\n Furthermore, analysis meta data is required. It can be obtained by\n \\ref rocsparse_scsritsv_analysis \"rocsparse_Xcsritsv_analysis()\". \\p rocsparse_csritsv_solve_ex\n reports the first zero pivot (either numerical or structural zero). The zero pivot status\n can be checked by calling rocsparse_csritsv_zero_pivot(). If\n \\ref rocsparse_diag_type == \\ref rocsparse_diag_type_unit, no zero pivot will be\n reported, even if \\f$A_{j,j} = 0\\f$ for some \\f$j\\f$.\n\n \\note\n The sparse CSR matrix has to be sorted. This can be achieved by calling\n rocsparse_csrsort().\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[inout]\n host_nmaxiter maximum number of iterations on input and number of iterations on output. If the output number of iterations is strictly less than the input maximum number of iterations, then the algorithm converged.\n @param[in]\n host_nfreeiter number of free iterations, that is, the number of iterations performed without stopping criteria evaluation between two iterations with stopping criteria evaluation.\n @param[in]\n host_tol if the pointer is null, then loop will execute \\p nmaxiter[0] iterations.\n @param[out]\n host_history optional array to record the norm of the residual before each iteration.\n @param[in]\n trans matrix operation type.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n descr descriptor of the sparse CSR matrix.\n @param[in]\n csr_val array of \\p nnz elements of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start\n of every row of the sparse CSR matrix.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[in]\n x array of \\p m elements, holding the right-hand side.\n @param[inout]\n y array of \\p m elements, holding the solution.\n @param[in]\n policy \\ref rocsparse_solve_policy_auto.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p alpha, \\p csr_val,\n \\p csr_row_ptr, \\p csr_col_ind, \\p x, or \\p y pointer is invalid.\n \\retval rocsparse_status_arch_mismatch the device is not supported.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general and \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_triangular.\n\n \\par Example\n Consider the lower triangular \\f$m \\times m\\f$ matrix \\f$L\\f$, stored in CSR\n storage format with unit diagonal. The following example solves \\f$L \\cdot y = x\\f$.\n \\code{.c}\n // Create rocSPARSE handle\n rocsparse_handle handle;\n rocsparse_create_handle(&handle);\n\n // Create matrix descriptor\n rocsparse_mat_descr descr;\n rocsparse_create_mat_descr(&descr);\n rocsparse_set_mat_fill_mode(descr, rocsparse_fill_mode_lower);\n rocsparse_set_mat_diag_type(descr, rocsparse_diag_type_unit);\n\n // Create matrix info structure\n rocsparse_mat_info info;\n rocsparse_create_mat_info(&info);\n\n // Obtain required buffer size\n size_t buffer_size;\n rocsparse_dcsritsv_buffer_size(handle,\n rocsparse_operation_none,\n m,\n nnz,\n descr,\n csr_val,\n csr_row_ptr,\n csr_col_ind,\n info,\n &buffer_size);\n\n // Allocate temporary buffer\n void* temp_buffer;\n hipMalloc(&temp_buffer, buffer_size);\n\n // Perform analysis step\n rocsparse_dcsritsv_analysis(handle,\n rocsparse_operation_none,\n m,\n nnz,\n descr,\n csr_val,\n csr_row_ptr,\n csr_col_ind,\n info,\n rocsparse_analysis_policy_reuse,\n rocsparse_solve_policy_auto,\n temp_buffer);\n\n // Solve Ly = x\n rocsparse_int nmaxiter = 200;\n rocsparse_int host_maxiter = nmaxiter;\n\n rocsparse_int host_nfreeiter = 20;\n double host_tol = 1.0e-4;\n double host_history[200];\n\n // Initialization of y\n hipMemset(y, 0, sizeof(double) * m);\n\n rocsparse_dcsritsv_solve_ex(handle,\n &host_maxiter,\n host_nfreeiter,\n &host_tol,\n host_history,\n rocsparse_operation_none,\n m,\n nnz,\n &alpha,\n descr,\n csr_val,\n csr_row_ptr,\n csr_col_ind,\n info,\n x,\n y,\n rocsparse_solve_policy_auto,\n temp_buffer);\n\n if (host_maxiter < nmaxiter)\n {\n printf(\"convergence\\n\");\n }\n else\n {\n printf(\"no convergence\\n\");\n }\n for (int i=0;i<=host_maxiter;++i)\n {\n printf(\"iter = %d, nrm inf residual=%e\\n\", i, host_history[i]);\n }\n // No zero pivot should be found, with L having unit diagonal\n\n // Clean up\n hipFree(temp_buffer);\n rocsparse_destroy_mat_info(info);\n rocsparse_destroy_mat_descr(descr);\n rocsparse_destroy_handle(handle);\n \\endcode\n/\n/**@{"]
pub fn rocsparse_scsritsv_solve_ex(
handle: rocsparse_handle,
host_nmaxiter: *mut rocsparse_int,
host_nfreeiter: rocsparse_int,
host_tol: *const f32,
host_history: *mut f32,
trans: rocsparse_operation,
m: rocsparse_int,
nnz: rocsparse_int,
alpha: *const f32,
descr: rocsparse_mat_descr,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
x: *const f32,
y: *mut f32,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsritsv_solve_ex(
handle: rocsparse_handle,
host_nmaxiter: *mut rocsparse_int,
host_nfreeiter: rocsparse_int,
host_tol: *const f64,
host_history: *mut f64,
trans: rocsparse_operation,
m: rocsparse_int,
nnz: rocsparse_int,
alpha: *const f64,
descr: rocsparse_mat_descr,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
x: *const f64,
y: *mut f64,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsritsv_solve_ex(
handle: rocsparse_handle,
host_nmaxiter: *mut rocsparse_int,
host_nfreeiter: rocsparse_int,
host_tol: *const f32,
host_history: *mut f32,
trans: rocsparse_operation,
m: rocsparse_int,
nnz: rocsparse_int,
alpha: *const rocsparse_float_complex,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
x: *const rocsparse_float_complex,
y: *mut rocsparse_float_complex,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsritsv_solve_ex(
handle: rocsparse_handle,
host_nmaxiter: *mut rocsparse_int,
host_nfreeiter: rocsparse_int,
host_tol: *const f64,
host_history: *mut f64,
trans: rocsparse_operation,
m: rocsparse_int,
nnz: rocsparse_int,
alpha: *const rocsparse_double_complex,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
x: *const rocsparse_double_complex,
y: *mut rocsparse_double_complex,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level2_module\n \\details\n \\p rocsparse_csrmv_analysis performs the analysis step for \\ref rocsparse_scsrmv \"rocsparse_Xcsrmv()\".\n It is expected that this function will be executed only once for a given sparsity pattern and particular operation\n type. The gathered analysis metadata is stored in the \\ref rocsparse_mat_info object and can be cleared by\n \\ref rocsparse_csrmv_clear().\n\n If the matrix sparsity pattern changes, the gathered information will become invalid. To perform another\n sparse matrix multiplication with a matrix having a different sparsity pattern, either destroy\n the old \\p info object and create a new one or clear the existing info object using\n \\ref rocsparse_csrmv_clear(). In both cases, the analysis will need to be called again.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n trans matrix operation type.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n n number of columns of the sparse CSR matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix.\n @param[in]\n descr descriptor of the sparse CSR matrix.\n @param[in]\n csr_val array of \\p nnz elements of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix.\n @param[out]\n info structure that holds the information collected during the analysis step.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p csr_val, \\p csr_row_ptr,\n \\p csr_col_ind, or \\p info pointer is invalid.\n \\retval rocsparse_status_memory_error the buffer for the gathered information\n could not be allocated.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented if \\ref rocsparse_matrix_type is not one of\n \\ref rocsparse_matrix_type_general, \\ref rocsparse_matrix_type_symmetric, or\n \\ref rocsparse_matrix_type_triangular.\n/\n/**@{"]
pub fn rocsparse_scsrmv_analysis(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsrmv_analysis(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsrmv_analysis(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsrmv_analysis(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level2_module\n \\details\n \\p rocsparse_csrmv_clear deallocates all memory that was allocated by\n \\ref rocsparse_scsrmv_analysis \"rocsparse_Xcsrmv_analysis()\". This is especially useful\n if memory is an issue and the analysis data is not required for further\n computation, for example, when switching to another sparse matrix format.\n\n \\note\n Calling \\p rocsparse_csrmv_clear is optional. All allocated resources will be\n cleared, when the opaque \\ref rocsparse_mat_info object is destroyed using\n \\ref rocsparse_destroy_mat_info().\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[inout]\n info structure that holds the information collected during the analysis step.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p info pointer is invalid.\n \\retval rocsparse_status_memory_error the buffer for the gathered information\n could not be deallocated.\n \\retval rocsparse_status_internal_error an internal error occurred."]
pub fn rocsparse_csrmv_clear(
handle: rocsparse_handle,
info: rocsparse_mat_info,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level2_module\n \\brief Sparse matrix vector multiplication using the CSR storage format.\n\n \\details\n \\p rocsparse_csrmv multiplies the scalar \\f$\\alpha\\f$ with a sparse \\f$m \\times n\\f$\n matrix, defined in CSR storage format, and the dense vector \\f$x\\f$ and adds the\n result to the dense vector \\f$y\\f$ that is multiplied by the scalar \\f$\\beta\\f$,\n such that\n \\f[\n y := \\alpha \\cdot op(A) \\cdot x + \\beta \\cdot y,\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans == rocsparse_operation_none} \\\\\n A^T, & \\text{if trans == rocsparse_operation_transpose} \\\\\n A^H, & \\text{if trans == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n\n The \\p info parameter is optional and contains information collected by\n \\ref rocsparse_scsrmv_analysis \"rocsparse_Xcsrmv_analysis()\". If present, the\n information will be used to speed up the \\p csrmv computation. If\n \\p info == \\p NULL, a general \\p csrmv routine will be used instead. Running with\n analysis might result in better performance when computing the matrix vector product\n but will also incur a performance cost attributed to the additional analysis step.\n For this reason, running with analysis makes sense when computing\n the matrix vector product many times, therefore amortizing the analysis cost.\n\n \\code{.c}\n for(i = 0; i < m; ++i)\n {\n y[i] = beta * y[i];\n\n for(j = csr_row_ptr[i]; j < csr_row_ptr[i + 1]; ++j)\n {\n y[i] = y[i] + alpha * csr_val[j] * x[csr_col_ind[j]];\n }\n }\n \\endcode\n\n To run the above operation without analysis, call the \\p rocsparse_csrmv routine while passing\n \\p NULL for the \\p info parameter.\n\n With analysis, completing the sparse matrix vector multiplication involves two steps. First,\n create a \\ref rocsparse_mat_info object by calling \\ref rocsparse_create_mat_info and then pass this to\n \\ref rocsparse_scsrmv_analysis \"rocsparse_Xcsrmv_analysis()\", which will perform analysis on the sparsity pattern of the\n matrix \\f$op(A)\\f$. Then complete the operation by calling \\p rocsparse_csrmv. The creation of the \\p info object\n and the call to the analysis routine only need to be performed once for a given sparsity pattern, while the computation\n can be performed repeatedly as long as the sparsity pattern has not changed. After all calls to \\p rocsparse_csrmv have\n been made, the \\p info object can be destroyed with a call to \\ref rocsparse_destroy_mat_info.\n\n When running with analysis, a user might want to perform multiple sparse matrix\n multiplications, with each sparse matrix having a different sparsity pattern. Instead of creating and destroying multiple\n \\ref rocsparse_mat_info objects for each unique sparsity pattern, they can instead create the \\p info object once and\n then call \\ref rocsparse_csrmv_clear and rerun the analysis in between each sparse matrix multiplication.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n trans matrix operation type.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n n number of columns of the sparse CSR matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n descr descriptor of the sparse CSR matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n csr_val array of \\p nnz elements of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start\n of every row of the sparse CSR matrix.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix.\n @param[in]\n info information collected by \\ref rocsparse_scsrmv_analysis \"rocsparse_Xcsrmv_analysis()\",\n which can be \\p NULL if no information is available.\n @param[in]\n x array of \\p n elements (\\f$op(A) == A\\f$) or \\p m elements\n (\\f$op(A) == A^T\\f$ or \\f$op(A) == A^H\\f$).\n @param[in]\n beta scalar \\f$\\beta\\f$.\n @param[inout]\n y array of \\p m elements (\\f$op(A) == A\\f$) or \\p n elements\n (\\f$op(A) == A^T\\f$ or \\f$op(A) == A^H\\f$).\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p alpha, \\p csr_val,\n \\p csr_row_ptr, \\p csr_col_ind, \\p x, \\p beta, or \\p y pointer is\n invalid.\n \\retval rocsparse_status_arch_mismatch the device is not supported.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n This example performs a sparse matrix vector multiplication in CSR format\n using additional meta data to improve performance.\n \\snippet example_rocsparse_csrmv.cpp doc example\n/\n/**@{"]
pub fn rocsparse_scsrmv(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
alpha: *const f32,
descr: rocsparse_mat_descr,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
x: *const f32,
beta: *const f32,
y: *mut f32,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsrmv(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
alpha: *const f64,
descr: rocsparse_mat_descr,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
x: *const f64,
beta: *const f64,
y: *mut f64,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsrmv(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
alpha: *const rocsparse_float_complex,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
x: *const rocsparse_float_complex,
beta: *const rocsparse_float_complex,
y: *mut rocsparse_float_complex,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsrmv(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
alpha: *const rocsparse_double_complex,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
x: *const rocsparse_double_complex,
beta: *const rocsparse_double_complex,
y: *mut rocsparse_double_complex,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level2_module\n \\details\n \\p rocsparse_csrsv_zero_pivot returns \\ref rocsparse_status_zero_pivot if either a\n structural or numerical zero has been found during \\ref rocsparse_scsrsv_solve \"rocsparse_Xcsrsv_solve()\"\n computation. The first zero pivot \\f$j\\f$ at \\f$A_{j,j}\\f$ is stored in \\p position,\n using the same index base as the CSR matrix.\n\n \\p position can be in host or device memory. If no zero pivot has been found,\n \\p position is set to -1 and \\ref rocsparse_status_success is returned instead.\n\n \\note \\p rocsparse_csrsv_zero_pivot is a blocking function. It might negatively influence\n performance.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n descr descriptor of the sparse CSR matrix.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[inout]\n position pointer to zero pivot \\f$j\\f$, can be in host or device memory.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p info or \\p position pointer is\n invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_zero_pivot zero pivot has been found."]
pub fn rocsparse_csrsv_zero_pivot(
handle: rocsparse_handle,
descr: rocsparse_mat_descr,
info: rocsparse_mat_info,
position: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level2_module\n \\details\n \\p rocsparse_csrsv_buffer_size returns the size of the temporary storage buffer that\n is required by \\ref rocsparse_scsrsv_analysis \"rocsparse_Xcsrsv_analysis()\" and\n \\ref rocsparse_scsrsv_solve \"rocsparse_Xcsrsv_solve()\". The temporary storage buffer\n must be allocated by the user. The size of the temporary storage buffer is identical\n to the size returned by \\ref rocsparse_scsrilu0_buffer_size \"rocsparse_Xcsrilu0_buffer_size()\"\n if the matrix sparsity pattern is identical. The user-allocated buffer can therefore be shared\n between subsequent calls to those functions.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n trans matrix operation type.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix.\n @param[in]\n descr descriptor of the sparse CSR matrix.\n @param[in]\n csr_val array of \\p nnz elements of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix.\n @param[out]\n info structure that holds the information collected during the analysis step.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n \\ref rocsparse_scsrsv_analysis \"rocsparse_Xcsrsv_analysis()\" and\n \\ref rocsparse_scsrsv_solve \"rocsparse_Xcsrsv_solve()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p csr_val, \\p csr_row_ptr,\n \\p csr_col_ind, \\p info, or \\p buffer_size pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\p trans == \\ref rocsparse_operation_conjugate_transpose or\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n/\n/**@{"]
pub fn rocsparse_scsrsv_buffer_size(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsrsv_buffer_size(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsrsv_buffer_size(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsrsv_buffer_size(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = "@}*/\n/*! \\ingroup level2_module\n \\details\n \\p rocsparse_csrsv_analysis performs the analysis step for\n \\ref rocsparse_scsrsv_solve \"rocsparse_Xcsrsv_solve()\". It is expected that this\n function will be executed only once for a given matrix and particular operation\n type. The analysis metadata can be cleared by \\ref rocsparse_csrsv_clear().\n\n If the matrix sparsity pattern changes, the gathered information will become invalid. To perform another\n sparse triangular solve with a matrix having a different sparsity pattern, either destroy\n the old \\p info object and create a new one or clear the existing \\p info object using\n \\ref rocsparse_csrsv_clear(). In both cases, the analysis will need to be called again.\n\n \\p rocsparse_csrsv_analysis can share its meta data with\n \\ref rocsparse_scsrsm_analysis \"rocsparse_Xcsrsm_analysis()\",\n \\ref rocsparse_scsrilu0_analysis \"rocsparse_Xcsrilu0_analysis()\", and\n \\ref rocsparse_scsric0_analysis \"rocsparse_Xcsric0_analysis()\". Selecting\n \\ref rocsparse_analysis_policy_reuse policy can greatly improve the computation\n performance of the metadata. However, the user needs to ensure that the sparsity\n pattern remains unchanged. If this cannot be assured,\n \\ref rocsparse_analysis_policy_force must be used.\n\n \\note\n If the matrix sparsity pattern changes, the gathered information will become invalid.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n trans matrix operation type.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix.\n @param[in]\n descr descriptor of the sparse CSR matrix.\n @param[in]\n csr_val array of \\p nnz elements of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix.\n @param[out]\n info structure that holds the information collected during\n the analysis step.\n @param[in]\n analysis \\ref rocsparse_analysis_policy_reuse or\n \\ref rocsparse_analysis_policy_force.\n @param[in]\n solve \\ref rocsparse_solve_policy_auto.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p csr_row_ptr,\n \\p csr_col_ind, \\p info, or \\p temp_buffer pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\p trans == \\ref rocsparse_operation_conjugate_transpose or\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n/\n/**@{"]
pub fn rocsparse_scsrsv_analysis(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsrsv_analysis(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsrsv_analysis(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsrsv_analysis(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level2_module\n \\details\n \\p rocsparse_csrsv_clear deallocates all memory that was allocated by\n \\ref rocsparse_scsrsv_analysis \"rocsparse_Xcsrsv_analysis()\". This is especially useful\n if memory is an issue and the analysis data is not required for further computation, for example,\n when switching to another sparse matrix format.\n\n Calling \\p rocsparse_csrsv_clear is optional. All allocated resources will be cleared when the\n opaque \\ref rocsparse_mat_info struct is destroyed using \\ref rocsparse_destroy_mat_info().\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n descr descriptor of the sparse CSR matrix.\n @param[inout]\n info structure that holds the information collected during the analysis step.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p info pointer is invalid.\n \\retval rocsparse_status_memory_error the buffer holding the meta data could not\n be deallocated.\n \\retval rocsparse_status_internal_error an internal error occurred."]
pub fn rocsparse_csrsv_clear(
handle: rocsparse_handle,
descr: rocsparse_mat_descr,
info: rocsparse_mat_info,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level2_module\n \\brief Sparse triangular solve using CSR storage format.\n\n \\details\n \\p rocsparse_csrsv_solve solves a sparse triangular linear system of a sparse\n \\f$m \\times m\\f$ matrix, defined in CSR storage format, a dense solution vector\n \\f$y\\f$ and the right-hand side \\f$x\\f$ that is multiplied by \\f$\\alpha\\f$, such that\n \\f[\n op(A) \\cdot y = \\alpha \\cdot x,\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans == rocsparse_operation_none} \\\\\n A^T, & \\text{if trans == rocsparse_operation_transpose} \\\\\n A^H, & \\text{if trans == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n\n Performing the above operation requires three steps. First, call\n \\ref rocsparse_scsrsv_buffer_size \"rocsparse_Xcsrsv_buffer_size()\", which determines the size of the required\n temporary storage buffer. Then allocate this buffer and call\n \\ref rocsparse_scsrsv_analysis \"rocsparse_Xcsrsv_analysis()\", which will perform analysis on the sparse matrix\n \\f$op(A)\\f$. Finally, complete the computation by calling \\p rocsparse_csrsv_solve. The buffer size,\n buffer allocation, and analysis only need to be called once for a given sparse matrix \\f$op(A)\\f$, while the\n computation stage can be repeatedly used with different \\f$x\\f$ and \\f$y\\f$ vectors. After all calls to\n \\p rocsparse_csrsv_solve are complete, the temporary buffer can be deallocated.\n\n Solving a triangular system involves division by the diagonal elements. This means that if the sparse matrix is\n missing the diagonal entry (referred to as a structural zero) or the diagonal entry is zero (referred to as a numerical zero),\n then a division by zero would occur. \\p rocsparse_csrsv_solve tracks the location of the first zero pivot (either numerical\n or structural zero). The zero pivot status can be checked by calling \\ref rocsparse_csrsv_zero_pivot(). If\n \\ref rocsparse_csrsv_zero_pivot() returns \\ref rocsparse_status_success, then no zero pivot was found and therefore\n the matrix does not have a structural or numerical zero.\n\n The user can specify that the sparse matrix should be interpreted as having ones on the diagonal by setting the diagonal type\n on the descriptor \\p descr to \\ref rocsparse_diag_type_unit using \\ref rocsparse_set_mat_diag_type. If\n \\ref rocsparse_diag_type == \\ref rocsparse_diag_type_unit, no zero pivot will be reported, even if \\f$A_{j,j} = 0\\f$ for\n some \\f$j\\f$.\n\n The sparse CSR matrix passed to \\p rocsparse_csrsv_solve does not actually have to be a triangular matrix. Instead the\n triangular upper or lower part of the sparse matrix is solved based on \\ref rocsparse_fill_mode set on the descriptor\n \\p descr. If the fill mode is set to \\ref rocsparse_fill_mode_lower, then the lower triangular matrix is solved. If the\n fill mode is set to \\ref rocsparse_fill_mode_upper, then the upper triangular matrix is solved.\n\n \\note\n The sparse CSR matrix has to be sorted. This can be achieved by calling\n rocsparse_csrsort().\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n Currently, only \\p trans == \\ref rocsparse_operation_none and\n \\p trans == \\ref rocsparse_operation_transpose is supported.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n trans matrix operation type.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n descr descriptor of the sparse CSR matrix.\n @param[in]\n csr_val array of \\p nnz elements of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start\n of every row of the sparse CSR matrix.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[in]\n x array of \\p m elements, holding the right-hand side.\n @param[out]\n y array of \\p m elements, holding the solution.\n @param[in]\n policy \\ref rocsparse_solve_policy_auto.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p alpha, \\p csr_val,\n \\p csr_row_ptr, \\p csr_col_ind, \\p x, or \\p y pointer is invalid.\n \\retval rocsparse_status_arch_mismatch the device is not supported.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\p trans == \\ref rocsparse_operation_conjugate_transpose or\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n Consider the lower triangular \\f$m \\times m\\f$ matrix \\f$L\\f$, stored in CSR\n storage format with unit diagonal. The following example solves \\f$L \\cdot y = x\\f$.\n \\snippet example_rocsparse_csrsv.cpp doc example\n/\n/**@{"]
pub fn rocsparse_scsrsv_solve(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
nnz: rocsparse_int,
alpha: *const f32,
descr: rocsparse_mat_descr,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
x: *const f32,
y: *mut f32,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsrsv_solve(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
nnz: rocsparse_int,
alpha: *const f64,
descr: rocsparse_mat_descr,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
x: *const f64,
y: *mut f64,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsrsv_solve(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
nnz: rocsparse_int,
alpha: *const rocsparse_float_complex,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
x: *const rocsparse_float_complex,
y: *mut rocsparse_float_complex,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsrsv_solve(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
nnz: rocsparse_int,
alpha: *const rocsparse_double_complex,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
x: *const rocsparse_double_complex,
y: *mut rocsparse_double_complex,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level2_module\n \\brief Sparse matrix vector multiplication using the ELL storage format.\n\n \\details\n \\p rocsparse_ellmv multiplies the scalar \\f$\\alpha\\f$ with a sparse \\f$m \\times n\\f$\n matrix, defined in ELL storage format, and the dense vector \\f$x\\f$ and adds the\n result to the dense vector \\f$y\\f$ that is multiplied by the scalar \\f$\\beta\\f$,\n such that\n \\f[\n y := \\alpha \\cdot op(A) \\cdot x + \\beta \\cdot y,\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans == rocsparse_operation_none} \\\\\n A^T, & \\text{if trans == rocsparse_operation_transpose} \\\\\n A^H, & \\text{if trans == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n\n \\code{.c}\n for(i = 0; i < m; ++i)\n {\n y[i] = beta * y[i];\n\n for(p = 0; p < ell_width; ++p)\n {\n idx = p * m + i;\n\n if((ell_col_ind[idx] >= 0) && (ell_col_ind[idx] < n))\n {\n y[i] = y[i] + alpha * ell_val[idx] * x[ell_col_ind[idx]];\n }\n }\n }\n \\endcode\n\n \\note\n This function does not produce deterministic results when A is transposed.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n trans matrix operation type.\n @param[in]\n m number of rows of the sparse ELL matrix.\n @param[in]\n n number of columns of the sparse ELL matrix.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n descr descriptor of the sparse ELL matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n ell_val array that contains the elements of the sparse ELL matrix. Padded\n elements should be zero.\n @param[in]\n ell_col_ind array that contains the column indices of the sparse ELL matrix.\n Padded column indices should be -1.\n @param[in]\n ell_width number of non-zero elements per row of the sparse ELL matrix.\n @param[in]\n x array of \\p n elements (\\f$op(A) == A\\f$) or \\p m elements\n (\\f$op(A) == A^T\\f$ or \\f$op(A) == A^H\\f$).\n @param[in]\n beta scalar \\f$\\beta\\f$.\n @param[inout]\n y array of \\p m elements (\\f$op(A) == A\\f$) or \\p n elements\n (\\f$op(A) == A^T\\f$ or \\f$op(A) == A^H\\f$).\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p ell_width is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p alpha, \\p ell_val,\n \\p ell_col_ind, \\p x, \\p beta, or \\p y pointer is invalid.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n This example performs a sparse matrix vector multiplication in ELL format. It also shows how to convert\n from CSR to ELL format.\n \\snippet example_rocsparse_ellmv.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sellmv(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
alpha: *const f32,
descr: rocsparse_mat_descr,
ell_val: *const f32,
ell_col_ind: *const rocsparse_int,
ell_width: rocsparse_int,
x: *const f32,
beta: *const f32,
y: *mut f32,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dellmv(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
alpha: *const f64,
descr: rocsparse_mat_descr,
ell_val: *const f64,
ell_col_ind: *const rocsparse_int,
ell_width: rocsparse_int,
x: *const f64,
beta: *const f64,
y: *mut f64,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cellmv(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
alpha: *const rocsparse_float_complex,
descr: rocsparse_mat_descr,
ell_val: *const rocsparse_float_complex,
ell_col_ind: *const rocsparse_int,
ell_width: rocsparse_int,
x: *const rocsparse_float_complex,
beta: *const rocsparse_float_complex,
y: *mut rocsparse_float_complex,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zellmv(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
alpha: *const rocsparse_double_complex,
descr: rocsparse_mat_descr,
ell_val: *const rocsparse_double_complex,
ell_col_ind: *const rocsparse_int,
ell_width: rocsparse_int,
x: *const rocsparse_double_complex,
beta: *const rocsparse_double_complex,
y: *mut rocsparse_double_complex,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level2_module\n \\brief Sparse matrix vector multiplication using the GEBSR storage format.\n\n \\details\n \\p rocsparse_gebsrmv multiplies the scalar \\f$\\alpha\\f$ with a sparse\n \\f$m \\times n\\f$ matrix, defined in GEBSR storage format, and the dense vector\n \\f$x\\f$ and adds the result to the dense vector \\f$y\\f$ that is multiplied by\n the scalar \\f$\\beta\\f$, such that\n \\f[\n y := \\alpha \\cdot op(A) \\cdot x + \\beta \\cdot y,\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans == rocsparse_operation_none}\n \\end{array}\n \\right.\n \\f]\n and where \\f$m = mb \\times row\\_block\\_dim\\f$ and \\f$n = nb \\times col\\_block\\_dim\\f$.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n Currently, only \\p trans == \\ref rocsparse_operation_none is supported.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir matrix storage of GEBSR blocks.\n @param[in]\n trans matrix operation type.\n @param[in]\n mb number of block rows of the sparse GEBSR matrix.\n @param[in]\n nb number of block columns of the sparse GEBSR matrix.\n @param[in]\n nnzb number of non-zero blocks of the sparse GEBSR matrix.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n descr descriptor of the sparse GEBSR matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n bsr_val array of \\p nnzb blocks of the sparse GEBSR matrix.\n @param[in]\n bsr_row_ptr array of \\p mb+1 elements that point to the start of every block row of\n the sparse GEBSR matrix.\n @param[in]\n bsr_col_ind array of \\p nnz containing the block column indices of the sparse\n GEBSR matrix.\n @param[in]\n row_block_dim row block dimension of the sparse GEBSR matrix.\n @param[in]\n col_block_dim column block dimension of the sparse GEBSR matrix.\n @param[in]\n x array of \\p nb*col_block_dim elements (\\f$op(A) = A\\f$) or \\p mb*row_block_dim\n elements (\\f$op(A) = A^T\\f$ or \\f$op(A) = A^H\\f$).\n @param[in]\n beta scalar \\f$\\beta\\f$.\n @param[inout]\n y array of \\p mb*row_block_dim elements (\\f$op(A) = A\\f$) or \\p nb*col_block_dim\n elements (\\f$op(A) = A^T\\f$ or \\f$op(A) = A^H\\f$).\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nb, \\p nnzb, \\p row_block_dim,\n or \\p col_block_dim is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p alpha, \\p bsr_val,\n \\p bsr_row_ind, \\p bsr_col_ind, \\p x, \\p beta, or \\p y pointer is invalid.\n \\retval rocsparse_status_arch_mismatch the device is not supported.\n \\retval rocsparse_status_not_implemented\n \\p trans != \\ref rocsparse_operation_none or\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n This example performs a sparse matrix vector multiplication in GEBSR format.\n \\snippet example_rocsparse_gebsrmv.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sgebsrmv(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans: rocsparse_operation,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
alpha: *const f32,
descr: rocsparse_mat_descr,
bsr_val: *const f32,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
x: *const f32,
beta: *const f32,
y: *mut f32,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dgebsrmv(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans: rocsparse_operation,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
alpha: *const f64,
descr: rocsparse_mat_descr,
bsr_val: *const f64,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
x: *const f64,
beta: *const f64,
y: *mut f64,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cgebsrmv(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans: rocsparse_operation,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
alpha: *const rocsparse_float_complex,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_float_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
x: *const rocsparse_float_complex,
beta: *const rocsparse_float_complex,
y: *mut rocsparse_float_complex,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zgebsrmv(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans: rocsparse_operation,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
alpha: *const rocsparse_double_complex,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_double_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
x: *const rocsparse_double_complex,
beta: *const rocsparse_double_complex,
y: *mut rocsparse_double_complex,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level2_module\n \\details\n \\p rocsparse_gemvi_buffer_size returns the size of the temporary storage buffer\n required by \\ref rocsparse_sgemvi \"rocsparse_Xgemvi()\". The temporary storage\n buffer must be allocated by the user.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n trans matrix operation type.\n @param[in]\n m number of rows of the dense matrix.\n @param[in]\n n number of columns of the dense matrix.\n @param[in]\n nnz number of non-zero entries in the sparse vector.\n @param[out]\n buffer_size temporary storage buffer size.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p buffer_size pointer is invalid.\n \\retval rocsparse_status_not_implemented\n \\p trans != \\ref rocsparse_operation_none or\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n/\n/**@{"]
pub fn rocsparse_sgemvi_buffer_size(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dgemvi_buffer_size(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cgemvi_buffer_size(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zgemvi_buffer_size(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level2_module\n \\brief Dense matrix sparse vector multiplication.\n\n \\details\n \\p rocsparse_gemvi multiplies the scalar \\f$\\alpha\\f$ with a dense \\f$m \\times n\\f$\n matrix \\f$A\\f$ and the sparse vector \\f$x\\f$ and adds the result to the dense vector\n \\f$y\\f$ that is multiplied by the scalar \\f$\\beta\\f$, such that\n \\f[\n y := \\alpha \\cdot op(A) \\cdot x + \\beta \\cdot y,\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans == rocsparse_operation_none}\n \\end{array}\n \\right.\n \\f]\n\n Performing the above operation involves two steps. First, call\n \\ref rocsparse_sgemvi_buffer_size \"rocsparse_Xgemvi_buffer_size()\" to determine the size of\n the temporary storage buffer. Next, allocate this temporary buffer and pass it to\n \\p rocsparse_gemvi to complete the computation. After all calls to \\p rocsparse_gemvi are complete, the\n temporary storage buffer can be freed.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n Currently, only \\p trans == \\ref rocsparse_operation_none is supported.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n trans matrix operation type.\n @param[in]\n m number of rows of the dense matrix.\n @param[in]\n n number of columns of the dense matrix.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n A pointer to the dense matrix.\n @param[in]\n lda leading dimension of the dense matrix.\n @param[in]\n nnz number of non-zero entries in the sparse vector.\n @param[in]\n x_val array of \\p nnz elements containing the values of the sparse vector.\n @param[in]\n x_ind array of \\p nnz elements containing the indices of the sparse vector.\n @param[in]\n beta scalar \\f$\\beta\\f$.\n @param[inout]\n y array of \\p m elements (\\f$op(A) == A\\f$) or \\p n elements\n (\\f$op(A) == A^T\\f$ or \\f$op(A) == A^H\\f$).\n @param[in]\n idx_base rocsparse_index_base_zero or rocsparse_index_base_one.\n @param[in]\n temp_buffer temporary storage buffer.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, \\p lda, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p alpha, \\p A, \\p x_val, \\p x_ind,\n \\p beta, \\p y, or \\p temp_buffer pointer is invalid.\n \\retval rocsparse_status_not_implemented\n \\p trans != \\ref rocsparse_operation_none or\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n \\snippet example_rocsparse_gemvi.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sgemvi(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
alpha: *const f32,
A: *const f32,
lda: rocsparse_int,
nnz: rocsparse_int,
x_val: *const f32,
x_ind: *const rocsparse_int,
beta: *const f32,
y: *mut f32,
idx_base: rocsparse_index_base,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dgemvi(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
alpha: *const f64,
A: *const f64,
lda: rocsparse_int,
nnz: rocsparse_int,
x_val: *const f64,
x_ind: *const rocsparse_int,
beta: *const f64,
y: *mut f64,
idx_base: rocsparse_index_base,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cgemvi(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
alpha: *const rocsparse_float_complex,
A: *const rocsparse_float_complex,
lda: rocsparse_int,
nnz: rocsparse_int,
x_val: *const rocsparse_float_complex,
x_ind: *const rocsparse_int,
beta: *const rocsparse_float_complex,
y: *mut rocsparse_float_complex,
idx_base: rocsparse_index_base,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zgemvi(
handle: rocsparse_handle,
trans: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
alpha: *const rocsparse_double_complex,
A: *const rocsparse_double_complex,
lda: rocsparse_int,
nnz: rocsparse_int,
x_val: *const rocsparse_double_complex,
x_ind: *const rocsparse_int,
beta: *const rocsparse_double_complex,
y: *mut rocsparse_double_complex,
idx_base: rocsparse_index_base,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level2_module\n \\brief Sparse matrix vector multiplication using the HYB storage format.\n\n \\details\n \\p rocsparse_hybmv multiplies the scalar \\f$\\alpha\\f$ with a sparse \\f$m \\times n\\f$\n matrix, defined in HYB storage format, and the dense vector \\f$x\\f$ and adds the\n result to the dense vector \\f$y\\f$ that is multiplied by the scalar \\f$\\beta\\f$,\n such that\n \\f[\n y := \\alpha \\cdot op(A) \\cdot x + \\beta \\cdot y,\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans == rocsparse_operation_none}\n \\end{array}\n \\right.\n \\f]\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n trans matrix operation type.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n descr descriptor of the sparse HYB matrix. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n hyb matrix in HYB storage format.\n @param[in]\n x array of \\p n elements (\\f$op(A) == A\\f$) or \\p m elements\n (\\f$op(A) == A^T\\f$ or \\f$op(A) == A^H\\f$).\n @param[in]\n beta scalar \\f$\\beta\\f$.\n @param[inout]\n y array of \\p m elements (\\f$op(A) == A\\f$) or \\p n elements\n (\\f$op(A) == A^T\\f$ or \\f$op(A) == A^H\\f$).\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p hyb structure was not initialized with\n valid matrix sizes.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p alpha, \\p hyb, \\p x,\n \\p beta, or \\p y pointer is invalid.\n \\retval rocsparse_status_invalid_value \\p hyb structure was not initialized\n with a valid partitioning type.\n \\retval rocsparse_status_arch_mismatch the device is not supported.\n \\retval rocsparse_status_memory_error the buffer could not be allocated.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\p trans != \\ref rocsparse_operation_none or\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n This example performs a sparse matrix vector multiplication in HYB format and\n demonstrates a conversion from the CSR to HYB format.\n \\snippet example_rocsparse_hybmv.cpp doc example\n/\n/**@{"]
pub fn rocsparse_shybmv(
handle: rocsparse_handle,
trans: rocsparse_operation,
alpha: *const f32,
descr: rocsparse_mat_descr,
hyb: rocsparse_hyb_mat,
x: *const f32,
beta: *const f32,
y: *mut f32,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dhybmv(
handle: rocsparse_handle,
trans: rocsparse_operation,
alpha: *const f64,
descr: rocsparse_mat_descr,
hyb: rocsparse_hyb_mat,
x: *const f64,
beta: *const f64,
y: *mut f64,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_chybmv(
handle: rocsparse_handle,
trans: rocsparse_operation,
alpha: *const rocsparse_float_complex,
descr: rocsparse_mat_descr,
hyb: rocsparse_hyb_mat,
x: *const rocsparse_float_complex,
beta: *const rocsparse_float_complex,
y: *mut rocsparse_float_complex,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zhybmv(
handle: rocsparse_handle,
trans: rocsparse_operation,
alpha: *const rocsparse_double_complex,
descr: rocsparse_mat_descr,
hyb: rocsparse_hyb_mat,
x: *const rocsparse_double_complex,
beta: *const rocsparse_double_complex,
y: *mut rocsparse_double_complex,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level3_module\n \\brief Sparse matrix dense matrix multiplication using the BSR storage format.\n\n \\details\n \\p rocsparse_bsrmm multiplies the scalar \\f$\\alpha\\f$ with a sparse \\f$m \\times k\\f$\n matrix \\f$A\\f$, defined in BSR storage format, and the column-oriented dense \\f$k \\times n\\f$\n matrix \\f$B\\f$ and adds the result to the column-oriented dense \\f$m \\times n\\f$ matrix \\f$C\\f$ that\n is multiplied by the scalar \\f$\\beta\\f$, such that\n \\f[\n C := \\alpha \\cdot op(A) \\cdot op(B) + \\beta \\cdot C,\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans_A == rocsparse_operation_none} \\\\\n \\end{array}\n \\right.\n \\f]\n and\n \\f[\n op(B) = \\left\\{\n \\begin{array}{ll}\n B, & \\text{if trans_B == rocsparse_operation_none} \\\\\n B^T, & \\text{if trans_B == rocsparse_operation_transpose} \\\\\n \\end{array}\n \\right.\n \\f]\n and where \\f$k = block\\_dim \\times kb\\f$ and \\f$m = block\\_dim \\times mb\\f$.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n Currently, only \\p trans_A == \\ref rocsparse_operation_none is supported.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir the storage format of the blocks. Can be \\ref rocsparse_direction_row or \\ref rocsparse_direction_column.\n @param[in]\n trans_A matrix \\f$A\\f$ operation type. Currently, only \\ref rocsparse_operation_none is supported.\n @param[in]\n trans_B matrix \\f$B\\f$ operation type. Currently, only \\ref rocsparse_operation_none and rocsparse_operation_transpose\n are supported.\n @param[in]\n mb number of block rows of the sparse BSR matrix \\f$A\\f$.\n @param[in]\n n number of columns of the column-oriented dense matrix \\f$op(B)\\f$ and \\f$C\\f$.\n @param[in]\n kb number of block columns of the sparse BSR matrix \\f$A\\f$.\n @param[in]\n nnzb number of non-zero blocks of the sparse BSR matrix \\f$A\\f$.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n descr descriptor of the sparse BSR matrix \\f$A\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n bsr_val array of \\p nnzb*block_dim*block_dim elements of the sparse BSR matrix \\f$A\\f$.\n @param[in]\n bsr_row_ptr array of \\p mb+1 elements that point to the start of every block row of the\n sparse BSR matrix \\f$A\\f$.\n @param[in]\n bsr_col_ind array of \\p nnzb elements containing the block column indices of the sparse\n BSR matrix \\f$A\\f$.\n @param[in]\n block_dim size of the blocks in the sparse BSR matrix.\n @param[in]\n B column-oriented dense matrix of dimension \\f$ldb \\times n\\f$ (\\f$op(B) == B\\f$),\n \\f$ldb \\times k\\f$ otherwise.\n @param[in]\n ldb leading dimension of \\f$B\\f$, must be at least \\f$\\max{(1, k)}\\f$ (\\f$ op(B) == B\\f$) where \\f$k = block\\_dim \\times kb\\f$,\n \\f$\\max{(1, n)}\\f$ otherwise.\n @param[in]\n beta scalar \\f$\\beta\\f$.\n @param[inout]\n C column-oriented dense matrix of dimension \\f$ldc \\times n\\f$.\n @param[in]\n ldc leading dimension of \\f$C\\f$, must be at least \\f$\\max{(1, m)}\\f$ (\\f$ op(A) == A\\f$) where \\f$m = block\\_dim \\times mb\\f$,\n \\f$\\max{(1, k)}\\f$ where \\f$k = block\\_dim \\times kb\\f$ otherwise.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p n, \\p kb, \\p nnzb, \\p ldb, or \\p ldc\n is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p alpha, \\p bsr_val,\n \\p bsr_row_ptr, \\p bsr_col_ind, \\p B, \\p beta, or \\p C pointer is invalid.\n \\retval rocsparse_status_arch_mismatch the device is not supported.\n \\retval rocsparse_status_not_implemented\n \\p trans_A != \\ref rocsparse_operation_none,\n \\p trans_B == \\ref rocsparse_operation_conjugate_transpose, or\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n This example multiplies a BSR matrix with a column-oriented dense matrix.\n \\snippet example_rocsparse_bsrmm.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sbsrmm(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
mb: rocsparse_int,
n: rocsparse_int,
kb: rocsparse_int,
nnzb: rocsparse_int,
alpha: *const f32,
descr: rocsparse_mat_descr,
bsr_val: *const f32,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
B: *const f32,
ldb: rocsparse_int,
beta: *const f32,
C: *mut f32,
ldc: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dbsrmm(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
mb: rocsparse_int,
n: rocsparse_int,
kb: rocsparse_int,
nnzb: rocsparse_int,
alpha: *const f64,
descr: rocsparse_mat_descr,
bsr_val: *const f64,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
B: *const f64,
ldb: rocsparse_int,
beta: *const f64,
C: *mut f64,
ldc: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cbsrmm(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
mb: rocsparse_int,
n: rocsparse_int,
kb: rocsparse_int,
nnzb: rocsparse_int,
alpha: *const rocsparse_float_complex,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_float_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
B: *const rocsparse_float_complex,
ldb: rocsparse_int,
beta: *const rocsparse_float_complex,
C: *mut rocsparse_float_complex,
ldc: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zbsrmm(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
mb: rocsparse_int,
n: rocsparse_int,
kb: rocsparse_int,
nnzb: rocsparse_int,
alpha: *const rocsparse_double_complex,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_double_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
B: *const rocsparse_double_complex,
ldb: rocsparse_int,
beta: *const rocsparse_double_complex,
C: *mut rocsparse_double_complex,
ldc: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level3_module\n \\details\n \\p rocsparse_bsrsm_zero_pivot returns \\ref rocsparse_status_zero_pivot if either a\n structural or numerical zero has been found during\n \\ref rocsparse_sbsrsm_solve \"rocsparse_Xbsrsm_solve()\" computation. The first zero\n pivot \\f$j\\f$ at \\f$A_{j,j}\\f$ is stored in \\p position, using the same index base as\n the BSR matrix.\n\n \\p position can be in the host or device memory. If no zero pivot has been found,\n \\p position is set to -1 and \\ref rocsparse_status_success is returned instead.\n\n \\note \\p rocsparse_bsrsm_zero_pivot is a blocking function. It might negatively influence\n performance.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[inout]\n position pointer to zero pivot \\f$j\\f$, which can be in host or device memory.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p info or \\p position pointer is\n invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_zero_pivot zero pivot has been found."]
pub fn rocsparse_bsrsm_zero_pivot(
handle: rocsparse_handle,
info: rocsparse_mat_info,
position: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level3_module\n \\details\n \\p rocsparse_bsrsm_buffer_size returns the size of the temporary storage buffer that\n is required by \\ref rocsparse_sbsrsm_analysis \"rocsparse_Xbsrsm_analysis()\" and\n \\ref rocsparse_sbsrsm_solve \"rocsparse_Xbsrsm_solve()\". The temporary storage buffer\n must be allocated by the user.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir matrix storage of BSR blocks.\n @param[in]\n trans_A matrix A operation type.\n @param[in]\n trans_X matrix X operation type.\n @param[in]\n mb number of block rows of the sparse BSR matrix A.\n @param[in]\n nrhs number of columns of the column-oriented dense matrix op(X).\n @param[in]\n nnzb number of non-zero blocks of the sparse BSR matrix A.\n @param[in]\n descr descriptor of the sparse BSR matrix A.\n @param[in]\n bsr_val array of \\p nnzb blocks of the sparse BSR matrix.\n @param[in]\n bsr_row_ptr array of \\p mb+1 elements that point to the start of every block row of\n the sparse BSR matrix.\n @param[in]\n bsr_col_ind array of \\p nnzb containing the block column indices of the sparse\n BSR matrix.\n @param[in]\n block_dim block dimension of the sparse BSR matrix.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n \\ref rocsparse_sbsrsm_analysis \"rocsparse_Xbsrsm_analysis()\" and\n \\ref rocsparse_sbsrsm_solve \"rocsparse_Xbsrsm_solve()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nrhs, \\p nnzb, or \\p block_dim is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p bsr_val,\n \\p bsr_row_ptr, \\p bsr_col_ind, \\p info, or \\p buffer_size pointer\n is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\p trans_A == \\ref rocsparse_operation_conjugate_transpose,\n \\p trans_X == \\ref rocsparse_operation_conjugate_transpose, or\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n/\n/**@{"]
pub fn rocsparse_sbsrsm_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_X: rocsparse_operation,
mb: rocsparse_int,
nrhs: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const f32,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dbsrsm_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_X: rocsparse_operation,
mb: rocsparse_int,
nrhs: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const f64,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cbsrsm_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_X: rocsparse_operation,
mb: rocsparse_int,
nrhs: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_float_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zbsrsm_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_X: rocsparse_operation,
mb: rocsparse_int,
nrhs: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_double_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level3_module\n \\details\n \\p rocsparse_bsrsm_analysis performs the analysis step for\n \\ref rocsparse_sbsrsm_solve \"rocsparse_Xbsrsm_solve()\". It is expected that this function\n will be executed only once for a given matrix and particular operation type. The analysis\n meta data can be cleared by \\ref rocsparse_bsrsm_clear().\n\n \\p rocsparse_bsrsm_analysis can share its meta data with\n \\ref rocsparse_sbsrilu0_analysis \"rocsparse_Xbsrilu0_analysis()\",\n \\ref rocsparse_sbsric0_analysis \"rocsparse_Xbsric0_analysis()\", and\n \\ref rocsparse_sbsrsv_analysis \"rocsparse_Xbsrsv_analysis()\". Selecting\n \\ref rocsparse_analysis_policy_reuse policy can greatly improve the computation\n performance of the metadata. However, the user needs to ensure that the sparsity\n pattern remains unchanged. If this cannot be assured,\n \\ref rocsparse_analysis_policy_force has to be used.\n\n \\note\n If the matrix sparsity pattern changes, the gathered information will become invalid.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir matrix storage of BSR blocks.\n @param[in]\n trans_A matrix A operation type.\n @param[in]\n trans_X matrix X operation type.\n @param[in]\n mb number of block rows of the sparse BSR matrix A.\n @param[in]\n nrhs number of columns of the column-oriented dense matrix op(X).\n @param[in]\n nnzb number of non-zero blocks of the sparse BSR matrix A.\n @param[in]\n descr descriptor of the sparse BSR matrix A.\n @param[in]\n bsr_val array of \\p nnzb blocks of the sparse BSR matrix A.\n @param[in]\n bsr_row_ptr array of \\p mb+1 elements that point to the start of every block row of\n the sparse BSR matrix A.\n @param[in]\n bsr_col_ind array of \\p nnzb containing the block column indices of the sparse\n BSR matrix A.\n @param[in]\n block_dim block dimension of the sparse BSR matrix A.\n @param[out]\n info structure that holds the information collected during the analysis step.\n @param[in]\n analysis \\ref rocsparse_analysis_policy_reuse or\n \\ref rocsparse_analysis_policy_force.\n @param[in]\n solve \\ref rocsparse_solve_policy_auto.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nrhs, \\p nnzb, or \\p block_dim is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p bsr_val, \\p bsr_row_ptr,\n \\p bsr_col_ind, \\p info, or \\p temp_buffer pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\p trans_A == \\ref rocsparse_operation_conjugate_transpose,\n \\p trans_X == \\ref rocsparse_operation_conjugate_transpose, or\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n/\n/**@{"]
pub fn rocsparse_sbsrsm_analysis(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_X: rocsparse_operation,
mb: rocsparse_int,
nrhs: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const f32,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dbsrsm_analysis(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_X: rocsparse_operation,
mb: rocsparse_int,
nrhs: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const f64,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cbsrsm_analysis(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_X: rocsparse_operation,
mb: rocsparse_int,
nrhs: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_float_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zbsrsm_analysis(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_X: rocsparse_operation,
mb: rocsparse_int,
nrhs: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_double_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level3_module\n \\details\n \\p rocsparse_bsrsm_clear deallocates all memory that was allocated by\n \\ref rocsparse_sbsrsm_analysis \"rocsparse_Xbsrsm_analysis()\". This is especially useful\n if memory is an issue and the analysis data is not required for further computation, for example,\n when switching to another sparse matrix format. Calling \\p rocsparse_bsrsm_clear is optional.\n All allocated resources will be cleared when the opaque \\ref rocsparse_mat_info struct\n is destroyed using \\ref rocsparse_destroy_mat_info().\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[inout]\n info structure that holds the information collected during the analysis step.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p info pointer is invalid.\n \\retval rocsparse_status_memory_error the buffer holding the metadata could not\n be deallocated.\n \\retval rocsparse_status_internal_error an internal error occurred."]
pub fn rocsparse_bsrsm_clear(
handle: rocsparse_handle,
info: rocsparse_mat_info,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level3_module\n \\brief Sparse triangular system solve using the BSR storage format.\n\n \\details\n \\p rocsparse_bsrsm_solve solves a sparse triangular linear system of a sparse\n \\f$m \\times m\\f$ matrix, defined in BSR storage format, a column-oriented dense solution matrix\n \\f$X\\f$, and the column-oriented dense right-hand side matrix \\f$B\\f$ that is multiplied by \\f$\\alpha\\f$,\n such that\n \\f[\n op(A) \\cdot op(X) = \\alpha \\cdot op(B),\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans_A == rocsparse_operation_none} \\\\\n A^T, & \\text{if trans_A == rocsparse_operation_transpose} \\\\\n A^H, & \\text{if trans_A == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n ,\n \\f[\n op(B) = \\left\\{\n \\begin{array}{ll}\n B, & \\text{if trans_X == rocsparse_operation_none} \\\\\n B^T, & \\text{if trans_X == rocsparse_operation_transpose} \\\\\n B^H, & \\text{if trans_X == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n and\n \\f[\n op(X) = \\left\\{\n \\begin{array}{ll}\n X, & \\text{if trans_X == rocsparse_operation_none} \\\\\n X^T, & \\text{if trans_X == rocsparse_operation_transpose} \\\\\n X^H, & \\text{if trans_X == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n and where \\f$m = block\\_dim \\times mb\\f$.\n\n Note that, as indicated above, the operation type of both \\f$op(B)\\f$ and \\f$op(X)\\f$ is specified by the\n \\p trans_X parameter and that the operation type of B and X must match. For example, if \\f$op(B)=B\\f$, then\n \\f$op(X)=X\\f$. Likewise, if \\f$op(B)=B^T\\f$, then \\f$op(X)=X^T\\f$.\n\n Given that the sparse matrix A is a square matrix, its size is \\f$m \\times m\\f$ regardless of\n whether A is transposed or not. The size of the column-oriented dense matrices B and X have\n a size that depends on the value of \\p trans_X :\n\n \\f[\n op(B) = \\left\\{\n \\begin{array}{ll}\n ldb \\times nrhs, \\text{ } ldb \\ge m, & \\text{if trans_X == rocsparse_operation_none} \\\\\n ldb \\times m, \\text{ } ldb \\ge nrhs, & \\text{if trans_X == rocsparse_operation_transpose} \\\\\n ldb \\times m, \\text{ } ldb \\ge nrhs, & \\text{if trans_X == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n and\n \\f[\n op(X) = \\left\\{\n \\begin{array}{ll}\n ldb \\times nrhs, \\text{ } ldb \\ge m, & \\text{if trans_X == rocsparse_operation_none} \\\\\n ldb \\times m, \\text{ } ldb \\ge nrhs, & \\text{if trans_X == rocsparse_operation_transpose} \\\\\n ldb \\times m, \\text{ } ldb \\ge nrhs, & \\text{if trans_X == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n\n \\p rocsparse_bsrsm_solve requires a user-allocated temporary buffer. Its size is returned by\n \\ref rocsparse_sbsrsm_buffer_size \"rocsparse_Xbsrsm_buffer_size()\". The size of the required buffer is larger\n when \\p trans_A equals \\ref rocsparse_operation_transpose or \\ref rocsparse_operation_conjugate_transpose and\n when \\p trans_X is \\ref rocsparse_operation_none. The subsequent solve will also be faster when \\f$A\\f$ is\n non-transposed and \\f$B\\f$ is transposed (or conjugate transposed). For example, instead of solving:\n\n \\f[\n \\left[\n \\begin{array}{c | c}\n \\begin{array}{c c}\n a_{00} & a_{01} \\\\\n a_{10} & a_{11}\n \\end{array} &\n \\begin{array}{c c}\n 0 & 0 \\\\\n 0 & 0\n \\end{array} \\\\\n \\hline\n \\begin{array}{c c}\n a_{20} & a_{21} \\\\\n a_{30} & a_{31}\n \\end{array} &\n \\begin{array}{c c}\n a_{22} & a_{23} \\\\\n a_{32} & a_{33}\n \\end{array} \\\\\n \\end{array}\n \\right]\n \\cdot\n \\begin{bmatrix}\n x_{00} & x_{01} \\\\\n x_{10} & x_{11} \\\\\n x_{20} & x_{21} \\\\\n x_{30} & x_{31} \\\\\n \\end{bmatrix}\n =\n \\begin{bmatrix}\n b_{00} & b_{01} \\\\\n b_{10} & b_{11} \\\\\n b_{20} & b_{21} \\\\\n b_{30} & b_{31} \\\\\n \\end{bmatrix}\n \\f]\n\n Consider solving:\n\n \\f[\n \\left[\n \\begin{array}{c | c}\n \\begin{array}{c c}\n a_{00} & a_{01} \\\\\n a_{10} & a_{11}\n \\end{array} &\n \\begin{array}{c c}\n 0 & 0 \\\\\n 0 & 0\n \\end{array} \\\\\n \\hline\n \\begin{array}{c c}\n a_{20} & a_{21} \\\\\n a_{30} & a_{31}\n \\end{array} &\n \\begin{array}{c c}\n a_{22} & a_{23} \\\\\n a_{32} & a_{33}\n \\end{array} \\\\\n \\end{array}\n \\right]\n \\cdot\n \\begin{bmatrix}\n x_{00} & x_{10} & x_{20} & x_{30} \\\\\n x_{01} & x_{11} & x_{21} & x_{31}\n \\end{bmatrix}^{T}\n =\n \\begin{bmatrix}\n b_{00} & b_{10} & b_{20} & b_{30} \\\\\n b_{01} & b_{11} & b_{21} & b_{31}\n \\end{bmatrix}^{T}\n \\f]\n\n After the temporary storage buffer has been allocated, analysis metadata is required. It can be obtained\n by \\ref rocsparse_sbsrsm_analysis \"rocsparse_Xbsrsm_analysis()\".\n\n Solving a triangular system involves inverting the diagonal blocks. This means that if the sparse matrix is\n missing the diagonal block (referred to as a structural zero) or the diagonal block is not invertible (referred\n to as a numerical zero) then a solution is not possible. \\p rocsparse_bsrsm_solve tracks the location of the first\n zero pivot (either numerical or structural zero). The zero pivot status can be checked by calling \\ref rocsparse_bsrsm_zero_pivot().\n If \\ref rocsparse_bsrsm_zero_pivot() returns \\ref rocsparse_status_success, then no zero pivot was found and therefore\n the matrix does not have a structural or numerical zero.\n\n The user can specify that the sparse matrix should be interpreted as having identity blocks on the diagonal by setting the diagonal\n type on the descriptor \\p descr to \\ref rocsparse_diag_type_unit using \\ref rocsparse_set_mat_diag_type. If\n \\ref rocsparse_diag_type == \\ref rocsparse_diag_type_unit, no zero pivot will be reported, even if the diagonal block \\f$A_{j,j}\\f$\n for some \\f$j\\f$ is not invertible.\n\n The sparse CSR matrix passed to \\p rocsparse_bsrsm_solve does not actually have to be a triangular matrix. Instead, the\n triangular upper or lower part of the sparse matrix is solved based on \\ref rocsparse_fill_mode set on the descriptor\n \\p descr. If the fill mode is set to \\ref rocsparse_fill_mode_lower, then the lower triangular matrix is solved. If the\n fill mode is set to \\ref rocsparse_fill_mode_upper, then the upper triangular matrix is solved.\n\n \\note\n The sparse BSR matrix has to be sorted.\n\n \\note\n Operation type of B and X must match, , if \\f$op(B)=B\\f$ then \\f$op(X)=X\\f$.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n Currently, only \\p trans_A != \\ref rocsparse_operation_conjugate_transpose and\n \\p trans_X != \\ref rocsparse_operation_conjugate_transpose is supported.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir matrix storage of BSR blocks.\n @param[in]\n trans_A matrix A operation type.\n @param[in]\n trans_X matrix X operation type.\n @param[in]\n mb number of block rows of the sparse BSR matrix A.\n @param[in]\n nrhs number of columns of the column-oriented dense matrix op(X).\n @param[in]\n nnzb number of non-zero blocks of the sparse BSR matrix A.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n descr descriptor of the sparse BSR matrix A.\n @param[in]\n bsr_val array of \\p nnzb blocks of the sparse BSR matrix.\n @param[in]\n bsr_row_ptr array of \\p mb+1 elements that point to the start of every block row of\n the sparse BSR matrix.\n @param[in]\n bsr_col_ind array of \\p nnzb containing the block column indices of the sparse\n BSR matrix.\n @param[in]\n block_dim block dimension of the sparse BSR matrix.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[in]\n B column-oriented dense matrix B with leading dimension \\p ldb.\n @param[in]\n ldb leading dimension of rhs matrix B.\n @param[out]\n X column-oriented dense solution matrix X with leading dimension \\p ldx.\n @param[in]\n ldx leading dimension of solution matrix X.\n @param[in]\n policy \\ref rocsparse_solve_policy_auto.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nrhs, \\p nnzb, or \\p block_dim is invalid.\n \\retval rocsparse_status_invalid_pointer \\p alpha, \\p descr, \\p bsr_val,\n \\p bsr_row_ptr, \\p bsr_col_ind, \\p B, \\p X \\p info, or \\p temp_buffer pointer\n is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\p trans_A == \\ref rocsparse_operation_conjugate_transpose,\n \\p trans_X == \\ref rocsparse_operation_conjugate_transpose, or\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n Consider the lower triangular \\f$m \\times m\\f$ matrix \\f$L\\f$, stored in BSR\n storage format with non-unit diagonal. The following example solves \\f$L \\cdot X = B\\f$.\n \\snippet example_rocsparse_bsrsm.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sbsrsm_solve(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_X: rocsparse_operation,
mb: rocsparse_int,
nrhs: rocsparse_int,
nnzb: rocsparse_int,
alpha: *const f32,
descr: rocsparse_mat_descr,
bsr_val: *const f32,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
B: *const f32,
ldb: rocsparse_int,
X: *mut f32,
ldx: rocsparse_int,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dbsrsm_solve(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_X: rocsparse_operation,
mb: rocsparse_int,
nrhs: rocsparse_int,
nnzb: rocsparse_int,
alpha: *const f64,
descr: rocsparse_mat_descr,
bsr_val: *const f64,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
B: *const f64,
ldb: rocsparse_int,
X: *mut f64,
ldx: rocsparse_int,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cbsrsm_solve(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_X: rocsparse_operation,
mb: rocsparse_int,
nrhs: rocsparse_int,
nnzb: rocsparse_int,
alpha: *const rocsparse_float_complex,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_float_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
B: *const rocsparse_float_complex,
ldb: rocsparse_int,
X: *mut rocsparse_float_complex,
ldx: rocsparse_int,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zbsrsm_solve(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_X: rocsparse_operation,
mb: rocsparse_int,
nrhs: rocsparse_int,
nnzb: rocsparse_int,
alpha: *const rocsparse_double_complex,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_double_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
B: *const rocsparse_double_complex,
ldb: rocsparse_int,
X: *mut rocsparse_double_complex,
ldx: rocsparse_int,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level3_module\n \\brief Sparse matrix dense matrix multiplication using the CSR storage format.\n\n \\details\n \\p rocsparse_csrmm multiplies the scalar \\f$\\alpha\\f$ with a sparse \\f$m \\times k\\f$\n matrix \\f$A\\f$, defined in CSR storage format, and the column-oriented dense \\f$k \\times n\\f$\n matrix \\f$B\\f$ and adds the result to the column-oriented dense \\f$m \\times n\\f$ matrix \\f$C\\f$ that\n is multiplied by the scalar \\f$\\beta\\f$, such that\n \\f[\n C := \\alpha \\cdot op(A) \\cdot op(B) + \\beta \\cdot C,\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans_A == rocsparse_operation_none} \\\\\n A^T, & \\text{if trans_A == rocsparse_operation_transpose} \\\\\n A^H, & \\text{if trans_A == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n and\n \\f[\n op(B) = \\left\\{\n \\begin{array}{ll}\n B, & \\text{if trans_B == rocsparse_operation_none} \\\\\n B^T, & \\text{if trans_B == rocsparse_operation_transpose} \\\\\n B^H, & \\text{if trans_B == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n\n \\code{.c}\n for(i = 0; i < ldc; ++i)\n {\n for(j = 0; j < n; ++j)\n {\n C[i][j] = beta * C[i][j];\n\n for(k = csr_row_ptr[i]; k < csr_row_ptr[i + 1]; ++k)\n {\n C[i][j] += alpha * csr_val[k] * B[csr_col_ind[k]][j];\n }\n }\n }\n \\endcode\n\n \\note\n This function does not produce deterministic results when A is transposed.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n trans_A matrix \\f$A\\f$ operation type.\n @param[in]\n trans_B matrix \\f$B\\f$ operation type.\n @param[in]\n m number of rows of the sparse CSR matrix \\f$A\\f$.\n @param[in]\n n number of columns of the column-oriented dense matrix \\f$op(B)\\f$ and \\f$C\\f$.\n @param[in]\n k number of columns of the sparse CSR matrix \\f$A\\f$.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix \\f$A\\f$.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n descr descriptor of the sparse CSR matrix \\f$A\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n csr_val array of \\p nnz elements of the sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$A\\f$.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix \\f$A\\f$.\n @param[in]\n B column-oriented dense matrix of dimension \\f$ldb \\times n\\f$ (\\f$op(B) == B\\f$),\n \\f$ldb \\times k\\f$ otherwise.\n @param[in]\n ldb leading dimension of \\f$B\\f$, must be at least \\f$\\max{(1, k)}\\f$\n (\\f$op(B) == B\\f$), \\f$\\max{(1, n)}\\f$ otherwise.\n @param[in]\n beta scalar \\f$\\beta\\f$.\n @param[inout]\n C column-oriented dense matrix of dimension \\f$ldc \\times n\\f$.\n @param[in]\n ldc leading dimension of \\f$C\\f$, must be at least \\f$\\max{(1, m)}\\f$\n (\\f$op(A) == A\\f$), \\f$\\max{(1, k)}\\f$ otherwise.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, \\p k, \\p nnz, \\p ldb, or \\p ldc\n is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p alpha, \\p csr_val,\n \\p csr_row_ptr, \\p csr_col_ind, \\p B, \\p beta, or \\p C pointer is invalid.\n \\retval rocsparse_status_arch_mismatch the device is not supported.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n This example multiplies a CSR matrix with a column-oriented dense matrix.\n \\snippet example_rocsparse_csrmm.cpp doc example\n/\n/**@{"]
pub fn rocsparse_scsrmm(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
k: rocsparse_int,
nnz: rocsparse_int,
alpha: *const f32,
descr: rocsparse_mat_descr,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
B: *const f32,
ldb: rocsparse_int,
beta: *const f32,
C: *mut f32,
ldc: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsrmm(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
k: rocsparse_int,
nnz: rocsparse_int,
alpha: *const f64,
descr: rocsparse_mat_descr,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
B: *const f64,
ldb: rocsparse_int,
beta: *const f64,
C: *mut f64,
ldc: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsrmm(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
k: rocsparse_int,
nnz: rocsparse_int,
alpha: *const rocsparse_float_complex,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
B: *const rocsparse_float_complex,
ldb: rocsparse_int,
beta: *const rocsparse_float_complex,
C: *mut rocsparse_float_complex,
ldc: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsrmm(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
k: rocsparse_int,
nnz: rocsparse_int,
alpha: *const rocsparse_double_complex,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
B: *const rocsparse_double_complex,
ldb: rocsparse_int,
beta: *const rocsparse_double_complex,
C: *mut rocsparse_double_complex,
ldc: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level3_module\n \\details\n \\p rocsparse_csrsm_zero_pivot returns \\ref rocsparse_status_zero_pivot if either a\n structural or numerical zero has been found during\n \\ref rocsparse_scsrsm_solve \"rocsparse_Xcsrsm_solve()\" computation. The first zero\n pivot \\f$j\\f$ at \\f$A_{j,j}\\f$ is stored in \\p position, using the same index base as\n the CSR matrix.\n\n \\p position can be in host or device memory. If no zero pivot has been found,\n \\p position is set to -1 and \\ref rocsparse_status_success is returned instead.\n\n \\note \\p rocsparse_csrsm_zero_pivot is a blocking function. It might negatively influence\n performance.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[inout]\n position pointer to zero pivot \\f$j\\f$, which can be in host or device memory.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p info or \\p position pointer is\n invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_zero_pivot zero pivot has been found."]
pub fn rocsparse_csrsm_zero_pivot(
handle: rocsparse_handle,
info: rocsparse_mat_info,
position: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level3_module\n \\details\n \\p rocsparse_csrsm_buffer_size returns the size of the temporary storage buffer that\n is required by \\ref rocsparse_scsrsm_analysis \"rocsparse_Xcsrsm_analysis()\" and\n \\ref rocsparse_scsrsm_solve \"rocsparse_Xcsrsm_solve()\". The temporary storage buffer\n must be allocated by the user.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n trans_A matrix A operation type.\n @param[in]\n trans_B matrix B operation type.\n @param[in]\n m number of rows of the sparse CSR matrix A.\n @param[in]\n nrhs number of columns of the column-oriented dense matrix op(B).\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix A.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n descr descriptor of the sparse CSR matrix A.\n @param[in]\n csr_val array of \\p nnz elements of the sparse CSR matrix A.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix A.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix A.\n @param[in]\n B column-oriented dense matrix of dimension \\p m \\f$\\times\\f$ \\p nrhs elements of the rhs matrix B.\n @param[in]\n ldb leading dimension of rhs matrix B.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[in]\n policy \\ref rocsparse_solve_policy_auto.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n rocsparse_scsrsm_analysis(), rocsparse_dcsrsm_analysis(),\n rocsparse_ccsrsm_analysis(), rocsparse_zcsrsm_analysis(),\n rocsparse_scsrsm_solve(), rocsparse_dcsrsm_solve(),\n rocsparse_ccsrsm_solve(), and rocsparse_zcsrsm_solve().\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p nrhs, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p alpha, \\p descr, \\p csr_val,\n \\p csr_row_ptr, \\p csr_col_ind, \\p B, \\p info, or \\p buffer_size pointer\n is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\p trans_A == \\ref rocsparse_operation_conjugate_transpose,\n \\p trans_B == \\ref rocsparse_operation_conjugate_transpose, or\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n/\n/**@{"]
pub fn rocsparse_scsrsm_buffer_size(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
nrhs: rocsparse_int,
nnz: rocsparse_int,
alpha: *const f32,
descr: rocsparse_mat_descr,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
B: *const f32,
ldb: rocsparse_int,
info: rocsparse_mat_info,
policy: rocsparse_solve_policy,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsrsm_buffer_size(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
nrhs: rocsparse_int,
nnz: rocsparse_int,
alpha: *const f64,
descr: rocsparse_mat_descr,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
B: *const f64,
ldb: rocsparse_int,
info: rocsparse_mat_info,
policy: rocsparse_solve_policy,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsrsm_buffer_size(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
nrhs: rocsparse_int,
nnz: rocsparse_int,
alpha: *const rocsparse_float_complex,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
B: *const rocsparse_float_complex,
ldb: rocsparse_int,
info: rocsparse_mat_info,
policy: rocsparse_solve_policy,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsrsm_buffer_size(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
nrhs: rocsparse_int,
nnz: rocsparse_int,
alpha: *const rocsparse_double_complex,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
B: *const rocsparse_double_complex,
ldb: rocsparse_int,
info: rocsparse_mat_info,
policy: rocsparse_solve_policy,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level3_module\n \\details\n \\p rocsparse_csrsm_analysis performs the analysis step for\n \\ref rocsparse_scsrsm_solve \"rocsparse_Xcsrsm_solve()\". It is expected that this\n function will be executed only once for a given matrix and particular operation\n type. The analysis metadata can be cleared by \\ref rocsparse_csrsm_clear().\n\n \\p rocsparse_csrsm_analysis can share its meta data with\n \\ref rocsparse_scsrilu0_analysis \"rocsparse_Xcsrilu0_analysis()\",\n \\ref rocsparse_scsric0_analysis \"rocsparse_Xcsric0_analysis()\", and\n \\ref rocsparse_scsrsv_analysis \"rocsparse_Xcsrsv_analysis()\". Selecting\n \\ref rocsparse_analysis_policy_reuse policy can greatly improve computation\n performance of the metadata. However, the user needs to ensure that the sparsity\n pattern remains unchanged. If this cannot be assured,\n \\ref rocsparse_analysis_policy_force has to be used.\n\n \\note\n If the matrix sparsity pattern changes, the gathered information will become invalid.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n trans_A matrix A operation type.\n @param[in]\n trans_B matrix B operation type.\n @param[in]\n m number of rows of the sparse CSR matrix A.\n @param[in]\n nrhs number of columns of the column-oriented dense matrix op(B).\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix A.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n descr descriptor of the sparse CSR matrix A.\n @param[in]\n csr_val array of \\p nnz elements of the sparse CSR matrix A.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix A.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix A.\n @param[in]\n B column-oriented dense matrix of dimension \\p m \\f$\\times\\f$ \\p nrhs elements of the rhs matrix B.\n @param[in]\n ldb leading dimension of rhs matrix B.\n @param[out]\n info structure that holds the information collected during the analysis step.\n @param[in]\n analysis \\ref rocsparse_analysis_policy_reuse or\n \\ref rocsparse_analysis_policy_force.\n @param[in]\n solve \\ref rocsparse_solve_policy_auto.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p nrhs, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p alpha, \\p descr, \\p csr_val,\n \\p csr_row_ptr, \\p csr_col_ind, \\p B, \\p info, or \\p temp_buffer pointer\n is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\p trans_A == \\ref rocsparse_operation_conjugate_transpose,\n \\p trans_B == \\ref rocsparse_operation_conjugate_transpose, or\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n/\n/**@{"]
pub fn rocsparse_scsrsm_analysis(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
nrhs: rocsparse_int,
nnz: rocsparse_int,
alpha: *const f32,
descr: rocsparse_mat_descr,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
B: *const f32,
ldb: rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsrsm_analysis(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
nrhs: rocsparse_int,
nnz: rocsparse_int,
alpha: *const f64,
descr: rocsparse_mat_descr,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
B: *const f64,
ldb: rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsrsm_analysis(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
nrhs: rocsparse_int,
nnz: rocsparse_int,
alpha: *const rocsparse_float_complex,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
B: *const rocsparse_float_complex,
ldb: rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsrsm_analysis(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
nrhs: rocsparse_int,
nnz: rocsparse_int,
alpha: *const rocsparse_double_complex,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
B: *const rocsparse_double_complex,
ldb: rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level3_module\n \\details\n \\p rocsparse_csrsm_clear deallocates all memory that was allocated by\n \\ref rocsparse_scsrsm_analysis \"rocsparse_Xcsrsm_analysis()\". This is especially\n useful if memory is an issue and the analysis data is not required for further\n computation, for example, when switching to another sparse matrix format. Calling\n \\p rocsparse_csrsm_clear is optional. All allocated resources will be cleared\n when the opaque \\ref rocsparse_mat_info struct is destroyed using\n \\ref rocsparse_destroy_mat_info().\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[inout]\n info structure that holds the information collected during the analysis step.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p info pointer is invalid.\n \\retval rocsparse_status_memory_error the buffer holding the metadata could not\n be deallocated.\n \\retval rocsparse_status_internal_error an internal error occurred."]
pub fn rocsparse_csrsm_clear(
handle: rocsparse_handle,
info: rocsparse_mat_info,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level3_module\n \\brief Sparse triangular system solve using the CSR storage format.\n\n \\details\n \\p rocsparse_csrsm_solve solves a sparse triangular linear system of a sparse\n \\f$m \\times m\\f$ matrix, defined in CSR storage format, a column-oriented dense solution matrix\n \\f$X\\f$ and the column-oriented dense right-hand side matrix \\f$B\\f$ that is multiplied by \\f$\\alpha\\f$, such that\n \\f[\n op(A) \\cdot op(X) = \\alpha \\cdot op(B),\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans_A == rocsparse_operation_none} \\\\\n A^T, & \\text{if trans_A == rocsparse_operation_transpose} \\\\\n A^H, & \\text{if trans_A == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n ,\n \\f[\n op(B) = \\left\\{\n \\begin{array}{ll}\n B, & \\text{if trans_B == rocsparse_operation_none} \\\\\n B^T, & \\text{if trans_B == rocsparse_operation_transpose} \\\\\n B^H, & \\text{if trans_B == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n and\n \\f[\n op(X) = \\left\\{\n \\begin{array}{ll}\n X, & \\text{if trans_B == rocsparse_operation_none} \\\\\n X^T, & \\text{if trans_B == rocsparse_operation_transpose} \\\\\n X^H, & \\text{if trans_B == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n\n The solution is performed inplace, meaning that the matrix B is overwritten with the solution\n X after calling \\p rocsparse_csrsm_solve. Given that the sparse matrix A is a square matrix, its\n size is \\f$m \\times m\\f$, regardless of whether A is transposed or not. The size of the column-oriented dense\n matrices B and X depends on the value of \\p trans_B:\n\n \\f[\n op(B)/op(X) = \\left\\{\n \\begin{array}{ll}\n ldb \\times nrhs, \\text{ } ldb \\ge m, & \\text{if trans_B == rocsparse_operation_none} \\\\\n ldb \\times m, \\text{ } ldb \\ge nrhs, & \\text{if trans_B == rocsparse_operation_transpose} \\\\\n ldb \\times m, \\text{ } ldb \\ge nrhs, & \\text{if trans_B == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n\n \\p rocsparse_csrsm_solve requires a user-allocated temporary buffer. Its size is returned by\n \\ref rocsparse_scsrsm_buffer_size \"rocsparse_Xcsrsm_buffer_size()\". The size of the required buffer is\n larger when \\p trans_A equals \\ref rocsparse_operation_transpose or \\ref rocsparse_operation_conjugate_transpose\n and when \\p trans_B is \\ref rocsparse_operation_none. The subsequent solve will also be faster when \\f$A\\f$\n is non-transposed and \\f$B\\f$ is transposed (or conjugate transposed). For example, instead of solving:\n\n \\f[\n \\begin{bmatrix}\n a_{00} & 0 & 0 \\\\\n a_{10} & a_{11} & 0 \\\\\n a_{20} & a_{21} & a_{22} \\\\\n \\end{bmatrix}\n \\cdot\n \\begin{bmatrix}\n x_{00} & x_{01} \\\\\n x_{10} & x_{11} \\\\\n x_{20} & x_{21} \\\\\n \\end{bmatrix}\n =\n \\begin{bmatrix}\n b_{00} & b_{01} \\\\\n b_{10} & b_{11} \\\\\n b_{20} & b_{21} \\\\\n \\end{bmatrix}\n \\f]\n\n Consider solving:\n\n \\f[\n \\begin{bmatrix}\n a_{00} & 0 & 0 \\\\\n a_{10} & a_{11} & 0 \\\\\n a_{20} & a_{21} & a_{22}\n \\end{bmatrix}\n \\cdot\n \\begin{bmatrix}\n x_{00} & x_{10} & x_{20} \\\\\n x_{01} & x_{11} & x_{21}\n \\end{bmatrix}^{T}\n =\n \\begin{bmatrix}\n b_{00} & b_{10} & b_{20} \\\\\n b_{01} & b_{11} & b_{21}\n \\end{bmatrix}^{T}\n \\f]\n\n After the temporary storage buffer has been allocated, analysis of the metadata is required.\n It can be obtained by \\ref rocsparse_scsrsm_analysis \"rocsparse_Xcsrsm_analysis()\".\n\n Solving a triangular system involves division by the diagonal elements. This means that if the sparse matrix is\n missing the diagonal entry (referred to as a structural zero) or the diagonal entry is zero (referred to as a numerical zero),\n then a division by zero would occur. \\p rocsparse_csrsm_solve tracks the location of the first zero pivot (either numerical\n or structural zero). The zero pivot status can be checked by calling \\ref rocsparse_csrsm_zero_pivot(). If\n \\ref rocsparse_csrsm_zero_pivot() returns \\ref rocsparse_status_success, then no zero pivot was found and therefore\n the matrix does not have a structural or numerical zero.\n\n The user can specify that the sparse matrix should be interpreted as having ones on the diagonal by setting the diagonal type\n on the descriptor \\p descr to \\ref rocsparse_diag_type_unit using \\ref rocsparse_set_mat_diag_type. If\n \\ref rocsparse_diag_type == \\ref rocsparse_diag_type_unit, no zero pivot will be reported, even if \\f$A_{j,j} = 0\\f$ for\n some \\f$j\\f$.\n\n The sparse CSR matrix passed to \\p rocsparse_csrsm_solve does not actually have to be a triangular matrix. Instead, the\n triangular upper or lower part of the sparse matrix is solved based on the \\ref rocsparse_fill_mode setting on the descriptor\n \\p descr. If the fill mode is set to \\ref rocsparse_fill_mode_lower, then the lower triangular matrix is solved. If the\n fill mode is set to \\ref rocsparse_fill_mode_upper, then the upper triangular matrix is solved.\n\n \\note\n The sparse CSR matrix has to be sorted. This can be achieved by calling\n rocsparse_csrsort().\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n Currently, only \\p trans_A != \\ref rocsparse_operation_conjugate_transpose and\n \\p trans_B != \\ref rocsparse_operation_conjugate_transpose is supported.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n trans_A matrix A operation type.\n @param[in]\n trans_B matrix B operation type.\n @param[in]\n m number of rows of the sparse CSR matrix A.\n @param[in]\n nrhs number of columns of the column-oriented dense matrix op(B).\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix A.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n descr descriptor of the sparse CSR matrix A.\n @param[in]\n csr_val array of \\p nnz elements of the sparse CSR matrix A.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix A.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix A.\n @param[inout]\n B column-oriented dense matrix of dimension \\p m \\f$\\times\\f$ \\p nrhs elements of the rhs matrix B.\n @param[in]\n ldb leading dimension of rhs matrix B.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[in]\n policy \\ref rocsparse_solve_policy_auto.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p nrhs, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p alpha, \\p descr, \\p csr_val,\n \\p csr_row_ptr, \\p csr_col_ind, \\p B, \\p info, or \\p temp_buffer pointer\n is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\p trans_A == \\ref rocsparse_operation_conjugate_transpose,\n \\p trans_B == \\ref rocsparse_operation_conjugate_transpose, or\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n Consider the lower triangular \\f$m \\times m\\f$ matrix \\f$L\\f$, stored in CSR\n storage format with unit diagonal. The following example solves \\f$L \\cdot X = B\\f$.\n \\snippet example_rocsparse_csrmm.cpp doc example\n/\n/**@{"]
pub fn rocsparse_scsrsm_solve(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
nrhs: rocsparse_int,
nnz: rocsparse_int,
alpha: *const f32,
descr: rocsparse_mat_descr,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
B: *mut f32,
ldb: rocsparse_int,
info: rocsparse_mat_info,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsrsm_solve(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
nrhs: rocsparse_int,
nnz: rocsparse_int,
alpha: *const f64,
descr: rocsparse_mat_descr,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
B: *mut f64,
ldb: rocsparse_int,
info: rocsparse_mat_info,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsrsm_solve(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
nrhs: rocsparse_int,
nnz: rocsparse_int,
alpha: *const rocsparse_float_complex,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
B: *mut rocsparse_float_complex,
ldb: rocsparse_int,
info: rocsparse_mat_info,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsrsm_solve(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
nrhs: rocsparse_int,
nnz: rocsparse_int,
alpha: *const rocsparse_double_complex,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
B: *mut rocsparse_double_complex,
ldb: rocsparse_int,
info: rocsparse_mat_info,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level3_module\n \\brief Sparse matrix dense matrix multiplication using the general BSR storage format\n\n \\details\n \\p rocsparse_gebsrmm multiplies the scalar \\f$\\alpha\\f$ with a sparse \\f$m \\times k\\f$\n matrix \\f$A\\f$, defined in general BSR storage format, and the column-oriented dense \\f$k \\times n\\f$\n matrix \\f$B\\f$ and adds the result to the column-oriented dense \\f$m \\times n\\f$ matrix \\f$C\\f$ that\n is multiplied by the scalar \\f$\\beta\\f$, such that\n \\f[\n C := \\alpha \\cdot op(A) \\cdot op(B) + \\beta \\cdot C,\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans_A == rocsparse_operation_none} \\\\\n \\end{array}\n \\right.\n \\f]\n and\n \\f[\n op(B) = \\left\\{\n \\begin{array}{ll}\n B, & \\text{if trans_B == rocsparse_operation_none} \\\\\n B^T, & \\text{if trans_B == rocsparse_operation_transpose} \\\\\n \\end{array}\n \\right.\n \\f]\n and where \\f$k = col\\_block\\_dim \\times kb\\f$ and \\f$m = row\\_block\\_dim \\times mb\\f$.\n\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n Currently, only \\p trans_A == \\ref rocsparse_operation_none is supported.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir the storage format of the blocks. Can be \\ref rocsparse_direction_row or \\ref rocsparse_direction_column.\n @param[in]\n trans_A matrix \\f$A\\f$ operation type. Currently, only \\ref rocsparse_operation_none is supported.\n @param[in]\n trans_B matrix \\f$B\\f$ operation type. Currently, only \\ref rocsparse_operation_none and rocsparse_operation_transpose\n are supported.\n @param[in]\n mb number of block rows of the sparse general BSR matrix \\f$A\\f$.\n @param[in]\n n number of columns of the column-oriented dense matrix \\f$op(B)\\f$ and \\f$C\\f$.\n @param[in]\n kb number of block columns of the sparse general BSR matrix \\f$A\\f$.\n @param[in]\n nnzb number of non-zero blocks of the sparse general BSR matrix \\f$A\\f$.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n descr descriptor of the sparse general BSR matrix \\f$A\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n bsr_val array of \\p nnzb*row_block_dim*col_block_dim elements of the sparse general BSR matrix \\f$A\\f$.\n @param[in]\n bsr_row_ptr array of \\p mb+1 elements that point to the start of every block row of the\n sparse general BSR matrix \\f$A\\f$.\n @param[in]\n bsr_col_ind array of \\p nnzb elements containing the block column indices of the sparse\n general BSR matrix \\f$A\\f$.\n @param[in]\n row_block_dim row size of the blocks in the sparse general BSR matrix.\n @param[in]\n col_block_dim column size of the blocks in the sparse general BSR matrix.\n @param[in]\n B column-oriented dense matrix of dimension \\f$ldb \\times n\\f$ (\\f$op(B) == B\\f$),\n \\f$ldb \\times k\\f$ otherwise.\n @param[in]\n ldb leading dimension of \\f$B\\f$, which must be at least \\f$\\max{(1, k)}\\f$ (\\f$ op(B) == B\\f$) where \\f$k = col\\_block\\_dim \\times kb\\f$,\n \\f$\\max{(1, n)}\\f$ otherwise.\n @param[in]\n beta scalar \\f$\\beta\\f$.\n @param[inout]\n C column-oriented dense matrix of dimension \\f$ldc \\times n\\f$.\n @param[in]\n ldc leading dimension of \\f$C\\f$, which must be at least \\f$\\max{(1, m)}\\f$ (\\f$ op(A) == A\\f$) where \\f$m = row\\_block\\_dim \\times mb\\f$,\n \\f$\\max{(1, k)}\\f$ where \\f$k = col\\_block\\_dim \\times kb\\f$ otherwise.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p n, \\p kb, \\p nnzb, \\p ldb, \\p ldc, \\p row_block_dim,\n or \\p col_block_dim is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p alpha, \\p bsr_val,\n \\p bsr_row_ptr, \\p bsr_col_ind, \\p B, \\p beta, or \\p C pointer is invalid.\n \\retval rocsparse_status_arch_mismatch the device is not supported.\n \\retval rocsparse_status_not_implemented\n \\p trans_A != \\ref rocsparse_operation_none,\n \\p trans_B == \\ref rocsparse_operation_conjugate_transpose, or\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n This example multiplies a general BSR matrix with a column-oriented dense matrix.\n \\snippet example_rocsparse_gebsrmm.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sgebsrmm(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
mb: rocsparse_int,
n: rocsparse_int,
kb: rocsparse_int,
nnzb: rocsparse_int,
alpha: *const f32,
descr: rocsparse_mat_descr,
bsr_val: *const f32,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
B: *const f32,
ldb: rocsparse_int,
beta: *const f32,
C: *mut f32,
ldc: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dgebsrmm(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
mb: rocsparse_int,
n: rocsparse_int,
kb: rocsparse_int,
nnzb: rocsparse_int,
alpha: *const f64,
descr: rocsparse_mat_descr,
bsr_val: *const f64,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
B: *const f64,
ldb: rocsparse_int,
beta: *const f64,
C: *mut f64,
ldc: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cgebsrmm(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
mb: rocsparse_int,
n: rocsparse_int,
kb: rocsparse_int,
nnzb: rocsparse_int,
alpha: *const rocsparse_float_complex,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_float_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
B: *const rocsparse_float_complex,
ldb: rocsparse_int,
beta: *const rocsparse_float_complex,
C: *mut rocsparse_float_complex,
ldc: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zgebsrmm(
handle: rocsparse_handle,
dir: rocsparse_direction,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
mb: rocsparse_int,
n: rocsparse_int,
kb: rocsparse_int,
nnzb: rocsparse_int,
alpha: *const rocsparse_double_complex,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_double_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
B: *const rocsparse_double_complex,
ldb: rocsparse_int,
beta: *const rocsparse_double_complex,
C: *mut rocsparse_double_complex,
ldc: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup level3_module\n \\brief Dense matrix sparse matrix multiplication using the CSR storage format.\n\n \\details\n \\p rocsparse_gemmi multiplies the scalar \\f$\\alpha\\f$ with a column-oriented dense \\f$m \\times k\\f$\n matrix \\f$op(A)\\f$ and the sparse \\f$k \\times n\\f$ matrix \\f$op(B)\\f$, defined in CSR\n storage format, and adds the result to the column-oriented dense \\f$m \\times n\\f$ matrix \\f$C\\f$ that\n is multiplied by the scalar \\f$\\beta\\f$, such that\n \\f[\n C := \\alpha \\cdot op(A) \\cdot op(B) + \\beta \\cdot C\n \\f]\n with\n \\f[\n op(A) = \\left\\{\n \\begin{array}{ll}\n A, & \\text{if trans_A == rocsparse_operation_none} \\\\\n A^T, & \\text{if trans_A == rocsparse_operation_transpose} \\\\\n A^H, & \\text{if trans_A == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n and\n \\f[\n op(B) = \\left\\{\n \\begin{array}{ll}\n B, & \\text{if trans_B == rocsparse_operation_none} \\\\\n B^T, & \\text{if trans_B == rocsparse_operation_transpose} \\\\\n B^H, & \\text{if trans_B == rocsparse_operation_conjugate_transpose}\n \\end{array}\n \\right.\n \\f]\n\n \\note\n Currently, only \\p trans_A == \\ref rocsparse_operation_none is supported.\n\n \\note\n Currently, only \\p trans_B == \\ref rocsparse_operation_transpose is supported.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n trans_A matrix \\f$A\\f$ operation type.\n @param[in]\n trans_B matrix \\f$B\\f$ operation type.\n @param[in]\n m number of rows of the column-oriented dense matrix \\f$A\\f$.\n @param[in]\n n number of columns of the sparse CSR matrix \\f$op(B)\\f$ and \\f$C\\f$.\n @param[in]\n k number of columns of the column-oriented dense matrix \\f$A\\f$.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix \\f$B\\f$.\n @param[in]\n alpha scalar \\f$\\alpha\\f$.\n @param[in]\n A array of dimension \\f$lda \\times k\\f$ (\\f$op(A) == A\\f$) or\n \\f$lda \\times m\\f$ (\\f$op(A) == A^T\\f$ or \\f$op(A) == A^H\\f$).\n @param[in]\n lda leading dimension of \\f$A\\f$, must be at least \\f$m\\f$\n (\\f$op(A) == A\\f$) or \\f$k\\f$ (\\f$op(A) == A^T\\f$ or\n \\f$op(A) == A^H\\f$).\n @param[in]\n descr descriptor of the sparse CSR matrix \\f$B\\f$. Currently, only\n \\ref rocsparse_matrix_type_general is supported.\n @param[in]\n csr_val array of \\p nnz elements of the sparse CSR matrix \\f$B\\f$.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix \\f$B\\f$.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse CSR\n matrix \\f$B\\f$.\n @param[in]\n beta scalar \\f$\\beta\\f$.\n @param[inout]\n C column-oriented dense matrix of dimension \\f$ldc \\times n\\f$ that holds the values of \\f$C\\f$.\n @param[in]\n ldc leading dimension of \\f$C\\f$, must be at least \\f$m\\f$.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, \\p k, \\p nnz, \\p lda, or \\p ldc\n is invalid.\n \\retval rocsparse_status_invalid_pointer \\p alpha, \\p A, \\p csr_val,\n \\p csr_row_ptr, \\p csr_col_ind, \\p beta, or \\p C pointer is invalid.\n\n \\par Example\n This example multiplies a column-oriented dense matrix with a CSC matrix.\n \\snippet example_rocsparse_gemmi.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sgemmi(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
k: rocsparse_int,
nnz: rocsparse_int,
alpha: *const f32,
A: *const f32,
lda: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
beta: *const f32,
C: *mut f32,
ldc: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dgemmi(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
k: rocsparse_int,
nnz: rocsparse_int,
alpha: *const f64,
A: *const f64,
lda: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
beta: *const f64,
C: *mut f64,
ldc: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cgemmi(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
k: rocsparse_int,
nnz: rocsparse_int,
alpha: *const rocsparse_float_complex,
A: *const rocsparse_float_complex,
lda: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
beta: *const rocsparse_float_complex,
C: *mut rocsparse_float_complex,
ldc: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zgemmi(
handle: rocsparse_handle,
trans_A: rocsparse_operation,
trans_B: rocsparse_operation,
m: rocsparse_int,
n: rocsparse_int,
k: rocsparse_int,
nnz: rocsparse_int,
alpha: *const rocsparse_double_complex,
A: *const rocsparse_double_complex,
lda: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
beta: *const rocsparse_double_complex,
C: *mut rocsparse_double_complex,
ldc: rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n \\p rocsparse_bsric0_zero_pivot returns \\ref rocsparse_status_zero_pivot if either a\n structural or numerical zero has been found during \\ref rocsparse_sbsric0 \"rocsparse_Xbsric0()\"\n computation. The first zero pivot \\f$j\\f$ at \\f$A_{j,j}\\f$ is stored in \\p position, using the same\n index base as the BSR matrix.\n\n \\p position can be in host or device memory. If no zero pivot has been found,\n \\p position is set to -1 and \\ref rocsparse_status_success is returned instead.\n\n \\note\n If a zero pivot is found, \\p position=j means that either the diagonal block \\p A(j,j)\n is missing (structural zero) or the diagonal block \\p A(j,j) is not positive definite\n (numerical zero).\n\n \\note \\p rocsparse_bsric0_zero_pivot is a blocking function. It might influence negatively\n performance.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[inout]\n position pointer to zero pivot \\f$j\\f$, which can be in host or device memory.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p info or \\p position pointer is\n invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_zero_pivot zero pivot has been found."]
pub fn rocsparse_bsric0_zero_pivot(
handle: rocsparse_handle,
info: rocsparse_mat_info,
position: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n \\p rocsparse_bsric0_buffer_size returns the size of the temporary storage buffer\n that is required by \\ref rocsparse_sbsric0_analysis \"rocsparse_Xbsric0_analysis()\" and\n \\ref rocsparse_sbsric0 \"rocsparse_Xbsric0()\". The temporary storage buffer must be\n allocated by the user. The size of the temporary storage buffer is identical to the size\n returned by \\ref rocsparse_sbsrsv_buffer_size \"rocsparse_Xbsrsv_buffer_size()\" and\n \\ref rocsparse_sbsrilu0_buffer_size \"rocsparse_Xbsrilu0_buffer_size()\" if the matrix sparsity\n pattern is identical. The user-allocated buffer can therefore be shared between subsequent calls\n to those functions.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir direction that specifies whether to count non-zero elements by \\ref rocsparse_direction_row or by\n \\ref rocsparse_direction_column.\n @param[in]\n mb number of block rows in the sparse BSR matrix.\n @param[in]\n nnzb number of non-zero block entries of the sparse BSR matrix.\n @param[in]\n descr descriptor of the sparse BSR matrix.\n @param[in]\n bsr_val array of length \\p nnzb*block_dim*block_dim containing the values of the sparse BSR matrix.\n @param[in]\n bsr_row_ptr array of \\p mb+1 elements that point to the start of every block row of the\n sparse BSR matrix.\n @param[in]\n bsr_col_ind array of \\p nnzb elements containing the block column indices of the sparse BSR matrix.\n @param[in]\n block_dim the block dimension of the BSR matrix. Between 1 and m, where \\p m=mb*block_dim.\n @param[out]\n info structure that holds the information collected during the analysis step.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n \\ref rocsparse_sbsric0_analysis \"rocsparse_Xbsric0_analysis()\" and\n \\ref rocsparse_sbsric0 \"rocsparse_Xbsric0()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nnzb, or \\p block_dim is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p bsr_val, \\p bsr_row_ptr,\n \\p bsr_col_ind, \\p info, or \\p buffer_size pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n/\n/**@{"]
pub fn rocsparse_sbsric0_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const f32,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dbsric0_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const f64,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cbsric0_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_float_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zbsric0_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_double_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n \\p rocsparse_bsric0_analysis performs the analysis step for\n \\ref rocsparse_sbsric0 \"rocsparse_Xbsric0()\". It is expected that this function will\n be executed only once for a given matrix and particular operation type. The analysis\n metadata can be cleared by \\ref rocsparse_bsric0_clear().\n\n \\p rocsparse_bsric0_analysis can share its meta data with\n \\ref rocsparse_sbsrilu0_analysis \"rocsparse_Xbsrilu0_analysis()\",\n \\ref rocsparse_sbsrsv_analysis \"rocsparse_Xbsrsv_analysis()\", and\n \\ref rocsparse_sbsrsm_analysis \"rocsparse_Xbsrsm_analysis()\". Selecting\n \\ref rocsparse_analysis_policy_reuse policy can greatly improve the computation\n performance of metadata. However, the user needs to ensure that the sparsity\n pattern remains unchanged. If this cannot be assured,\n \\ref rocsparse_analysis_policy_force must be used.\n\n \\note\n If the matrix sparsity pattern changes, the gathered information will become invalid.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir direction that specified whether to count non-zero elements by \\ref rocsparse_direction_row or by\n \\ref rocsparse_direction_column.\n @param[in]\n mb number of block rows in the sparse BSR matrix.\n @param[in]\n nnzb number of non-zero block entries of the sparse BSR matrix.\n @param[in]\n descr descriptor of the sparse BSR matrix.\n @param[in]\n bsr_val array of length \\p nnzb*block_dim*block_dim containing the values of the sparse BSR matrix.\n @param[in]\n bsr_row_ptr array of \\p mb+1 elements that point to the start of every block row of the\n sparse BSR matrix.\n @param[in]\n bsr_col_ind array of \\p nnzb elements containing the block column indices of the sparse BSR matrix.\n @param[in]\n block_dim the block dimension of the BSR matrix. Between 1 and m, where \\p m=mb*block_dim.\n @param[out]\n info structure that holds the information collected during\n the analysis step.\n @param[in]\n analysis \\ref rocsparse_analysis_policy_reuse or\n \\ref rocsparse_analysis_policy_force.\n @param[in]\n solve \\ref rocsparse_solve_policy_auto.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nnzb, or \\p block_dim is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p bsr_val, \\p bsr_row_ptr,\n \\p bsr_col_ind, \\p info, or \\p temp_buffer pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n/\n/**@{"]
pub fn rocsparse_sbsric0_analysis(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const f32,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dbsric0_analysis(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const f64,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cbsric0_analysis(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_float_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zbsric0_analysis(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_double_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n \\p rocsparse_bsric0_clear deallocates all memory that was allocated by\n \\ref rocsparse_sbsric0_analysis \"rocsparse_Xbsric0_analysis()\". This is especially useful\n if memory is an issue and the analysis data is not required for further computation.\n\n \\note\n Calling \\p rocsparse_bsric0_clear is optional. All allocated resources will be\n cleared when the opaque \\ref rocsparse_mat_info struct is destroyed using\n \\ref rocsparse_destroy_mat_info().\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[inout]\n info structure that holds the information collected during the analysis step.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p info pointer is invalid.\n \\retval rocsparse_status_memory_error the buffer holding the meta data could not\n be deallocated.\n \\retval rocsparse_status_internal_error an internal error occurred."]
pub fn rocsparse_bsric0_clear(
handle: rocsparse_handle,
info: rocsparse_mat_info,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\brief Incomplete Cholesky factorization with 0 fill-ins and no pivoting using the BSR\n storage format.\n\n \\details\n \\p rocsparse_bsric0 computes the incomplete Cholesky factorization with 0 fill-ins\n and no pivoting of a sparse \\f$mb \\times mb\\f$ BSR matrix \\f$A\\f$, such that\n \\f[\n A \\approx LL^T\n \\f]\n\n Computing the above incomplete Cholesky factorization requires three steps to complete. First,\n determine the size of the required temporary storage buffer by calling \\ref rocsparse_sbsric0_buffer_size,\n \\ref rocsparse_dbsric0_buffer_size, \\ref rocsparse_cbsric0_buffer_size, or \\ref rocsparse_zbsric0_buffer_size. After\n this buffer size has been determined, allocate the buffer and pass it to \\ref rocsparse_sbsric0_analysis,\n \\ref rocsparse_dbsric0_analysis, \\ref rocsparse_cbsric0_analysis, or \\ref rocsparse_zbsric0_analysis. This will\n perform analysis on the sparsity pattern of the matrix. Finally, call \\p rocsparse_sbsric0,\n \\p rocsparse_dbsric0, \\p rocsparse_cbsric0, or \\p rocsparse_zbsric0 to perform the actual factorization. The calculation\n of the buffer size and the analysis of the sparse matrix only need to be performed once for a given sparsity pattern,\n while the factorization can be repeatedly applied to multiple matrices having the same sparsity pattern. After all calls\n to \\ref rocsparse_sbsric0 \"rocsparse_Xbsric0()\" are complete, the temporary buffer can be deallocated.\n\n \\p rocsparse_bsric0 reports the first zero pivot (either numerical or structural zero).\n The zero pivot status can be obtained by calling \\ref rocsparse_bsric0_zero_pivot().\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir direction that specified whether to count non-zero elements by \\ref rocsparse_direction_row or by\n \\ref rocsparse_direction_column.\n @param[in]\n mb number of block rows in the sparse BSR matrix.\n @param[in]\n nnzb number of non-zero block entries of the sparse BSR matrix.\n @param[in]\n descr descriptor of the sparse BSR matrix.\n @param[inout]\n bsr_val array of length \\p nnzb*block_dim*block_dim containing the values of the sparse BSR matrix.\n @param[in]\n bsr_row_ptr array of \\p mb+1 elements that point to the start of every block row of the\n sparse BSR matrix.\n @param[in]\n bsr_col_ind array of \\p nnzb elements containing the block column indices of the sparse BSR matrix.\n @param[in]\n block_dim the block dimension of the BSR matrix. Between 1 and m, where \\p m=mb*block_dim.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[in]\n policy \\ref rocsparse_solve_policy_auto.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nnzb, or \\p block_dim is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p bsr_val, \\p bsr_row_ptr,\n or \\p bsr_col_ind pointer is invalid.\n \\retval rocsparse_status_arch_mismatch the device is not supported.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n Consider the sparse \\f$m \\times m\\f$ matrix \\f$A\\f$, stored in BSR\n storage format. The following example computes the incomplete Cholesky factorization\n \\f$M \\approx LL^T\\f$ and solves the preconditioned system \\f$My = x\\f$.\n \\snippet example_rocsparse_bsric0.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sbsric0(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *mut f32,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dbsric0(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *mut f64,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cbsric0(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *mut rocsparse_float_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zbsric0(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *mut rocsparse_double_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n \\p rocsparse_bsrilu0_zero_pivot returns \\ref rocsparse_status_zero_pivot if either a\n structural or numerical zero has been found during \\ref rocsparse_sbsrilu0 \"rocsparse_Xbsrilu0()\"\n computation. The first zero pivot \\f$j\\f$ at \\f$A_{j,j}\\f$ is stored in \\p position, using the same\n index base as the BSR matrix.\n\n \\p position can be in host or device memory. If no zero pivot has been found,\n \\p position is set to -1 and \\ref rocsparse_status_success is returned instead.\n\n \\note\n If a zero pivot is found, \\p position \\f$=j\\f$ means that either the diagonal block\n \\f$A_{j,j}\\f$ is missing (structural zero) or the diagonal block \\f$A_{j,j}\\f$ is not\n invertible (numerical zero).\n\n \\note \\p rocsparse_bsrilu0_zero_pivot is a blocking function. It might negatively influence\n performance.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[inout]\n position pointer to zero pivot \\f$j\\f$, which can be in host or device memory.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p info or \\p position pointer is\n invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_zero_pivot zero pivot has been found."]
pub fn rocsparse_bsrilu0_zero_pivot(
handle: rocsparse_handle,
info: rocsparse_mat_info,
position: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n \\p rocsparse_bsrilu0_numeric_boost enables the user to replace a numerical value in\n an incomplete LU factorization. \\p tol is used to determine whether a numerical value\n is replaced by \\p boost_val, such that \\f$A_{j,j} = \\text{boost_val}\\f$ if\n \\f$\\text{tol} \\ge \\left|A_{j,j}\\right|\\f$.\n\n \\note The boost value is enabled by setting \\p enable_boost to 1 or disabled by\n setting \\p enable_boost to 0.\n\n \\note \\p tol and \\p boost_val can be in host or device memory.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[in]\n enable_boost enable/disable numeric boost.\n @param[in]\n boost_tol tolerance to determine whether a numerical value is replaced or not.\n @param[in]\n boost_val boost value to replace a numerical value.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p info, \\p tol, or \\p boost_val pointer\n is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n/\n/**@{"]
pub fn rocsparse_sbsrilu0_numeric_boost(
handle: rocsparse_handle,
info: rocsparse_mat_info,
enable_boost: ::std::os::raw::c_int,
boost_tol: *const f32,
boost_val: *const f32,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dbsrilu0_numeric_boost(
handle: rocsparse_handle,
info: rocsparse_mat_info,
enable_boost: ::std::os::raw::c_int,
boost_tol: *const f64,
boost_val: *const f64,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cbsrilu0_numeric_boost(
handle: rocsparse_handle,
info: rocsparse_mat_info,
enable_boost: ::std::os::raw::c_int,
boost_tol: *const f32,
boost_val: *const rocsparse_float_complex,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zbsrilu0_numeric_boost(
handle: rocsparse_handle,
info: rocsparse_mat_info,
enable_boost: ::std::os::raw::c_int,
boost_tol: *const f64,
boost_val: *const rocsparse_double_complex,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dsbsrilu0_numeric_boost(
handle: rocsparse_handle,
info: rocsparse_mat_info,
enable_boost: ::std::os::raw::c_int,
boost_tol: *const f64,
boost_val: *const f32,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcbsrilu0_numeric_boost(
handle: rocsparse_handle,
info: rocsparse_mat_info,
enable_boost: ::std::os::raw::c_int,
boost_tol: *const f64,
boost_val: *const rocsparse_float_complex,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n \\p rocsparse_bsrilu0_buffer_size returns the size of the temporary storage buffer\n that is required by \\ref rocsparse_sbsrilu0_analysis \"rocsparse_Xbsrilu0_analysis()\" and\n \\ref rocsparse_sbsrilu0 \"rocsparse_Xbsrilu0()\". The temporary storage buffer must be allocated\n by the user. The size of the temporary storage buffer is identical to the size returned by\n \\ref rocsparse_sbsrsv_buffer_size \"rocsparse_Xbsrsv_buffer_size()\" and\n \\ref rocsparse_sbsric0_buffer_size \"rocsparse_Xbsric0_buffer_size()\" if the matrix sparsity\n pattern is identical. The user-allocated buffer can therefore be shared between subsequent calls\n to those functions.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir direction that specifies whether to count non-zero elements by \\ref rocsparse_direction_row or by\n \\ref rocsparse_direction_column.\n @param[in]\n mb number of block rows in the sparse BSR matrix.\n @param[in]\n nnzb number of non-zero block entries of the sparse BSR matrix.\n @param[in]\n descr descriptor of the sparse BSR matrix.\n @param[in]\n bsr_val array of length \\p nnzb*block_dim*block_dim containing the values of the sparse BSR matrix.\n @param[in]\n bsr_row_ptr array of \\p mb+1 elements that point to the start of every block row of the\n sparse BSR matrix.\n @param[in]\n bsr_col_ind array of \\p nnzb elements containing the block column indices of the sparse BSR matrix.\n @param[in]\n block_dim the block dimension of the BSR matrix. Between 1 and m, where \\p m=mb*block_dim.\n @param[out]\n info structure that holds the information collected during the analysis step.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n \\ref rocsparse_sbsrilu0_analysis \"rocsparse_Xbsrilu0_analysis()\" and\n \\ref rocsparse_sbsrilu0 \"rocsparse_Xbsrilu0()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nnzb, or \\p block_dim is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p bsr_val, \\p bsr_row_ptr,\n \\p bsr_col_ind, \\p info, or \\p buffer_size pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n/\n/**@{"]
pub fn rocsparse_sbsrilu0_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const f32,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dbsrilu0_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const f64,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cbsrilu0_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_float_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zbsrilu0_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_double_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n \\p rocsparse_bsrilu0_analysis performs the analysis step for\n \\ref rocsparse_sbsrilu0 \"rocsparse_Xbsrilu0()\". It is expected that this function will\n be executed only once for a given matrix. The analysis metadata can be cleared by\n \\ref rocsparse_bsrilu0_clear().\n\n \\p rocsparse_bsrilu0_analysis can share its metadata with\n \\ref rocsparse_sbsric0_analysis \"rocsparse_Xbsric0_analysis()\",\n \\ref rocsparse_sbsrsv_analysis \"rocsparse_Xbsrsv_analysis()\", and\n \\ref rocsparse_sbsrsm_analysis \"rocsparse_Xbsrsm_analysis()\". Selecting\n \\ref rocsparse_analysis_policy_reuse policy can greatly improve the computation\n performance of metadata. However, the user needs to ensure that the sparsity\n pattern remains unchanged. If this cannot be assured,\n \\ref rocsparse_analysis_policy_force must be used.\n\n \\note\n If the matrix sparsity pattern changes, the gathered information will become invalid.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir direction that specified whether to count non-zero elements by\n \\ref rocsparse_direction_row or by \\ref rocsparse_direction_column.\n @param[in]\n mb number of block rows in the sparse BSR matrix.\n @param[in]\n nnzb number of non-zero block entries of the sparse BSR matrix.\n @param[in]\n descr descriptor of the sparse BSR matrix.\n @param[in]\n bsr_val array of length \\p nnzb*block_dim*block_dim containing the values of the sparse BSR matrix.\n @param[in]\n bsr_row_ptr array of \\p mb+1 elements that point to the start of every block row of the\n sparse BSR matrix.\n @param[in]\n bsr_col_ind array of \\p nnzb elements containing the block column indices of the sparse BSR matrix.\n @param[in]\n block_dim the block dimension of the BSR matrix. Between 1 and m, where \\p m=mb*block_dim.\n @param[out]\n info structure that holds the information collected during\n the analysis step.\n @param[in]\n analysis \\ref rocsparse_analysis_policy_reuse or\n \\ref rocsparse_analysis_policy_force.\n @param[in]\n solve \\ref rocsparse_solve_policy_auto.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nnzb, or \\p block_dim is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p bsr_val, \\p bsr_row_ptr,\n \\p bsr_col_ind, \\p info, or \\p temp_buffer pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n/\n/**@{"]
pub fn rocsparse_sbsrilu0_analysis(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const f32,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dbsrilu0_analysis(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const f64,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cbsrilu0_analysis(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_float_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zbsrilu0_analysis(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *const rocsparse_double_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n \\p rocsparse_bsrilu0_clear deallocates all memory that was allocated by\n \\ref rocsparse_sbsrilu0_analysis \"rocsparse_Xbsrilu0_analysis()\". This is especially useful\n if memory is an issue and the analysis data is not required for further computation.\n\n \\note\n Calling \\p rocsparse_bsrilu0_clear is optional. All allocated resources will be\n cleared when the opaque \\ref rocsparse_mat_info struct is destroyed using\n \\ref rocsparse_destroy_mat_info().\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[inout]\n info structure that holds the information collected during the analysis step.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p info pointer is invalid.\n \\retval rocsparse_status_memory_error the buffer holding the metadata could not\n be deallocated.\n \\retval rocsparse_status_internal_error an internal error occurred."]
pub fn rocsparse_bsrilu0_clear(
handle: rocsparse_handle,
info: rocsparse_mat_info,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\brief Incomplete LU factorization with 0 fill-ins and no pivoting using the BSR storage\n format\n\n \\details\n \\p rocsparse_bsrilu0 computes the incomplete LU factorization with 0 fill-ins and no\n pivoting of a sparse \\f$mb \\times mb\\f$ BSR matrix \\f$A\\f$, such that\n \\f[\n A \\approx LU\n \\f]\n\n Computing the above incomplete LU factorization requires three steps to complete. First,\n determine the size of the required temporary storage buffer by calling\n \\ref rocsparse_sbsrilu0_buffer_size \"rocsparse_Xbsrilu0_buffer_size()\". After this buffer size\n has been determined, allocate the buffer and pass it to\n \\ref rocsparse_sbsrilu0_analysis \"rocsparse_Xbsrilu0_analysis()\". This will perform analysis on\n the sparsity pattern of the matrix. Finally, call \\p rocsparse_sbsrilu0, \\p rocsparse_dbsrilu0,\n \\p rocsparse_cbsrilu0, or \\p rocsparse_zbsrilu0 to perform the actual factorization. The calculation of\n the buffer size and the analysis of the sparse matrix only need to be performed once for a given sparsity\n pattern, while the factorization can be repeatedly applied to multiple matrices having the same sparsity\n pattern. After all calls to \\ref rocsparse_sbsrilu0 \"rocsparse_Xbsrilu0()\" are complete, the temporary\n buffer can be deallocated.\n\n \\p rocsparse_bsrilu0 reports the first zero pivot (either numerical or structural zero).\n The zero pivot status can be obtained by calling \\ref rocsparse_bsrilu0_zero_pivot().\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir direction that specified whether to count non-zero elements by\n \\ref rocsparse_direction_row or by \\ref rocsparse_direction_column.\n @param[in]\n mb number of block rows in the sparse BSR matrix.\n @param[in]\n nnzb number of non-zero block entries of the sparse BSR matrix.\n @param[in]\n descr descriptor of the sparse BSR matrix.\n @param[inout]\n bsr_val array of length \\p nnzb*block_dim*block_dim containing the values of the sparse BSR matrix.\n @param[in]\n bsr_row_ptr array of \\p mb+1 elements that point to the start of every block row of the\n sparse BSR matrix.\n @param[in]\n bsr_col_ind array of \\p nnzb elements containing the block column indices of the sparse BSR matrix.\n @param[in]\n block_dim the block dimension of the BSR matrix. Between 1 and m, where \\p m=mb*block_dim.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[in]\n policy \\ref rocsparse_solve_policy_auto.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nnzb, or \\p block_dim is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p bsr_val, \\p bsr_row_ptr,\n or \\p bsr_col_ind pointer is invalid.\n \\retval rocsparse_status_arch_mismatch the device is not supported.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n Consider the sparse \\f$m \\times m\\f$ matrix \\f$A\\f$, stored in the BSR\n storage format. The following example computes the incomplete LU factorization\n \\f$M \\approx LU\\f$ and solves the preconditioned system \\f$My = x\\f$.\n \\snippet example_rocsparse_bsrilu0.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sbsrilu0(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *mut f32,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dbsrilu0(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *mut f64,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cbsrilu0(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *mut rocsparse_float_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zbsrilu0(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nnzb: rocsparse_int,
descr: rocsparse_mat_descr,
bsr_val: *mut rocsparse_double_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
block_dim: rocsparse_int,
info: rocsparse_mat_info,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n \\p rocsparse_csric_zero_pivot returns \\ref rocsparse_status_zero_pivot if either a\n structural or numerical zero has been found during \\ref rocsparse_scsric0 \"rocsparse_Xcsric0()\"\n computation. The first zero pivot \\f$j\\f$ at \\f$A_{j,j}\\f$ is stored in \\p position, using\n the same index base as the CSR matrix.\n\n \\p position can be in host or device memory. If no zero pivot has been found,\n \\p position is set to -1 and \\ref rocsparse_status_success is returned instead.\n\n \\note \\p rocsparse_csric0_zero_pivot is a blocking function. It might negatively influence\n performance.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[inout]\n position pointer to zero pivot \\f$j\\f$, which can be in host or device memory.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p info or \\p position pointer is\n invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_zero_pivot zero pivot has been found."]
pub fn rocsparse_csric0_zero_pivot(
handle: rocsparse_handle,
info: rocsparse_mat_info,
position: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n rocsparse_csric0_singular_pivot() returns the position of a\n numerical singular pivot (where \\f$|L_{j,j}| \\leq \\text{tolerance}\\f$)\n that has been found during \\ref rocsparse_scsric0 \"rocsparse_Xcsric0()\" computation.\n The first singular pivot \\f$j\\f$ at \\f$L_{j,j}\\f$ is stored in \\p position, using the\n same index base as the CSR matrix.\n\n \\p position can be in host or device memory. If no singular pivot has been found,\n \\p position is set to -1.\n\n \\note rocsparse_csric0_singular_pivot() is a blocking function. It might negatively influence\n performance.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[inout]\n position pointer to singular pivot \\f$k\\f$, which can be in host or device memory.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p info or \\p position pointer is\n invalid.\n \\retval rocsparse_status_internal_error an internal error occurred."]
pub fn rocsparse_csric0_singular_pivot(
handle: rocsparse_handle,
info: rocsparse_mat_info,
position: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n rocsparse_csric0_set_tolerance() sets the numerical tolerance for detecting a\n numerical singular pivot (where \\f$|L_{j,j}| \\leq \\text{tolerance}\\f$)\n that might be found during \\ref rocsparse_scsric0 \"rocsparse_Xcsric0()\" computation.\n\n\n \\note rocsparse_csric0_set_tolerance() is a blocking function. It might negatively influence\n performance.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[in]\n tolerance tolerance for detecting singular pivot (\\f$|L_{j,j}| \\leq \\text{tolerance}\\f$).\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer if \\p info tolerance pointer is\n invalid"]
pub fn rocsparse_csric0_set_tolerance(
handle: rocsparse_handle,
info: rocsparse_mat_info,
tolerance: f64,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n rocsparse_csric0_get_tolerance() returns the numerical tolerance for detecting a\n numerical singular pivot (where \\f$|L_{j,j}| \\leq \\text{tolerance}\\f$)\n that might be found during \\ref rocsparse_scsric0 \"rocsparse_Xcsric0()\" computation.\n\n\n \\note rocsparse_csric0_get_tolerance() is a blocking function. It might negatively influence\n performance.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[out]\n tolerance obtain tolerance for detecting singular pivot (\\f$|L_{j,j}| \\leq \\text{tolerance}\\f$).\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer if \\p info or \\p tolerance pointer is\n invalid"]
pub fn rocsparse_csric0_get_tolerance(
handle: rocsparse_handle,
info: rocsparse_mat_info,
tolerance: *mut f64,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n \\p rocsparse_csric0_buffer_size returns the size of the temporary storage buffer\n that is required by \\ref rocsparse_scsric0_analysis \"rocsparse_Xcsric0_analysis()\".\n The temporary storage buffer must be allocated by the user. The size of the temporary\n storage buffer is identical to the size returned by\n \\ref rocsparse_scsrsv_buffer_size \"rocsparse_Xcsrsv_buffer_size()\" and\n \\ref rocsparse_scsrilu0_buffer_size \"rocsparse_Xcsrilu0_buffer_size()\" if the matrix\n sparsity pattern is identical. The user-allocated buffer can therefore be shared between\n subsequent calls to those functions.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix.\n @param[in]\n descr descriptor of the sparse CSR matrix.\n @param[in]\n csr_val array of \\p nnz elements of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix.\n @param[out]\n info structure that holds the information collected during the analysis step.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n \\ref rocsparse_scsric0_analysis \"rocsparse_Xcsric0_analysis()\" and\n \\ref rocsparse_scsric0 \"rocsparse_Xcsric0()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p csr_val, \\p csr_row_ptr,\n \\p csr_col_ind, \\p info, or \\p buffer_size pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n/\n/**@{"]
pub fn rocsparse_scsric0_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsric0_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsric0_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsric0_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n \\p rocsparse_csric0_analysis performs the analysis step for\n \\ref rocsparse_scsric0 \"rocsparse_Xcsric0()\". It is expected that this function will be\n executed only once for a given matrix and particular operation type. The analysis metadata\n can be cleared by \\ref rocsparse_csric0_clear().\n\n \\p rocsparse_csric0_analysis can share its metadata with\n \\ref rocsparse_scsrilu0_analysis \"rocsparse_Xcsrilu0_analysis()\",\n \\ref rocsparse_scsrsv_analysis \"rocsparse_Xcsrsv_analysis()\", and\n \\ref rocsparse_scsrsm_analysis \"rocsparse_Xcsrsm_analysis()\". Selecting\n \\ref rocsparse_analysis_policy_reuse policy can greatly improve the computation\n performance of metadata. However, the user needs to ensure that the sparsity\n pattern remains unchanged. If this cannot be assured,\n \\ref rocsparse_analysis_policy_force has to be used.\n\n \\note\n If the matrix sparsity pattern changes, the gathered information will become invalid.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix.\n @param[in]\n descr descriptor of the sparse CSR matrix.\n @param[in]\n csr_val array of \\p nnz elements of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix.\n @param[out]\n info structure that holds the information collected during\n the analysis step.\n @param[in]\n analysis \\ref rocsparse_analysis_policy_reuse or\n \\ref rocsparse_analysis_policy_force.\n @param[in]\n solve \\ref rocsparse_solve_policy_auto.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p csr_val, \\p csr_row_ptr,\n \\p csr_col_ind, \\p info, or \\p temp_buffer pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n/\n/**@{"]
pub fn rocsparse_scsric0_analysis(
handle: rocsparse_handle,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsric0_analysis(
handle: rocsparse_handle,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsric0_analysis(
handle: rocsparse_handle,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsric0_analysis(
handle: rocsparse_handle,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n \\p rocsparse_csric0_clear deallocates all memory that was allocated by\n \\ref rocsparse_scsric0_analysis \"rocsparse_Xcsric0_analysis()\". This is especially\n useful if memory is an issue and the analysis data is not required for further\n computation.\n\n \\note\n Calling \\p rocsparse_csric0_clear is optional. All allocated resources will be\n cleared when the opaque \\ref rocsparse_mat_info struct is destroyed using\n \\ref rocsparse_destroy_mat_info().\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[inout]\n info structure that holds the information collected during the analysis step.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p info pointer is invalid.\n \\retval rocsparse_status_memory_error the buffer holding the metadata could not\n be deallocated.\n \\retval rocsparse_status_internal_error an internal error occurred."]
pub fn rocsparse_csric0_clear(
handle: rocsparse_handle,
info: rocsparse_mat_info,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\brief Incomplete Cholesky factorization with 0 fill-ins and no pivoting using the CSR\n storage format.\n\n \\details\n \\p rocsparse_csric0 computes the incomplete Cholesky factorization with 0 fill-ins\n and no pivoting of a sparse \\f$m \\times m\\f$ CSR matrix \\f$A\\f$, such that\n \\f[\n A \\approx LL^T\n \\f]\n where the lower triangular matrix \\f$L\\f$ is computed using:\n \\f[\n L_{ij} = \\left\\{\n \\begin{array}{ll}\n \\sqrt{A_{jj} - \\sum_{k=0}^{j-1}(L_{jk})^{2}}, & \\text{if i == j} \\\\\n \\frac{1}{L_{jj}}(A_{ij} - \\sum_{k=0}^{j-1}L_{ik} \\times L_{jk}), & \\text{if i > j}\n \\end{array}\n \\right.\n \\f]\n for each entry found in the CSR matrix \\f$A\\f$.\n\n Computing the above incomplete Cholesky factorization requires three steps to complete. First,\n determine the size of the required temporary storage buffer by calling\n \\ref rocsparse_scsric0_buffer_size \"rocsparse_Xcsric0_buffer_size()\". After this buffer size has been determined,\n allocate the buffer and pass it to \\ref rocsparse_scsric0_analysis \"rocsparse_Xcsric0_analysis()\".\n This will perform analysis on the sparsity pattern of the matrix. Finally, call \\p rocsparse_scsric0,\n \\p rocsparse_dcsric0, \\p rocsparse_ccsric0, or \\p rocsparse_zcsric0 to perform the actual factorization. The calculation\n of the buffer size and the analysis of the sparse matrix only need to be performed once for a given sparsity pattern,\n while the factorization can be repeatedly applied to multiple matrices having the same sparsity pattern. After all calls\n to \\ref rocsparse_scsric0 \"rocsparse_Xcsric0()\" are complete, the temporary buffer can be deallocated.\n\n When computing the Cholesky factorization, it is possible that \\f$L_{jj} == 0\\f$, which would result in a division by zero.\n This could occur from either \\f$A_{jj}\\f$ not existing in the sparse CSR matrix (referred to as a structural zero) or because\n \\f$A_{jj} - \\sum_{k=0}^{j-1}(L_{jk})^{2} == 0\\f$ (referred to as a numerical zero). For example, running the Cholesky\n factorization on the following matrix:\n \\f[\n \\begin{bmatrix}\n 2 & 1 & 0 \\\\\n 1 & 2 & 1 \\\\\n 0 & 1 & 2\n \\end{bmatrix}\n \\f]\n results in a successful Cholesky factorization, however running with the matrix:\n \\f[\n \\begin{bmatrix}\n 2 & 1 & 0 \\\\\n 1 & 1/2 & 1 \\\\\n 0 & 1 & 2\n \\end{bmatrix}\n \\f]\n results in a numerical zero because:\n \\f[\n \\begin{array}{ll}\n L_{00} &= \\sqrt{2} \\\\\n L_{10} &= \\frac{1}{\\sqrt{2}} \\\\\n L_{11} &= \\sqrt{\\frac{1}{2} - (\\frac{1}{\\sqrt{2}})^2}\n &= 0\n \\end{array}\n \\f]\n The user can detect the presence of a structural zero by calling \\ref rocsparse_csric0_zero_pivot() after\n \\ref rocsparse_scsric0_analysis \"rocsparse_Xcsric0_analysis()\" and/or the presence of a structural or\n numerical zero by calling \\ref rocsparse_csric0_zero_pivot() after \\ref rocsparse_scsric0 \"rocsparse_Xcsric0()\":\n \\code{.c}\n rocsparse_dcsric0(handle,\n m,\n nnz,\n descr_M,\n csr_val,\n csr_row_ptr,\n csr_col_ind,\n info,\n rocsparse_solve_policy_auto,\n temp_buffer);\n\n // Check for zero pivot\n if(rocsparse_status_zero_pivot == rocsparse_csric0_zero_pivot(handle,\n info,\n &position))\n {\n printf(\"L has structural and/or numerical zero at L(%d,%d)\\n\", position, position);\n }\n \\endcode\n In both cases, \\ref rocsparse_csric0_zero_pivot() will report the first zero pivot (either numerical or structural)\n found. See the full example below. The user can also set the diagonal type to be \\f$1\\f$ using \\ref rocsparse_set_mat_diag_type(),\n which will interpret the matrix \\f$A\\f$ as having ones on its diagonal (even if no non-zero exists in the sparsity pattern).\n\n \\p rocsparse_csric0 computes the Cholesky factorization inplace, meaning that the values array \\p csr_val of the \\f$A\\f$\n matrix is overwritten with the \\f$L\\f$ matrix stored in the lower triangular part of \\f$A\\f$:\n\n \\f[\n \\begin{align}\n \\begin{bmatrix}\n a_{00} & a_{01} & a_{02} \\\\\n a_{10} & a_{11} & a_{12} \\\\\n a_{20} & a_{21} & a_{22}\n \\end{bmatrix}\n \\rightarrow\n \\begin{bmatrix}\n l_{00} & a_{01} & a_{02} \\\\\n l_{10} & l_{11} & a_{12} \\\\\n l_{20} & l_{21} & l_{22}\n \\end{bmatrix}\n \\end{align}\n \\f]\n The row pointer array \\p csr_row_ptr and the column indices array \\p csr_col_ind remain the same for \\f$A\\f$ and the output, as\n the incomplete factorization does not generate new non-zeros in the output which do not already exist in \\f$A\\f$.\n\n The performance of computing the Cholesky factorization with rocSPARSE greatly depends on the sparsity pattern\n of the matrix \\f$A\\f$, as this is what determines the amount of parallelism available.\n\n \\note\n The sparse CSR matrix has to be sorted. This can be achieved by calling\n rocsparse_csrsort().\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix.\n @param[in]\n descr descriptor of the sparse CSR matrix.\n @param[inout]\n csr_val array of \\p nnz elements of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start\n of every row of the sparse CSR matrix.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[in]\n policy \\ref rocsparse_solve_policy_auto.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p csr_val, \\p csr_row_ptr,\n or \\p csr_col_ind pointer is invalid.\n \\retval rocsparse_status_arch_mismatch the device is not supported.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n Consider the sparse \\f$m \\times m\\f$ matrix \\f$A\\f$, stored in the CSR\n storage format. The following example computes the incomplete Cholesky factorization\n \\f$M \\approx LL^T\\f$ and solves the preconditioned system \\f$My = x\\f$.\n \\snippet example_rocsparse_csric0.cpp doc example\n/\n/**@{"]
pub fn rocsparse_scsric0(
handle: rocsparse_handle,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *mut f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsric0(
handle: rocsparse_handle,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *mut f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsric0(
handle: rocsparse_handle,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *mut rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsric0(
handle: rocsparse_handle,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *mut rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n \\p rocsparse_csrilu0_zero_pivot returns \\ref rocsparse_status_zero_pivot if either a\n structural or numerical zero has been found during \\ref rocsparse_scsrilu0 \"rocsparse_Xcsrilu0()\"\n computation. The first zero pivot \\f$j\\f$ at \\f$A_{j,j}\\f$ is stored in \\p position, using the same index\n base as the CSR matrix.\n\n \\p position can be in host or device memory. If no zero pivot has been found,\n \\p position is set to -1 and \\ref rocsparse_status_success is returned instead.\n\n \\note \\p rocsparse_csrilu0_zero_pivot is a blocking function. It might negatively influence\n performance.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[inout]\n position pointer to zero pivot \\f$j\\f$, which can be in host or device memory.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p info or \\p position pointer is\n invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_zero_pivot zero pivot has been found."]
pub fn rocsparse_csrilu0_zero_pivot(
handle: rocsparse_handle,
info: rocsparse_mat_info,
position: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n rocsparse_csrilu0_set_tolerance() sets the numerical tolerance for detecting a\n near numerical zero entry during \\ref rocsparse_scsrilu0 \"rocsparse_Xcsrilu0()\"\n computation. The first singular pivot \\f$j\\f$ at \\f$|A_{j,j}| \\leq \\text{tolerance}\\f$.\n\n\n \\note rocsparse_csrilu0_set_tolerance() is a blocking function. It might negatively influence\n performance.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[in]\n tolerance tolerance value to determine singular pivot \\f$|A_{j,j}| \\leq \\text{tolerance}\\f$,\n where variable tolerance is in host memory.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p info pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred."]
pub fn rocsparse_csrilu0_set_tolerance(
handle: rocsparse_handle,
info: rocsparse_mat_info,
tolerance: f64,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n rocsparse_csrilu0_get_tolerance() returns the numerical tolerance for detecting\n a near numerical zero entry during \\ref rocsparse_scsrilu0 \"rocsparse_Xcsrilu0()\"\n computation. The first singular pivot \\f$j\\f$ at \\f$|A_{j,j}| \\leq \\text{tolerance}\\f$.\n\n \\note rocsparse_csrilu0_get_tolerance() is a blocking function. It might negatively influence\n performance.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[out]\n tolerance obtain tolerance value to determine the singular pivot \\f$|A_{j,j}| \\leq \\text{tolerance}\\f$,\n where variable tolerance is in host memory.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p info or tolerance pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred."]
pub fn rocsparse_csrilu0_get_tolerance(
handle: rocsparse_handle,
info: rocsparse_mat_info,
tolerance: *mut f64,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n rocsparse_csrilu0_singular_pivot() returns the position of a\n near numerical zero entry that has been found during \\ref rocsparse_scsrilu0 \"rocsparse_Xcsrilu0()\"\n computation. The first singular pivot \\f$j\\f$ at \\f$|A_{j,j}| \\leq \\text{tolerance}\\f$ is stored\n in \\p position, using the same index base as the CSR matrix.\n\n \\p position can be in host or device memory. If no singular pivot has been found,\n \\p position is set to -1.\n\n \\note rocsparse_csrilu0_singular_pivot() is a blocking function. It might influence\n performance negatively.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[inout]\n position pointer to singular pivot \\f$j\\f$, which can be in host or device memory.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p info or \\p position pointer is\n invalid.\n \\retval rocsparse_status_internal_error an internal error occurred."]
pub fn rocsparse_csrilu0_singular_pivot(
handle: rocsparse_handle,
info: rocsparse_mat_info,
position: *mut rocsparse_int,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n \\p rocsparse_csrilu0_numeric_boost enables the user to replace a numerical value in\n an incomplete LU factorization. \\p tol is used to determine whether a numerical value\n is replaced by \\p boost_val, such that \\f$A_{j,j} = \\text{boost_val}\\f$ if\n \\f$\\text{tol} \\ge \\left|A_{j,j}\\right|\\f$.\n\n \\note The boost value is enabled by setting \\p enable_boost to 1 or disabled by\n setting \\p enable_boost to 0.\n\n \\note \\p tol and \\p boost_val can be in host or device memory.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[in]\n enable_boost enable/disable numeric boost.\n @param[in]\n boost_tol tolerance to determine whether a numerical value is replaced or not.\n @param[in]\n boost_val boost value to replace a numerical value.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p info, \\p tol, or \\p boost_val pointer\n is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n/\n/**@{"]
pub fn rocsparse_scsrilu0_numeric_boost(
handle: rocsparse_handle,
info: rocsparse_mat_info,
enable_boost: ::std::os::raw::c_int,
boost_tol: *const f32,
boost_val: *const f32,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsrilu0_numeric_boost(
handle: rocsparse_handle,
info: rocsparse_mat_info,
enable_boost: ::std::os::raw::c_int,
boost_tol: *const f64,
boost_val: *const f64,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsrilu0_numeric_boost(
handle: rocsparse_handle,
info: rocsparse_mat_info,
enable_boost: ::std::os::raw::c_int,
boost_tol: *const f32,
boost_val: *const rocsparse_float_complex,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsrilu0_numeric_boost(
handle: rocsparse_handle,
info: rocsparse_mat_info,
enable_boost: ::std::os::raw::c_int,
boost_tol: *const f64,
boost_val: *const rocsparse_double_complex,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dscsrilu0_numeric_boost(
handle: rocsparse_handle,
info: rocsparse_mat_info,
enable_boost: ::std::os::raw::c_int,
boost_tol: *const f64,
boost_val: *const f32,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dccsrilu0_numeric_boost(
handle: rocsparse_handle,
info: rocsparse_mat_info,
enable_boost: ::std::os::raw::c_int,
boost_tol: *const f64,
boost_val: *const rocsparse_float_complex,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n \\p rocsparse_csrilu0_buffer_size returns the size of the temporary storage buffer\n that is required by \\ref rocsparse_scsrilu0_analysis \"rocsparse_Xcsrilu0_analysis()\" and\n \\ref rocsparse_scsrilu0 \"rocsparse_Xcsrilu0()\". The temporary storage buffer must be allocated\n by the user. The size of the temporary storage buffer is identical to the size returned by\n \\ref rocsparse_scsrsv_buffer_size \"rocsparse_Xcsrsv_buffer_size()\" if the matrix sparsity pattern\n is identical. The user-allocated buffer can therefore be shared between subsequent calls to those functions.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix.\n @param[in]\n descr descriptor of the sparse CSR matrix.\n @param[in]\n csr_val array of \\p nnz elements of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix.\n @param[out]\n info structure that holds the information collected during the analysis step.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n \\ref rocsparse_scsrilu0_analysis \"rocsparse_Xcsrilu0_analysis()\" and\n \\ref rocsparse_scsrilu0 \"rocsparse_Xcsrilu0()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p csr_val, \\p csr_row_ptr,\n \\p csr_col_ind, \\p info, or \\p buffer_size pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n/\n/**@{"]
pub fn rocsparse_scsrilu0_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsrilu0_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsrilu0_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsrilu0_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n \\p rocsparse_csrilu0_analysis performs the analysis step for \\ref rocsparse_scsrilu0 \"rocsparse_Xcsrilu0()\".\n It is expected that this function will be executed only once for a given matrix and particular\n operation type. The analysis metadata can be cleared by \\ref rocsparse_csrilu0_clear().\n\n \\p rocsparse_csrilu0_analysis can share its meta data with\n \\ref rocsparse_scsric0_analysis \"rocsparse_Xcsric0_analysis()\",\n \\ref rocsparse_scsrsv_analysis \"rocsparse_Xcsrsv_analysis()\", and\n \\ref rocsparse_scsrsm_analysis \"rocsparse_Xcsrsm_analysis()\". Selecting\n \\ref rocsparse_analysis_policy_reuse policy can greatly improve the computation\n performance of metadata. However, the user needs to ensure that the sparsity\n pattern remains unchanged. If this cannot be assured,\n \\ref rocsparse_analysis_policy_force must be used.\n\n \\note\n If the matrix sparsity pattern changes, the gathered information will become invalid.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix.\n @param[in]\n descr descriptor of the sparse CSR matrix.\n @param[in]\n csr_val array of \\p nnz elements of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix.\n @param[out]\n info structure that holds the information collected during\n the analysis step.\n @param[in]\n analysis \\ref rocsparse_analysis_policy_reuse or\n \\ref rocsparse_analysis_policy_force.\n @param[in]\n solve \\ref rocsparse_solve_policy_auto.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p csr_val, \\p csr_row_ptr,\n \\p csr_col_ind, \\p info, or \\p temp_buffer pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n/\n/**@{"]
pub fn rocsparse_scsrilu0_analysis(
handle: rocsparse_handle,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsrilu0_analysis(
handle: rocsparse_handle,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsrilu0_analysis(
handle: rocsparse_handle,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsrilu0_analysis(
handle: rocsparse_handle,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
analysis: rocsparse_analysis_policy,
solve: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n \\p rocsparse_csrilu0_clear deallocates all memory that was allocated by\n \\ref rocsparse_scsrilu0_analysis \"rocsparse_Xcsrilu0_analysis()\". This is especially\n useful if memory is an issue and the analysis data is not required for further\n computation.\n\n \\note\n Calling \\p rocsparse_csrilu0_clear is optional. All allocated resources will be\n cleared when the opaque \\ref rocsparse_mat_info struct is destroyed using\n \\ref rocsparse_destroy_mat_info().\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[inout]\n info structure that holds the information collected during the analysis step.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p info pointer is invalid.\n \\retval rocsparse_status_memory_error the buffer holding the metadata could not\n be deallocated.\n \\retval rocsparse_status_internal_error an internal error occurred."]
pub fn rocsparse_csrilu0_clear(
handle: rocsparse_handle,
info: rocsparse_mat_info,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\brief Incomplete LU factorization with 0 fill-ins and no pivoting using the CSR\n storage format.\n\n \\details\n \\p rocsparse_csrilu0 computes the incomplete LU factorization with 0 fill-ins and no\n pivoting of a sparse \\f$m \\times m\\f$ CSR matrix \\f$A\\f$, such that\n \\f[\n A \\approx LU\n \\f]\n where the lower triangular matrix \\f$L\\f$ and the upper triangular matrix \\f$U\\f$ are computed using:\n \\f[\n \\begin{array}{ll}\n L_{ij} = \\frac{1}{U_{jj}}(A_{ij} - \\sum_{k=0}^{j-1}L_{ik} \\times U_{kj}), & \\text{if i > j} \\\\\n U_{ij} = (A_{ij} - \\sum_{k=0}^{j-1}L_{ik} \\times U_{kj}), & \\text{if i <= j}\n \\end{array}\n \\f]\n for each entry found in the CSR matrix \\f$A\\f$.\n\n Computing the above incomplete \\f$LU\\f$ factorization requires three steps to complete. First,\n determine the size of the required temporary storage buffer by calling\n \\ref rocsparse_scsrilu0_buffer_size \"rocsparse_Xcsrilu0_buffer_size()\". After this buffer size has been determined,\n allocate the buffer and pass it to \\ref rocsparse_scsrilu0_analysis \"rocsparse_Xcsrilu0_analysis()\".\n This will perform analysis on the sparsity pattern of the matrix. Finally, call \\p rocsparse_scsrilu0,\n \\p rocsparse_dcsrilu0, \\p rocsparse_ccsrilu0, or \\p rocsparse_zcsrilu0 to perform the actual factorization. The calculation\n of the buffer size and the analysis of the sparse matrix only need to be performed once for a given sparsity pattern\n while the factorization can be repeatedly applied to multiple matrices having the same sparsity pattern. After all calls\n to \\ref rocsparse_scsrilu0 \"rocsparse_Xcsrilu0()\" are complete, the temporary buffer can be deallocated.\n\n When computing the \\f$LU\\f$ factorization, it is possible that \\f$U_{jj} == 0\\f$, which would result in a division by zero.\n This could occur from either \\f$A_{jj}\\f$ not existing in the sparse CSR matrix (referred to as a structural zero) or because\n \\f$A_{ij} - \\sum_{k=0}^{j-1}L_{ik} \\times U_{kj} == 0\\f$ (referred to as a numerical zero). For example, running the\n \\f$LU\\f$ factorization on the following matrix:\n \\f[\n \\begin{bmatrix}\n 2 & 1 & 0 \\\\\n 1 & 2 & 1 \\\\\n 0 & 1 & 2\n \\end{bmatrix}\n \\f]\n results in a successful \\f$LU\\f$ factorization. However, running with the matrix:\n \\f[\n \\begin{bmatrix}\n 2 & 1 & 0 \\\\\n 1 & 1/2 & 1 \\\\\n 0 & 1 & 2\n \\end{bmatrix}\n \\f]\n results in a numerical zero because:\n \\f[\n \\begin{array}{ll}\n U_{00} &= 2 \\\\\n U_{01} &= 1 \\\\\n L_{10} &= \\frac{1}{2} \\\\\n U_{11} &= \\frac{1}{2} - \\frac{1}{2}\n &= 0\n \\end{array}\n \\f]\n The user can detect the presence of a structural zero by calling \\ref rocsparse_csrilu0_zero_pivot() after\n \\ref rocsparse_scsrilu0_analysis \"rocsparse_Xcsrilu0_analysis()\" and/or the presence of a structural or\n numerical zero by calling \\ref rocsparse_csrilu0_zero_pivot() after \\ref rocsparse_scsrilu0 \"rocsparse_Xcsric0()\".\n In both cases, \\ref rocsparse_csrilu0_zero_pivot() will report the first zero pivot (either numerical or structural)\n found. See the example below. The user can also set the diagonal type to be \\f$1\\f$ using \\ref rocsparse_set_mat_diag_type(),\n which will interpret the matrix \\f$A\\f$ as having ones on its diagonal (even if no non-zero exists in the sparsity pattern).\n\n \\p rocsparse_csrilu0 computes the \\f$LU\\f$ factorization inplace, meaning that the values array \\p csr_val of the \\f$A\\f$\n matrix is overwritten with the \\f$L\\f$ matrix stored in the strictly lower triangular part of \\f$A\\f$ and the \\f$U\\f$ matrix\n stored in the upper part of \\f$A\\f$:\n\n \\f[\n \\begin{align}\n \\begin{bmatrix}\n a_{00} & a_{01} & a_{02} \\\\\n a_{10} & a_{11} & a_{12} \\\\\n a_{20} & a_{21} & a_{22}\n \\end{bmatrix}\n \\rightarrow\n \\begin{bmatrix}\n u_{00} & u_{01} & u_{02} \\\\\n l_{10} & u_{11} & u_{12} \\\\\n l_{20} & l_{21} & u_{22}\n \\end{bmatrix}\n \\end{align}\n \\f]\n The row pointer array \\p csr_row_ptr and the column indices array \\p csr_col_ind remain the same for \\f$A\\f$ and \\f$LU\\f$, as\n the incomplete factorization does not generate new non-zeros in \\f$LU\\f$ which do not already exist in \\f$A\\f$.\n\n The performance of computing \\f$LU\\f$ factorization with rocSPARSE greatly depends on the sparsity pattern\n the the matrix \\f$A\\f$, as this is what determines the amount of parallelism available.\n\n \\note\n The sparse CSR matrix has to be sorted. This can be achieved by calling\n rocsparse_csrsort().\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix.\n @param[in]\n descr descriptor of the sparse CSR matrix.\n @param[inout]\n csr_val array of \\p nnz elements of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start\n of every row of the sparse CSR matrix.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix.\n @param[in]\n info structure that holds the information collected during the analysis step.\n @param[in]\n policy \\ref rocsparse_solve_policy_auto.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p csr_val, \\p csr_row_ptr,\n or \\p csr_col_ind pointer is invalid.\n \\retval rocsparse_status_arch_mismatch the device is not supported.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_not_implemented\n \\ref rocsparse_matrix_type != \\ref rocsparse_matrix_type_general.\n\n \\par Example\n Consider the sparse \\f$m \\times m\\f$ matrix \\f$A\\f$, stored in CSR\n storage format. The following example computes the incomplete LU factorization\n \\f$M \\approx LU\\f$ and solves the preconditioned system \\f$My = x\\f$.\n \\snippet example_rocsparse_csrilu0.cpp doc example\n/\n/**@{"]
pub fn rocsparse_scsrilu0(
handle: rocsparse_handle,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *mut f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsrilu0(
handle: rocsparse_handle,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *mut f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsrilu0(
handle: rocsparse_handle,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *mut rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsrilu0(
handle: rocsparse_handle,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *mut rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
info: rocsparse_mat_info,
policy: rocsparse_solve_policy,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n \\p rocsparse_csritilu0_buffer_size computes the size in bytes of the buffer that must be allocated by the user.\n This buffer is then used in \\ref rocsparse_csritilu0_preprocess, \\ref rocsparse_scsritilu0_compute \"rocsparse_Xcsritilu0_compute()\",\n \\ref rocsparse_scsritilu0_compute_ex \"rocsparse_Xcsritilu0_compute_ex()\", and \\ref rocsparse_scsritilu0_history \"rocsparse_Xcsritilu0_history()\".\n\n \\note\n The sparse CSR matrix has to be sorted. This can be achieved by calling\n rocsparse_csrsort().\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n alg algorithm to use, \\ref rocsparse_itilu0_alg.\n @param[in]\n option combination of enumeration values from \\ref rocsparse_itilu0_option.\n @param[in]\n nmaxiter maximum number of iterations.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start\n of every row of the sparse CSR matrix.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n datatype Type of numerical values, \\ref rocsparse_datatype.\n @param[out]\n buffer_size size of the temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_value \\p alg, \\p base, or datatype is invalid.\n \\retval rocsparse_status_invalid_pointer \\p csr_row_ptr\n or \\p csr_col_ind pointer is invalid.\n \\retval rocsparse_status_zero_pivot if nnz is zero.\n \\retval rocsparse_status_internal_error an internal error occurred."]
pub fn rocsparse_csritilu0_buffer_size(
handle: rocsparse_handle,
alg: rocsparse_itilu0_alg,
option: rocsparse_int,
nmaxiter: rocsparse_int,
m: rocsparse_int,
nnz: rocsparse_int,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
datatype: rocsparse_datatype,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n \\p rocsparse_csritilu0_preprocess computes the information required to run \\ref rocsparse_scsritilu0_compute \"rocsparse_Xcsritilu0_compute()\"\n and \\ref rocsparse_scsritilu0_compute_ex \"rocsparse_Xcsritilu0_compute_ex()\" and stores it in the buffer.\n\n \\note\n The sparse CSR matrix has to be sorted. This can be achieved by calling\n rocsparse_csrsort().\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n alg algorithm to use, \\ref rocsparse_itilu0_alg.\n @param[in]\n option combination of enumeration values from \\ref rocsparse_itilu0_option.\n @param[in]\n nmaxiter maximum number of iterations.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start\n of every row of the sparse CSR matrix.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n datatype type of numerical values, \\ref rocsparse_datatype.\n @param[in]\n buffer_size size of the storage buffer allocated by the user.\n @param[in]\n buffer storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_value \\p alg, \\p base, or datatype is invalid.\n \\retval rocsparse_status_invalid_size \\p m or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p csr_row_ptr\n or \\p csr_col_ind pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n \\retval rocsparse_status_zero_pivot if a missing diagonal element is detected."]
pub fn rocsparse_csritilu0_preprocess(
handle: rocsparse_handle,
alg: rocsparse_itilu0_alg,
option: rocsparse_int,
nmaxiter: rocsparse_int,
m: rocsparse_int,
nnz: rocsparse_int,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
datatype: rocsparse_datatype,
buffer_size: usize,
buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\brief Iterative Incomplete LU factorization with 0 fill-ins and no pivoting using the CSR\n storage format.\n\n \\details\n \\p rocsparse_csritilu0_compute computes iteratively the incomplete LU factorization with 0 fill-ins and no\n pivoting of a sparse \\f$m \\times m\\f$ CSR matrix \\f$A\\f$, such that\n \\f[\n A \\approx (L + Id)(D + U)\n \\f]\n\n The following notation applies for the equations below: diag is the diagonal part, lower is the strict lower triangular part, and upper is the strict upper triangular part of a given matrix.\n Starting with \\f$L_{0} = lower(\\f$ \\p ilu0 \\f$)\\f$ and \\f$U_{0} = upper(\\f$ \\p ilu0 \\f$)\\f$, the method iterates with\n \\f[\n \\begin{eqnarray}\n R_k &=& A - L_{k} U_{k},\\\\\n D_{k+1} &=& diag(R_k),\\\\\n L_{k+1} &=& lower(R_k) D_{k+1}^{-1},\\\\\n U_{k+1} &=& upper(R_k),\n \\end{eqnarray}\n \\f]\n if \\f$ 0 \\le k \\lt \\f$ \\p nmaxiter and if\n \\f[\n \\Vert R_k \\Vert_{\\infty} \\gt \\epsilon \\Vert A \\Vert_{\\infty},\n \\f]\n with \\f$\\epsilon\\f$ = \\p tol. Note that the calculation of \\f$R_k\\f$ is performed with no fill-in.\n\n Computing the above iterative incomplete LU factorization requires three steps to complete. First,\n determine the size of the required temporary storage buffer by calling \\ref rocsparse_csritilu0_buffer_size.\n After this buffer size has been determined, allocate the buffer and pass it to\n \\ref rocsparse_csritilu0_preprocess. This will perform analysis on the sparsity pattern of the matrix. Finally,\n call \\p rocsparse_scsritilu0_compute, \\p rocsparse_dcsritilu0_compute, \\p rocsparse_ccsritilu0_compute,\n or \\p rocsparse_zcsritilu0_compute to perform the actual factorization. The calculation\n of the buffer size and the analysis of the sparse matrix only need to be performed once for a given sparsity pattern\n while the factorization can be repeatedly applied to multiple matrices having the same sparsity pattern. After all calls\n to \\ref rocsparse_scsritilu0_compute \"rocsparse_Xcsritilu0_compute()\" are complete, the temporary buffer can be deallocated.\n\n \\p rocsparse_csritilu0 has a number of options that can be useful for examining the convergence history, easily printing debug\n information, and using the COO internal format.\n <table>\n <caption id=\"csritilu0 options\">Options</caption>\n <tr><th>Option <th>Notes\n <tr><td>rocsparse_itilu0_option_verbose</td> <td>Print to stdout convergence data as the routine runs. Useful for debugging.</td>\n <tr><td>rocsparse_itilu0_option_stopping_criteria</td> <td>Enable stopping criteria.</td>\n <tr><td>rocsparse_itilu0_option_compute_nrm_correction</td> <td>Compute and store normalized correction. The stored data can then be queried later with \\ref rocsparse_scsritilu0_history \"rocsparse_Xcsritilu0_history\".</td>\n <tr><td>rocsparse_itilu0_option_compute_nrm_residual</td> <td>Compute and store the normalized residual of the between the approximate solution and the exact solution per iteration. The stored data can then be queried later with \\ref rocsparse_scsritilu0_history \"rocsparse_Xcsritilu0_history\".</td>\n <tr><td>rocsparse_itilu0_option_convergence_history</td> <td>Enable collecting convergence history data with \\ref rocsparse_scsritilu0_history \"rocsparse_Xcsritilu0_history\".</td>\n <tr><td>rocsparse_itilu0_option_coo_format</td> <td>Use COO format internally.</td>\n </table>\n\n \\note\n The sparse CSR matrix has to be sorted. This can be achieved by calling\n rocsparse_csrsort().\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n alg algorithm to use, \\ref rocsparse_itilu0_alg\n @param[in]\n option combination of enumeration values from \\ref rocsparse_itilu0_option.\n @param[inout]\n nmaxiter maximum number of iterations on input and number of iterations on output. If the output number of iterations is strictly less than the input maximum number of iterations, then the algorithm converged.\n @param[in]\n tol tolerance to use for stopping criteria.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start\n of every row of the sparse CSR matrix.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix.\n @param[inout]\n csr_val array of \\p nnz elements of the sparse CSR matrix.\n @param[out]\n ilu0 incomplete factorization.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n buffer_size size of the storage buffer allocated by the user.\n @param[in]\n buffer storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_value \\p alg or \\p base is invalid.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p csr_row_ptr\n or \\p csr_col_ind pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n\n \\par Example\n \\include example_rocsparse_csritilu0.cpp\n/\n/**@{"]
pub fn rocsparse_scsritilu0_compute(
handle: rocsparse_handle,
alg: rocsparse_itilu0_alg,
option: rocsparse_int,
nmaxiter: *mut rocsparse_int,
tol: f32,
m: rocsparse_int,
nnz: rocsparse_int,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
csr_val: *const f32,
ilu0: *mut f32,
idx_base: rocsparse_index_base,
buffer_size: usize,
buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsritilu0_compute(
handle: rocsparse_handle,
alg: rocsparse_itilu0_alg,
option: rocsparse_int,
nmaxiter: *mut rocsparse_int,
tol: f64,
m: rocsparse_int,
nnz: rocsparse_int,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
csr_val: *const f64,
ilu0: *mut f64,
idx_base: rocsparse_index_base,
buffer_size: usize,
buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsritilu0_compute(
handle: rocsparse_handle,
alg: rocsparse_itilu0_alg,
option: rocsparse_int,
nmaxiter: *mut rocsparse_int,
tol: f32,
m: rocsparse_int,
nnz: rocsparse_int,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
csr_val: *const rocsparse_float_complex,
ilu0: *mut rocsparse_float_complex,
idx_base: rocsparse_index_base,
buffer_size: usize,
buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsritilu0_compute(
handle: rocsparse_handle,
alg: rocsparse_itilu0_alg,
option: rocsparse_int,
nmaxiter: *mut rocsparse_int,
tol: f64,
m: rocsparse_int,
nnz: rocsparse_int,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
csr_val: *const rocsparse_double_complex,
ilu0: *mut rocsparse_double_complex,
idx_base: rocsparse_index_base,
buffer_size: usize,
buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\brief Iterative incomplete LU factorization with 0 fill-ins and no pivoting using the CSR\n storage format.\n\n \\details\n \\p rocsparse_csritilu0_compute computes iteratively the incomplete LU factorization with 0 fill-ins and no\n pivoting of a sparse \\f$m \\times m\\f$ CSR matrix \\f$A\\f$, such that\n \\f[\n A \\approx (L + Id)(D + U)\n \\f]\n\n\n The following notation applies for the equations below: diag is the diagonal part, lower is the strict lower triangular part, and upper is the strict upper triangular part of a given matrix.\n Starting with \\f$L_{0} = lower(\\f$ \\p ilu0 \\f$)\\f$, \\f$U_{0} = upper(\\f$ \\p ilu0 \\f$)\\f$, the method iterates with\n \\f[\n \\begin{eqnarray}\n R_k &=& A - L_{k} U_{k},\\\\\n D_{k+1} &=& diag(R_k),\\\\\n L_{k+1} &=& lower(R_k) D_{k+1}^{-1},\\\\\n U_{k+1} &=& upper(R_k),\n \\end{eqnarray}\n \\f]\n if \\f$ 0 \\le k \\lt \\f$ \\p nmaxiter and if\n \\f[\n \\Vert R_k \\Vert_{\\infty} \\gt \\epsilon \\Vert A \\Vert_{\\infty},\n \\f]\n with \\f$\\epsilon\\f$ = \\p tol. Note that the calculation of \\f$R_k\\f$ is performed with no fill-in.\n\n The parameter \\p nfreeiter is used to control the frequence of the stopping criteria evaluation, potentially improving the performance of the algorithm with less norm calculation. Between each iteration of index \\f$ k \\f$, \\p nfreeiter are performed without stopping criteria evaluation. Therefore, if the convergence is obtained with \\f$ k \\f$, this means \\f$ (k + 1)( \\f$ \\p nfreeiter \\f$ ) + k \\f$ iterations.\n\n \\p rocsparse_csritilu0 requires a user-allocated temporary buffer. Its size is returned\n by rocsparse_csritilu0_buffer_size(). Furthermore,\n analysis metadata is required. It can be obtained by rocsparse_csritilu0_preprocess().\n\n \\note\n The sparse CSR matrix has to be sorted. This can be achieved by calling\n rocsparse_csrsort().\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n alg algorithm to use, \\ref rocsparse_itilu0_alg.\n @param[in]\n option combination of enumeration values from \\ref rocsparse_itilu0_option.\n @param[inout]\n nmaxiter maximum number of iterations on input and number of iterations on output. If the output number of iterations is strictly less than the input maximum number of iterations, then the algorithm converged.\n @param[inout]\n nfreeiter number of free iterations, that is, the number of iterations the algorithm will perform without stopping criteria evaluations.\n @param[in]\n tol tolerance to use for stopping criteria.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start\n of every row of the sparse CSR matrix.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix.\n @param[inout]\n csr_val array of \\p nnz elements of the sparse CSR matrix.\n @param[out]\n ilu0 incomplete factorization.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n buffer_size size of the storage buffer allocated by the user.\n @param[in]\n buffer storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_value \\p alg or \\p base is invalid.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p csr_row_ptr\n or \\p csr_col_ind pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n\n/\n/**@{"]
pub fn rocsparse_scsritilu0_compute_ex(
handle: rocsparse_handle,
alg: rocsparse_itilu0_alg,
option: rocsparse_int,
nmaxiter: *mut rocsparse_int,
nfreeiter: rocsparse_int,
tol: f32,
m: rocsparse_int,
nnz: rocsparse_int,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
csr_val: *const f32,
ilu0: *mut f32,
idx_base: rocsparse_index_base,
buffer_size: usize,
buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsritilu0_compute_ex(
handle: rocsparse_handle,
alg: rocsparse_itilu0_alg,
option: rocsparse_int,
nmaxiter: *mut rocsparse_int,
nfreeiter: rocsparse_int,
tol: f64,
m: rocsparse_int,
nnz: rocsparse_int,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
csr_val: *const f64,
ilu0: *mut f64,
idx_base: rocsparse_index_base,
buffer_size: usize,
buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsritilu0_compute_ex(
handle: rocsparse_handle,
alg: rocsparse_itilu0_alg,
option: rocsparse_int,
nmaxiter: *mut rocsparse_int,
nfreeiter: rocsparse_int,
tol: f32,
m: rocsparse_int,
nnz: rocsparse_int,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
csr_val: *const rocsparse_float_complex,
ilu0: *mut rocsparse_float_complex,
idx_base: rocsparse_index_base,
buffer_size: usize,
buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsritilu0_compute_ex(
handle: rocsparse_handle,
alg: rocsparse_itilu0_alg,
option: rocsparse_int,
nmaxiter: *mut rocsparse_int,
nfreeiter: rocsparse_int,
tol: f64,
m: rocsparse_int,
nnz: rocsparse_int,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
csr_val: *const rocsparse_double_complex,
ilu0: *mut rocsparse_double_complex,
idx_base: rocsparse_index_base,
buffer_size: usize,
buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n \\p rocsparse_csritilu0_history fetches convergence history data if\n \\ref rocsparse_itilu0_option_convergence_history has been set when calling\n \\ref rocsparse_scsritilu0_compute \"rocsparse_Xcsritilu0_compute\" or\n \\ref rocsparse_scsritilu0_compute_ex \"rocsparse_Xcsritilu0_compute_ex\":\n\n \\code{.c}\n int options = 0;\n options |= rocsparse_itilu0_option_stopping_criteria;\n options |= rocsparse_itilu0_option_compute_nrm_residual;\n options |= rocsparse_itilu0_option_convergence_history;\n rocsparse_scsritilu0_compute(handle,\n alg,\n options,\n &nmaxiter,\n tol,\n m,\n nnz,\n dcsr_row_ptr,\n dcsr_col_ind,\n dcsr_val,\n dilu0,\n idx_base,\n buffer_size,\n dbuffer);\n\n if((options & rocsparse_itilu0_option_convergence_history) > 0)\n {\n std::vector<float> history(nmaxiter * 2);\n rocsparse_int history_niter = 0;\n rocsparse_scsritilu0_history(handle, alg, &history_niter, history.data(), buffer_size, dbuffer);\n\n const bool nrm_residual = (options & rocsparse_itilu0_option_compute_nrm_residual) > 0;\n for(rocsparse_int i = 0; i < history_niter; ++i)\n {\n std::cout << std::setw(12) << i;\n if(nrm_residual)\n {\n std::cout << std::setw(12) << history[history_niter + i];\n }\n std::cout << std::endl;\n }\n }\n \\endcode\n\n \\note\n The sparse CSR matrix has to be sorted. This can be achieved by calling\n rocsparse_csrsort().\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n alg algorithm to use, \\ref rocsparse_itilu0_alg.\n @param[out]\n niter number of performed iterations.\n @param[out]\n data norms.\n @param[in]\n buffer_size size of the buffer allocated by the user.\n @param[in]\n buffer buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_pointer \\p niter or \\p data is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n\n/\n/**@{"]
pub fn rocsparse_scsritilu0_history(
handle: rocsparse_handle,
alg: rocsparse_itilu0_alg,
niter: *mut rocsparse_int,
data: *mut f32,
buffer_size: usize,
buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsritilu0_history(
handle: rocsparse_handle,
alg: rocsparse_itilu0_alg,
niter: *mut rocsparse_int,
data: *mut f64,
buffer_size: usize,
buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsritilu0_history(
handle: rocsparse_handle,
alg: rocsparse_itilu0_alg,
niter: *mut rocsparse_int,
data: *mut f32,
buffer_size: usize,
buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsritilu0_history(
handle: rocsparse_handle,
alg: rocsparse_itilu0_alg,
niter: *mut rocsparse_int,
data: *mut f64,
buffer_size: usize,
buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n \\p rocsparse_gpsv_interleaved_batch_buffer_size calculates the required buffer size\n for \\ref rocsparse_sgpsv_interleaved_batch \"rocsparse_Xgpsv_interleaved_batch()\". It is the user's\n responsibility to allocate this buffer.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n alg algorithm to solve the linear system.\n @param[in]\n m size of the pentadiagonal linear system.\n @param[in]\n ds lower diagonal (distance 2) of pentadiagonal system. The first two entries\n must be zero.\n @param[in]\n dl lower diagonal of pentadiagonal system. The first entry must be zero.\n @param[in]\n d main diagonal of pentadiagonal system.\n @param[in]\n du upper diagonal of pentadiagonal system. The last entry must be zero.\n @param[in]\n dw upper diagonal (distance 2) of pentadiagonal system. The last two entries\n must be zero.\n @param[in]\n x Dense array of right-hand-sides, with dimension \\p batch_stride by \\p m.\n @param[in]\n batch_count The number of systems to solve.\n @param[in]\n batch_stride The number of elements that separate consecutive elements in a system.\n Must satisfy \\p batch_stride >= \\p batch_count.\n @param[out]\n buffer_size Number of bytes of the temporary storage buffer required.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p alg, \\p batch_count, or\n \\p batch_stride is invalid.\n \\retval rocsparse_status_invalid_pointer \\p ds, \\p dl, \\p d, \\p du, \\p dw, \\p x,\n or \\p temp_buffer pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n/\n/**@{"]
pub fn rocsparse_sgpsv_interleaved_batch_buffer_size(
handle: rocsparse_handle,
alg: rocsparse_gpsv_interleaved_alg,
m: rocsparse_int,
ds: *const f32,
dl: *const f32,
d: *const f32,
du: *const f32,
dw: *const f32,
x: *const f32,
batch_count: rocsparse_int,
batch_stride: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dgpsv_interleaved_batch_buffer_size(
handle: rocsparse_handle,
alg: rocsparse_gpsv_interleaved_alg,
m: rocsparse_int,
ds: *const f64,
dl: *const f64,
d: *const f64,
du: *const f64,
dw: *const f64,
x: *const f64,
batch_count: rocsparse_int,
batch_stride: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cgpsv_interleaved_batch_buffer_size(
handle: rocsparse_handle,
alg: rocsparse_gpsv_interleaved_alg,
m: rocsparse_int,
ds: *const rocsparse_float_complex,
dl: *const rocsparse_float_complex,
d: *const rocsparse_float_complex,
du: *const rocsparse_float_complex,
dw: *const rocsparse_float_complex,
x: *const rocsparse_float_complex,
batch_count: rocsparse_int,
batch_stride: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zgpsv_interleaved_batch_buffer_size(
handle: rocsparse_handle,
alg: rocsparse_gpsv_interleaved_alg,
m: rocsparse_int,
ds: *const rocsparse_double_complex,
dl: *const rocsparse_double_complex,
d: *const rocsparse_double_complex,
du: *const rocsparse_double_complex,
dw: *const rocsparse_double_complex,
x: *const rocsparse_double_complex,
batch_count: rocsparse_int,
batch_stride: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\brief Batched pentadiagonal solver.\n\n \\details\n \\p rocsparse_gpsv_interleaved_batch solves a batch of pentadiagonal linear systems\n \\f[\n P^{i}*x^{i} = x^{i}\n \\f]\n where for each batch \\f$i=0\\ldots\\f$ \\p batch_count, \\f$P^{i}\\f$ is a sparse pentadiagonal matrix and\n \\f$x^{i}\\f$ is a dense right-hand side vector. All of the pentadiagonal matrices, \\f$P^{i}\\f$, are\n packed in an interleaved fashion into five vectors: \\p ds for the lowest diagonals, \\p dl for the lower\n diagonals, \\p d for the main diagonals, \\p du for the upper diagonals, and \\p dw for the highest diagonals.\n See below for a description of what this interleaved memory pattern looks like.\n\n Solving the batched pentadiagonal system involves two steps. First, call\n \\ref rocsparse_sgpsv_interleaved_batch_buffer_size \"rocsparse_Xgpsv_interleaved_batch_buffer_size()\"\n to determine the size of the required temporary storage buffer. After this is determined, allocate\n the buffer and pass it to \\ref rocsparse_sgpsv_interleaved_batch \"rocsparse_Xgpsv_interleaved_batch()\"\n to perform the actual solve. The \\f$x^{i}\\f$ vectors, which initially stores the right-hand side values, are\n overwritten with the solution after the call to\n \\ref rocsparse_sgpsv_interleaved_batch \"rocsparse_Xgpsv_interleaved_batch()\".\n\n Unlike the strided batch routines, which write each batch matrix one after the other in memory, the interleaved\n routines write the batch matrices such that each element from each matrix is written consecutively one after\n the other. For example, consider the following batch matrices:\n\n \\f[\n \\begin{bmatrix}\n t^{0}_{00} & t^{0}_{01} & t^{0}_{02} \\\\\n t^{0}_{10} & t^{0}_{11} & t^{0}_{12} \\\\\n t^{0}_{20} & t^{0}_{21} & t^{0}_{22}\n \\end{bmatrix}\n \\begin{bmatrix}\n t^{1}_{00} & t^{1}_{01} & t^{1}_{02} \\\\\n t^{1}_{10} & t^{1}_{11} & t^{1}_{12} \\\\\n t^{1}_{20} & t^{1}_{21} & t^{1}_{22}\n \\end{bmatrix}\n \\begin{bmatrix}\n t^{2}_{00} & t^{2}_{01} & t^{2}_{02} \\\\\n t^{2}_{10} & t^{2}_{11} & t^{2}_{12} \\\\\n t^{2}_{20} & t^{2}_{21} & t^{2}_{22}\n \\end{bmatrix}\n \\f]\n\n In interleaved format, the highest, higher, lowest, lower, and diagonal arrays would look like:\n \\f[\n \\begin{align}\n \\text{lowest} &= \\begin{bmatrix} 0 & 0 & 0 & 0 & 0 & 0 & t^{0}_{20} & t^{1}_{20} & t^{2}_{20} \\end{bmatrix} \\\\\n \\text{lower} &= \\begin{bmatrix} 0 & 0 & 0 & t^{0}_{10} & t^{1}_{10} & t^{1}_{10} & t^{0}_{21} & t^{1}_{21} & t^{2}_{21} \\end{bmatrix} \\\\\n \\text{diagonal} &= \\begin{bmatrix} t^{0}_{00} & t^{1}_{00} & t^{2}_{00} & t^{0}_{11} & t^{1}_{11} & t^{2}_{11} & t^{0}_{22} & t^{1}_{22} & t^{2}_{22} \\end{bmatrix} \\\\\n \\text{higher} &= \\begin{bmatrix} t^{0}_{01} & t^{1}_{01} & t^{2}_{01} & t^{0}_{12} & t^{1}_{12} & t^{2}_{12} & 0 & 0 & 0 \\end{bmatrix} \\\\\n \\text{highest} &= \\begin{bmatrix} t^{0}_{02} & t^{1}_{02} & t^{2}_{02} & 0 & 0 & 0 & 0 & 0 & 0 \\end{bmatrix} \\\\\n \\end{align}\n \\f]\n For the lowest array, the first \\p 2*batch_count entries are zero, and for the lower array, the first \\p batch_count entries are zero.\n For the upper array, the last \\p batch_count entries are zero, and for the highest array, the last \\p 2*batch_count entries are zero.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n The routine is numerically stable because it uses QR to solve the linear systems.\n\n \\note\n m need to be at least 3 to be a valid pentadiagonal matrix.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n alg algorithm to solve the linear system.\n @param[in]\n m size of the pentadiagonal linear system.\n @param[inout]\n ds lower diagonal (distance 2) of pentadiagonal system. The first two entries\n must be zero.\n @param[inout]\n dl lower diagonal of pentadiagonal system. The first entry must be zero.\n @param[inout]\n d main diagonal of pentadiagonal system.\n @param[inout]\n du upper diagonal of pentadiagonal system. The last entry must be zero.\n @param[inout]\n dw upper diagonal (distance 2) of pentadiagonal system. The last two entries\n must be zero.\n @param[inout]\n x Dense array of right-hand-sides, with dimension \\p batch_stride by \\p m.\n @param[in]\n batch_count The number of systems to solve.\n @param[in]\n batch_stride The number of elements that separate consecutive elements in a system.\n Must satisfy \\p batch_stride >= \\p batch_count.\n @param[in]\n temp_buffer Temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p alg, \\p batch_count, or\n \\p batch_stride is invalid.\n \\retval rocsparse_status_invalid_pointer \\p ds, \\p dl, \\p d, \\p du, \\p dw, \\p x,\n or \\p temp_buffer pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n\n \\par Example\n \\snippet example_rocsparse_gpsv.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sgpsv_interleaved_batch(
handle: rocsparse_handle,
alg: rocsparse_gpsv_interleaved_alg,
m: rocsparse_int,
ds: *mut f32,
dl: *mut f32,
d: *mut f32,
du: *mut f32,
dw: *mut f32,
x: *mut f32,
batch_count: rocsparse_int,
batch_stride: rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dgpsv_interleaved_batch(
handle: rocsparse_handle,
alg: rocsparse_gpsv_interleaved_alg,
m: rocsparse_int,
ds: *mut f64,
dl: *mut f64,
d: *mut f64,
du: *mut f64,
dw: *mut f64,
x: *mut f64,
batch_count: rocsparse_int,
batch_stride: rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cgpsv_interleaved_batch(
handle: rocsparse_handle,
alg: rocsparse_gpsv_interleaved_alg,
m: rocsparse_int,
ds: *mut rocsparse_float_complex,
dl: *mut rocsparse_float_complex,
d: *mut rocsparse_float_complex,
du: *mut rocsparse_float_complex,
dw: *mut rocsparse_float_complex,
x: *mut rocsparse_float_complex,
batch_count: rocsparse_int,
batch_stride: rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zgpsv_interleaved_batch(
handle: rocsparse_handle,
alg: rocsparse_gpsv_interleaved_alg,
m: rocsparse_int,
ds: *mut rocsparse_double_complex,
dl: *mut rocsparse_double_complex,
d: *mut rocsparse_double_complex,
du: *mut rocsparse_double_complex,
dw: *mut rocsparse_double_complex,
x: *mut rocsparse_double_complex,
batch_count: rocsparse_int,
batch_stride: rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n \\p rocsparse_gtsv_buffer_size returns the size of the temporary storage buffer\n that is required by \\ref rocsparse_sgtsv \"rocsparse_Xgtsv()\". The temporary\n storage buffer must be allocated by the user.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m size of the tri-diagonal linear system (must be >= 2).\n @param[in]\n n number of columns in the dense matrix B.\n @param[in]\n dl lower diagonal of tri-diagonal system. The first entry must be zero.\n @param[in]\n d main diagonal of tri-diagonal system.\n @param[in]\n du upper diagonal of tri-diagonal system. The last entry must be zero.\n @param[in]\n B dense matrix of size ( \\p ldb, \\p n ).\n @param[in]\n ldb leading dimension of B. Must satisfy \\p ldb >= max(1, m).\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n rocsparse_sgtsv(), rocsparse_dgtsv(), rocsparse_cgtsv(),\n and rocsparse_zgtsv().\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p ldb is invalid.\n \\retval rocsparse_status_invalid_pointer \\p dl, \\p d, \\p du,\n \\p B, or \\p buffer_size pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n/\n/**@{"]
pub fn rocsparse_sgtsv_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
dl: *const f32,
d: *const f32,
du: *const f32,
B: *const f32,
ldb: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dgtsv_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
dl: *const f64,
d: *const f64,
du: *const f64,
B: *const f64,
ldb: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cgtsv_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
dl: *const rocsparse_float_complex,
d: *const rocsparse_float_complex,
du: *const rocsparse_float_complex,
B: *const rocsparse_float_complex,
ldb: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zgtsv_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
dl: *const rocsparse_double_complex,
d: *const rocsparse_double_complex,
du: *const rocsparse_double_complex,
B: *const rocsparse_double_complex,
ldb: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\brief Tridiagonal solver with pivoting\n\n \\details\n \\p rocsparse_gtsv solves a tridiagonal system for multiple right-hand sides using pivoting\n \\f[\n T*B = B\n \\f]\n where \\f$T\\f$ is a sparse tridiagonal matrix and \\f$B\\f$ is a dense \\f$ldb \\times n\\f$ matrix storing the\n right-hand side vectors in column order. The tridiagonal matrix \\f$T\\f$ is defined by three vectors: \\p dl\n for the lower diagonal, \\p d for the main diagonal, and \\p du for the upper diagonal.\n\n Solving the tridiagonal system involves two steps. First, call\n \\ref rocsparse_sgtsv_buffer_size \"rocsparse_Xgtsv_buffer_size()\" to determine the size of the required\n temporary storage buffer. After this is determined, allocate this buffer and pass it to\n \\ref rocsparse_sgtsv \"rocsparse_Xgtsv()\" to perform the actual solve. The \\f$B\\f$ dense matrix, which initially\n stores the \\p n right-hand side vectors, is overwritten with the \\p n solution vectors after the call to\n \\ref rocsparse_sgtsv \"rocsparse_Xgtsv()\".\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m size of the tri-diagonal linear system (must be >= 2).\n @param[in]\n n number of columns in the dense matrix B.\n @param[in]\n dl lower diagonal of tri-diagonal system. The first entry must be zero.\n @param[in]\n d main diagonal of tri-diagonal system.\n @param[in]\n du upper diagonal of tri-diagonal system. The last entry must be zero.\n @param[inout]\n B dense matrix of size ( \\p ldb, \\p n ).\n @param[in]\n ldb leading dimension of B. Must satisfy \\p ldb >= max(1, m).\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p ldb is invalid.\n \\retval rocsparse_status_invalid_pointer \\p dl, \\p d,\n \\p du, \\p B, or \\p temp_buffer pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n\n \\par Example\n \\snippet example_rocsparse_gtsv.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sgtsv(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
dl: *const f32,
d: *const f32,
du: *const f32,
B: *mut f32,
ldb: rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dgtsv(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
dl: *const f64,
d: *const f64,
du: *const f64,
B: *mut f64,
ldb: rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cgtsv(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
dl: *const rocsparse_float_complex,
d: *const rocsparse_float_complex,
du: *const rocsparse_float_complex,
B: *mut rocsparse_float_complex,
ldb: rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zgtsv(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
dl: *const rocsparse_double_complex,
d: *const rocsparse_double_complex,
du: *const rocsparse_double_complex,
B: *mut rocsparse_double_complex,
ldb: rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n \\p rocsparse_gtsv_no_pivot_buffer_size returns the size of the temporary storage buffer\n that is required by \\ref rocsparse_sgtsv_no_pivot \"rocsparse_Xgtsv_no_pivot()\". The temporary\n storage buffer must be allocated by the user.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m size of the tri-diagonal linear system (must be >= 2).\n @param[in]\n n number of columns in the dense matrix B.\n @param[in]\n dl lower diagonal of tri-diagonal system. The first entry must be zero.\n @param[in]\n d main diagonal of tri-diagonal system.\n @param[in]\n du upper diagonal of tri-diagonal system. The last entry must be zero.\n @param[in]\n B dense matrix of size ( \\p ldb, \\p n ).\n @param[in]\n ldb leading dimension of B. Must satisfy \\p ldb >= max(1, m).\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n rocsparse_sgtsv_no_pivot(), rocsparse_dgtsv_no_pivot(), rocsparse_cgtsv_no_pivot(),\n and rocsparse_zgtsv_no_pivot().\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p ldb is invalid.\n \\retval rocsparse_status_invalid_pointer \\p dl, \\p d, \\p du,\n \\p B, or \\p buffer_size pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n/\n/**@{"]
pub fn rocsparse_sgtsv_no_pivot_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
dl: *const f32,
d: *const f32,
du: *const f32,
B: *const f32,
ldb: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dgtsv_no_pivot_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
dl: *const f64,
d: *const f64,
du: *const f64,
B: *const f64,
ldb: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cgtsv_no_pivot_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
dl: *const rocsparse_float_complex,
d: *const rocsparse_float_complex,
du: *const rocsparse_float_complex,
B: *const rocsparse_float_complex,
ldb: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zgtsv_no_pivot_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
dl: *const rocsparse_double_complex,
d: *const rocsparse_double_complex,
du: *const rocsparse_double_complex,
B: *const rocsparse_double_complex,
ldb: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\brief Tridiagonal solver (no pivoting)\n\n \\details\n \\p rocsparse_gtsv_no_pivot solves a tridiagonal linear system for multiple right-hand sides without pivoting\n \\f[\n T*B = B\n \\f]\n where \\f$T\\f$ is a sparse tridiagonal matrix and \\f$B\\f$ is a dense \\f$ldb \\times n\\f$ matrix storing the\n right-hand side vectors in column order. The tridiagonal matrix \\f$T\\f$ is defined by three vectors: \\p dl\n for the lower diagonal, \\p d for the main diagonal, and \\p du for the upper diagonal.\n\n Solving the tridiagonal system with multiple right-hand sides without pivoting involves two steps. First,\n call \\ref rocsparse_sgtsv_no_pivot_buffer_size \"rocsparse_Xgtsv_no_pivot_buffer_size()\"\n to determine the size of the required temporary storage buffer. After this is determined, allocate the\n buffer and pass it to \\ref rocsparse_sgtsv_no_pivot \"rocsparse_Xgtsv_no_pivot()\" to perform the actual\n solve. The \\f$B\\f$ dense matrix, which initially stores the \\p n right-hand side vectors, is overwritten\n with the \\p n solution vectors after the call to \\ref rocsparse_sgtsv_no_pivot \"rocsparse_Xgtsv_no_pivot()\".\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m size of the tri-diagonal linear system (must be >= 2).\n @param[in]\n n number of columns in the dense matrix B.\n @param[in]\n dl lower diagonal of tri-diagonal system. The first entry must be zero.\n @param[in]\n d main diagonal of tri-diagonal system.\n @param[in]\n du upper diagonal of tri-diagonal system. The last entry must be zero.\n @param[inout]\n B dense matrix of size ( \\p ldb, \\p n ).\n @param[in]\n ldb leading dimension of B. Must satisfy \\p ldb >= max(1, m).\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p ldb is invalid.\n \\retval rocsparse_status_invalid_pointer \\p dl, \\p d,\n \\p du, \\p B, or \\p temp_buffer pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n\n \\par Example\n \\snippet example_rocsparse_gtsv_no_pivot.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sgtsv_no_pivot(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
dl: *const f32,
d: *const f32,
du: *const f32,
B: *mut f32,
ldb: rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dgtsv_no_pivot(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
dl: *const f64,
d: *const f64,
du: *const f64,
B: *mut f64,
ldb: rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cgtsv_no_pivot(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
dl: *const rocsparse_float_complex,
d: *const rocsparse_float_complex,
du: *const rocsparse_float_complex,
B: *mut rocsparse_float_complex,
ldb: rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zgtsv_no_pivot(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
dl: *const rocsparse_double_complex,
d: *const rocsparse_double_complex,
du: *const rocsparse_double_complex,
B: *mut rocsparse_double_complex,
ldb: rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n \\p rocsparse_gtsv_no_pivot_strided_batch_buffer_size returns the size of the temporary storage buffer\n that is required by \\ref rocsparse_sgtsv_no_pivot_strided_batch \"rocsparse_Xgtsv_no_pivot_strided_batch()\".\n The temporary storage buffer must be allocated by the user.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m size of the tri-diagonal linear system.\n @param[in]\n dl lower diagonal of tri-diagonal system, where the ith system lower diagonal starts at \\p dl+batch_stride*i.\n @param[in]\n d main diagonal of tri-diagonal system, where the ith system diagonal starts at \\p d+batch_stride*i.\n @param[in]\n du upper diagonal of tri-diagonal system, where the ith system upper diagonal starts at \\p du+batch_stride*i.\n @param[inout]\n x dense array of righthand-sides where the ith righthand-side starts at \\p x+batch_stride*i.\n @param[in]\n batch_count the number of systems to solve.\n @param[in]\n batch_stride the number of elements that separate each system. Must satisfy \\p batch_stride >= \\p m.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n \\ref rocsparse_sgtsv_no_pivot_strided_batch \"rocsparse_Xgtsv_no_pivot_strided_batch()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p batch_count, or \\p batch_stride is invalid.\n \\retval rocsparse_status_invalid_pointer \\p dl, \\p d, \\p du,\n \\p x, or \\p buffer_size pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n/\n/**@{"]
pub fn rocsparse_sgtsv_no_pivot_strided_batch_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
dl: *const f32,
d: *const f32,
du: *const f32,
x: *const f32,
batch_count: rocsparse_int,
batch_stride: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dgtsv_no_pivot_strided_batch_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
dl: *const f64,
d: *const f64,
du: *const f64,
x: *const f64,
batch_count: rocsparse_int,
batch_stride: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cgtsv_no_pivot_strided_batch_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
dl: *const rocsparse_float_complex,
d: *const rocsparse_float_complex,
du: *const rocsparse_float_complex,
x: *const rocsparse_float_complex,
batch_count: rocsparse_int,
batch_stride: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zgtsv_no_pivot_strided_batch_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
dl: *const rocsparse_double_complex,
d: *const rocsparse_double_complex,
du: *const rocsparse_double_complex,
x: *const rocsparse_double_complex,
batch_count: rocsparse_int,
batch_stride: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\brief Strided Batch tridiagonal solver (no pivoting)\n\n \\details\n \\p rocsparse_gtsv_no_pivot_strided_batch solves a batched tridiagonal linear system\n \\f[\n T^{i}*x^{i} = x^{i}\n \\f]\n where for each batch \\f$i=0\\ldots\\f$ \\p batch_count, \\f$T^{i}\\f$ is a sparse tridiagonal matrix and\n \\f$x^{i}\\f$ is a dense right-hand side vector. All of the tridiagonal matrices, \\f$T^{i}\\f$, are\n packed one after the other into three vectors: \\p dl for the lower diagonals, \\p d for the main\n diagonals, and \\p du for the upper diagonals. See below for a description of what this strided\n memory pattern looks like.\n\n Solving the batched tridiagonal system involves two steps. First, call\n \\ref rocsparse_sgtsv_no_pivot_strided_batch_buffer_size \"rocsparse_Xgtsv_no_pivot_strided_batch_buffer_size()\"\n to determine the size of the required temporary storage buffer. After this is determined, allocate\n the buffer and pass it to \\ref rocsparse_sgtsv_no_pivot_strided_batch \"rocsparse_Xgtsv_no_pivot_strided_batch()\"\n to perform the actual solve. The \\f$x^{i}\\f$ vectors, which initially stores the right-hand side values, are\n overwritten with the solution after the call to\n \\ref rocsparse_sgtsv_no_pivot_strided_batch \"rocsparse_Xgtsv_no_pivot_strided_batch()\".\n\n The strided batch routines write each batch matrix one after the other in memory. For example, consider\n the following batch matrices:\n\n \\f[\n \\begin{bmatrix}\n t^{0}_{00} & t^{0}_{01} & 0 \\\\\n t^{0}_{10} & t^{0}_{11} & t^{0}_{12} \\\\\n 0 & t^{0}_{21} & t^{0}_{22}\n \\end{bmatrix}\n \\begin{bmatrix}\n t^{1}_{00} & t^{1}_{01} & 0 \\\\\n t^{1}_{10} & t^{1}_{11} & t^{1}_{12} \\\\\n 0 & t^{1}_{21} & t^{1}_{22}\n \\end{bmatrix}\n \\begin{bmatrix}\n t^{2}_{00} & t^{2}_{01} & 0 \\\\\n t^{2}_{10} & t^{2}_{11} & t^{2}_{12} \\\\\n 0 & t^{2}_{21} & t^{2}_{22}\n \\end{bmatrix}\n \\f]\n\n In strided format, the upper, lower, and diagonal arrays would look like:\n \\f[\n \\begin{align}\n \\text{lower} &= \\begin{bmatrix} 0 & t^{0}_{10} & t^{0}_{21} & 0 & t^{1}_{10} & t^{1}_{21} & 0 & t^{2}_{10} & t^{2}_{21} \\end{bmatrix} \\\\\n \\text{diagonal} &= \\begin{bmatrix} t^{0}_{00} & t^{0}_{11} & t^{0}_{22} & t^{1}_{00} & t^{1}_{11} & t^{1}_{22} & t^{2}_{00} & t^{2}_{11} & t^{2}_{22} \\end{bmatrix} \\\\\n \\text{upper} &= \\begin{bmatrix} t^{0}_{01} & t^{0}_{12} & 0 & t^{1}_{01} & t^{1}_{12} & 0 & t^{2}_{01} & t^{2}_{12} & 0 \\end{bmatrix} \\\\\n \\end{align}\n \\f]\n For the lower array, for each batch \\p i, the \\p i*batch_stride entries are zero, and for the upper array, the\n \\p i*batch_stride+batch_stride-1 entries are zero.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m size of the tri-diagonal linear system (must be >= 2).\n @param[in]\n dl lower diagonal of tri-diagonal system. The first entry must be zero.\n @param[in]\n d main diagonal of tri-diagonal system.\n @param[in]\n du upper diagonal of tri-diagonal system. The last entry must be zero.\n @param[inout]\n x dense array of righthand-sides, where the ith right-hand side starts at \\p x+batch_stride*i.\n @param[in]\n batch_count the number of systems to solve.\n @param[in]\n batch_stride the number of elements that separate each system. Must satisfy \\p batch_stride >= \\p m.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p batch_count, or \\p batch_stride is invalid.\n \\retval rocsparse_status_invalid_pointer \\p dl, \\p d,\n \\p du, \\p x, or \\p temp_buffer pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n\n \\par Example\n \\snippet example_rocsparse_gtsv_no_pivot_strided_batch.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sgtsv_no_pivot_strided_batch(
handle: rocsparse_handle,
m: rocsparse_int,
dl: *const f32,
d: *const f32,
du: *const f32,
x: *mut f32,
batch_count: rocsparse_int,
batch_stride: rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dgtsv_no_pivot_strided_batch(
handle: rocsparse_handle,
m: rocsparse_int,
dl: *const f64,
d: *const f64,
du: *const f64,
x: *mut f64,
batch_count: rocsparse_int,
batch_stride: rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cgtsv_no_pivot_strided_batch(
handle: rocsparse_handle,
m: rocsparse_int,
dl: *const rocsparse_float_complex,
d: *const rocsparse_float_complex,
du: *const rocsparse_float_complex,
x: *mut rocsparse_float_complex,
batch_count: rocsparse_int,
batch_stride: rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zgtsv_no_pivot_strided_batch(
handle: rocsparse_handle,
m: rocsparse_int,
dl: *const rocsparse_double_complex,
d: *const rocsparse_double_complex,
du: *const rocsparse_double_complex,
x: *mut rocsparse_double_complex,
batch_count: rocsparse_int,
batch_stride: rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\details\n \\p rocsparse_gtsv_interleaved_batch_buffer_size returns the size of the temporary storage buffer\n that is required by \\ref rocsparse_sgtsv_interleaved_batch \"rocsparse_Xgtsv_interleaved_batch()\".\n The temporary storage buffer must be allocated by the user.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n alg algorithm to use when solving tridiagonal systems. Options are Thomas ( \\ref rocsparse_gtsv_interleaved_alg_thomas ),\n LU ( \\ref rocsparse_gtsv_interleaved_alg_lu ), or QR ( \\ref rocsparse_gtsv_interleaved_alg_qr ). Passing\n \\ref rocsparse_gtsv_interleaved_alg_default defaults to using the QR algorithm. The Thomas algorithm is the fastest but is not\n stable, while LU and QR are slower but are stable.\n @param[in]\n m size of the tri-diagonal linear system.\n @param[in]\n dl lower diagonal of tri-diagonal system. The first element of the lower diagonal must be zero.\n @param[in]\n d main diagonal of tri-diagonal system.\n @param[in]\n du upper diagonal of tri-diagonal system. The last element of the upper diagonal must be zero.\n @param[inout]\n x dense array of right-hand sides with dimension \\p batch_stride by \\p m.\n @param[in]\n batch_count the number of systems to solve.\n @param[in]\n batch_stride the number of elements that separate consecutive elements in a system. Must satisfy \\p batch_stride >= \\p batch_count.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n \\ref rocsparse_sgtsv_interleaved_batch \"rocsparse_Xgtsv_interleaved_batch()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m, \\p batch_count, \\p batch_stride is invalid.\n \\retval rocsparse_status_invalid_pointer \\p dl, \\p d, \\p du,\n \\p x, or \\p buffer_size pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n/\n/**@{"]
pub fn rocsparse_sgtsv_interleaved_batch_buffer_size(
handle: rocsparse_handle,
alg: rocsparse_gtsv_interleaved_alg,
m: rocsparse_int,
dl: *const f32,
d: *const f32,
du: *const f32,
x: *const f32,
batch_count: rocsparse_int,
batch_stride: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dgtsv_interleaved_batch_buffer_size(
handle: rocsparse_handle,
alg: rocsparse_gtsv_interleaved_alg,
m: rocsparse_int,
dl: *const f64,
d: *const f64,
du: *const f64,
x: *const f64,
batch_count: rocsparse_int,
batch_stride: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cgtsv_interleaved_batch_buffer_size(
handle: rocsparse_handle,
alg: rocsparse_gtsv_interleaved_alg,
m: rocsparse_int,
dl: *const rocsparse_float_complex,
d: *const rocsparse_float_complex,
du: *const rocsparse_float_complex,
x: *const rocsparse_float_complex,
batch_count: rocsparse_int,
batch_stride: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zgtsv_interleaved_batch_buffer_size(
handle: rocsparse_handle,
alg: rocsparse_gtsv_interleaved_alg,
m: rocsparse_int,
dl: *const rocsparse_double_complex,
d: *const rocsparse_double_complex,
du: *const rocsparse_double_complex,
x: *const rocsparse_double_complex,
batch_count: rocsparse_int,
batch_stride: rocsparse_int,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup precond_module\n \\brief Interleaved batch tridiagonal solver.\n\n \\details\n \\p rocsparse_gtsv_interleaved_batch solves a batched tridiagonal linear system\n \\f[\n T^{i}*x^{i} = x^{i}\n \\f]\n where for each batch \\f$i=0\\ldots\\f$ \\p batch_count, \\f$T^{i}\\f$ is a sparse tridiagonal matrix and\n \\f$x^{i}\\f$ is a dense right-hand side vector. All of the tridiagonal matrices, \\f$T^{i}\\f$, are\n packed in an interleaved fashion into three vectors: \\p dl for the lower diagonals, \\p d for the main\n diagonals, and \\p du for the upper diagonals. See below for a description of what this interleaved\n memory pattern looks like.\n\n Solving the batched tridiagonal system involves two steps. First, call\n \\ref rocsparse_sgtsv_interleaved_batch_buffer_size \"rocsparse_Xgtsv_interleaved_batch_buffer_size()\"\n to determine the size of the required temporary storage buffer. After this is determined, allocate\n the buffer and pass it to \\ref rocsparse_sgtsv_interleaved_batch \"rocsparse_Xgtsv_interleaved_batch()\"\n to perform the actual solve. The \\f$x^{i}\\f$ vectors, which initially stores the right-hand side values, are\n overwritten with the solution after the call to\n \\ref rocsparse_sgtsv_interleaved_batch \"rocsparse_Xgtsv_interleaved_batch()\".\n\n The user can specify different algorithms for \\p rocsparse_gtsv_interleaved_batch\n to use. Options are Thomas ( \\ref rocsparse_gtsv_interleaved_alg_thomas ),\n LU ( \\ref rocsparse_gtsv_interleaved_alg_lu ), or QR ( \\ref rocsparse_gtsv_interleaved_alg_qr ).\n Passing \\ref rocsparse_gtsv_interleaved_alg_default defaults to using the QR algorithm.\n\n Unlike the strided batch routines, which write each batch matrix one after the other in memory, the interleaved\n routines write the batch matrices such that each element from each matrix is written consecutively one after\n the other. For example, consider the following batch matrices:\n\n \\f[\n \\begin{bmatrix}\n t^{0}_{00} & t^{0}_{01} & 0 \\\\\n t^{0}_{10} & t^{0}_{11} & t^{0}_{12} \\\\\n 0 & t^{0}_{21} & t^{0}_{22}\n \\end{bmatrix}\n \\begin{bmatrix}\n t^{1}_{00} & t^{1}_{01} & 0 \\\\\n t^{1}_{10} & t^{1}_{11} & t^{1}_{12} \\\\\n 0 & t^{1}_{21} & t^{1}_{22}\n \\end{bmatrix}\n \\begin{bmatrix}\n t^{2}_{00} & t^{2}_{01} & 0 \\\\\n t^{2}_{10} & t^{2}_{11} & t^{2}_{12} \\\\\n 0 & t^{2}_{21} & t^{2}_{22}\n \\end{bmatrix}\n \\f]\n\n In interleaved format, the upper, lower, and diagonal arrays would look like:\n \\f[\n \\begin{align}\n \\text{lower} &= \\begin{bmatrix} 0 & 0 & 0 & t^{0}_{10} & t^{1}_{10} & t^{1}_{10} & t^{0}_{21} & t^{1}_{21} & t^{2}_{21} \\end{bmatrix} \\\\\n \\text{diagonal} &= \\begin{bmatrix} t^{0}_{00} & t^{1}_{00} & t^{2}_{00} & t^{0}_{11} & t^{1}_{11} & t^{2}_{11} & t^{0}_{22} & t^{1}_{22} & t^{2}_{22} \\end{bmatrix} \\\\\n \\text{upper} &= \\begin{bmatrix} t^{0}_{01} & t^{1}_{01} & t^{2}_{01} & t^{0}_{12} & t^{1}_{12} & t^{2}_{12} & 0 & 0 & 0 \\end{bmatrix} \\\\\n \\end{align}\n \\f]\n For the lower array, the first \\p batch_count entries are zero, and for the upper array, the last \\p batch_count\n entries are zero.\n\n \\note\n This function is non-blocking and executed asynchronously with respect to the host.\n It can return before the actual computation has finished.\n\n \\note\n This routine supports execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n alg algorithm to use when solving tridiagonal systems. Options are Thomas ( \\ref rocsparse_gtsv_interleaved_alg_thomas ),\n LU ( \\ref rocsparse_gtsv_interleaved_alg_lu ), or QR ( \\ref rocsparse_gtsv_interleaved_alg_qr ). Passing\n \\ref rocsparse_gtsv_interleaved_alg_default defaults to using the QR algorithm. The Thomas algorithm is the fastest but is not\n stable, while LU and QR are slower but are stable.\n @param[in]\n m size of the tri-diagonal linear system.\n @param[inout]\n dl lower diagonal of tri-diagonal system. The first element of the lower diagonal must be zero.\n @param[inout]\n d main diagonal of tri-diagonal system.\n @param[inout]\n du upper diagonal of tri-diagonal system. The last element of the upper diagonal must be zero.\n @param[inout]\n x dense array of right-hand sides, with dimension \\p batch_stride by \\p m.\n @param[in]\n batch_count the number of systems to solve.\n @param[in]\n batch_stride the number of elements that separate consecutive elements in a system. Must satisfy \\p batch_stride >= \\p batch_count.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m or \\p batch_count, or \\p batch_stride is invalid.\n \\retval rocsparse_status_invalid_pointer \\p dl, \\p d,\n \\p du, \\p x, or \\p temp_buffer pointer is invalid.\n \\retval rocsparse_status_internal_error an internal error occurred.\n\n \\par Example\n \\snippet example_rocsparse_gtsv_interleaved_batch.cpp doc example\n/\n/**@{"]
pub fn rocsparse_sgtsv_interleaved_batch(
handle: rocsparse_handle,
alg: rocsparse_gtsv_interleaved_alg,
m: rocsparse_int,
dl: *mut f32,
d: *mut f32,
du: *mut f32,
x: *mut f32,
batch_count: rocsparse_int,
batch_stride: rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dgtsv_interleaved_batch(
handle: rocsparse_handle,
alg: rocsparse_gtsv_interleaved_alg,
m: rocsparse_int,
dl: *mut f64,
d: *mut f64,
du: *mut f64,
x: *mut f64,
batch_count: rocsparse_int,
batch_stride: rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_cgtsv_interleaved_batch(
handle: rocsparse_handle,
alg: rocsparse_gtsv_interleaved_alg,
m: rocsparse_int,
dl: *mut rocsparse_float_complex,
d: *mut rocsparse_float_complex,
du: *mut rocsparse_float_complex,
x: *mut rocsparse_float_complex,
batch_count: rocsparse_int,
batch_stride: rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zgtsv_interleaved_batch(
handle: rocsparse_handle,
alg: rocsparse_gtsv_interleaved_alg,
m: rocsparse_int,
dl: *mut rocsparse_double_complex,
d: *mut rocsparse_double_complex,
du: *mut rocsparse_double_complex,
x: *mut rocsparse_double_complex,
batch_count: rocsparse_int,
batch_stride: rocsparse_int,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup reordering_module\n \\brief Coloring of the adjacency graph of the matrix \\f$A\\f$ stored in the CSR format.\n\n \\details\n \\p rocsparse_csrcolor performs the coloring of the undirected graph represented by the (symmetric) sparsity pattern of the\n matrix \\f$A\\f$ stored in CSR format. Graph coloring is a way of coloring the nodes of a graph such that no two adjacent nodes\n are of the same color. The \\p fraction_to_color is a parameter to only color a given percentage of the graph nodes, while the\n remaining uncolored nodes receive distinct new colors. The optional \\p reordering array is a permutation array such that\n unknowns of the same color are grouped. The matrix \\f$A\\f$ must be stored as a general matrix with a symmetric sparsity pattern,\n and if the matrix \\f$A\\f$ is non-symmetric, then the user is responsible to provide the symmetric part \\f$\\frac{A+A^T}{2}\\f$.\n\n \\note\n This function is blocking with respect to the host.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of sparse matrix \\f$A\\f$.\n @param[in]\n nnz number of non-zero entries of sparse matrix \\f$A\\f$.\n @param[in]\n descr sparse matrix descriptor.\n @param[in]\n csr_val array of \\p nnz elements of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix.\n @param[in]\n fraction_to_color fraction of nodes to be colored, which should be in the interval [0.0,1.0], for example, 0.8 implies that 80 percent of nodes will be colored.\n @param[out]\n ncolors resulting number of distinct colors.\n @param[out]\n coloring resulting mapping of colors.\n @param[out]\n reordering optional resulting reordering permutation if \\p reordering is a non-null pointer.\n @param[inout]\n info structure that holds the information collected during the coloring algorithm.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_size \\p m or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p descr, \\p csr_val, \\p csr_row_ptr, \\p csr_col_ind, \\p fraction_to_color, \\p ncolors, \\p coloring, or \\p info pointer is invalid.\n/\n/**@{"]
pub fn rocsparse_scsrcolor(
handle: rocsparse_handle,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
fraction_to_color: *const f32,
ncolors: *mut rocsparse_int,
coloring: *mut rocsparse_int,
reordering: *mut rocsparse_int,
info: rocsparse_mat_info,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcsrcolor(
handle: rocsparse_handle,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
fraction_to_color: *const f64,
ncolors: *mut rocsparse_int,
coloring: *mut rocsparse_int,
reordering: *mut rocsparse_int,
info: rocsparse_mat_info,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccsrcolor(
handle: rocsparse_handle,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
fraction_to_color: *const f32,
ncolors: *mut rocsparse_int,
coloring: *mut rocsparse_int,
reordering: *mut rocsparse_int,
info: rocsparse_mat_info,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcsrcolor(
handle: rocsparse_handle,
m: rocsparse_int,
nnz: rocsparse_int,
descr: rocsparse_mat_descr,
csr_val: *const rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
fraction_to_color: *const f64,
ncolors: *mut rocsparse_int,
coloring: *mut rocsparse_int,
reordering: *mut rocsparse_int,
info: rocsparse_mat_info,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup utility_module\n \\details\n \\p rocsparse_check_matrix_coo_buffer_size computes the required buffer size needed when\n calling \\ref rocsparse_scheck_matrix_coo \"rocsparse_Xcheck_matrix_coo()\".\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n n number of columns of the sparse CSR matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix.\n @param[in]\n coo_val array of \\p nnz elements of the sparse COO matrix.\n @param[in]\n coo_row_ind array of \\p nnz elements containing the row indices of the sparse\n COO matrix.\n @param[in]\n coo_col_ind array of \\p nnz elements containing the column indices of the sparse\n COO matrix.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n matrix_type \\ref rocsparse_matrix_type_general, \\ref rocsparse_matrix_type_symmetric,\n \\ref rocsparse_matrix_type_hermitian, or \\ref rocsparse_matrix_type_triangular.\n @param[in]\n uplo \\ref rocsparse_fill_mode_lower or \\ref rocsparse_fill_mode_upper.\n @param[in]\n storage \\ref rocsparse_storage_mode_sorted or \\ref rocsparse_storage_mode_sorted.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n \\ref rocsparse_scheck_matrix_coo \"rocsparse_Xcheck_matrix_coo()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_value \\p idx_base, \\p matrix_type, \\p uplo, or \\p storage is invalid.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p coo_val, \\p coo_row_ind, \\p coo_col_ind, or \\p buffer_size pointer\n is invalid.\n/\n/**@{"]
pub fn rocsparse_scheck_matrix_coo_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
coo_val: *const f32,
coo_row_ind: *const rocsparse_int,
coo_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcheck_matrix_coo_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
coo_val: *const f64,
coo_row_ind: *const rocsparse_int,
coo_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccheck_matrix_coo_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
coo_val: *const rocsparse_float_complex,
coo_row_ind: *const rocsparse_int,
coo_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcheck_matrix_coo_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
coo_val: *const rocsparse_double_complex,
coo_row_ind: *const rocsparse_int,
coo_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup utility_module\n \\brief Check matrix to see if it is valid.\n\n \\details\n \\p rocsparse_check_matrix_coo checks whether the input COO matrix is valid. It performs basic sanity checks on the input\n matrix and tries to detect issues in the data. This includes looking for 'nan' or 'inf' values in the data arrays,\n invalid row/column indices, whether the matrix is triangular or not, whether there are duplicate row/column\n indices, or whether the row/column indices are not sorted when they should be. If an issue is found, it is written to the\n \\p data_status parameter.\n\n Performing the above checks involves two steps. First, call \\p rocsparse_Xcheck_matrix_coo_buffer_size\n to determine the required buffer size. Then allocate this buffer and pass it to \\p rocsparse_Xcheck_matrix_coo.\n Any issues detected will be written to the \\p data_status parameter, which is always a host variable regardless of the pointer mode.\n\n **Example**\n\n This example checks whether a COO matrix has the correct row indices. The input matrix\n is invalid because it contains a -1 entry in the row indices array.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse COO matrix.\n @param[in]\n n number of columns of the sparse COO matrix.\n @param[in]\n nnz number of non-zero entries of the sparse COO matrix.\n @param[in]\n coo_val array of \\p nnz elements of the sparse COO matrix.\n @param[in]\n coo_row_ind array of \\p nnz elements containing the row indices of the sparse\n COO matrix.\n @param[in]\n coo_col_ind array of \\p nnz elements containing the column indices of the sparse\n COO matrix.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n matrix_type \\ref rocsparse_matrix_type_general, \\ref rocsparse_matrix_type_symmetric,\n \\ref rocsparse_matrix_type_hermitian, or \\ref rocsparse_matrix_type_triangular.\n @param[in]\n uplo \\ref rocsparse_fill_mode_lower or \\ref rocsparse_fill_mode_upper.\n @param[in]\n storage \\ref rocsparse_storage_mode_sorted or \\ref rocsparse_storage_mode_sorted.\n @param[out]\n data_status modified to indicate the status of the data.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_value \\p idx_base, \\p matrix_type, \\p uplo, or \\p storage is invalid.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p coo_val, \\p coo_row_ind, \\p coo_col_ind, \\p temp_buffer, or \\p data_status pointer\n is invalid.\n\n \\code{.c}\n // 1 2 0 0\n // 0 3 4 0\n // 0 0 1 1\n // 0 0 0 2\n std::vector<int> hcoo_row_ind = {0, 0, -1, 1, 2, 2, 3}; // <---- invalid row index\n std::vector<int> hcoo_col_ind = {0, 1, 1, 2, 2, 3, 3};\n std::vector<float> hcoo_val = {1, 2, 3, 4, 1, 1, 2};\n\n int m = 4;\n int n = 4;\n int nnz = 7;\n\n int* dcoo_row_ind = nullptr;\n int* dcoo_col_ind = nullptr;\n float* dcoo_val = nullptr;\n hipMalloc((void**)&dcoo_row_ind, sizeof(int) * nnz);\n hipMalloc((void**)&dcoo_col_ind, sizeof(int) * nnz);\n hipMalloc((void**)&dcoo_val, sizeof(float) * nnz);\n\n hipMemcpy(dcoo_row_ind, hcoo_row_ind.data(), sizeof(int) * nnz, hipMemcpyHostToDevice);\n hipMemcpy(dcoo_col_ind, hcoo_col_ind.data(), sizeof(int) * nnz, hipMemcpyHostToDevice);\n hipMemcpy(dcoo_val, hcoo_val.data(), sizeof(float) * nnz, hipMemcpyHostToDevice);\n\n rocsparse_handle handle;\n rocsparse_create_handle(&handle);\n\n const rocsparse_index_base idx_base = rocsparse_index_base_zero;\n const rocsparse_fill_mode fill_mode = rocsparse_fill_mode_upper;\n const rocsparse_matrix_type matrix_type = rocsparse_matrix_type_triangular;\n const rocsparse_storage_mode storage_mode = rocsparse_storage_mode_sorted;\n\n rocsparse_data_status data_status;\n\n size_t buffer_size;\n rocsparse_scheck_matrix_coo_buffer_size(handle, m, n, nnz, dcoo_val, dcoo_row_ind, dcoo_col_ind,\n idx_base, matrix_type, fill_mode, storage_mode, &buffer_size);\n\n void* dbuffer = nullptr;\n hipMalloc((void**)&dbuffer, buffer_size);\n\n rocsparse_scheck_matrix_coo(handle, m, n, nnz, dcoo_val, dcoo_row_ind, dcoo_col_ind, idx_base,\n matrix_type, fill_mode, storage_mode, &data_status, dbuffer);\n\n std::cout << \"data_status: \" << data_status << std::endl;\n\n hipFree(dbuffer);\n\n rocsparse_destroy_handle(handle);\n\n hipFree(dcoo_row_ind);\n hipFree(dcoo_col_ind);\n hipFree(dcoo_val);\n \\endcode\n/\n/**@{"]
pub fn rocsparse_scheck_matrix_coo(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
coo_val: *const f32,
coo_row_ind: *const rocsparse_int,
coo_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
data_status: *mut rocsparse_data_status,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcheck_matrix_coo(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
coo_val: *const f64,
coo_row_ind: *const rocsparse_int,
coo_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
data_status: *mut rocsparse_data_status,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccheck_matrix_coo(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
coo_val: *const rocsparse_float_complex,
coo_row_ind: *const rocsparse_int,
coo_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
data_status: *mut rocsparse_data_status,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcheck_matrix_coo(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
coo_val: *const rocsparse_double_complex,
coo_row_ind: *const rocsparse_int,
coo_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
data_status: *mut rocsparse_data_status,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup utility_module\n \\details\n \\p rocsparse_check_matrix_csc_buffer_size computes the required buffer size needed when\n calling \\ref rocsparse_scheck_matrix_csc \"rocsparse_Xcheck_matrix_csc()\".\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse CSC matrix.\n @param[in]\n n number of columns of the sparse CSC matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSC matrix.\n @param[in]\n csc_val array of \\p nnz elements of the sparse CSC matrix.\n @param[in]\n csc_col_ptr array of \\p m+1 elements that point to the start of every column of the\n sparse CSC matrix.\n @param[in]\n csc_row_ind array of \\p nnz elements containing the row indices of the sparse\n CSC matrix.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n matrix_type \\ref rocsparse_matrix_type_general, \\ref rocsparse_matrix_type_symmetric,\n \\ref rocsparse_matrix_type_hermitian, or \\ref rocsparse_matrix_type_triangular.\n @param[in]\n uplo \\ref rocsparse_fill_mode_lower or \\ref rocsparse_fill_mode_upper.\n @param[in]\n storage \\ref rocsparse_storage_mode_sorted or \\ref rocsparse_storage_mode_sorted.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n \\ref rocsparse_scheck_matrix_csc \"rocsparse_Xcheck_matrix_csc()\".\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_value \\p idx_base, \\p matrix_type, \\p uplo, or \\p storage is invalid.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p csc_val, \\p csc_col_ptr, \\p csc_row_ind, or \\p buffer_size pointer\n is invalid.\n/\n/**@{"]
pub fn rocsparse_scheck_matrix_csc_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
csc_val: *const f32,
csc_col_ptr: *const rocsparse_int,
csc_row_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcheck_matrix_csc_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
csc_val: *const f64,
csc_col_ptr: *const rocsparse_int,
csc_row_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccheck_matrix_csc_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
csc_val: *const rocsparse_float_complex,
csc_col_ptr: *const rocsparse_int,
csc_row_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcheck_matrix_csc_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
csc_val: *const rocsparse_double_complex,
csc_col_ptr: *const rocsparse_int,
csc_row_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup utility_module\n \\brief Check matrix to see if it is valid.\n\n \\details\n \\p rocsparse_check_matrix_csc checks if the input CSC matrix is valid. It performs basic sanity checks on the input\n matrix and tries to detect issues in the data. This includes looking for 'nan' or 'inf' values in the data arrays,\n invalid row indices or invalid column offsets, whether the matrix is triangular or not, whether there are duplicate row\n indices, or whether the row indices are not sorted when they should be. If an issue is found, it is written to the\n \\p data_status parameter.\n\n Performing the above checks involves two steps. First, call \\p rocsparse_Xcheck_matrix_csc_buffer_size\n to determine the required buffer size. Then allocate this buffer and pass it to \\p rocsparse_Xcheck_matrix_csc.\n Any issues detected will be written to the \\p data_status parameter, which is always a host variable regardless of the pointer mode.\n\n **Example**\n\n This example checks whether a CSC matrix has the correct row indices. The input matrix\n is invalid because it contains a duplicate entry in the row indices array.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse CSC matrix.\n @param[in]\n n number of columns of the sparse CSC matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSC matrix.\n @param[in]\n csc_val array of \\p nnz elements of the sparse CSC matrix.\n @param[in]\n csc_col_ptr array of \\p m+1 elements that point to the start of every column of the\n sparse CSC matrix.\n @param[in]\n csc_row_ind array of \\p nnz elements containing the row indices of the sparse\n CSC matrix.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n matrix_type \\ref rocsparse_matrix_type_general, \\ref rocsparse_matrix_type_symmetric,\n \\ref rocsparse_matrix_type_hermitian, or \\ref rocsparse_matrix_type_triangular.\n @param[in]\n uplo \\ref rocsparse_fill_mode_lower or \\ref rocsparse_fill_mode_upper.\n @param[in]\n storage \\ref rocsparse_storage_mode_sorted or \\ref rocsparse_storage_mode_sorted.\n @param[out]\n data_status modified to indicate the status of the data.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_value \\p idx_base, \\p matrix_type, \\p uplo, or \\p storage is invalid.\n \\retval rocsparse_status_invalid_size \\p m \\p n or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p csc_val, \\p csc_col_ptr, \\p csc_row_ind, \\p temp_buffer, or \\p data_status pointer\n is invalid.\n\n \\code{.c}\n // 1 2 0 0\n // 0 3 4 0\n // 2 0 1 1\n // 0 3 0 2\n std::vector<int> hcsc_row_ind = {0, 2, 0, 1, 1, 1, 2, 2, 3}; //<---duplicate row index in second column\n std::vector<int> hcsc_col_ptr = {0, 2, 5, 7, 9};\n std::vector<float> hcsc_val = {1, 2, 2, 3, 3, 4, 1, 1, 2};\n\n int m = 4;\n int n = 4;\n int nnz = 9;\n\n int* dcsc_row_ind = nullptr;\n int* dcsc_col_ptr = nullptr;\n float* dcsc_val = nullptr;\n hipMalloc((void**)&dcsc_row_ind, sizeof(int) * nnz);\n hipMalloc((void**)&dcsc_col_ptr, sizeof(int) * (n + 1));\n hipMalloc((void**)&dcsc_val, sizeof(float) * nnz);\n\n hipMemcpy(dcsc_row_ind, hcsc_row_ind.data(), sizeof(int) * nnz, hipMemcpyHostToDevice);\n hipMemcpy(dcsc_col_ptr, hcsc_col_ptr.data(), sizeof(int) * (n + 1), hipMemcpyHostToDevice);\n hipMemcpy(dcsc_val, hcsc_val.data(), sizeof(float) * nnz, hipMemcpyHostToDevice);\n\n rocsparse_handle handle;\n rocsparse_create_handle(&handle);\n\n const rocsparse_index_base idx_base = rocsparse_index_base_zero;\n const rocsparse_fill_mode fill_mode = rocsparse_fill_mode_upper;\n const rocsparse_matrix_type matrix_type = rocsparse_matrix_type_general;\n const rocsparse_storage_mode storage_mode = rocsparse_storage_mode_sorted;\n\n rocsparse_data_status data_status;\n\n size_t buffer_size;\n rocsparse_scheck_matrix_csc_buffer_size(handle, m, n, nnz, dcsc_val, dcsc_col_ptr, dcsc_row_ind,\n idx_base, matrix_type, fill_mode, storage_mode, &buffer_size);\n\n void* dbuffer = nullptr;\n hipMalloc((void**)&dbuffer, buffer_size);\n\n rocsparse_scheck_matrix_csc(handle, m, n, nnz, dcsc_val, dcsc_col_ptr, dcsc_row_ind, idx_base,\n matrix_type, fill_mode, storage_mode, &data_status, dbuffer);\n\n std::cout << \"data_status: \" << data_status << std::endl;\n\n hipFree(dbuffer);\n\n rocsparse_destroy_handle(handle);\n\n hipFree(dcsc_row_ind);\n hipFree(dcsc_col_ptr);\n hipFree(dcsc_val);\n \\endcode\n/\n/**@{"]
pub fn rocsparse_scheck_matrix_csc(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
csc_val: *const f32,
csc_col_ptr: *const rocsparse_int,
csc_row_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
data_status: *mut rocsparse_data_status,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcheck_matrix_csc(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
csc_val: *const f64,
csc_col_ptr: *const rocsparse_int,
csc_row_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
data_status: *mut rocsparse_data_status,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccheck_matrix_csc(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
csc_val: *const rocsparse_float_complex,
csc_col_ptr: *const rocsparse_int,
csc_row_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
data_status: *mut rocsparse_data_status,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcheck_matrix_csc(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
csc_val: *const rocsparse_double_complex,
csc_col_ptr: *const rocsparse_int,
csc_row_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
data_status: *mut rocsparse_data_status,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup utility_module\n \\details\n \\p rocsparse_check_matrix_csr_buffer_size computes the required buffer size needed when calling\n \\ref rocsparse_scheck_matrix_csr \"rocsparse_Xcheck_matrix_csr()\".\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n n number of columns of the sparse CSR matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix.\n @param[in]\n csr_val array of \\p nnz elements of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n matrix_type \\ref rocsparse_matrix_type_general, \\ref rocsparse_matrix_type_symmetric,\n \\ref rocsparse_matrix_type_hermitian, or \\ref rocsparse_matrix_type_triangular.\n @param[in]\n uplo \\ref rocsparse_fill_mode_lower or \\ref rocsparse_fill_mode_upper.\n @param[in]\n storage \\ref rocsparse_storage_mode_sorted or \\ref rocsparse_storage_mode_sorted.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n rocsparse_scheck_matrix_csr(), rocsparse_dcheck_matrix_csr(),\n rocsparse_ccheck_matrix_csr(), and rocsparse_zcheck_matrix_csr().\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_value \\p idx_base, \\p matrix_type, \\p uplo, or \\p storage is invalid.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p csr_val, \\p csr_row_ptr, \\p csr_col_ind, or \\p buffer_size pointer\n is invalid.\n/\n/**@{"]
pub fn rocsparse_scheck_matrix_csr_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcheck_matrix_csr_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccheck_matrix_csr_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
csr_val: *const rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcheck_matrix_csr_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
csr_val: *const rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup utility_module\n \\brief Check matrix to see if it is valid.\n\n \\details\n \\p rocsparse_check_matrix_csr checks whether the input CSR matrix is valid. It performs basic sanity checks on the input\n matrix and tries to detect issues in the data. This includes looking for 'nan' or 'inf' values in the data arrays,\n invalid column indices or row offsets, whether the matrix is triangular or not, whether there are duplicate\n indices, or whether the column indices are not sorted when they should be. If an issue is found, it is written to the\n \\p data_status parameter.\n\n Performing the above checks involves two steps. First, call \\p rocsparse_Xcheck_matrix_csr_buffer_size\n to determine the required buffer size. Then allocate this buffer and pass it to \\p rocsparse_Xcheck_matrix_csr.\n Any issues detected will be written to the \\p data_status parameter, which is always a host variable regardless of the pointer mode.\n\n **Example**\n\n This example checks whether a CSR matrix has the correct row pointer array. The input matrix\n is invalid because it contains a -1 entry in the row pointer array.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse CSR matrix.\n @param[in]\n n number of columns of the sparse CSR matrix.\n @param[in]\n nnz number of non-zero entries of the sparse CSR matrix.\n @param[in]\n csr_val array of \\p nnz elements of the sparse CSR matrix.\n @param[in]\n csr_row_ptr array of \\p m+1 elements that point to the start of every row of the\n sparse CSR matrix.\n @param[in]\n csr_col_ind array of \\p nnz elements containing the column indices of the sparse\n CSR matrix.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n matrix_type \\ref rocsparse_matrix_type_general, \\ref rocsparse_matrix_type_symmetric,\n \\ref rocsparse_matrix_type_hermitian, or \\ref rocsparse_matrix_type_triangular.\n @param[in]\n uplo \\ref rocsparse_fill_mode_lower or \\ref rocsparse_fill_mode_upper.\n @param[in]\n storage \\ref rocsparse_storage_mode_sorted or \\ref rocsparse_storage_mode_sorted.\n @param[out]\n data_status modified to indicate the status of the data.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_value \\p idx_base, \\p matrix_type, \\p uplo, or \\p storage is invalid.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p nnz is invalid.\n \\retval rocsparse_status_invalid_pointer \\p csr_val, \\p csr_row_ptr, \\p csr_col_ind, \\p temp_buffer, or \\p data_status pointer\n is invalid.\n\n \\code{.c}\n // 1 2 0 0\n // 0 3 4 0\n // 2 0 1 1\n // 0 3 0 2\n std::vector<int> hcsr_row_ptr = {0, 2, -1, 7, 9}; // <---- invalid ptr array\n std::vector<int> hcsr_col_ind = {0, 1, 1, 2, 0, 2, 3, 1, 3};\n std::vector<float> hcsr_val = {1, 2, 3, 4, 2, 1, 1, 3, 2};\n\n int m = 4;\n int n = 4;\n int nnz = 9;\n\n int* dcsr_row_ptr = nullptr;\n int* dcsr_col_ind = nullptr;\n float* dcsr_val = nullptr;\n hipMalloc((void**)&dcsr_row_ptr, sizeof(int) * (m + 1));\n hipMalloc((void**)&dcsr_col_ind, sizeof(int) * nnz);\n hipMalloc((void**)&dcsr_val, sizeof(float) * nnz);\n\n hipMemcpy(dcsr_row_ptr, hcsr_row_ptr.data(), sizeof(int) * (m + 1), hipMemcpyHostToDevice);\n hipMemcpy(dcsr_col_ind, hcsr_col_ind.data(), sizeof(int) * nnz, hipMemcpyHostToDevice);\n hipMemcpy(dcsr_val, hcsr_val.data(), sizeof(float) * nnz, hipMemcpyHostToDevice);\n\n rocsparse_handle handle;\n rocsparse_create_handle(&handle);\n\n const rocsparse_index_base idx_base = rocsparse_index_base_zero;\n const rocsparse_fill_mode fill_mode = rocsparse_fill_mode_upper;\n const rocsparse_matrix_type matrix_type = rocsparse_matrix_type_general;\n const rocsparse_storage_mode storage_mode = rocsparse_storage_mode_sorted;\n\n rocsparse_data_status data_status;\n\n size_t buffer_size;\n rocsparse_scheck_matrix_csr_buffer_size(handle, m, n, nnz, dcsr_val, dcsr_row_ptr, dcsr_col_ind,\n idx_base, matrix_type, fill_mode, storage_mode, &buffer_size);\n\n void* dbuffer = nullptr;\n hipMalloc((void**)&dbuffer, buffer_size);\n\n rocsparse_scheck_matrix_csr(handle, m, n, nnz, dcsr_val, dcsr_row_ptr, dcsr_col_ind, idx_base,\n matrix_type, fill_mode, storage_mode, &data_status, dbuffer);\n\n std::cout << \"data_status: \" << data_status << std::endl;\n\n hipFree(dbuffer);\n\n rocsparse_destroy_handle(handle);\n\n hipFree(dcsr_row_ptr);\n hipFree(dcsr_col_ind);\n hipFree(dcsr_val);\n \\endcode\n/\n/**@{"]
pub fn rocsparse_scheck_matrix_csr(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
csr_val: *const f32,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
data_status: *mut rocsparse_data_status,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcheck_matrix_csr(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
csr_val: *const f64,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
data_status: *mut rocsparse_data_status,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccheck_matrix_csr(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
csr_val: *const rocsparse_float_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
data_status: *mut rocsparse_data_status,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcheck_matrix_csr(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
nnz: rocsparse_int,
csr_val: *const rocsparse_double_complex,
csr_row_ptr: *const rocsparse_int,
csr_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
data_status: *mut rocsparse_data_status,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup utility_module\n \\details\n \\p rocsparse_check_matrix_ell_buffer_size computes the required buffer size needed when\n calling \\ref rocsparse_scheck_matrix_ell \"rocsparse_Xcheck_matrix_ell()\".\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse ELL matrix.\n @param[in]\n n number of columns of the sparse ELL matrix.\n @param[in]\n ell_width number of non-zero elements per row of the sparse ELL matrix.\n @param[in]\n ell_val array that contains the elements of the sparse ELL matrix. Padded\n elements should be zero.\n @param[in]\n ell_col_ind array that contains the column indices of the sparse ELL matrix.\n Padded column indices should be -1.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n matrix_type \\ref rocsparse_matrix_type_general, \\ref rocsparse_matrix_type_symmetric,\n \\ref rocsparse_matrix_type_hermitian, or \\ref rocsparse_matrix_type_triangular.\n @param[in]\n uplo \\ref rocsparse_fill_mode_lower or \\ref rocsparse_fill_mode_upper.\n @param[in]\n storage \\ref rocsparse_storage_mode_sorted or \\ref rocsparse_storage_mode_sorted.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n rocsparse_scheck_matrix_ell(), rocsparse_dcheck_matrix_ell(),\n rocsparse_ccheck_matrix_ell(), and rocsparse_zcheck_matrix_ell().\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_value \\p idx_base, \\p matrix_type, \\p uplo, or \\p storage is invalid.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p ell_width is invalid.\n \\retval rocsparse_status_invalid_pointer \\p ell_val, \\p ell_col_ind, or \\p buffer_size pointer\n is invalid.\n/\n/**@{"]
pub fn rocsparse_scheck_matrix_ell_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
ell_width: rocsparse_int,
ell_val: *const f32,
ell_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcheck_matrix_ell_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
ell_width: rocsparse_int,
ell_val: *const f64,
ell_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccheck_matrix_ell_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
ell_width: rocsparse_int,
ell_val: *const rocsparse_float_complex,
ell_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcheck_matrix_ell_buffer_size(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
ell_width: rocsparse_int,
ell_val: *const rocsparse_double_complex,
ell_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup utility_module\n \\brief Check matrix to see if it is valid.\n\n \\details\n \\p rocsparse_check_matrix_ell checks if the input ELL matrix is valid. It performs basic sanity checks on the input\n matrix and tries to detect issues in the data. This includes looking for 'nan' or 'inf' values in the data arrays,\n invalid column indices, whether there are duplicate indices, or whether the column indices are not sorted when they\n should be. If an issue is found, it is written to the \\p data_status parameter.\n\n Performing the above checks involves two steps. First, call \\p rocsparse_Xcheck_matrix_ell_buffer_size\n to determine the required buffer size. Then allocate this buffer and pass it to \\p rocsparse_Xcheck_matrix_ell.\n Any issues detected will be written to the \\p data_status parameter, which is always a host variable regardless of the pointer mode.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n m number of rows of the sparse ELL matrix.\n @param[in]\n n number of columns of the sparse ELL matrix.\n @param[in]\n ell_width number of non-zero elements per row of the sparse ELL matrix.\n @param[in]\n ell_val array that contains the elements of the sparse ELL matrix. Padded\n elements should be zero.\n @param[in]\n ell_col_ind array that contains the column indices of the sparse ELL matrix.\n Padded column indices should be -1.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n matrix_type \\ref rocsparse_matrix_type_general, \\ref rocsparse_matrix_type_symmetric,\n \\ref rocsparse_matrix_type_hermitian, or \\ref rocsparse_matrix_type_triangular.\n @param[in]\n uplo \\ref rocsparse_fill_mode_lower or \\ref rocsparse_fill_mode_upper.\n @param[in]\n storage \\ref rocsparse_storage_mode_sorted or \\ref rocsparse_storage_mode_sorted.\n @param[out]\n data_status modified to indicate the status of the data.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_value \\p idx_base, \\p matrix_type, \\p uplo, or \\p storage is invalid.\n \\retval rocsparse_status_invalid_size \\p m, \\p n, or \\p ell_width is invalid.\n \\retval rocsparse_status_invalid_pointer \\p ell_val, \\p ell_col_ind, \\p temp_buffer, or \\p data_status pointer\n is invalid.\n/\n/**@{"]
pub fn rocsparse_scheck_matrix_ell(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
ell_width: rocsparse_int,
ell_val: *const f32,
ell_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
data_status: *mut rocsparse_data_status,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcheck_matrix_ell(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
ell_width: rocsparse_int,
ell_val: *const f64,
ell_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
data_status: *mut rocsparse_data_status,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccheck_matrix_ell(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
ell_width: rocsparse_int,
ell_val: *const rocsparse_float_complex,
ell_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
data_status: *mut rocsparse_data_status,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcheck_matrix_ell(
handle: rocsparse_handle,
m: rocsparse_int,
n: rocsparse_int,
ell_width: rocsparse_int,
ell_val: *const rocsparse_double_complex,
ell_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
data_status: *mut rocsparse_data_status,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup utility_module\n \\details\n \\p rocsparse_check_matrix_gebsc_buffer_size computes the required buffer size needed when\n calling \\ref rocsparse_scheck_matrix_gebsc \"rocsparse_Xcheck_matrix_gebsc()\".\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir matrix storage of GEBSC blocks.\n @param[in]\n mb number of block rows of the sparse GEBSC matrix.\n @param[in]\n nb number of block columns of the sparse GEBSC matrix.\n @param[in]\n nnzb number of non-zero blocks of the sparse GEBSC matrix.\n @param[in]\n row_block_dim row block dimension of the sparse GEBSC matrix.\n @param[in]\n col_block_dim column block dimension of the sparse GEBSC matrix.\n @param[in]\n bsc_val array of \\p nnzb elements of the sparse GEBSC matrix.\n @param[in]\n bsc_col_ptr array of \\p nb+1 elements that point to the start of every column of the\n sparse GEBSC matrix.\n @param[in]\n bsc_row_ind array of \\p nnzb elements containing the row indices of the sparse\n GEBSC matrix.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n matrix_type \\ref rocsparse_matrix_type_general, \\ref rocsparse_matrix_type_symmetric,\n \\ref rocsparse_matrix_type_hermitian, or \\ref rocsparse_matrix_type_triangular.\n @param[in]\n uplo \\ref rocsparse_fill_mode_lower or \\ref rocsparse_fill_mode_upper.\n @param[in]\n storage \\ref rocsparse_storage_mode_sorted or \\ref rocsparse_storage_mode_sorted.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n rocsparse_scheck_matrix_gebsc(), rocsparse_dcheck_matrix_gebsc(),\n rocsparse_ccheck_matrix_gebsc(), and rocsparse_zcheck_matrix_gebsc().\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_value \\p dir, \\p idx_base, \\p matrix_type, \\p uplo, or \\p storage is invalid.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nb, \\p nnzb, \\p row_block_dim, or \\p col_block_dim is invalid.\n \\retval rocsparse_status_invalid_pointer \\p bsc_val, \\p bsc_col_ptr, \\p bsc_row_ind, or \\p buffer_size pointer\n is invalid.\n/\n/**@{"]
pub fn rocsparse_scheck_matrix_gebsc_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
bsc_val: *const f32,
bsc_col_ptr: *const rocsparse_int,
bsc_row_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcheck_matrix_gebsc_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
bsc_val: *const f64,
bsc_col_ptr: *const rocsparse_int,
bsc_row_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccheck_matrix_gebsc_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
bsc_val: *const rocsparse_float_complex,
bsc_col_ptr: *const rocsparse_int,
bsc_row_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcheck_matrix_gebsc_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
bsc_val: *const rocsparse_double_complex,
bsc_col_ptr: *const rocsparse_int,
bsc_row_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup utility_module\n \\brief Check matrix to see if it is valid.\n\n \\details\n \\p rocsparse_check_matrix_gebsc checks whether the input GEBSC matrix is valid. It performs basic sanity checks on the input\n matrix and tries to detect issues in the data. This includes looking for 'nan' or 'inf' values in the data arrays,\n invalid row indices or column offsets, whether the matrix is triangular or not, whether there are duplicate\n indices, or whether the row indices are not sorted when they should be. If an issue is found, it is written to the\n \\p data_status parameter.\n\n Performing the above checks involves two steps. First, call \\p rocsparse_Xcheck_matrix_gebsc_buffer_size\n to determine the required buffer size. Then allocate this buffer and pass it to \\p rocsparse_Xcheck_matrix_gebsc.\n Any issues detected will be written to the \\p data_status parameter, which is always a host variable regardless of the pointer mode.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir matrix storage of GEBSC blocks.\n @param[in]\n mb number of block rows of the sparse GEBSC matrix.\n @param[in]\n nb number of block columns of the sparse GEBSC matrix.\n @param[in]\n nnzb number of non-zero blocks of the sparse GEBSC matrix.\n @param[in]\n row_block_dim row block dimension of the sparse GEBSC matrix.\n @param[in]\n col_block_dim column block dimension of the sparse GEBSC matrix.\n @param[in]\n bsc_val array of \\p nnzb elements of the sparse GEBSC matrix.\n @param[in]\n bsc_col_ptr array of \\p nb+1 elements that point to the start of every column of the\n sparse GEBSC matrix.\n @param[in]\n bsc_row_ind array of \\p nnzb elements containing the row indices of the sparse\n GEBSC matrix.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n matrix_type \\ref rocsparse_matrix_type_general, \\ref rocsparse_matrix_type_symmetric,\n \\ref rocsparse_matrix_type_hermitian, or \\ref rocsparse_matrix_type_triangular.\n @param[in]\n uplo \\ref rocsparse_fill_mode_lower or \\ref rocsparse_fill_mode_upper.\n @param[in]\n storage \\ref rocsparse_storage_mode_sorted or \\ref rocsparse_storage_mode_sorted.\n @param[out]\n data_status modified to indicate the status of the data.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_value \\p dir, \\p idx_base, \\p matrix_type, \\p uplo, or \\p storage is invalid.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nb, \\p nnzb, \\p row_block_dim, or \\p col_block_dim is invalid.\n \\retval rocsparse_status_invalid_pointer \\p bsc_val, \\p bsc_col_ptr, \\p bsc_row_ind, \\p temp_buffer, or \\p data_status pointer\n is invalid.\n/\n/**@{"]
pub fn rocsparse_scheck_matrix_gebsc(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
bsc_val: *const f32,
bsc_col_ptr: *const rocsparse_int,
bsc_row_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
data_status: *mut rocsparse_data_status,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcheck_matrix_gebsc(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
bsc_val: *const f64,
bsc_col_ptr: *const rocsparse_int,
bsc_row_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
data_status: *mut rocsparse_data_status,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccheck_matrix_gebsc(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
bsc_val: *const rocsparse_float_complex,
bsc_col_ptr: *const rocsparse_int,
bsc_row_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
data_status: *mut rocsparse_data_status,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcheck_matrix_gebsc(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
bsc_val: *const rocsparse_double_complex,
bsc_col_ptr: *const rocsparse_int,
bsc_row_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
data_status: *mut rocsparse_data_status,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup utility_module\n \\brief Check matrix to see if it is valid.\n\n \\details\n \\p rocsparse_check_matrix_gebsr_buffer_size computes the required buffer size needed when\n calling \\ref rocsparse_scheck_matrix_gebsr \"rocsparse_Xcheck_matrix_gebsr()\".\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir matrix storage of GEBSR blocks.\n @param[in]\n mb number of block rows of the sparse GEBSR matrix.\n @param[in]\n nb number of block columns of the sparse GEBSR matrix.\n @param[in]\n nnzb number of non-zero blocks of the sparse GEBSR matrix.\n @param[in]\n row_block_dim row block dimension of the sparse GEBSR matrix.\n @param[in]\n col_block_dim column block dimension of the sparse GEBSR matrix.\n @param[in]\n bsr_val array of \\p nnzb elements of the sparse GEBSR matrix.\n @param[in]\n bsr_row_ptr array of \\p mb+1 elements that point to the start of every row of the\n sparse GEBSR matrix.\n @param[in]\n bsr_col_ind array of \\p nnzb elements containing the column indices of the sparse\n GEBSR matrix.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n matrix_type \\ref rocsparse_matrix_type_general, \\ref rocsparse_matrix_type_symmetric,\n \\ref rocsparse_matrix_type_hermitian, or \\ref rocsparse_matrix_type_triangular.\n @param[in]\n uplo \\ref rocsparse_fill_mode_lower or \\ref rocsparse_fill_mode_upper.\n @param[in]\n storage \\ref rocsparse_storage_mode_sorted or \\ref rocsparse_storage_mode_sorted.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n rocsparse_scheck_matrix_gebsr(), rocsparse_dcheck_matrix_gebsr(),\n rocsparse_ccheck_matrix_gebsr(), and rocsparse_zcheck_matrix_gebsr().\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_value \\p dir, \\p idx_base, \\p matrix_type, \\p uplo, or \\p storage is invalid.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nb, \\p nnzb, \\p row_block_dim, or \\p col_block_dim is invalid.\n \\retval rocsparse_status_invalid_pointer \\p bsr_val, \\p bsr_row_ptr, \\p bsr_col_ind, or \\p buffer_size pointer\n is invalid.\n/\n/**@{"]
pub fn rocsparse_scheck_matrix_gebsr_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
bsr_val: *const f32,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcheck_matrix_gebsr_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
bsr_val: *const f64,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccheck_matrix_gebsr_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
bsr_val: *const rocsparse_float_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcheck_matrix_gebsr_buffer_size(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
bsr_val: *const rocsparse_double_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup utility_module\n \\brief Check matrix to see if it is valid.\n\n \\details\n \\p rocsparse_check_matrix_gebsr checks whether the input GEBSR matrix is valid. It performs basic sanity checks on the input\n matrix and tries to detect issues in the data. This includes looking for 'nan' or 'inf' values in the data arrays,\n invalid column indices and row offsets, whether the matrix is triangular or not, whether there are duplicate\n indices, or whether the column indices are not sorted when they should be. If an issue is found, it is written to the\n \\p data_status parameter.\n\n Performing the above checks involves two steps. First, call \\p rocsparse_Xcheck_matrix_gebsr_buffer_size\n to determine the required buffer size. Then allocate this buffer and pass it to \\p rocsparse_Xcheck_matrix_gebsr.\n Any issues detected will be written to the \\p data_status parameter, which is always a host variable regardless of the pointer mode.\n\n **Example**\n\n This example checks whether a GEBSR matrix has valid values. The input matrix\n is invalid because it contains a nan entry in the values array.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n dir matrix storage of GEBSR blocks.\n @param[in]\n mb number of block rows of the sparse GEBSR matrix.\n @param[in]\n nb number of block columns of the sparse GEBSR matrix.\n @param[in]\n nnzb number of non-zero blocks of the sparse GEBSR matrix.\n @param[in]\n row_block_dim row block dimension of the sparse GEBSR matrix.\n @param[in]\n col_block_dim column block dimension of the sparse GEBSR matrix.\n @param[in]\n bsr_val array of \\p nnzb elements of the sparse GEBSR matrix.\n @param[in]\n bsr_row_ptr array of \\p mb+1 elements that point to the start of every row of the\n sparse GEBSR matrix.\n @param[in]\n bsr_col_ind array of \\p nnzb elements containing the column indices of the sparse\n GEBSR matrix.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n matrix_type \\ref rocsparse_matrix_type_general, \\ref rocsparse_matrix_type_symmetric,\n \\ref rocsparse_matrix_type_hermitian, or \\ref rocsparse_matrix_type_triangular.\n @param[in]\n uplo \\ref rocsparse_fill_mode_lower or \\ref rocsparse_fill_mode_upper.\n @param[in]\n storage \\ref rocsparse_storage_mode_sorted or \\ref rocsparse_storage_mode_sorted.\n @param[out]\n data_status modified to indicate the status of the data.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_value \\p dir, \\p idx_base, \\p matrix_type, \\p uplo, or \\p storage is invalid.\n \\retval rocsparse_status_invalid_size \\p mb, \\p nb, \\p nnzb, \\p row_block_dim, or \\p col_block_dim is invalid.\n \\retval rocsparse_status_invalid_pointer \\p bsr_val, \\p bsr_row_ptr, \\p bsr_col_ind, \\p temp_buffer, or \\p data_status pointer\n is invalid.\n\n \\code{.c}\n // 1 2 | 0 0\n // 0 3 | 0 0\n // ---------\n // 4 5 | 7 8\n // 0 6 | 0 9\n std::vector<int> hbsr_row_ptr = {0, 1, 3};\n std::vector<int> hbsr_col_ind = {0, 0, 1};\n std::vector<float> hbsr_val = {1, 2, 0, 3, 4, 5, 0, 6, 7, 8, std::numeric_limits<double>::quiet_NaN(), 9}; //<---contains nan\n\n int mb = 2;\n int nb = 2;\n int nnzb = 3;\n int block_dim = 2;\n\n int* dbsr_row_ptr = nullptr;\n int* dbsr_col_ind = nullptr;\n float* dbsr_val = nullptr;\n hipMalloc((void**)&dbsr_row_ptr, sizeof(int) * (mb + 1));\n hipMalloc((void**)&dbsr_col_ind, sizeof(int) * nnzb);\n hipMalloc((void**)&dbsr_val, sizeof(float) * nnzb * block_dim * block_dim);\n\n hipMemcpy(dbsr_row_ptr, hbsr_row_ptr.data(), sizeof(int) * (mb + 1), hipMemcpyHostToDevice);\n hipMemcpy(dbsr_col_ind, hbsr_col_ind.data(), sizeof(int) * nnzb, hipMemcpyHostToDevice);\n hipMemcpy(dbsr_val, hbsr_val.data(), sizeof(float) * nnzb * block_dim * block_dim, hipMemcpyHostToDevice);\n\n rocsparse_handle handle;\n rocsparse_create_handle(&handle);\n\n const rocsparse_direction direction = rocsparse_direction_row;\n const rocsparse_index_base idx_base = rocsparse_index_base_zero;\n const rocsparse_fill_mode fill_mode = rocsparse_fill_mode_upper;\n const rocsparse_matrix_type matrix_type = rocsparse_matrix_type_triangular;\n const rocsparse_storage_mode storage_mode = rocsparse_storage_mode_sorted;\n\n rocsparse_data_status data_status;\n\n size_t buffer_size;\n rocsparse_scheck_matrix_gebsr_buffer_size(handle, direction, mb, nb, nnzb, block_dim, block_dim,\n dbsr_val, dbsr_row_ptr, dbsr_col_ind, idx_base, matrix_type, fill_mode, storage_mode, &buffer_size);\n\n void* dbuffer = nullptr;\n hipMalloc((void**)&dbuffer, buffer_size);\n\n rocsparse_scheck_matrix_gebsr(handle, direction, mb, nb, nnzb, block_dim, block_dim, dbsr_val, dbsr_row_ptr,\n dbsr_col_ind, idx_base, matrix_type, fill_mode, storage_mode, &data_status, dbuffer);\n\n std::cout << \"data_status: \" << data_status << std::endl;\n\n hipFree(dbuffer);\n\n rocsparse_destroy_handle(handle);\n\n hipFree(dbsr_row_ptr);\n hipFree(dbsr_col_ind);\n hipFree(dbsr_val);\n \\endcode\n/\n/**@{"]
pub fn rocsparse_scheck_matrix_gebsr(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
bsr_val: *const f32,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
data_status: *mut rocsparse_data_status,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_dcheck_matrix_gebsr(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
bsr_val: *const f64,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
data_status: *mut rocsparse_data_status,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_ccheck_matrix_gebsr(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
bsr_val: *const rocsparse_float_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
data_status: *mut rocsparse_data_status,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
pub fn rocsparse_zcheck_matrix_gebsr(
handle: rocsparse_handle,
dir: rocsparse_direction,
mb: rocsparse_int,
nb: rocsparse_int,
nnzb: rocsparse_int,
row_block_dim: rocsparse_int,
col_block_dim: rocsparse_int,
bsr_val: *const rocsparse_double_complex,
bsr_row_ptr: *const rocsparse_int,
bsr_col_ind: *const rocsparse_int,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
data_status: *mut rocsparse_data_status,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup utility_module\n \\brief Check matrix to see if it is valid.\n\n \\details\n \\p rocsparse_check_matrix_hyb_buffer_size computes the required buffer size needed when\n calling \\ref rocsparse_check_matrix_hyb.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n hyb matrix in HYB storage format.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n matrix_type \\ref rocsparse_matrix_type_general, \\ref rocsparse_matrix_type_symmetric,\n \\ref rocsparse_matrix_type_hermitian, or \\ref rocsparse_matrix_type_triangular.\n @param[in]\n uplo \\ref rocsparse_fill_mode_lower or \\ref rocsparse_fill_mode_upper.\n @param[in]\n storage \\ref rocsparse_storage_mode_sorted or \\ref rocsparse_storage_mode_sorted.\n @param[out]\n buffer_size number of bytes of the temporary storage buffer required by\n rocsparse_check_matrix_hyb().\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_value \\p idx_base, \\p matrix_type, \\p uplo, or \\p storage is invalid.\n \\retval rocsparse_status_invalid_pointer \\p hyb or \\p buffer_size pointer is invalid."]
pub fn rocsparse_check_matrix_hyb_buffer_size(
handle: rocsparse_handle,
hyb: rocsparse_hyb_mat,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
buffer_size: *mut usize,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup utility_module\n \\brief Check matrix to see if it is valid.\n\n \\details\n \\p rocsparse_check_matrix_hyb checks whether the input HYB matrix is valid. It performs basic sanity checks on the input\n matrix and tries to detect issues in the data. This includes looking for 'nan' or 'inf' values in the data arrays,\n invalid row/column indices, whether the matrix is triangular or not, whether there are duplicate indices, or whether\n the row/column indices are not sorted when they should be. If an issue is found, it is written to the \\p data_status\n parameter.\n\n Performing the above checks involves two steps. First, call \\p rocsparse_Xcheck_matrix_hyb_buffer_size\n to determine the required buffer size. Then allocate this buffer and pass it to \\p rocsparse_Xcheck_matrix_hyb.\n Any issues detected will be written to the \\p data_status parameter, which is always a host variable regardless of the pointer mode.\n\n \\note\n This routine does not support execution in a hipGraph context.\n\n @param[in]\n handle handle to the rocSPARSE library context queue.\n @param[in]\n hyb matrix in HYB storage format.\n @param[in]\n idx_base \\ref rocsparse_index_base_zero or \\ref rocsparse_index_base_one.\n @param[in]\n matrix_type \\ref rocsparse_matrix_type_general, \\ref rocsparse_matrix_type_symmetric,\n \\ref rocsparse_matrix_type_hermitian, or \\ref rocsparse_matrix_type_triangular.\n @param[in]\n uplo \\ref rocsparse_fill_mode_lower or \\ref rocsparse_fill_mode_upper.\n @param[in]\n storage \\ref rocsparse_storage_mode_sorted or \\ref rocsparse_storage_mode_sorted.\n @param[out]\n data_status modified to indicate the status of the data.\n @param[in]\n temp_buffer temporary storage buffer allocated by the user.\n\n \\retval rocsparse_status_success the operation completed successfully.\n \\retval rocsparse_status_invalid_handle the library context was not initialized.\n \\retval rocsparse_status_invalid_value \\p idx_base, \\p matrix_type, \\p uplo, or \\p storage is invalid.\n \\retval rocsparse_status_invalid_pointer \\p hyb or \\p data_status pointer is invalid."]
pub fn rocsparse_check_matrix_hyb(
handle: rocsparse_handle,
hyb: rocsparse_hyb_mat,
idx_base: rocsparse_index_base,
matrix_type: rocsparse_matrix_type,
uplo: rocsparse_fill_mode,
storage: rocsparse_storage_mode,
data_status: *mut rocsparse_data_status,
temp_buffer: *mut ::std::os::raw::c_void,
) -> rocsparse_status;
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\details Enable rocTX instrumentation.\n \\note This routine ignores the environment variable \\p ROCSPARSE_ROCTX."]
pub fn rocsparse_enable_roctx();
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\details Disable rocTX instrumentation.\n \\note This routine ignores the environment variable \\p ROCSPARSE_ROCTX."]
pub fn rocsparse_disable_roctx();
}
unsafe extern "C" {
#[doc = " \\ingroup aux_module\n \\details Query whether rocTX instrumentation has been enabled. See \\ref rocsparse_enable_roctx.\n \\return 1 if enabled, 0 otherwise."]
pub fn rocsparse_state_roctx() -> ::std::os::raw::c_int;
}