Skip to content

Commit 79afaad

Browse files
Frail fix for batch_constant documentation
1 parent 37e5d9f commit 79afaad

File tree

2 files changed

+32
-11
lines changed

2 files changed

+32
-11
lines changed

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
@@ -302,6 +302,20 @@ namespace xsimd
302302
return {};
303303
}
304304

305+
/**
306+
* @brief Build a @c batch_bool_constant out of a generator function
307+
*
308+
* Similar to @c make_batch_constant for @c batch_bool_constant
309+
*/
310+
template <typename T, class G, class A = default_arch>
311+
XSIMD_INLINE constexpr decltype(detail::make_batch_bool_constant<T, G, A>(detail::make_index_sequence<batch<T, A>::size>()))
312+
make_batch_bool_constant() noexcept
313+
{
314+
return {};
315+
}
316+
317+
// FIXME: Skipping those for doxygen because of bad interaction with breathe.
318+
#ifdef DOXYGEN_SHOULD_SKIP_THIS
305319
/**
306320
* @brief Build a @c batch_constant with a single repeated value.
307321
*
@@ -316,19 +330,10 @@ namespace xsimd
316330
return {};
317331
}
318332

319-
template <typename T, class G, class A = default_arch>
320-
XSIMD_INLINE constexpr decltype(detail::make_batch_bool_constant<T, G, A>(detail::make_index_sequence<batch<T, A>::size>()))
321-
make_batch_bool_constant() noexcept
322-
{
323-
return {};
324-
}
325-
326-
/**
333+
/*
327334
* @brief Build a @c batch_bool_constant with a single repeated value.
328335
*
329-
* @tparam T type of the data held in the batch.
330-
* @tparam Val The value to repeat.
331-
* @tparam A Architecture that will be used when converting to a regular batch.
336+
* Similar to @c make_batch_constant for @c batch_bool_constant
332337
*/
333338
template <typename T, bool Val, class A = default_arch>
334339
XSIMD_INLINE constexpr decltype(detail::make_batch_bool_constant<T, Val, A>(detail::make_index_sequence<batch<T, A>::size>()))
@@ -337,6 +342,8 @@ namespace xsimd
337342
return {};
338343
}
339344

345+
#endif
346+
340347
} // namespace xsimd
341348

342349
#endif

0 commit comments

Comments
 (0)