8 Replies Latest reply on Dec 19, 2013 11:06 PM by tal1974

    Difference between : clCreateBuffer OR clCreateBuffer + clEnqueueWriteBuffer

    spectral

       

      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