@@ -37,20 +37,19 @@ inline constexpr void add_impl(const in1_t &in1, const in2_t &in2,
3737 *
3838 * @note Equivalent to In1 + In2 = Out in terms of array broadcasting.
3939 *
40- * @see ctmd::add(In1Type &&, In2Type &&, MPMode) for the in-place version that
41- * returns the result.
40+ * @see ctmd::add(auto &&, auto &&, MPMode) for the in-place version that returns
41+ * the result.
4242 */
43- template <typename In1Type, typename In2Type, typename OutType>
44- inline constexpr void add (In1Type &&In1, In2Type &&In2, OutType &&Out,
43+ inline constexpr void add (auto &&In1, auto &&In2, auto &&Out,
4544 const MPMode mpmode = MPMode::NONE) noexcept {
4645 core::batch (
4746 [](auto &&...elems ) {
4847 detail::add_impl (std::forward<decltype (elems)>(elems)...);
4948 },
5049 std::index_sequence<0 , 0 , 0 >{}, mpmode,
51- core::to_const_mdspan (std::forward<In1Type >(In1)),
52- core::to_const_mdspan (std::forward<In2Type >(In2)),
53- core::to_mdspan (std::forward<OutType >(Out)));
50+ core::to_const_mdspan (std::forward<decltype (In1) >(In1)),
51+ core::to_const_mdspan (std::forward<decltype (In2) >(In2)),
52+ core::to_mdspan (std::forward<decltype (Out) >(Out)));
5453}
5554
5655/* *
@@ -67,19 +66,19 @@ inline constexpr void add(In1Type &&In1, In2Type &&In2, OutType &&Out,
6766 *
6867 * @note Equivalent to In1 + In2 = Out in terms of array broadcasting.
6968 *
70- * @see ctmd::add(In1Type &&, In2Type &&, OutType &&, MPMode) for the in-place
71- * version that modifies the output.
69+ * @see ctmd::add(auto &&, auto &&, auto &&, MPMode) for the in-place version that
70+ * modifies the output.
7271 */
73- template <typename dtype = void , typename In1Type, typename In2Type >
72+ template <typename dtype = void >
7473[[nodiscard]] inline constexpr auto
75- add (In1Type &&In1, In2Type &&In2, const MPMode mpmode = MPMode::NONE) noexcept {
74+ add (auto &&In1, auto &&In2, const MPMode mpmode = MPMode::NONE) noexcept {
7675 return core::batch_out<dtype>(
7776 [](auto &&...elems ) {
7877 detail::add_impl (std::forward<decltype (elems)>(elems)...);
7978 },
8079 std::index_sequence<0 , 0 >{}, ctmd::extents<uint8_t >{}, mpmode,
81- core::to_const_mdspan (std::forward<In1Type >(In1)),
82- core::to_const_mdspan (std::forward<In2Type >(In2)));
80+ core::to_const_mdspan (std::forward<decltype (In1) >(In1)),
81+ core::to_const_mdspan (std::forward<decltype (In2) >(In2)));
8382}
8483
8584} // namespace ctmd
0 commit comments