@@ -294,23 +294,23 @@ int c_dbcsr_acc_host_mem_deallocate(void* host_mem, void* stream) {
294294
295295void CL_CALLBACK c_dbcsr_acc_memcpy_notify (cl_event /*event*/ , cl_int /*event_status*/ , void * /*data*/ );
296296void CL_CALLBACK c_dbcsr_acc_memcpy_notify (cl_event event , cl_int event_status , void * data ) {
297- int durdev_result = EXIT_SUCCESS ;
298- const double durdev = c_dbcsr_acc_opencl_duration (event , & durdev_result );
297+ int result = EXIT_SUCCESS ;
298+ const double durdev = c_dbcsr_acc_opencl_duration (event , & result );
299299 c_dbcsr_acc_opencl_info_memptr_t info ;
300- cl_command_type command_type ;
300+ cl_command_type type ;
301301 size_t size = 0 , offset = 0 ;
302302 LIBXSMM_UNUSED (event_status );
303303 assert (CL_COMPLETE == event_status && NULL != data );
304- if (EXIT_SUCCESS == clGetEventInfo (event , CL_EVENT_COMMAND_TYPE , sizeof (command_type ), & command_type , NULL ) &&
305- EXIT_SUCCESS == c_dbcsr_acc_opencl_info_devptr_lock (& info , NULL /*lock*/ , data , 1 /*elsize*/ , NULL /*amount*/ , & offset ) &&
306- EXIT_SUCCESS == clGetMemObjectInfo (info .memory , CL_MEM_SIZE , sizeof (size_t ), & size , NULL ) && EXIT_SUCCESS == durdev_result )
304+ if (EXIT_SUCCESS == result && EXIT_SUCCESS == clGetEventInfo (event , CL_EVENT_COMMAND_TYPE , sizeof (type ), & type , NULL ) &&
305+ EXIT_SUCCESS == c_dbcsr_acc_opencl_info_devptr_lock (& info , NULL , data , 1 /*elsize*/ , NULL /*amount*/ , & offset ) &&
306+ EXIT_SUCCESS == clGetMemObjectInfo (info .memory , CL_MEM_SIZE , sizeof (size_t ), & size , NULL ) && offset <= size )
307307 {
308308 /*const double durhst = libxsmm_timer_duration((libxsmm_timer_tickint)info.data, libxsmm_timer_tick());
309309 const double durtot = durdev - LIBXSMM_MIN(durdev, durhst);*/
310310 const size_t amount = size - offset ;
311311 const double vals [] = {(double )amount , durdev };
312312 const int mb = (int )((amount + (1 << 19 )) >> 20 );
313- switch (command_type ) {
313+ switch (type ) {
314314 case CL_COMMAND_WRITE_BUFFER : {
315315 assert (NULL != c_dbcsr_acc_opencl_config .hist_h2d );
316316 c_dbcsr_acc_opencl_hist_set (c_dbcsr_acc_opencl_config .lock_memory , c_dbcsr_acc_opencl_config .hist_h2d , vals );
0 commit comments