how to link cubin files generated from .ptx ?


help me please!
I know maybe this topic might already been discussed:

I want to code a kernel directly on ptx assembler and then link it with the main
program, however I couldn’t find any suitable options how to do it with nvcc.

nvcc -cubin test.ptx produces .cubin file, then
I tried nvcc -lib test.cubin
and other combinations but nvcc seems not to recognize cubin files…


Are you trying to “link” to host code or to device code?
AFAIK you can’t “link” to device code.

If you just want to run your ptxas’ed kernel you should look on Driver API. It allows to load .cubin file and execute it on device.

ideally I want to declare some kernel which can be called from .cu files:

global void my_kernel(float *x);

and then define it’s body in ptx file, that is:

.entry my_kernel {

…blah blah


ok, but using driver API is also fine.