Search code examples
compilationcudagpujitnvrtc

Serializing a CUfunction object


Is it possible to serialize a CUfunction object generated by NVRTC and save it on a non-volatile memory (disk, SSD, etc.) so that it can be used again later without having to go through the JIT compilation process?


Solution

  • I have not found a way to do this. The API exposes a way to retrieve PTX from an nvrtc compilation call, but not the resulting binary payload. You could use that PTX output to avoid calling an nvrtc session at every runtime, but that is about all that is possible.