From f9900fe84a780331ac0e715913ab2627e451d73d Mon Sep 17 00:00:00 2001 From: Joseph Schuchart Date: Fri, 22 Dec 2023 14:08:08 +0000 Subject: [PATCH] Reset readers on reduced copy Signed-off-by: Joseph Schuchart --- ttg/ttg/parsec/ttg.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ttg/ttg/parsec/ttg.h b/ttg/ttg/parsec/ttg.h index c0dcaf3b7..3157a02b5 100644 --- a/ttg/ttg/parsec/ttg.h +++ b/ttg/ttg/parsec/ttg.h @@ -1737,6 +1737,7 @@ ttg::abort(); // should not happen using rtask_t = detail::reducer_task_t; using value_t = std::tuple_element_t; constexpr const bool val_is_void = ttg::meta::is_void_v; + constexpr const bool input_is_const = std::is_const_v; rtask_t *rtask = (rtask_t*)parsec_task; task_t *parent_task = static_cast(rtask->parent_task); ttT *baseobj = parent_task->tt; @@ -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); }