5.9 Reading the results

After your kernels have finished execution, you must make the result accessible to the host. To access the results from the kernel, use clEnqueueMapBuffer() to map the buffer into host memory.

For example:
local_buffer = clEnqueueMapBuffer(queue, buffer, CL_NON_BLOCKING, CL_MAP_READ, 0,
               (sizeof(buffer_size), num_deps, &deps[0], NULL, &err);



  • clFinish() must be called to make the buffer available.
  • The third parameter of clEnqueueMapBuffer() is CL_CL_NON_BLOCKING in the previous example. If you change this parameter in clEnqueueMapBuffer() or clFinish() to CL_CL_BLOCKING, the call becomes a blocking call and the read must be completed before clEnqueueMapBuffer() returns.
Non-ConfidentialPDF file icon PDF versionARM 100614_0300_00_en
Copyright © 2012, 2013, 2015, 2016 ARM. All rights reserved.