Skip to content

Commit

Permalink
Broadcast: Forward rvalue references instead of wrapping them in std:…
Browse files Browse the repository at this point in the history
…:tie

Signed-off-by: Joseph Schuchart <joseph.schuchart@stonybrook.edu>
  • Loading branch information
devreal committed Sep 5, 2024
1 parent ded1793 commit 6b1eaee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ttg/ttg/device/task.h
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,11 @@ namespace ttg::device {
template <size_t i, typename rangeT,
ttg::Runtime Runtime = ttg::ttg_runtime>
inline detail::send_t broadcastk(rangeT &&keylist) {
return detail::send_t{detail::broadcastk_coro<i>(std::tie(keylist))};
if constexpr (std::is_rvalue_reference_v<decltype(keylist)>) {
return detail::send_t{detail::broadcastk_coro<i>(std::forward<rangeT>(keylist))};
} else {
return detail::send_t{detail::broadcastk_coro<i>(std::tie(keylist))};
}
}


Expand Down

0 comments on commit 6b1eaee

Please sign in to comment.