Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Well, where do you read the image back from your GPU? </p> <p>You allocate your input image with the flag <code>CL_MEM_COPY_HOST_PTR</code></p> <blockquote> <p>This flag is valid only if host_ptr is not NULL. If specified, it indicates that the application wants the OpenCL implementation to allocate memory for the memory object and copy the data from memory referenced by host_ptr. </p> </blockquote> <p>and your output image with <code>CL_MEM_USE_HOST_PTR</code></p> <blockquote> <p>This flag is valid only if host_ptr is not NULL. If specified, it indicates that the application wants the OpenCL implementation to use memory referenced by host_ptr as the storage bits for the memory object.</p> <p>OpenCL implementations are allowed to cache the buffer contents pointed to by host_ptr in device memory. This cached copy can be used when kernels are executed on a device.</p> <p>The result of OpenCL commands that operate on multiple buffer objects created with the same host_ptr or overlapping host regions is considered to be undefined.</p> </blockquote> <p>there is nothing wrong with your allocation, however you never tell the OpenCL implementation to write the memory to the used device and to read that memory back into hosts main memory. This may work for CPUs because the memory is already in their device memory (the main memory) but fails for GPUs.</p> <p>The OpenCL c++ binding offers <code>cl::enqueueWriteImage(/*params*/);</code> and <code>cl::enqueueReadImage(/*params*/);</code> to write and read image buffers to/from a device. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload