Skip to content

Commit

Permalink
Improve documentation generation
Browse files Browse the repository at this point in the history
Fix xs::select output and add forgotten conversion functions
  • Loading branch information
serge-sans-paille committed Dec 14, 2022
1 parent 5186173 commit 2b1167c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
14 changes: 8 additions & 6 deletions docs/source/api/batch_manip.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@ Conditional expression

.. toctree::

+---------------------------------------------+---------------------------------------------------+
| :ref:`select <select-function-reference>` | conditional selection |
+---------------------------------------------+---------------------------------------------------+
+-------------------------------------------------+---------------------------------------------------+
| :ref:`select <select-function-reference-dyn>` | conditional selection with dynamic mask |
+-------------------------------------------------+---------------------------------------------------+
| :ref:`select <select-function-reference>` | conditional selection with constant mask |
+-------------------------------------------------+---------------------------------------------------+


.. _select-function-reference:
.. doxygenfunction:: xsimd::select(batch_bool<T, A> const&, batch<T, A> const&, batch<T, A> const&)
.. _select-function-reference-dyn:
.. doxygenfunction:: select(batch_bool<T, A> const &cond, batch<T, A> const &true_br, batch<T, A> const &false_br) noexcept
:project: xsimd

.. _select-function-reference:
.. doxygenfunction:: xsimd::select(batch_bool_constant<T, A> const&, batch<T, A> const&, batch<T, A> const&)
.. doxygenfunction:: select(batch_bool_constant<batch<T, A>, Values...> const &cond, batch<T, A> const &true_br, batch<T, A> const &false_br) noexcept
:project: xsimd

15 changes: 12 additions & 3 deletions include/xsimd/types/xsimd_api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ namespace xsimd
*
* Perform a static_cast from \c T_in to \c T_out on \c \c x.
* @param x batch_bool of \c T_in
* @return \c x casted to \c T_out
* @return \c x cast to \c T_out
*/
template <class T_out, class T_in, class A>
inline batch_bool<T_out, A> batch_bool_cast(batch_bool<T_in, A> const& x) noexcept
Expand All @@ -223,7 +223,7 @@ namespace xsimd
*
* Perform a static_cast from \c T_in to \c T_out on \c \c x.
* @param x batch of \c T_in
* @return \c x casted to \c T_out
* @return \c x cast to \c T_out
*/
template <class T_out, class T_in, class A>
inline batch<T_out, A> batch_cast(batch<T_in, A> const& x) noexcept
Expand Down Expand Up @@ -2174,7 +2174,16 @@ namespace xsimd
return kernel::zip_lo<A>(x, y, A {});
}

// bitwise_cast
/**
* @ingroup batch_conversion
*
* Cast a \c batch_bool of \c T into a \c batch of the same type using the
* following rule: if an element of \c self is true, it maps to -1 in the
* returned integral batch, otherwise it maps to 0.
*
* @param self batch_bool of \c T
* @return \c self cast to a \c batch of \c T
*/
template <class T, class A, typename std::enable_if<std::is_integral<T>::value, int>::type = 3>
inline batch<T, A> bitwise_cast(batch_bool<T, A> const& self) noexcept
{
Expand Down

0 comments on commit 2b1167c

Please sign in to comment.