I am using the Runtime environment (not the driver level) in Visual Studio. I am wondering if it is possible to compile an executable with a PTX embedded, which will compile (using JIT) to a device specific binary at runtime. The documentation I have read seems to say this is possible, but I cannot find any examples in the SDK which use the Runtime API–only the Driver API. I tried changing the custom build rule for the kernel.cu file to only compile .ptx and turned on ‘keep’, so the file would not be deleted. When I try to compile the main .cpp file, I get unresolved externals if I do not specify this .ptx file in the Linker. If I do specify the .ptx file in the Linker, I get an ‘invalid or corrupt file’ error. Could someone explain the process of doing this in Visual Studio, if it is possible using the Runtime API?
Thanks