Multiple calls to enqueueReadBuffer return different results

By my understanding, multiple calls to enqueueReadBuffer should return the same result because the buffer will be written to an allocated array present in the host.
And the second call should just overwrite the previous without changing the results since nothing has changed in the device.

The code is basically:


n->out= new cl::Buffer(neuron_data->ocl->context, CL_MEM_READ_WRITE, image_width*image_height*sizeof(float));

queue.enqueueReadBuffer(*(n->out), CL_TRUE, 0, n->image_width*n->image_height*sizeof(float),n->last_output);

//process the last_output on the host here
//print 

queue.enqueueReadBuffer(*(n->out), CL_TRUE, 0, n->image_width*n->image_height*sizeof(float),n->last_output);

//process the last_output on the host here
//print again (this time the result differs)

Did I misread the documentation?

[QUOTE=zweifel;43017]By my understanding, multiple calls to enqueueReadBuffer should return the same result because the buffer will be written to an allocated array present in the host.
And the second call should just overwrite the previous without changing the results since nothing has changed in the device.

The code is basically:


n->out= new cl::Buffer(neuron_data->ocl->context, CL_MEM_READ_WRITE, image_width*image_height*sizeof(float));

queue.enqueueReadBuffer(*(n->out), CL_TRUE, 0, n->image_width*n->image_height*sizeof(float),n->last_output);

//process the last_output on the host here
//print 

queue.enqueueReadBuffer(*(n->out), CL_TRUE, 0, n->image_width*n->image_height*sizeof(float),n->last_output);

//process the last_output on the host here
//print again (this time the result differs)

Did I misread the documentation?[/QUOTE]

Problem found elsewhere.
I tried but could not find a way to either delete or change its title to [solved].
Please do it if you can.