dedalus.tools.linalg_gpu ======================== .. py:module:: dedalus.tools.linalg_gpu .. autoapi-nested-parse:: Linear algebra routines using cupy. Module Contents --------------- .. py:class:: CustomCupyUpperTriangularSolver(matrix) Hacky class to save spsm_descr for reuse in spsm for triangular solves. .. py:method:: solve(b, lower=True, overwrite_A=False, overwrite_b=False, unit_diagonal=False) Solves a sparse triangular system ``A x = b``. :Parameters: * **A** (*cupyx.scipy.sparse.spmatrix*) -- Sparse matrix with dimension ``(M, M)``. * **b** (*cupy.ndarray*) -- Dense vector or matrix with dimension ``(M)`` or ``(M, K)``. * **lower** (*bool*) -- Whether ``A`` is a lower or upper triangular matrix. If True, it is lower triangular, otherwise, upper triangular. * **overwrite_A** (*bool*) -- (not supported) * **overwrite_b** (*bool*) -- Allows overwriting data in ``b``. * **unit_diagonal** (*bool*) -- If True, diagonal elements of ``A`` are assumed to be 1 and will not be referenced. :returns: Solution to the system ``A x = b``. The shape is the same as ``b``. :rtype: cupy.ndarray .. py:attribute:: matrix .. py:attribute:: spsm_descr :value: None .. py:function:: apply_csr_mid_kernel(data, indices, indptr, x3, y3, N1, N2i, N2o, N3) .. py:function:: cupy_apply_csr(matrix, array, axis, out) Apply CSR matrix to arbitrary axis of array. .. py:function:: cupy_apply_csr_mid(matrix, array, out) .. py:function:: cupy_solve_upper_csr(matrix, array, axis, out) Solve upper triangular CSR matrix along specified axis of an array. .. py:function:: cupy_solve_upper_csr_first(matrix, array, out) Solve upper triangular CSR matrix along first axis of 2D array. .. py:function:: cupy_solve_upper_csr_last(matrix, array, out) Solve upper triangular CSR matrix along last axis of 2D array. .. py:function:: cupy_solve_upper_csr_mid(matrix, array, out) Solve upper triangular CSR matrix along middle axis of 3D array. .. py:function:: cupy_solve_upper_csr_vec(matrix, vec, out) Solve upper triangular CSR matrix along a vector. .. py:function:: custom_SuperLU_solve(self, rhs, trans='N', spsm_descr=None) Custom SuperLU solve wrapper to save spsm_descr, since spsm_analysis takes lots of time. .. py:function:: custom_spsm(a, b, alpha=1.0, lower=True, unit_diag=False, transa=False, spsm_descr=None) Custom spsm wrapper to save spsm_descr, since spsm_analysis takes lots of time. .. py:data:: cupy_available :value: True