Can I use a PTX function contained in a PTX file as an external device function to link it to another .cu file which should call that function?
This is another question from CUDA - link kernels together where the function itself is not contained in a .cu file but I rather have a PTX function to be linked somehow.
You can load the file containing PTX code in your own code from the filesystem by
cuModuleLoad
andcuModuleGetFunction
as follows:You can also pass the PTX code to the CUDA driver directly as a string, see Passing the PTX program to the CUDA driver directly.