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,
               (data_size, num_deps, &deps[0], NULL, &err);

ASSERT(CL_SUCCESS == err);

Note:

  • clFinish() must be called to make the buffer available.
  • The third parameter of clEnqueueMapBuffer() is CL_NON_BLOCKING in the previous example. If you change this parameter in clEnqueueMapBuffer() or clFinish() to CL_BLOCKING, the call becomes a blocking call and the read must be completed before clEnqueueMapBuffer() returns.
Non-ConfidentialPDF file icon PDF version101574_0301_00_en
Copyright © 2019 Arm Limited or its affiliates. All rights reserved.