--- OpenCL/OpenCL.xs 2012/04/24 14:24:42 1.48 +++ OpenCL/OpenCL.xs 2012/04/24 14:57:06 1.50 @@ -1008,7 +1008,7 @@ const void *c_fus [3] = { &c_f, &c_u, &c_s }; static const char fus [] = { 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 1, 1, 1, 0, 0 }; cl_image_format format; - NEED_SUCCESS (clGetImageInfo, (img, CL_IMAGE_FORMAT, sizeof (format), &format, 0)); + NEED_SUCCESS (GetImageInfo, (img, CL_IMAGE_FORMAT, sizeof (format), &format, 0)); assert (sizeof (fus) == CL_FLOAT + 1 - CL_SNORM_INT8); if (format.image_channel_data_type < CL_SNORM_INT8 || CL_FLOAT < format.image_channel_data_type) croak ("enqueue_fill_image: image has unsupported channel type, only opencl 1.2 channel types supported."); @@ -1317,7 +1317,10 @@ #if CL_VERSION_1_2 NEED_SUCCESS (EnqueueMarkerWithWaitList, (self, event_list_count, event_list_ptr, GIMME_V != G_VOID ? &ev : 0)); #else - NEED_SUCCESS (EnqueueWaitForEvents, (self, event_list_count, event_list_ptr, GIMME_V != G_VOID ? &ev : 0)); // also a barrier + { + NEED_SUCCESS (EnqueueWaitForEvents, (self, event_list_count, event_list_ptr)); // also a barrier + NEED_SUCCESS (EnqueueMarker, (self, GIMME_V != G_VOID ? &ev : 0)); + } #endif #else NEED_SUCCESS (EnqueueMarkerWithWaitList, (self, event_list_count, event_list_ptr, GIMME_V != G_VOID ? &ev : 0)); @@ -1339,7 +1342,7 @@ #else { if (event_list_count) - NEED_SUCCESS (EnqueueWaitForEvents, (self, event_list_count, event_list_ptr, GIMME_V != G_VOID ? &ev : 0)); + NEED_SUCCESS (EnqueueWaitForEvents, (self, event_list_count, event_list_ptr)); if (GIMME_V != G_VOID) NEED_SUCCESS (EnqueueMarker, (self, &ev)); @@ -1536,6 +1539,15 @@ PPCODE: INFO (Image) +void +format (OpenCL::Image self) + PPCODE: + cl_image_format format; + NEED_SUCCESS (GetImageInfo, (self, CL_IMAGE_FORMAT, sizeof (format), &format, 0)); + EXTEND (SP, 2); + PUSHs (sv_2mortal (newSVuv (format.image_channel_order))); + PUSHs (sv_2mortal (newSVuv (format.image_channel_data_type))); + #BEGIN:image void