5

I have written a code for the Convolution of image using API's clCreateImage2D for creating space,clEnqueueWriteImage to write to the device and read_imageui for reading the image in a kernel and write_imageui for writing the image back to the host.

Now i want to use the result of the convolution kernel which is pointing to a buffer in another kernel argument.Without moving the result back to host and forth to the device.Is this possible.

If the result is moved back and forth...i think it will be expensive.

Any help in this regards will be invaluable.

1 Answer 1

8

From the Host's point of view, you should be able to take the buffer object, and just pass it as an argument to another kernel. After that you just treat it like any other buffer. The only trick is making sure that when you create the buffer, it has sufficient read-write permissions that it can be both output and input to your kernels.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.