Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DF behaviour: Allow zero-horizon windows/views #13

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions libworkstream_df/reuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
15 changes: 11 additions & 4 deletions libworkstream_df/wstream_df.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -718,13 +720,20 @@ 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;
}

trace_state_change(current_thread, WORKER_STATE_RT_RESDEP);

if(is_read_view_p)
check_add_view_to_chain(&fp->input_view_chain, view);
else
check_add_view_to_chain(&fp->output_view_chain, view);

trace_state_change(current_thread, WORKER_STATE_RT_RESDEP);

pthread_mutex_lock (&stream->stream_lock);

if (is_read_view_p == true)
Expand Down Expand Up @@ -1451,8 +1460,6 @@ wstream_df_resolve_n_dependences (size_t n, void *v, void *s, bool is_read_view_
view->burst = dummy_view->burst;
view->horizon = dummy_view->horizon;

assert(view->horizon != 0);

view->owner = dummy_view->owner;

if(!dummy_view->reuse_associated_view) {
Expand Down