spectral

Difference between : clCreateBuffer OR clCreateBuffer + clEnqueueWriteBuffer

Discussion created by spectral on Dec 31, 2009
Latest reply on Dec 19, 2013 by tal1974

 

Hi,

I would like to know what is the difference between :

oclBuff = clCreateBuffer(gpu_context, CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, mem_size, dataSet, &err);

 

...and...

 

oclBuff = clCreateBuffer(gpu_context, CL_MEM_READ_ONLY, mem_size, NULL, &err);

err = clEnqueueWriteBuffer(cmd_queue, dataSet, CL_TRUE, 0, mem_size, a, 0, NULL, NULL);

Which one I should use in which case ? and why ? Or it is exactly the same ?

Thanks



Outcomes