cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

lava555
Journeyman III

clCreateBuffer() need lots of time

given a kernel and repeat running it, the corresponding cl_mem object is constant, but values of a array binded with the cl_mem object is changing, how to synchronize data between host and device ? it seems that only rebuilding cl_mem object can do that. if the array is big enough, it will consumes lots of time. So my question is : is there any method to achieve it quickly and efficiently?

0 Likes
1 Reply
nou
Exemplar

why. if you enqueue write into buffer and then enqueue kernel execution on the same comman queue then you can be sure that data is on the device before kernel run. (queue can not be out of order of course). if you must synchronize data on the host then enqueue read/write and call clWaitEvents() or clFinish()

0 Likes