Hi guys!
i am tring to use Pipe in OpenCL2.0. But I am confused about the built-in Pipe read and write functions,such as write_pipe, reserver_read_pipe.
Code :
reserve_id_t reserve_write_pipe ( pipe gentype p, uint num_packets)
Code :
int write_pipe (pipe gentype p, reserve_id_t reserve_id, uint index, const gentype *p
1. For the reserve_write_pipe() function, Description is that
Code :
Reserve num_packets entries for writing to pipe p. Returns a valid reservation ID if the reservation is successful.
I don't know what's the meaning of the num_packets argument.
2. For write_pipe() function,Description is that
Code :
Write packet specified by ptr to the reserved area of the pipe referred to by reserve_id and index.
What's the meaning of "reserved area of the pipe"? and What's the meaning of "reserve_id " and "index"?
3. If i want to write to Pipe by order(such as work-item 0 writes 0 to the pipe,work-items 1 write 1 to the pipe,.. work-item n writes n to the pipe,so the data in the pipe is "012345……n" ,and 0 is the first one in the pipe),what should I do ?
Can someone help me please? Thanks.
hi_buddy