.. index:: pair: class; gpr::linalg::KokkosWorkspace .. _doxid-classgpr_1_1linalg_1_1_kokkos_workspace: class gpr::linalg::KokkosWorkspace ================================== .. toctree:: :hidden: struct_gpr_linalg_KokkosWorkspace_Impl.rst Overview ~~~~~~~~ Device copy of one physical host factor plus reusable device buffers. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class KokkosWorkspace { public: // structs struct :ref:`Impl`; // construction :target:`KokkosWorkspace`(); :target:`KokkosWorkspace`(const KokkosWorkspace&); :target:`~KokkosWorkspace`(); // methods :ref:`KokkosWorkspace`& :target:`operator=`(const :ref:`KokkosWorkspace`&); :ref:`EigenMatrix` :ref:`forward`(const :ref:`EigenMatrix`& factor, const :ref:`EigenMatrix`& rhs); :ref:`EigenMatrix` :ref:`backward`(const :ref:`EigenMatrix`& factor, const :ref:`EigenMatrix`& rhs); :ref:`EigenMatrix` :ref:`solve`(const :ref:`EigenMatrix`& factor, const :ref:`EigenMatrix`& rhs); Eigen::VectorXd :ref:`squaredNorms`(const :ref:`EigenMatrix`& factor, const :ref:`EigenMatrix`& rhs); :ref:`EigenMatrix` :ref:`inverse`(const :ref:`EigenMatrix`& factor); :ref:`KokkosTransferStats` :target:`transferStats`() const; void :ref:`resetTransferStats`(); void :ref:`clear`(); }; .. _details-classgpr_1_1linalg_1_1_kokkos_workspace: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Device copy of one physical host factor plus reusable device buffers. Every call takes the factor explicitly. The resident copy is reused only when the supplied factor has the same shape and identical stored entries as the host witness of the last upload; any other factor, including the same storage after in-place mutation, is uploaded again. Inputs and results remain host matrices. Calls on one workspace are serialized. Device storage is released at the start of Kokkos::finalize, after which device operations throw std::logic_error. The execution-space state is created on the first call. A default-constructed workspace is empty, so a non-Kokkos build can embed one without linking the :ref:`Kokkos ` runtime. Methods ------- .. index:: pair: function; forward .. _doxid-classgpr_1_1linalg_1_1_kokkos_workspace_1a0032b78a1a8d74aa46b2118eccd09d5b: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`EigenMatrix` forward(const :ref:`EigenMatrix`& factor, const :ref:`EigenMatrix`& rhs) L X = B. .. index:: pair: function; backward .. _doxid-classgpr_1_1linalg_1_1_kokkos_workspace_1aaa4f238e7cc71369f77f1fd2f8d7757e: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`EigenMatrix` backward(const :ref:`EigenMatrix`& factor, const :ref:`EigenMatrix`& rhs) L^T X = B. .. index:: pair: function; solve .. _doxid-classgpr_1_1linalg_1_1_kokkos_workspace_1a0f9b3c2350bef8435033753ed3a14f0a: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`EigenMatrix` solve(const :ref:`EigenMatrix`& factor, const :ref:`EigenMatrix`& rhs) L L^T X = B with one right-hand-side upload and one result download. .. index:: pair: function; squaredNorms .. _doxid-classgpr_1_1linalg_1_1_kokkos_workspace_1a9711ca529c833fb7f4d1dc9d59240b87: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::VectorXd squaredNorms(const :ref:`EigenMatrix`& factor, const :ref:`EigenMatrix`& rhs) Squared column norms of L^{-1} B; only the norms are downloaded. .. index:: pair: function; inverse .. _doxid-classgpr_1_1linalg_1_1_kokkos_workspace_1a012ec8e814beeb916bdb4a2fac6ea30e: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`EigenMatrix` inverse(const :ref:`EigenMatrix`& factor) (L L^T)^{-1}, formed on the device from the resident factor. .. index:: pair: function; resetTransferStats .. _doxid-classgpr_1_1linalg_1_1_kokkos_workspace_1a048b64659703594eab5089bafefe6f8c: .. ref-code-block:: cpp :class: doxyrest-title-code-block void resetTransferStats() Zeroes the counters; the resident factor is kept. .. index:: pair: function; clear .. _doxid-classgpr_1_1linalg_1_1_kokkos_workspace_1a90f5ac9349cea52abca458a65c0cfe0d: .. ref-code-block:: cpp :class: doxyrest-title-code-block void clear() Releases the resident factor and all device buffers; counters are kept.