1 Reply Latest reply on Jul 29, 2010 7:39 AM by nou

    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?

        • clCreateBuffer() need lots of time

          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()