diff options
Diffstat (limited to 'src/ufo-stacked-backproject-task.c')
-rw-r--r-- | src/ufo-stacked-backproject-task.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/ufo-stacked-backproject-task.c b/src/ufo-stacked-backproject-task.c index 5ddfd26..cbf2600 100644 --- a/src/ufo-stacked-backproject-task.c +++ b/src/ufo-stacked-backproject-task.c @@ -69,6 +69,7 @@ struct _UfoStackedBackprojectTaskPrivate { gint roi_width; gint roi_height; Precision precision; + size_t out_mem_size; }; static void ufo_task_interface_init (UfoTaskIface *iface); @@ -307,6 +308,8 @@ ufo_stacked_backproject_task_process (UfoTask *task, cmd_queue = ufo_gpu_node_get_cmd_queue(node); out_mem = ufo_buffer_get_device_array (output, cmd_queue); profiler = ufo_task_node_get_profiler (UFO_TASK_NODE (task)); + + ufo_profiler_enable_tracing(profiler, TRUE); /* Guess axis position if they are not provided by the user. */ if (priv->axis_pos <= 0.0) { @@ -348,13 +351,13 @@ ufo_stacked_backproject_task_process (UfoTask *task, buffer_size = sizeof(cl_float4) * dim_x * dim_y * quotient; format.image_channel_data_type = CL_HALF_FLOAT; }else if(priv->precision == INT8){ - quotient = requisition->dims[2]/4; + quotient = requisition->dims[2]/8; kernel_interleave = priv->interleave_uint; kernel_texture = priv->texture_uint; kernel_uninterleave = priv->uninterleave_uint; - format.image_channel_order = CL_RGBA; - format.image_channel_data_type = CL_UNSIGNED_INT8; - buffer_size = sizeof(cl_uint4) * dim_x * dim_y * quotient; + format.image_channel_order = CL_RG; + format.image_channel_data_type = CL_UNSIGNED_INT32; + buffer_size = sizeof(cl_uint8) * dim_x * dim_y * quotient; } cl_image_desc imageDesc; @@ -424,7 +427,13 @@ ufo_stacked_backproject_task_process (UfoTask *task, UFO_RESOURCES_CHECK_CLERR(clReleaseMemObject(interleaved_img)); UFO_RESOURCES_CHECK_CLERR(clReleaseMemObject(reconstructed_buffer)); } + + size_t temp_size; + clGetMemObjectInfo(out_mem,CL_MEM_SIZE,sizeof(temp_size),&temp_size,NULL); + priv->out_mem_size += temp_size; + //fprintf(stdout, "Time taken GPU: %f Size: %zu \n", ufo_profiler_elapsed(profiler, UFO_PROFILER_TIMER_GPU), priv->out_mem_size); +// fprintf(stdout, "Time taken: %f \n",ufo_profiler_elapsed(profiler,UFO_PROFILER_TIMER_GPU)); return TRUE; } @@ -716,4 +725,6 @@ ufo_stacked_backproject_task_init(UfoStackedBackprojectTask *self) priv->roi_x = priv->roi_y = 0; priv->roi_width = priv->roi_height = 0; priv->precision = SINGLE; -}
\ No newline at end of file + priv->out_mem_size = 0; +} + |