|
@@ -284,6 +284,7 @@ copy_to_image (UfoBuffer *input,
|
|
|
{
|
|
|
const UfoBufferLocation location = ufo_buffer_get_location (input);
|
|
|
cl_mem input_data;
|
|
|
+ cl_event event;
|
|
|
gfloat *input_data_host;
|
|
|
size_t src_offset;
|
|
|
|
|
@@ -301,7 +302,7 @@ copy_to_image (UfoBuffer *input,
|
|
|
input_data_host + src_offset,
|
|
|
0,
|
|
|
NULL,
|
|
|
- NULL));
|
|
|
+ &event));
|
|
|
break;
|
|
|
case UFO_BUFFER_LOCATION_DEVICE:
|
|
|
input_data = ufo_buffer_get_device_array (input, cmd_queue);
|
|
@@ -314,7 +315,7 @@ copy_to_image (UfoBuffer *input,
|
|
|
region,
|
|
|
0,
|
|
|
NULL,
|
|
|
- NULL));
|
|
|
+ &event));
|
|
|
break;
|
|
|
case UFO_BUFFER_LOCATION_DEVICE_IMAGE:
|
|
|
input_data = ufo_buffer_get_device_image (input, cmd_queue);
|
|
@@ -326,12 +327,14 @@ copy_to_image (UfoBuffer *input,
|
|
|
region,
|
|
|
0,
|
|
|
NULL,
|
|
|
- NULL));
|
|
|
+ &event));
|
|
|
break;
|
|
|
default:
|
|
|
g_warning ("Invalid input buffer location");
|
|
|
break;
|
|
|
}
|
|
|
+ UFO_RESOURCES_CHECK_CLERR (clWaitForEvents (1, &event));
|
|
|
+ UFO_RESOURCES_CHECK_CLERR (clReleaseEvent (event));
|
|
|
}
|
|
|
|
|
|
|