ROCm / HIP

HIP: C++ Heterogeneous-Compute Interface for Portability
https://rocmdocs.amd.com/projects/HIP/
MIT License
3.78k stars 540 forks source link

Is run-time compilation supported/planned? #77

Closed alex-weaver closed 7 years ago

alex-weaver commented 7 years ago

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.

aditya4d commented 7 years ago

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.

alex-weaver commented 7 years ago

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?

aditya4d commented 7 years ago

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

gstoner commented 7 years ago

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.

bensander commented 7 years ago

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.