Skip to content

Instantly share code, notes, and snippets.

@jrprice
Created May 29, 2017 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrprice/4dca8971102bb0ba2d3d342db96f7f2e to your computer and use it in GitHub Desktop.
Save jrprice/4dca8971102bb0ba2d3d342db96f7f2e to your computer and use it in GitHub Desktop.
WIP patch for attempting to fix event dependencies in pocl
diff --git a/lib/CL/devices/common.c b/lib/CL/devices/common.c
index 075474c..a574b14 100644
--- a/lib/CL/devices/common.c
+++ b/lib/CL/devices/common.c
@@ -632,6 +632,7 @@ pocl_broadcast (cl_event brc_event)
if (tmp->event == brc_event)
{
LL_DELETE (target->event->wait_list, tmp);
+ POname(clReleaseEvent) (tmp->event);
pocl_mem_manager_free_event_node (tmp);
break;
}
diff --git a/lib/CL/pocl_util.c b/lib/CL/pocl_util.c
index d102a3a..b822ee5 100644
--- a/lib/CL/pocl_util.c
+++ b/lib/CL/pocl_util.c
@@ -269,6 +269,9 @@ pocl_create_event_sync(cl_event waiting_event,
wait_list_item->event = notifier_event;
LL_PREPEND (notifier_event->notify_list, notify_target);
LL_PREPEND (waiting_event->wait_list, wait_list_item);
+
+ notifier_event->pocl_refcount++;
+
POCL_UNLOCK_OBJ (waiting_event);
return CL_SUCCESS;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment