UCL / openqcd-oneapi

GNU General Public License v2.0
0 stars 0 forks source link

Rewrite memory movement with implicit USM #37

Open tkoskela opened 2 years ago

tkoskela commented 2 years ago

Replace malloc_device and memcpy calls with malloc_host or malloc_shared as appropriate

tkoskela commented 2 years ago

After discussion today, the issue with USM is that we can't convert pointers created with malloc elsewhere in the main program into USM pointers of the same type. That means that we would have to copy the data on the host into memory allocated with malloc_shared, which is essentially the same thing as copying them onto the device with memcpy. Another option would be allocating with sycl malloc_shared calls in the main program but that has a risk of making our changes harder to upstream. Since it does not seem like a big job, it's worth experimenting with, but the buffer/accessor model #32 seems more suited to our situation.