NVIDIA/jitify

Is it possible to create program from cuBin or PTX?

FdyCN opened this issue · 3 comments

FdyCN commented

Hi guys, i used jitify.hpp in my project, and it works just fine. However, i still have a question:
according to this:

jitify/jitify.hpp

Line 3507 in b22bf7d

inline Program program(std::string source,

seems it's no way to create progtam from cuBin or PTX? or how can i create a CUFunction by giving cuBin or PTX?
Thank you very much!

In the jitify2 API (under development) you can do this:
https://github.com/NVIDIA/jitify/blob/ca7f794/jitify2.hpp#L2153

FdyCN commented

In the jitify2 API (under development) you can do this: https://github.com/NVIDIA/jitify/blob/ca7f794/jitify2.hpp#L2153

@benbarsdell Thx a lot, glad to hear that. i reviewed this branch. and is this tool necessary? https://github.com/NVIDIA/jitify/blob/jitify2/jitify2_preprocess.cpp
Must i use this tool to pre-build or pre-compiling obj when i have some headers dependencies in my kernel source?Can cuBin( PTX ) carry these dependencies( it can be regard as another kind of pre-build)?

I appreciate and wait for jitify2 : )

Sorry I missed this.
You don't have to use jitify2_preprocess, other workflows are possible.
If you are starting from ptx/cubin, you can create a CompiledProgramData object directly from ptx or cubin and then just link and execute it.