Hi, I'm trying to get 2 kernels to communicate with each other using pipes.
1 parent kernel writes to a pipe, and enqueues a child kernel.
Meanwhile a child kernel reads from the pipe, and writes to another pipe, that will be read by the parent.
There are 2 different pipes.
One is: write end -> parent, read-end -> child. The other is write-end -> child, read-end -> parent.
The call for the parent kernel to read from the child kernel write pipe is placed directly after the enqueue is performed. The child does not enqueue the parent.
My reserve ID is failing to return back a valid ID for the read. What am I doing wrong?
Am I wrong to assume that the control flow returns back to the parent kernel after the child kernels finish executing?
If so, then what is the control flow?
Solved! Go to Solution.
>>Am I wrong to assume that the control flow returns back to the parent kernel after the child kernels finish executing?
The blog author reviewed your post. Hope this helps.
Yes, that is an incorrect assumption. The design of parent kernel should not assume waiting for results of child kernel. They are completely asynchronous and there is no way in current OpenCL specification to ensure sync point between them. The Breadth-First-Search sample in 3.0 Beta demonstrates the use of pipes read/write that are passed between parent and child kernels.
Thanks for the reply.
So if I were to understand this correctly, in order to pass the child pipe's information back to the parent kernel, a new instance of the parent kernel must be made, using enqueue_kernel.
The instance of the parent kernel used to call the child kernel is destroyed after its termination.
Is this correct?
That particular blog entry didn't illustrate what I wanted to do, which was to test out the communication schemes between a parent kernel, and an instantiated child kernel. If I recall correctly, "pipes producer consumer" had 2 kernels called from the host.
Hence, why I decided to experiment and see what pipes and device-side enqueues were capable (and not capable) of doing, by testing out my initial assumption.