EnqueueWriteBuffer vs direct writes performance

Hi there,
I’m performing some tests on an AMD fusion. I actually want to test the bandwidth of the host writing to buffers allocated in various positions (host, device, host-device accessible memory).
Now, suppose that I want to test the performance of writing into a generic buffer. I can do that by:

  1. allocating the buffer and doing an enqueueWriteBuffer(data)

or by:

  1. allocating the buffer, getting the pointer through enqueueMapBuffer, and “explicitely” writing into the buffer dereferencing the pointer (es. *p = x, *(p + 1) = y, etc).

Which is the differences between those two methods regarding limitations and performances issues?

Thank you very much for you help!
Gabriel

At least, could someone point me to a reference regarding my question? Thank you!

The AMD OpenCL programming guide has a fair bit about memory in chapter 4, particularly 4.4 “OpenCL Memory Objects”. I don’t have an APU so I haven’t checked if they have a newer version that covers APU devices, or other documents about it: but i would guess they do.

You’re better off checking all of their documentation first and any examples they might have to show off their hardware, and then trying the amd forums for such device-specific questions.