But the cuModuleLoad() doesn’t pick up this file. It only works when I pass in the absolute path of the ptx file. But I would like to have the ptx file shipped with compile jar files. Is there any way to accomplish this?
A short/quick response: You’ll likely have to open the file with getResourceAsStream, then read the contents of the stream into a byte[] array, and then load it using [%29"]cuModuleLoadData](http://www.jcuda.org/jcuda/doc/jcuda/driver/JCudaDriver.html#cuModuleLoadData(jcuda.driver.CUmodule,%20byte[). The cuModuleLoad is a CUDA function, and it expects a real file name - it can’t extract the PTX from the JAR. If it doesn’t work, or you encounter problems, I can test it an extend this answer later today.