HIP icon indicating copy to clipboard operation
HIP copied to clipboard

Is run-time compilation supported/planned?

Open alex-weaver opened this issue 9 years ago • 5 comments

Basically I'm wondering if HIP has an alternative to NVRTC for compiling at runtime? Although NVRTC is somewhat hacky, it is an immensely useful tool at times, and an alternative for HIP would be great for targeting AMD / portable code.

alex-weaver avatar May 06 '17 18:05 alex-weaver

Great question. Not in near future, we are more focused on stability and features of Runtime. We certainly discussed about NVRTC. Will let you know if we roll it out.

aditya4d avatar May 08 '17 03:05 aditya4d

Ah ok, thanks for getting back. A quick follow-up then: is there any way to do interop between HIP and vulkan? ie. a way for both APIs to share the same region of GPU memory? That would allow the runtime compiled parts to go via vulkan/spir-v and the remainder via HIP without a round trip to main memory. Is that possible?

alex-weaver avatar May 08 '17 08:05 alex-weaver

@gstoner is the right person to talk to on graphics interop.

aditya4d avatar May 08 '17 13:05 aditya4d

We have been working on Interop with MesaGraphics OpenGL Stack, focused on key use case OpenGL on EGL with bi-directional interop. This was for headless use result are pipe via console ( Note no X11 needed) We also test with OpenGL/X11. Vulkan is some we are looking at.

gstoner avatar May 08 '17 13:05 gstoner

Also, as a workaround for online compilation, you can use named pipes to call "hipcc -genco".as a separate process. Input pipe sends the device code to the compiler and the output pipe can read back a compiled code object. A wrapper around this could provide a string and memory-based interface that looks like an online compiler for most applications.

bensander avatar May 08 '17 14:05 bensander