Using the driver api, is it possible to call a ptx function in another cuda module? I tried playing around with this with something like…
======== file1.cu ==============
extern device void Test(float * input, float * output);
extern “C” global void MyKernal(float * input, float * output)
{. . .
Test();
. . . }
======== file2.ptx ==============
.func Test {
. . .
.param .u32 __cudaparm_Test _input;
.param .u32 __cudaparm_Test_output;
cvt.s32.u16 %r1, %tid.x;
. . . }
A possible solution I came up with but maybe there is something better:
- Compile file1.cu to file1.ptx
2.Combine both files into one ptx file (file3.ptx = file1.ptx + file2.ptx)
3.Compile that file(file3.ptx) to the final file3.cubin.
my reasons for separating them:
1)The ptx file will be modified and recompiled while my app is running over and over again. I do not want to recompile everything.
2)I want to use ptx to build one of the modules and cuda to build the other module.
Thank you.