.. index:: pair: namespace; gpr::kokkos_environment .. _doxid-namespacegpr_1_1kokkos__environment: namespace gpr::kokkos_environment ================================= .. toctree:: :hidden: class_gpr_kokkos_environment_DeviceEnvironments.rst Overview ~~~~~~~~ .. ref-code-block:: cpp :class: doxyrest-overview-code-block namespace kokkos_environment { // typedefs typedef kd::exec_space :target:`ExecutionSpace`; typedef kd::mem_space :target:`MemorySpace`; typedef Kokkos::View`> :target:`DeviceArray`; typedef Kokkos::IndexType :target:`Index`; // classes class :ref:`DeviceEnvironments`; // global variables std::size_t :ref:`default_scratch_bytes` = std::size_t(256)<<20; // global functions :ref:`DeviceEnvironments` :ref:`upload`(const gpr::detail::EnvironmentBatchView& source); std::size_t :ref:`pairsPerChunk`(const :ref:`DeviceEnvironments`& left, const :ref:`DeviceEnvironments`& right, int channel_count, std::size_t scratch_bytes); Eigen::VectorXd :ref:`assemble`(const :ref:`DeviceEnvironments`& left, const :ref:`DeviceEnvironments`& right, const gpr::detail::EnvironmentPairBatch& batch, std::size_t scratch_bytes = :ref:`default_scratch_bytes`); } // namespace kokkos_environment .. _details-namespacegpr_1_1kokkos__environment: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Global Variables ---------------- .. index:: pair: variable; default_scratch_bytes .. _doxid-namespacegpr_1_1kokkos__environment_1a3cb0e5b4e8cc13d0607dc8d5007e8a80: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::size_t default_scratch_bytes = std::size_t(256)<<20 Execution memory, in bytes, that one call to :ref:`assemble() ` may use for its per-pair scratch (jets, weighted Jacobians, Gram matrices and blocks). Global Functions ---------------- .. index:: pair: function; upload .. _doxid-namespacegpr_1_1kokkos__environment_1a03c8547f76b02b4c885567191175de54: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`DeviceEnvironments` upload(const gpr::detail::EnvironmentBatchView& source) Copy the environments of ``source`` to execution memory. .. index:: pair: function; pairsPerChunk .. _doxid-namespacegpr_1_1kokkos__environment_1a9dd85306b21dda891d4492f5b96f084d: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::size_t pairsPerChunk(const :ref:`DeviceEnvironments`& left, const :ref:`DeviceEnvironments`& right, int channel_count, std::size_t scratch_bytes) Pairs :ref:`assemble() ` processes at once so that their scratch fits in ``scratch_bytes``; at least one. A pair's scratch grows with the number of central atoms squared, so the batch is never allocated whole. .. index:: pair: function; assemble .. _doxid-namespacegpr_1_1kokkos__environment_1add0759ce52190bf9921addc5660fa799: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::VectorXd assemble(const :ref:`DeviceEnvironments`& left, const :ref:`DeviceEnvironments`& right, const gpr::detail::EnvironmentPairBatch& batch, std::size_t scratch_bytes = :ref:`default_scratch_bytes`) Covariance blocks of the pairs in ``batch``, one (1 + dl) x (1 + dr) column-major block per pair and channel. ``batch`` names host index arrays; its environment views are replaced by ``left`` and ``right``, which live in execution memory. The pairs run in chunks of pairsPerChunk(``scratch_bytes``) and each chunk's blocks are copied to the host after its last kernel. Every work item has one writer and a fixed summation order, so the result does not depend on the chunk size.