From b89aef7377b960c4ae9962404e0ef11468b10670 Mon Sep 17 00:00:00 2001 From: Nuno Miguel Nobre Date: Fri, 26 Jun 2020 12:08:41 +0100 Subject: [PATCH] DF behaviour: Allow zero-horizon windows/views --- libworkstream_df/reuse.c | 3 +++ libworkstream_df/wstream_df.c | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/libworkstream_df/reuse.c b/libworkstream_df/reuse.c index de43c4f3c..36bbb5189 100644 --- a/libworkstream_df/reuse.c +++ b/libworkstream_df/reuse.c @@ -141,6 +141,9 @@ void __built_in_wstream_df_prepare_data(void* v) wstream_df_view_p out_view = v; int force_reuse = 0; + if (!out_view->horizon) + return; + /* View of a direct consumer of the task to be executed */ wstream_df_view_p consumer_view = out_view->consumer_view; diff --git a/libworkstream_df/wstream_df.c b/libworkstream_df/wstream_df.c index 9d9b6706b..fa965fde4 100644 --- a/libworkstream_df/wstream_df.c +++ b/libworkstream_df/wstream_df.c @@ -352,6 +352,8 @@ void update_numa_nodes_of_views(wstream_df_thread_p cthread, wstream_df_frame_p static inline void tdecrease_n (void *data, size_t n, bool is_write) { + if (!n) + return; wstream_df_frame_p fp = (wstream_df_frame_p) data; wstream_df_thread_p cthread = current_thread; @@ -718,6 +720,13 @@ wstream_df_resolve_dependences (void *v, void *s, bool is_read_view_p) wstream_df_frame_p fp = view->owner; int defer_further = 0; + if (!view->horizon) + { + if (!is_read_view_p) + tdecrease_n (fp, 1, 0); + return; + } + if(is_read_view_p) check_add_view_to_chain(&fp->input_view_chain, view); else