What is the difference between queue.memcpy and queue.copy

Hi guys,

I read the sycl manual but am confused with memcpy and copy in sycl::queue.

  • What is the difference?
  • How to apply the correct memory copy operation using above API?

Thanks

Hi @alanzhai219,

as far as I am aware, the memcpy function only works on USM allocations, and cares about number of bytes copied from the source to the destination, whereas the copy function can handle accessors and USM, and copies a number of elements (and therefore needs to know the type that it is copying).