I found this forum post on calling functions in the kernel: https://software.intel.com/en-us/forums/oneapi-data-parallel-c-compiler/topic/856531
How is the memcpy(d_A0 different from accessors created in the kernel scope? I am curious about it.
Are they the same thing? Are they different in memory?
Thanks for reaching out to us.!
There are broadly two ways of managing memories:
DPC++ supports both Explicit and Implicit data management strategies. As both methods have their own advantages and drawbacks, you may choose any of the methods depending on your requirements.
To implement the above strategies DPC++ provides abstractions: USM, Buffers, and Images.
USM supports both explicit and Implicit data movement strategies. As per the query which you have asked it is USM Explicit strategy.
By using Buffers we can implement an Implicit data management strategy.
You may refer to the below link for more information regarding the memory model for oneAPI.
Please let us know if the information provided is helpful.
Thanks & Regards
Glad to know that the information provided was helpful.
As I have already commented that USM Supports both explicit and Implicit data movement strategies. Implicit data movement with USM can be achieved with host and shared allocations. With these types of allocations, the programmer does not need to explicitly insert copy operations (memcpy) to move data between host and device. Instead, the programmer can simply access the pointers inside a kernel, and any required data movement is performed automatically without programmer intervention.
Please do refer to the below links for more information.
Let us know if the information provided was helpful.