Skip to content

Commit

Permalink
Fix some typos and check via GitHub actions (#564)
Browse files Browse the repository at this point in the history
* Fix typos

* Add GitHub Action

* Pin crate-ci/typos version.
  • Loading branch information
masterleinad authored Aug 13, 2024
1 parent eb3e5a7 commit 2c87476
Show file tree
Hide file tree
Showing 38 changed files with 82 additions and 50 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/typos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Test GitHub Action
on: [push, pull_request]

jobs:
run:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4

- name: Writes changes in the local checkout
uses: crate-ci/[email protected]
with:
write_changes: true
files: ./docs/source/ProgrammingGuide/ ./docs/source/API/ ./docs/source/*.rst ./docs/source/*.md
config: ./.typos.toml
15 changes: 15 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[default]
# Don't check text that matches the following regexes'
extend-ignore-re = []

[default.extend-identifiers]
# Don't correct these whole identifiers (word-groups)

[default.extend-words]
# Don't correct these word (parts)
countr = "countr"
OT = "OT"

# Don't check the following files
[files]
extend-exclude = []
4 changes: 2 additions & 2 deletions docs/source/API/algorithms/Random-Number.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ are collectives, i.e. all functions can be called inside conditionals.
void free_state(Generator_Type Gen);
}
A Pool of Generators are intialized using a starting seed and establishing
A Pool of Generators are initialized using a starting seed and establishing
a pool_size of num_states. The Random_XorShift64 generator is used in serial
to initialize all states making the intialization process platform independent
to initialize all states making the initialization process platform independent
and deterministic. Requesting a generator locks it's state guaranteeing that
each thread has a private (independent) generator. (Note, getting a state on a Cuda
device involves atomics, making it non-deterministic!)
Expand Down
2 changes: 1 addition & 1 deletion docs/source/API/algorithms/std-algorithms-index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ Std Algorithms
./std-algorithms/StdModSeq
./std-algorithms/StdNonModSeq
./std-algorithms/StdNumeric
./std-algorithms/StdPartioningOps
./std-algorithms/StdPartitioningOps
./std-algorithms/StdSorting
2 changes: 1 addition & 1 deletion docs/source/API/algorithms/std-algorithms/all/StdEqual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ Corner cases when ``false`` is returned:

- if ``view1.extent(0) != view2.extent(1)`` for all overloads accepting Views

- if the lenght of the range ``[first1, last)`` is not equal to lenght of ``[first2,last2)``
- if the length of the range ``[first1, last)`` is not equal to length of ``[first2,last2)``


Example
Expand Down
2 changes: 1 addition & 1 deletion docs/source/API/algorithms/std-algorithms/all/StdFind.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Return Value
or ``last`` if no element is found

- (3,4,6): iterator to the first element that equals ``value``,
or ``Kokkos::Experimental::end(view)`` if no elememt is found
or ``Kokkos::Experimental::end(view)`` if no element is found


Example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ Return Value
~~~~~~~~~~~~

Iterator to the beginning of the last occurrence of the sequence ``[s_first, s_last)``
in range ``[first, last)``, or the last occurence of ``s_view`` in ``view``.
in range ``[first, last)``, or the last occurrence of ``s_view`` in ``view``.

If ``[s_first, s_last)`` or ``[first, last)`` is empty, ``last`` is returned.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,4 @@ Parameters and Requirements
Return Value
~~~~~~~~~~~~

- The last iterator ``it`` for which range ``[first, it)`` is sorted and where the following is true: ``std::is_same_v<decltype(it), IteratorType>``, or for which range ``[Kokkos::Experimental::begin(view), it)`` is sorted. For this second case, note that ``it`` is computed as: ``Kokkos::Experimental::begin(view) + increment`` where ``increment`` is found in the algoritm.
- The last iterator ``it`` for which range ``[first, it)`` is sorted and where the following is true: ``std::is_same_v<decltype(it), IteratorType>``, or for which range ``[Kokkos::Experimental::begin(view), it)`` is sorted. For this second case, note that ``it`` is computed as: ``Kokkos::Experimental::begin(view) + increment`` where ``increment`` is found in the algorithm.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Elements (5,6,7,8) are compared using `comp`.
- execution space instance

- `label`:
- 1,5: The default string is "Kokkos::lexicographical_compare_iterator_api_defaul".
- 1,5: The default string is "Kokkos::lexicographical_compare_iterator_api_default".
- 3,7: The default string is "Kokkos::lexicographical_compare_view_api_default".

- `first1`, `last1`, `first2`, `last2`:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ view_type b("b", 15);
// fill a,b somehow
// create functor
MisMatchFunctor<int, int> p();
MismatchFunctor<int, int> p();
Kokkos::pair<int,int> mismatch_index = KE::mismatch(exespace, KE::begin(a), KE::end(a), KE::begin(b), KE::end(b) p);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Assumes the range (or the view) already to be partitioned.

## Parameters and Requirements

- `exespace`, `first`, `last`, `view`, `pred`: same as in [`is_partioned`](./StdIsPartitioned)
- `exespace`, `first`, `last`, `view`, `pred`: same as in [`is_partitioned`](./StdIsPartitioned)
- execution space instance
- `label`:
- used to name the implementation kernels for debugging purposes
Expand All @@ -52,5 +52,5 @@ Assumes the range (or the view) already to be partitioned.

## Return

Iterator to the elment *after* the last element in the first partition,
Iterator to the element *after* the last element in the first partition,
or `last` if all elements satisfy `pred`.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Description
-----------

Copies the elements from a range to a new range starting at ``first_to`` or from ``view_from``
to ``view_dest`` omitting thos for which ``pred`` returns ``true``.
to ``view_dest`` omitting those for which ``pred`` returns ``true``.

Interface
---------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Header: ``<Kokkos_StdAlgorithms.hpp>``
Description
-----------

Reverses ther order of the elements in a range or in rank-1 ``View``.
Reverses the order of the elements in a range or in rank-1 ``View``.

Interface
---------
Expand Down
4 changes: 2 additions & 2 deletions docs/source/API/alphabetical.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Containers
+----------------------------------------------------+---------------------------------------+----------+----------------------------------------------------------------------------------------------------------------+
| ErrorReporter | `Containers <containers-index.html>`_ | View | A class supporting error recording in parallel code. |
+----------------------------------------------------+---------------------------------------+----------+----------------------------------------------------------------------------------------------------------------+
| `OffsetView <containers/Offset-View.html>`_ | `Containers <containers-index.html>`_ | View | View structure supporting non-zero start indicies. |
| `OffsetView <containers/Offset-View.html>`_ | `Containers <containers-index.html>`_ | View | View structure supporting non-zero start indices. |
+----------------------------------------------------+---------------------------------------+----------+----------------------------------------------------------------------------------------------------------------+
| `ScatterView <containers/ScatterView.html>`_ | `Containers <containers-index.html>`_ | View | View structure to transpartently support atomic and data replication strategies for scatter-reduce algorithms. |
+----------------------------------------------------+---------------------------------------+----------+----------------------------------------------------------------------------------------------------------------+
Expand Down Expand Up @@ -162,7 +162,7 @@ Core
+--------------------------------------------------------------------------------------+---------------------------+------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| `MinMax <core/builtinreducers/MinMax.html>`_ | `Core <core-index.html>`_ | `Built-in Reducers <core/builtin_reducers.html>`_ | Reducer for Reduction providing both minimum and maximum |
+--------------------------------------------------------------------------------------+---------------------------+------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| `MinMaxLoc <core/builtinreducers/MinMaxLoc.html>`_ | `Core <core-index.html>`_ | `Built-in Reducers <core/builtin_reducers.html>`_ | Reducer for Reduction providing both minimum and maximum and associated indicies |
| `MinMaxLoc <core/builtinreducers/MinMaxLoc.html>`_ | `Core <core-index.html>`_ | `Built-in Reducers <core/builtin_reducers.html>`_ | Reducer for Reduction providing both minimum and maximum and associated indices |
+--------------------------------------------------------------------------------------+---------------------------+------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| `OpenMP <core/execution_spaces.html#kokkos-openmp>`_ | `Core <core-index.html>`_ | `Spaces <core/Spaces.html>`_ | Execution space using non-target OpenMP parallel execution mechanisms. |
+--------------------------------------------------------------------------------------+---------------------------+------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
Expand Down
2 changes: 1 addition & 1 deletion docs/source/API/containers/Unordered-Map.rst
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ There are 3 potential states for every insertion which are reported by the ``Uno

- ``failed`` means that either the capacity of the map was exhausted or that a free index was not found
with a bounded search of the internal atomic bitset. A ``failed`` insertion requires the user to increase
the capacity (``rehash``) and restart the algoritm.
the capacity (``rehash``) and restart the algorithm.

.. code-block:: cpp
Expand Down
2 changes: 1 addition & 1 deletion docs/source/API/core/Detection-Idiom.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ API
// VOID_T and DETECTOR are exposition-only and not intended to be used directly.
// Convienent metafunction to leverage SFINAE
// Convenient metafunction to leverage SFINAE
template<class...>
using VOID_T = void;
Expand Down
2 changes: 1 addition & 1 deletion docs/source/API/core/Macros.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Kokkos was compiled with.
Third-Party Library Settings
----------------------------

These defines give information about what third-party libaries Kokkos was compiled with.
These defines give information about what third-party libraries Kokkos was compiled with.

+-------------------------------+-----------------------------------------------------------------------------------------------------------------------+
| Macro | Description |
Expand Down
2 changes: 1 addition & 1 deletion docs/source/API/core/Task-Parallelism.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Kokkos has support for lightweight task-based programming, which is currently pr
Will Kokkos Tasking work for my problem?
----------------------------------------

Not all task-based problems are a good fit for the current Kokkos approach to tasking. Currently, the tasking interface in Kokkos is targetted at problems with kernels far too small to overcome the inherent overhead of top-level Kokkos data parallel launches—that is, small but plentiful data parallel tasks with a non-trivial dependency structure. For tasks that fit this general scale model but have (very) trivial dependency structures, it may be easier to use `hierarchical parallelism <../../ProgrammingGuide/HierarchicalParallelism.html>`_, potentially with a ``Kokkos::Schedule<Dynamic>`` scheduling policy (see, for instance, `this page <policies/RangePolicy.html>`_) for load balancing if necessary.
Not all task-based problems are a good fit for the current Kokkos approach to tasking. Currently, the tasking interface in Kokkos is targeted at problems with kernels far too small to overcome the inherent overhead of top-level Kokkos data parallel launches—that is, small but plentiful data parallel tasks with a non-trivial dependency structure. For tasks that fit this general scale model but have (very) trivial dependency structures, it may be easier to use `hierarchical parallelism <../../ProgrammingGuide/HierarchicalParallelism.html>`_, potentially with a ``Kokkos::Schedule<Dynamic>`` scheduling policy (see, for instance, `this page <policies/RangePolicy.html>`_) for load balancing if necessary.

Basic Usage
-----------
Expand Down
2 changes: 1 addition & 1 deletion docs/source/API/core/atomics/atomic_fetch_op.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Description
Atomically executes ``*ptr_to_value -= value``.

:param ptr_to_value: address of the value to be updated
:param value: value to be substracted..
:param value: value to be subtracted..

.. cppkokkos:function:: template<class T> T atomic_fetch_xor(T* const ptr_to_value, const T value);
Expand Down
2 changes: 1 addition & 1 deletion docs/source/API/core/atomics/atomic_op_fetch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Description

* ``ptr_to_value``: address of the to be updated value.

* ``value``: value to be substracted.
* ``value``: value to be subtracted.

.. cppkokkos:function:: template<class T> T atomic_xor_fetch(T* const ptr_to_value, const T value);
Expand Down
2 changes: 1 addition & 1 deletion docs/source/API/core/builtinreducers/MinMaxLoc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.. role:: cppkokkos(code)
:language: cppkokkos

Specific implementation of `ReducerConcept <ReducerConcept.html>`_ storing both the minimum and maximum values with corresponding indicies
Specific implementation of `ReducerConcept <ReducerConcept.html>`_ storing both the minimum and maximum values with corresponding indices

Header File: ``<Kokkos_Core.hpp>``

Expand Down
4 changes: 2 additions & 2 deletions docs/source/API/core/execution_spaces.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Aliases based on configuration

``Kokkos::DefaultExecutionSpace`` is an alias of |ExecutionSpaceConceptType|_ pointing to an ``ExecutionSpace``
based on the current configuration of Kokkos. It is set to the highest available in the hierarchy ``device,host-parallel,host-serial``.
It also serves as default for optionally specified template prameters of |ExecutionSpaceConceptType|_.
It also serves as default for optionally specified template parameters of |ExecutionSpaceConceptType|_.

``Kokkos::DefaultHostExecutionSpace``
-------------------------------------
Expand Down Expand Up @@ -338,6 +338,6 @@ Non Member Facilities

* ``template<class MS> struct is_execution_space;``: typetrait to check whether a class is a execution space.

* ``template<class S1, class S2> struct SpaceAccessibility;``: typetraits to check whether two spaces are compatible (assignable, deep_copy-able, accessable). (see |KokkosSpaceAccessibility|_)
* ``template<class S1, class S2> struct SpaceAccessibility;``: typetraits to check whether two spaces are compatible (assignable, deep_copy-able, accessible). (see |KokkosSpaceAccessibility|_)

* ``bool operator==(const execution_space& lhs, const execution_space& rhs)``: tests whether the two space instances (of the same type) are identical.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Usage:
.. versionadded:: 3.7
``InitializationSettings`` is a class that can be used to define the settings for
initializating Kokkos programmatically without having to call the two parameter
initializing Kokkos programmatically without having to call the two parameter
form (``argc`` and ``argv``) of `Kokkos::initialize() <initialize.html#kokkosinitialize>`_.
It was introduced as a replacement for the `Kokkos::InitArguments <InitArguments.html#kokkosInitArguments>`_ structure.

Expand Down
2 changes: 1 addition & 1 deletion docs/source/API/core/initialize_finalize/finalize.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ resources.
Once this function is called, no Kokkos API functions (not even
`Kokkos::initialize <initialize.html>`_) may be called, except for
``Kokkos::is_initialized`` or ``Kokkos::is_finalized``.
The user must ensure that all Kokkos objects (e.g. ``Kokkos::View``) are detroyed
The user must ensure that all Kokkos objects (e.g. ``Kokkos::View``) are destroyed
before ``Kokkos::finalize`` gets called.

Programs are ill-formed if they do not call this function after calling `Kokkos::initialize <initialize.html>`_.
Expand Down
6 changes: 3 additions & 3 deletions docs/source/API/core/memory_spaces.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Memory Spaces

``Kokkos::SharedSpace`` :sup:`since 4.0` is a |MemorySpaceType|_ alias representing memory that can be accessed by any enabled |ExecutionSpaceType|_. To achieve this, the memory can be moved to and from the local memory of the processing units represented by the ``ExecutionSpaces``. The movement is done automatically by the OS and driver at the moment of access. If not currently located in the local memory of the accessing processing unit, the memory is moved in chunks (size is backend dependent). These chunks can be moved independently (e.g. only the part that is accessed on the GPU is moved to the GPU) and are treated like local memory while residing on the processing unit. For details, see |TheDocumentationOnTheMemorySpaceConcept|_.
Availability can be checked with the preprocessor define ``KOKKOS_HAS_SHARED_SPACE`` or the ``constexpr bool Kokkos::has_shared_space``.
For the following backends ``Kokkos::SharedSpace`` is pointing to the correspoinding |MemorySpaceType|_:
For the following backends ``Kokkos::SharedSpace`` is pointing to the corresponding |MemorySpaceType|_:

* Cuda -> ``CudaUVMSpace``
* HIP -> ``HIPManagedSpace``
Expand All @@ -89,9 +89,9 @@ For the following backends ``Kokkos::SharedSpace`` is pointing to the correspoin
``Kokkos::SharedHostPinnedSpace``
---------------------------------

``Kokkos::SharedHostPinnedSpace`` :sup:`since 4.0` is a |MemorySpaceType|_ alias which is accessible by all enabled |ExecutionSpaceTypes|_. The memory stays pinned on the host and is availabe on the device via zero copy access in small chunks (cache lines, memory pages, etc. depending on the backend). Writes to the memory in one ``ExecutionSpace`` become visible in other ``ExecutionSpaces`` at synchronization events. Which events trigger a synchronization depend on the backend specifics. Nevertheless, fences are synchronization events on all backends.
``Kokkos::SharedHostPinnedSpace`` :sup:`since 4.0` is a |MemorySpaceType|_ alias which is accessible by all enabled |ExecutionSpaceTypes|_. The memory stays pinned on the host and is available on the device via zero copy access in small chunks (cache lines, memory pages, etc. depending on the backend). Writes to the memory in one ``ExecutionSpace`` become visible in other ``ExecutionSpaces`` at synchronization events. Which events trigger a synchronization depend on the backend specifics. Nevertheless, fences are synchronization events on all backends.
Availability can be checked with the preprocessor define ``KOKKOS_HAS_SHARED_HOST_PINNED_SPACE`` or the ``constexpr bool Kokkos::has_shared_host_pinned_space``.
For the following backends ``Kokkos::SharedHostPinnedSpace`` is pointing to the correspoinding |MemorySpaceType|_:
For the following backends ``Kokkos::SharedHostPinnedSpace`` is pointing to the corresponding |MemorySpaceType|_:

* Cuda -> ``CudaHostPinnedSpace``
* HIP -> ``HipHostPinnedSpace``
Expand Down
6 changes: 3 additions & 3 deletions docs/source/API/core/numerics/bit-manipulation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ Bit manipulation

.. |KokkosBitManipulation| replace:: ``<Kokkos_BitManipulation.hpp>``

.. _StandarLibraryHeaderBit: https://en.cppreference.com/w/cpp/header/bit
.. _StandardLibraryHeaderBit: https://en.cppreference.com/w/cpp/header/bit

.. |StandarLibraryHeaderBit| replace:: ``<bit>``
.. |StandardLibraryHeaderBit| replace:: ``<bit>``

Defined in header |KokkosBitManipulation|_ which is included from ``<Kokkos_Core.hpp>``

Provides function templates from the standard library header |StandarLibraryHeaderBit|_ (since C++20).
Provides function templates from the standard library header |StandardLibraryHeaderBit|_ (since C++20).

Bit manipulation function templates are defined in the ``Kokkos::`` namespace since Kokkos 4.1

Expand Down
Loading

0 comments on commit 2c87476

Please sign in to comment.