cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

billyc59
Journeyman III

OpenCL pipes communication: collection at child kernel

I'm trying to have a single child kernel read from multiple pipes, but the each individual write-end of the pipes are called by different kernels.  I'm effectively trying to perform a gather operation using pipes as a communications vehicle.   

Is this scheme possible?  If not, is there a better solution than simply using a global buffer?

0 Likes
1 Solution

Hopefully this will help clarify. The engineering team says:

What :

-          Pipes are memory objects that store data organized as a FIFO.

-          Contain data in the form of packets

-          Pipes are only "coherent" at the standard synchronization points; the result of concurrent accesses to the same pipe by multiple kernels (even if permitted by hardware) is undefined.

-          Pipe can be read-only or write-only in a given kernel. A pipe cannot be read from and written into at the same time (in same kernel).

Why use Pipes:

-          Read from and write to a pipe without requiring atomic operations to global memory

-          Enable producer – consumer relationships between kernels. (Pipe will be write-only in producer, read-only for consumer)

-          Pipes may be particularly useful when combined with device-side enqueue for dynamically constructing computational data flow graphs

View solution in original post

7 Replies
maxdz8
Elite

Following thread.

I would be very surprised if you could assume an order of operations. Those things are supposed to be massively-parallel hardware constructs.

0 Likes
billyc59
Journeyman III

The current way I see this working is if I come up with a control scheme for a global buffer.  I was hoping there'd be a built-in trick in the API that I wasn't aware of, or another misunderstanding of the concepts. 

From my findings:

Pipes are for a single kernel to communicate to another single kernel.  Be that with 1 pipe, or many. 
You cannot tell multiple kernels to read from a single pipe.  Pipes can't be used as inter-kernel scatter buffers.  With that revelation comes a reasonable expectation that pipes can't be used as inter-kernel gather buffers.

So, when are pipes useful? 
To me, pipes are useful for transferring subsets of data to specific kernels, without the risk of data loss.  Pipes are restrictive memory objects, whereas buffers are not.

0 Likes

Just checking in.... it's not clear to me, but you may have resolved your own question. Are you requesting confirmation of your findings? Or do you think your initial question is answered?

0 Likes

I am requesting confirmation of my findings, if possible.  Please and thank you.

0 Likes

Cool. Let me check in with the OpenCL 2 team and see what we get.

0 Likes

Hopefully this will help clarify. The engineering team says:

What :

-          Pipes are memory objects that store data organized as a FIFO.

-          Contain data in the form of packets

-          Pipes are only "coherent" at the standard synchronization points; the result of concurrent accesses to the same pipe by multiple kernels (even if permitted by hardware) is undefined.

-          Pipe can be read-only or write-only in a given kernel. A pipe cannot be read from and written into at the same time (in same kernel).

Why use Pipes:

-          Read from and write to a pipe without requiring atomic operations to global memory

-          Enable producer – consumer relationships between kernels. (Pipe will be write-only in producer, read-only for consumer)

-          Pipes may be particularly useful when combined with device-side enqueue for dynamically constructing computational data flow graphs

Thank you!

0 Likes