summaryrefslogtreecommitdiff
path: root/src/cl_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cl_api.c')
-rw-r--r--src/cl_api.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/cl_api.c b/src/cl_api.c
index 036ae172..197627a1 100644
--- a/src/cl_api.c
+++ b/src/cl_api.c
@@ -283,7 +283,7 @@ clEnqueueSVMFree (cl_command_queue command_queue,
data->size = num_svm_pointers;
data->ptr = user_data;
- if (e_status == CL_COMPLETE) {
+ if (cl_command_queue_allow_bypass_submit(command_queue) && (e_status == CL_COMPLETE)) {
// Sync mode, no need to queue event.
err = cl_event_exec(e, CL_COMPLETE, CL_FALSE);
if (err != CL_SUCCESS) {
@@ -429,7 +429,7 @@ cl_int clEnqueueSVMMemcpy (cl_command_queue command_queue,
data->const_ptr = src_ptr;
data->size = size;
- if (e_status == CL_COMPLETE) {
+ if (cl_command_queue_allow_bypass_submit(command_queue) && (e_status == CL_COMPLETE)) {
// Sync mode, no need to queue event.
err = cl_event_exec(e, CL_COMPLETE, CL_FALSE);
if (err != CL_SUCCESS) {
@@ -441,6 +441,9 @@ cl_int clEnqueueSVMMemcpy (cl_command_queue command_queue,
break;
}
cl_command_queue_enqueue_event(command_queue, e);
+ if (blocking_copy) {
+ cl_event_wait_for_events_list(1, &e);
+ }
}
} while(0);
@@ -518,7 +521,7 @@ cl_int clEnqueueSVMMemFill (cl_command_queue command_queue,
data->pattern_size = pattern_size;
data->size = size;
- if (e_status == CL_COMPLETE) {
+ if (cl_command_queue_allow_bypass_submit(command_queue) && (e_status == CL_COMPLETE)) {
// Sync mode, no need to queue event.
err = cl_event_exec(e, CL_COMPLETE, CL_FALSE);
if (err != CL_SUCCESS) {