.. index:: pair: class; gpr::linalg::CusolverEighLib .. _doxid-classgpr_1_1linalg_1_1_cusolver_eigh_lib: class gpr::linalg::CusolverEighLib ================================== .. toctree:: :hidden: struct_gpr_linalg_CusolverEighLib_Impl.rst Overview ~~~~~~~~ .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class CusolverEighLib { public: // structs struct :ref:`Impl`; // methods static CusolverEighLib& :target:`instance`(); static void :ref:`setVerbose`(bool verbose); bool :ref:`available`() const; bool :ref:`allEigenpairs`(const Eigen::MatrixXd& sym, Eigen::VectorXd& evals, Eigen::MatrixXd& evecs) const; bool :ref:`gemmNN`(const Eigen::MatrixXd& A, const Eigen::MatrixXd& B, Eigen::MatrixXd& C) const; bool :ref:`trsmLowerResident`(std::uint64_t epoch, const Eigen::MatrixXd& L, Eigen::MatrixXd& B) const; private: // construction :target:`~CusolverEighLib`(); }; .. _details-classgpr_1_1linalg_1_1_cusolver_eigh_lib: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Methods ------- .. index:: pair: function; setVerbose .. _doxid-classgpr_1_1linalg_1_1_cusolver_eigh_lib_1af8c5593140769be8bb2d078f2762003c: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void setVerbose(bool verbose) Loader/step chatter on stderr. Wired from the GP report_level (>= 3); failures print regardless of this flag. Set before the first :ref:`available() ` /allEigenpairs() call to cover dlopen loading. .. index:: pair: function; available .. _doxid-classgpr_1_1linalg_1_1_cusolver_eigh_lib_1a76b92cd770fcedbad9168ce38d70fe40: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool available() const True if the cuSOLVER + cudart symbols loaded and a CUDA device is usable. When false, :ref:`allEigenpairs() ` always returns false. .. index:: pair: function; allEigenpairs .. _doxid-classgpr_1_1linalg_1_1_cusolver_eigh_lib_1a6f1ae4625f55962463718c50fe0411e1: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool allEigenpairs(const Eigen::MatrixXd& sym, Eigen::VectorXd& evals, Eigen::MatrixXd& evecs) const Full symmetric eigendecomposition via cusolverDnDsyevd. On success ``evals`` holds all eigenvalues in ASCENDING order and ``evecs`` the corresponding orthonormal eigenvectors as columns (matching Eigen::SelfAdjointEigenSolver and LAPACK dsyevr range 'A'). ``sym`` must be square; only its lower triangle is read. Returns false on any device/solver error (the caller falls back to the CPU path). .. index:: pair: function; gemmNN .. _doxid-classgpr_1_1linalg_1_1_cusolver_eigh_lib_1a38e1a248e12db6d70175f64b974ab135: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool gemmNN(const Eigen::MatrixXd& A, const Eigen::MatrixXd& B, Eigen::MatrixXd& C) const C = A \* B via cublasDgemm. Column-major end to end, no transposes. Returns false below the dispatch floor or on any device error (the caller falls back to the :ref:`Eigen ` product). .. index:: pair: function; trsmLowerResident .. _doxid-classgpr_1_1linalg_1_1_cusolver_eigh_lib_1ae7084a20378a102f3212c0173980f2dc: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool trsmLowerResident(std::uint64_t epoch, const Eigen::MatrixXd& L, Eigen::MatrixXd& B) const Solve L X = B in place for a lower-triangular L that stays on the device between calls: the factor is uploaded when ``:ref:`epoch ``` or its order changes and reused otherwise, so a run of posterior variance queries against one training factor pays the upload once. Returns false below the dispatch floor or on any device error (the caller falls back to the :ref:`Eigen ` triangular solve; B is then untouched).