# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
#
# SPDX-License-Identifier: Apache-2.0
#
# This code was automatically generated across versions from 0.7.2 to 0.8.0, generator version 0.3.1.dev1471+g7122059e9. Do not modify it directly.

from ..cycusolverMp cimport *


###############################################################################
# Wrapper functions
###############################################################################

cdef cusolverStatus_t _cusolverMpCreate(cusolverMpHandle_t* handle, int deviceId, cudaStream_t stream) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpDestroy(cusolverMpHandle_t handle) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpGetStream(cusolverMpHandle_t handle, cudaStream_t* stream) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpGetVersion(cusolverMpHandle_t handle, int* version) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpCreateDeviceGrid(cusolverMpHandle_t handle, cusolverMpGrid_t* grid, const ncclComm_t comm, int32_t numRowDevices, int32_t numColDevices, const cusolverMpGridMapping_t mapping) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpDestroyGrid(cusolverMpGrid_t grid) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpCreateMatrixDesc(cusolverMpMatrixDescriptor_t* desc, cusolverMpGrid_t grid, cudaDataType dataType, int64_t M_A, int64_t N_A, int64_t MB_A, int64_t NB_A, uint32_t RSRC_A, uint32_t CSRC_A, int64_t LLD_A) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpDestroyMatrixDesc(cusolverMpMatrixDescriptor_t desc) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef int64_t _cusolverMpNUMROC(int64_t n, int64_t nb, uint32_t iproc, uint32_t isrcproc, uint32_t nprocs) except?-42 nogil
cdef cusolverStatus_t _cusolverMpMatrixScatterH2D(cusolverMpHandle_t handle, int64_t M, int64_t N, void* d_A, int64_t IA, int64_t JA, cusolverMpMatrixDescriptor_t descA, int root, const void* h_src, int64_t h_ldsrc) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpMatrixGatherD2H(cusolverMpHandle_t handle, int64_t M, int64_t N, const void* d_A, int64_t IA, int64_t JA, cusolverMpMatrixDescriptor_t descA, int root, void* h_dst, int64_t h_lddst) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpGetrf_bufferSize(cusolverMpHandle_t handle, int64_t M, int64_t N, void* d_A, int64_t IA, int64_t JA, cusolverMpMatrixDescriptor_t descA, int64_t* d_ipiv, cudaDataType_t computeType, size_t* workspaceInBytesOnDevice, size_t* workspaceInBytesOnHost) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpGetrf(cusolverMpHandle_t handle, int64_t M, int64_t N, void* d_A, int64_t IA, int64_t JA, cusolverMpMatrixDescriptor_t descA, int64_t* d_ipiv, cudaDataType_t computeType, void* d_work, size_t workspaceInBytesOnDevice, void* h_work, size_t workspaceInBytesOnHost, int* info) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpGetrs_bufferSize(cusolverMpHandle_t handle, cublasOperation_t trans, int64_t N, int64_t NRHS, const void* d_A, int64_t IA, int64_t JA, cusolverMpMatrixDescriptor_t descA, const int64_t* d_ipiv, void* d_B, int64_t IB, int64_t JB, cusolverMpMatrixDescriptor_t descB, cudaDataType_t computeType, size_t* workspaceInBytesOnDevice, size_t* workspaceInBytesOnHost) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpGetrs(cusolverMpHandle_t handle, cublasOperation_t trans, int64_t N, int64_t NRHS, const void* d_A, int64_t IA, int64_t JA, cusolverMpMatrixDescriptor_t descA, const int64_t* d_ipiv, void* d_B, int64_t IB, int64_t JB, cusolverMpMatrixDescriptor_t descB, cudaDataType_t computeType, void* d_work, size_t workspaceInBytesOnDevice, void* h_work, size_t workspaceInBytesOnHost, int* d_info) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpPotrf_bufferSize(cusolverMpHandle_t handle, cublasFillMode_t uplo, int64_t n, const void* a, int64_t ia, int64_t ja, cusolverMpMatrixDescriptor_t descA, cudaDataType_t computeType, size_t* workspaceInBytesOnDevice, size_t* workspaceInBytesOnHost) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpPotrf(cusolverMpHandle_t handle, cublasFillMode_t uplo, int64_t n, void* a, int64_t ia, int64_t ja, cusolverMpMatrixDescriptor_t descA, cudaDataType_t computeType, void* d_work, size_t workspaceInBytesOnDevice, void* h_work, size_t workspaceInBytesOnHost, int* info) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpPotrs_bufferSize(cusolverMpHandle_t handle, cublasFillMode_t uplo, int64_t n, int64_t nrhs, const void* a, int64_t ia, int64_t ja, cusolverMpMatrixDescriptor_t descA, const void* b, int64_t ib, int64_t jb, cusolverMpMatrixDescriptor_t descB, cudaDataType_t computeType, size_t* workspaceInBytesOnDevice, size_t* workspaceInBytesOnHost) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpPotrs(cusolverMpHandle_t handle, cublasFillMode_t uplo, int64_t n, int64_t nrhs, const void* a, int64_t ia, int64_t ja, cusolverMpMatrixDescriptor_t descA, void* b, int64_t ib, int64_t jb, cusolverMpMatrixDescriptor_t descB, cudaDataType_t computeType, void* d_work, size_t workspaceInBytesOnDevice, void* h_work, size_t workspaceInBytesOnHost, int* info) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpOrmqr_bufferSize(cusolverMpHandle_t handle, cublasSideMode_t side, cublasOperation_t trans, int64_t m, int64_t n, int64_t k, const void* a, int64_t ia, int64_t ja, cusolverMpMatrixDescriptor_t descA, const void* tau, void* c, int64_t ic, int64_t jc, cusolverMpMatrixDescriptor_t descC, cudaDataType_t computeType, size_t* workspaceInBytesOnDevice, size_t* workspaceInBytesOnHost) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpOrmqr(cusolverMpHandle_t handle, cublasSideMode_t side, cublasOperation_t trans, int64_t m, int64_t n, int64_t k, const void* a, int64_t ia, int64_t ja, cusolverMpMatrixDescriptor_t descA, const void* tau, void* c, int64_t ic, int64_t jc, cusolverMpMatrixDescriptor_t descC, cudaDataType_t computeType, void* d_work, size_t workspaceInBytesOnDevice, void* h_work, size_t workspaceInBytesOnHost, int* info) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpOrmtr_bufferSize(cusolverMpHandle_t handle, cublasSideMode_t side, cublasFillMode_t uplo, cublasOperation_t trans, int64_t m, int64_t n, const void* a, int64_t ia, int64_t ja, cusolverMpMatrixDescriptor_t descA, const void* tau, void* c, int64_t ic, int64_t jc, cusolverMpMatrixDescriptor_t descC, cudaDataType_t computeType, size_t* workspaceInBytesOnDevice, size_t* workspaceInBytesOnHost) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpOrmtr(cusolverMpHandle_t handle, cublasSideMode_t side, cublasFillMode_t uplo, cublasOperation_t trans, int64_t m, int64_t n, const void* a, int64_t ia, int64_t ja, cusolverMpMatrixDescriptor_t descA, const void* tau, void* c, int64_t ic, int64_t jc, cusolverMpMatrixDescriptor_t descC, cudaDataType_t computeType, void* d_work, size_t workspaceInBytesOnDevice, void* h_work, size_t workspaceInBytesOnHost, int* info) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpGels_bufferSize(cusolverMpHandle_t handle, cublasOperation_t trans, int64_t m, int64_t n, int64_t nrhs, void* a, int64_t ia, int64_t ja, cusolverMpMatrixDescriptor_t descA, void* b, int64_t ib, int64_t jb, cusolverMpMatrixDescriptor_t descB, cudaDataType_t computeType, size_t* workspaceInBytesOnDevice, size_t* workspaceInBytesOnHost) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpGels(cusolverMpHandle_t handle, cublasOperation_t trans, int64_t m, int64_t n, int64_t nrhs, void* a, int64_t ia, int64_t ja, cusolverMpMatrixDescriptor_t descA, void* b, int64_t ib, int64_t jb, cusolverMpMatrixDescriptor_t descB, cudaDataType_t computeType, void* d_work, size_t workspaceInBytesOnDevice, void* h_work, size_t workspaceInBytesOnHost, int* info) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpStedc_bufferSize(cusolverMpHandle_t handle, char* compz, int64_t N, void* d_D, void* d_E, void* d_Q, int64_t IQ, int64_t JQ, cusolverMpMatrixDescriptor_t descQ, cudaDataType_t computeType, size_t* workspaceInBytesOnDevice, size_t* workspaceInBytesOnHost, int* iwork) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpStedc(cusolverMpHandle_t handle, char* compz, int64_t N, void* d_D, void* d_E, void* d_Q, int64_t IQ, int64_t JQ, cusolverMpMatrixDescriptor_t descQ, cudaDataType_t computeType, void* d_work, size_t workspaceInBytesOnDevice, void* h_work, size_t workspaceInBytesOnHost, int* info) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpGeqrf_bufferSize(cusolverMpHandle_t handle, int64_t M, int64_t N, void* d_A, int64_t IA, int64_t JA, cusolverMpMatrixDescriptor_t descA, cudaDataType_t computeType, size_t* workspaceInBytesOnDevice, size_t* workspaceInBytesOnHost) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpGeqrf(cusolverMpHandle_t handle, int64_t M, int64_t N, void* d_A, int64_t IA, int64_t JA, cusolverMpMatrixDescriptor_t descA, void* d_tau, cudaDataType_t computeType, void* d_work, size_t workspaceInBytesOnDevice, void* h_work, size_t workspaceInBytesOnHost, int* info) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpSytrd_bufferSize(cusolverMpHandle_t handle, cublasFillMode_t uplo, int64_t N, void* d_A, int64_t IA, int64_t JA, cusolverMpMatrixDescriptor_t descA, void* d_D, void* d_E, void* d_TAU, cudaDataType_t computeType, size_t* workspaceInBytesOnDevice, size_t* workspaceInBytesOnHost) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpSytrd(cusolverMpHandle_t handle, cublasFillMode_t uplo, int64_t N, void* d_A, int64_t IA, int64_t JA, cusolverMpMatrixDescriptor_t descA, void* d_D, void* d_E, void* d_TAU, cudaDataType_t computeType, void* d_work, size_t workspaceInBytesOnDevice, void* h_work, size_t workspaceInBytesOnHost, int* info) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpSyevd_bufferSize(cusolverMpHandle_t handle, char* compz, cublasFillMode_t uplo, int64_t N, void* d_A, int64_t IA, int64_t JA, cusolverMpMatrixDescriptor_t descA, void* d_D, void* d_Q, int64_t IQ, int64_t JQ, cusolverMpMatrixDescriptor_t descQ, cudaDataType_t computeType, size_t* workspaceInBytesOnDevice, size_t* workspaceInBytesOnHost) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpSyevd(cusolverMpHandle_t handle, char* compz, cublasFillMode_t uplo, int64_t N, void* d_A, int64_t IA, int64_t JA, cusolverMpMatrixDescriptor_t descA, void* d_D, void* d_Q, int64_t IQ, int64_t JQ, cusolverMpMatrixDescriptor_t descQ, cudaDataType_t computeType, void* d_work, size_t workspaceInBytesOnDevice, void* h_work, size_t workspaceInBytesOnHost, int* d_info) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpSygst_bufferSize(cusolverMpHandle_t handle, cusolverEigType_t ibtype, cublasFillMode_t uplo, int64_t m, int64_t ia, int64_t ja, cusolverMpMatrixDescriptor_t descA, int64_t ib, int64_t jb, cusolverMpMatrixDescriptor_t descB, cudaDataType_t computeType, size_t* workspaceInBytesOnDevice, size_t* workspaceInBytesOnHost) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpSygst(cusolverMpHandle_t handle, cusolverEigType_t ibtype, cublasFillMode_t uplo, int64_t m, void* a, int64_t ia, int64_t ja, cusolverMpMatrixDescriptor_t descA, const void* b, int64_t ib, int64_t jb, cusolverMpMatrixDescriptor_t descB, cudaDataType_t computeType, void* d_work, size_t workspaceInBytesOnDevice, void* h_work, size_t workspaceInBytesOnHost, int* info) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpSygvd_bufferSize(cusolverMpHandle_t handle, cusolverEigType_t ibtype, cusolverEigMode_t jobz, cublasFillMode_t uplo, int64_t m, int64_t ia, int64_t ja, cusolverMpMatrixDescriptor_t descA, int64_t ib, int64_t jb, cusolverMpMatrixDescriptor_t descB, int64_t iz, int64_t jz, cusolverMpMatrixDescriptor_t descZ, cudaDataType_t computeType, size_t* workspaceInBytesOnDevice, size_t* workspaceInBytesOnHost) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpSygvd(cusolverMpHandle_t handle, cusolverEigType_t ibtype, cusolverEigMode_t jobz, cublasFillMode_t uplo, int64_t m, void* a, int64_t ia, int64_t ja, cusolverMpMatrixDescriptor_t descA, void* b, int64_t ib, int64_t jb, cusolverMpMatrixDescriptor_t descB, void* w, void* z, int64_t iz, int64_t jz, cusolverMpMatrixDescriptor_t descZ, cudaDataType_t computeType, void* d_work, size_t workspaceInBytesOnDevice, void* h_work, size_t workspaceInBytesOnHost, int* info) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpLoggerSetFile(FILE* file) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpLoggerOpenFile(const char* logFile) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpLoggerSetLevel(int level) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpLoggerSetMask(int mask) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpLoggerForceDisable() except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpSetMathMode(cusolverMpHandle_t handle, cusolverMathMode_t mode) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpGetMathMode(cusolverMpHandle_t handle, cusolverMathMode_t* mode) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpSetEmulationStrategy(cusolverMpHandle_t handle, cudaEmulationStrategy_t strategy) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpGetEmulationStrategy(cusolverMpHandle_t handle, cudaEmulationStrategy_t* strategy) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpNewtonSchulzDescriptorCreate(cusolverMpNewtonSchulzDescriptor_t* nsDesc) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpNewtonSchulzDescriptorDestroy(cusolverMpNewtonSchulzDescriptor_t nsDesc) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpNewtonSchulzDescriptorSetAttribute(cusolverMpNewtonSchulzDescriptor_t nsDesc, cusolverMpNewtonSchulzDescriptorAttribute_t attr, const void* buf, size_t sizeInBytes) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpNewtonSchulzDescriptorGetAttribute(cusolverMpNewtonSchulzDescriptor_t nsDesc, cusolverMpNewtonSchulzDescriptorAttribute_t attr, void* buf, size_t sizeInBytes, size_t* sizeInBytesWritten) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpSetStream(cusolverMpHandle_t handle, cudaStream_t stream) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpBufferRegister(cusolverMpGrid_t grid, void* ptr, size_t size) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpBufferDeregister(cusolverMpGrid_t grid, void* ptr) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpOrgqr_bufferSize(cusolverMpHandle_t handle, int64_t m, int64_t n, int64_t k, const void* d_A, int64_t ia, int64_t ja, cusolverMpMatrixDescriptor_t descA, const void* d_tau, cudaDataType_t computeType, size_t* workspaceInBytesOnDevice, size_t* workspaceInBytesOnHost) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpOrgqr(cusolverMpHandle_t handle, int64_t m, int64_t n, int64_t k, void* d_A, int64_t ia, int64_t ja, cusolverMpMatrixDescriptor_t descA, const void* d_tau, cudaDataType_t computeType, void* d_work, size_t workspaceInBytesOnDevice, void* h_work, size_t workspaceInBytesOnHost, int* d_info) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpLaset(cusolverMpHandle_t handle, cublasFillMode_t uplo, int64_t M, int64_t N, const void* alpha, const void* beta, void* d_A, int64_t IA, int64_t JA, cusolverMpMatrixDescriptor_t descA, int* d_info) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpNewtonSchulz_bufferSize(cusolverMpHandle_t handle, cusolverMpNewtonSchulzDescriptor_t nsDesc, const int64_t m, const int64_t n, void* d_x, const int64_t ix, const int64_t jx, const cusolverMpMatrixDescriptor_t descX, const int64_t numberOfNewtonSchulzIterations, const void* h_coeffs, const cudaDataType_t computeType, size_t* workspaceInBytesOnDevice, size_t* workspaceInBytesOnHost) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
cdef cusolverStatus_t _cusolverMpNewtonSchulz(cusolverMpHandle_t handle, cusolverMpNewtonSchulzDescriptor_t nsDesc, const int64_t m, const int64_t n, void* d_x, const int64_t ix, const int64_t jx, const cusolverMpMatrixDescriptor_t descX, const int64_t numberOfNewtonSchulzIterations, const void* h_coeffs, const cudaDataType_t computeType, void* d_work, const size_t workspaceInBytesOnDevice, void* h_work, const size_t workspaceInBytesOnHost, int* info) except?_CUSOLVERSTATUS_T_INTERNAL_LOADING_ERROR nogil
