Skip to content

Commit ba7216c

Browse files
committed
Move type inference to auto declaration due to CUDA 12.4 compiler error
1 parent 7cc409e commit ba7216c

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

source/PTL/TaskGroup.hh

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -654,14 +654,16 @@ TaskGroup<Tp, Arg, MaxDepth>::join(Up accum)
654654
{
655655
this->wait();
656656
for(auto& itr : m_task_list)
657-
{
658-
using RetT = decay_t<decltype(itr->get())>;
659-
accum = std::move(m_join(std::ref(accum), std::forward<RetT>(itr->get())));
657+
{
658+
auto&& ret = itr->get();
659+
using RetT = decay_t<decltype(ret)>;
660+
accum = std::move(m_join(std::ref(accum), std::forward<RetT>(ret)));
660661
}
661662
for(auto& itr : m_future_list)
662-
{
663-
using RetT = decay_t<decltype(itr.get())>;
664-
accum = std::move(m_join(std::ref(accum), std::forward<RetT>(itr.get())));
663+
{
664+
auto&& ret = itr.get();
665+
using RetT = decay_t<decltype(ret)>;
666+
accum = std::move(m_join(std::ref(accum), std::forward<RetT>(ret)));
665667
}
666668
this->clear();
667669
return accum;
@@ -691,13 +693,15 @@ TaskGroup<Tp, Arg, MaxDepth>::join()
691693
this->wait();
692694
for(auto& itr : m_task_list)
693695
{
694-
using RetT = decay_t<decltype(itr->get())>;
695-
m_join(std::forward<RetT>(itr->get()));
696+
auto&& ret = itr->get();
697+
using RetT = decay_t<decltype(ret)>;
698+
m_join(std::forward<RetT>(ret));
696699
}
697700
for(auto& itr : m_future_list)
698701
{
699-
using RetT = decay_t<decltype(itr.get())>;
700-
m_join(std::forward<RetT>(itr.get()));
702+
auto&& ret = itr.get();
703+
using RetT = decay_t<decltype(ret)>;
704+
m_join(std::forward<RetT>(ret));
701705
}
702706
this->clear();
703707
}

0 commit comments

Comments
 (0)