Browse Source

Always request data as image in lamino bp

The other variants don't work and ROI copying will
be moved elsewhere anyway.
Tomas Farago 9 years ago
parent
commit
464e75a1f7
1 changed files with 11 additions and 45 deletions
  1. 11 45
      src/ufo-anka-backproject-task.c

+ 11 - 45
src/ufo-anka-backproject-task.c

@@ -141,51 +141,17 @@ copy_to_image (UfoBuffer *input,
     gfloat *input_data_host;
     size_t src_offset;
 
-    switch (location) {
-        case UFO_BUFFER_LOCATION_HOST:
-            input_data_host = ufo_buffer_get_host_array (input, NULL);
-            src_offset = origin[1] * in_width + origin[0];
-            UFO_RESOURCES_CHECK_CLERR (clEnqueueWriteImage (cmd_queue,
-                                                            output_image,
-                                                            CL_TRUE,
-                                                            origin,
-                                                            region,
-                                                            0,
-                                                            0,
-                                                            input_data_host + src_offset,
-                                                            0,
-                                                            NULL,
-                                                            &event));
-            break;
-        case UFO_BUFFER_LOCATION_DEVICE:
-            input_data = ufo_buffer_get_device_array (input, cmd_queue);
-            src_offset = (origin[1] * in_width + origin[0]) * sizeof (cl_float);
-            UFO_RESOURCES_CHECK_CLERR (clEnqueueCopyBufferToImage (cmd_queue,
-                                                                   input_data,
-                                                                   output_image,
-                                                                   src_offset,
-                                                                   origin,
-                                                                   region,
-                                                                   0,
-                                                                   NULL,
-                                                                   &event));
-            break;
-        case UFO_BUFFER_LOCATION_DEVICE_IMAGE:
-            input_data = ufo_buffer_get_device_image (input, cmd_queue);
-            UFO_RESOURCES_CHECK_CLERR (clEnqueueCopyImage (cmd_queue,
-                                                           input_data,
-                                                           output_image,
-                                                           origin,
-                                                           origin,
-                                                           region,
-                                                           0,
-                                                           NULL,
-                                                           &event));
-            break;
-        default:
-            g_warning ("Invalid input buffer location");
-            break;
-    }
+    input_data = ufo_buffer_get_device_image (input, cmd_queue);
+    UFO_RESOURCES_CHECK_CLERR (clEnqueueCopyImage (cmd_queue,
+                                                   input_data,
+                                                   output_image,
+                                                   origin,
+                                                   origin,
+                                                   region,
+                                                   0,
+                                                   NULL,
+                                                   &event));
+
     UFO_RESOURCES_CHECK_CLERR (clWaitForEvents (1, &event));
     UFO_RESOURCES_CHECK_CLERR (clReleaseEvent (event));
 }