public class CUDAUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
jcuda.driver.CUcontext |
getContext(jcuda.driver.CUdevice device)
Returns the context for
device . |
jcuda.driver.CUdevice |
getDevice(int ordinal)
Returns the
device assigned to ordinal . |
static CUDAUtils |
getInstance()
Returns the current instance of CUDAUtils.
|
int |
getMaxThreads(jcuda.driver.CUdevice device)
Returns the maximum number of threads per block for
device . |
void |
initCUDA()
Initialize the CUDA driver API.
|
static java.lang.String |
preparePtxFile(java.lang.String cuFileName)
The extension of the given file name is replaced with "ptx".
|
public static CUDAUtils getInstance()
null
, a new instance is created.public void initCUDA()
public jcuda.driver.CUdevice getDevice(int ordinal)
device
assigned to ordinal
.ordinal
- public jcuda.driver.CUcontext getContext(jcuda.driver.CUdevice device)
device
. If the current context is
null
, a new CUcontext is created.device
- public int getMaxThreads(jcuda.driver.CUdevice device)
device
.device
- public static java.lang.String preparePtxFile(java.lang.String cuFileName) throws java.io.IOException
cuFileName
- The name of the .CU filejava.io.IOException
- If an I/O error occurs