Package net.finmath.jcuda
Class JCudaUtils
- java.lang.Object
-
- net.finmath.jcuda.JCudaUtils
-
public class JCudaUtils extends Object
Adapted from JCuda examples: Reads a CUDA file, compiles it to a PTX file using NVCC, loads the PTX file as a module and executes the kernel function.
-
-
Constructor Summary
Constructors Constructor Description JCudaUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
preparePtxFile(InputStream cuFileStream, String arch)
The extension of the given file name is replaced with "ptx".
-
-
-
Method Detail
-
preparePtxFile
public static String preparePtxFile(InputStream cuFileStream, String arch) throws IOException, URISyntaxException
The extension of the given file name is replaced with "ptx". If the file with the resulting name does not exist, it is compiled from the given file using NVCC. The name of the PTX file is returned.- Parameters:
cuFileStream
- The name of the .cu filearch
- String specifying the architecture (see nvcc command, -arch argument). Examples are sm_12, sm_20, sm_30- Returns:
- The name of the PTX file.
- Throws:
IOException
- Thrown if an I/O error occurs.URISyntaxException
- Thrown if the cuFileURL cannot be converted to an URI.
-
-