OpenCl 2:如何将image2d对象转换为不带副本的缓冲区,反之亦然

时间:2015-10-28 07:42:59

标签: buffer opencl gpgpu

有谁知道如何将给定的image2d对象转换为缓冲区,从缓冲区转换为image2d对象?

我知道在opencl 1.2中有一个名为cl_khr_image2d_from_buffer的扩展名,而在opencl 2中它就成了核心功能。

1 个答案:

答案 0 :(得分:1)

Use cl_khr_image2d_from_buffer when you can, otherwise write a kernel that copies the data from image to buffer or buffer to image. The memory layout of an image is private to the implementation and should be considered unknown.