Skip to content

Commit 7a8d77a

Browse files
Frail fix for batch_constant documentation
1 parent 6280185 commit 7a8d77a

File tree

3 files changed

+33
-12
lines changed

3 files changed

+33
-12
lines changed

docs/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ WARN_AS_ERROR = NO
4545
ENABLE_PREPROCESSING = YES
4646
MACRO_EXPANSION = YES
4747
EXPAND_ONLY_PREDEF = YES
48-
PREDEFINED = XSIMD_NO_DISCARD= XSIMD_INLINE=inline
48+
PREDEFINED = XSIMD_NO_DISCARD= XSIMD_INLINE=inline DOXYGEN_SHOULD_SKIP_THIS=

docs/source/api/xsimd_batch_constant.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@ Batch of constants
1313
:project: xsimd
1414
:members:
1515

16+
.. doxygenstruct:: xsimd::batch_bool_constant
17+
:project: xsimd
18+
:members:
19+
1620

1721
.. doxygenfunction:: xsimd::make_batch_constant
1822
:project: xsimd
23+
24+
25+
.. doxygenfunction:: xsimd::make_batch_bool_constant
26+
:project: xsimd
27+
28+
.. note::
29+
30+
:cpp:func:`make_batch_constant` and :cpp:func:`make_batch_bool_constant` also
31+
accept a scalar value instead of a generator. In that case, that value is
32+
broadcast to each slot of the constant batch.

include/xsimd/types/xsimd_batch_constant.hpp

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,20 @@ namespace xsimd
504504
return {};
505505
}
506506

507+
/**
508+
* @brief Build a @c batch_bool_constant out of a generator function
509+
*
510+
* Similar to @c make_batch_constant for @c batch_bool_constant
511+
*/
512+
template <typename T, class G, class A = default_arch>
513+
XSIMD_INLINE constexpr decltype(detail::make_batch_bool_constant<T, G, A>(detail::make_index_sequence<batch<T, A>::size>()))
514+
make_batch_bool_constant() noexcept
515+
{
516+
return {};
517+
}
518+
519+
// FIXME: Skipping those for doxygen because of bad interaction with breathe.
520+
#ifndef DOXYGEN_SHOULD_SKIP_THIS
507521
/**
508522
* @brief Build a @c batch_constant with a single repeated value.
509523
*
@@ -518,19 +532,10 @@ namespace xsimd
518532
return {};
519533
}
520534

521-
template <typename T, class G, class A = default_arch>
522-
XSIMD_INLINE constexpr decltype(detail::make_batch_bool_constant<T, G, A>(detail::make_index_sequence<batch<T, A>::size>()))
523-
make_batch_bool_constant() noexcept
524-
{
525-
return {};
526-
}
527-
528-
/**
535+
/*
529536
* @brief Build a @c batch_bool_constant with a single repeated value.
530537
*
531-
* @tparam T type of the data held in the batch.
532-
* @tparam Val The value to repeat.
533-
* @tparam A Architecture that will be used when converting to a regular batch.
538+
* Similar to @c make_batch_constant for @c batch_bool_constant
534539
*/
535540
template <typename T, bool Val, class A = default_arch>
536541
XSIMD_INLINE constexpr decltype(detail::make_batch_bool_constant<T, Val, A>(detail::make_index_sequence<batch<T, A>::size>()))
@@ -539,6 +544,8 @@ namespace xsimd
539544
return {};
540545
}
541546

547+
#endif
548+
542549
} // namespace xsimd
543550

544551
#endif

0 commit comments

Comments
 (0)