Skip to content

Commit

Permalink
Reset readers on reduced copy
Browse files Browse the repository at this point in the history
Signed-off-by: Joseph Schuchart <[email protected]>
  • Loading branch information
devreal committed Dec 22, 2023
1 parent 4547d8c commit f9900fe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ttg/ttg/parsec/ttg.h
Original file line number Diff line number Diff line change
Expand Up @@ -1737,6 +1737,7 @@ ttg::abort(); // should not happen
using rtask_t = detail::reducer_task_t;
using value_t = std::tuple_element_t<i, actual_input_tuple_type>;
constexpr const bool val_is_void = ttg::meta::is_void_v<value_t>;
constexpr const bool input_is_const = std::is_const_v<value_t>;
rtask_t *rtask = (rtask_t*)parsec_task;
task_t *parent_task = static_cast<task_t*>(rtask->parent_task);
ttT *baseobj = parent_task->tt;
Expand Down Expand Up @@ -1810,7 +1811,11 @@ ttg::abort(); // should not happen
// << " of " << parent_task->streams[i].goal << " complete " << complete
// << " c " << c << std::endl;
if (complete && c == 0) {
/* task is still in the hash table, have release_task remove it */
if constexpr(input_is_const) {
/* make the consumer task a reader if its input is const */
target_copy->reset_readers();
}
/* task may not be runnable yet because other inputs are missing, have release_task decide */
parent_task->remove_from_hash = true;
parent_task->release_task(parent_task);
}
Expand Down

0 comments on commit f9900fe

Please sign in to comment.