Title could probably use some rewording...
I am still forming my thoughts here but am using this issue as a placeholder to figure out how best to handle the scenario where we are sharing data which should live exclusively on device (i.e ray origins + directions generated by OpenMC) and not involve expensive device-to-host transfers. Essentially what this boils down to is trying to share arrays/buffers between OpenMP Offlload and Vulkan.
I'm still figuring my way around Vulkan vs OpenMP but my current mental model is both of them provide a way of writing vendor agnostic code but do so in a different manner:
- OpenMP Offload higher level. It's going to take my source code with pragmas -> then the compiler+openmp runtime lower that into a vendor specific GPU format -> which can then run on the GPU driver.
- Vulkan is lower level. The Vulkan code I write -> talks directly to the GPU driver. So is probably more at the same level as CUDA/HIP?
Given that, I'm pretty sure a pointer defined in OpenMP has no meaning to Vulkan and vice versa. But if all of my data lives on device, SURELY there must be a way to move it between the two without involving the expensive transfer to host?
In theory vulkan supports the concept of external memory via this extension https://docs.vulkan.org/guide/latest/extensions/external.html which lets you take import external CUDA/HIP memory and convert it to Vulkan. So if there is a way to get the underlying vendor specific pointers from OpenMP maybe I could use this external memory extension?
Title could probably use some rewording...
I am still forming my thoughts here but am using this issue as a placeholder to figure out how best to handle the scenario where we are sharing data which should live exclusively on device (i.e ray origins + directions generated by OpenMC) and not involve expensive device-to-host transfers. Essentially what this boils down to is trying to share arrays/buffers between OpenMP Offlload and Vulkan.
I'm still figuring my way around Vulkan vs OpenMP but my current mental model is both of them provide a way of writing vendor agnostic code but do so in a different manner:
Given that, I'm pretty sure a pointer defined in OpenMP has no meaning to Vulkan and vice versa. But if all of my data lives on device, SURELY there must be a way to move it between the two without involving the expensive transfer to host?
In theory vulkan supports the concept of external memory via this extension https://docs.vulkan.org/guide/latest/extensions/external.html which lets you take import external CUDA/HIP memory and convert it to Vulkan. So if there is a way to get the underlying vendor specific pointers from OpenMP maybe I could use this external memory extension?