public abstract class CUDAUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int[] |
gridBlockSize |
Constructor and Description |
---|
CUDAUtil() |
Modifier and Type | Method and Description |
---|---|
static int |
align(int value,
int alignment)
Returns the given (address) value, adjusted to have
the given alignment.
|
static jcuda.driver.CUdeviceptr |
allocateSpace(Volume3D vol)
Allocates space on the CUDA device for a Volume3D
|
static jcuda.driver.CUdeviceptr |
copyFloatArrayToDevice(float[] array,
jcuda.driver.CUmodule module,
java.lang.String nameInCode) |
static jcuda.driver.CUdeviceptr |
copyToDeviceMemory(float[] data)
copies a float array to the device and returns a pointer to the memory.
|
static jcuda.driver.CUdeviceptr |
copyToDeviceMemory(int[] data)
copies an int array to the device and returns a pointer to the memory.
|
static long |
correctMemoryValue(int memory) |
static void |
fetchFromDevice(Volume3D vol,
jcuda.driver.CUdeviceptr deviceX)
Fetches the volume from the device
|
static void |
fetchFromDeviceMemory(float[] data,
jcuda.driver.CUdeviceptr deviceX)
fetches a float data array from the device and frees the memory on the device.
|
static jcuda.driver.CUdevice |
getBestDevice() |
static jcuda.driver.CUdevice |
getSmallestDevice() |
static int |
iDivUp(int a,
int b)
Integral division, rounding the result to the next highest integer.
|
static void |
moveToDevice(Volume3D vol,
jcuda.driver.CUdeviceptr deviceX)
Moves the volume to the device.
|
static void |
updateFloatArrayOnDevice(jcuda.driver.CUdeviceptr devptr,
float[] array,
jcuda.driver.CUmodule module) |
public static int align(int value, int alignment)
value
- The address valuealignment
- The desired alignmentpublic static jcuda.driver.CUdeviceptr copyToDeviceMemory(int[] data)
data
- the int arraypublic static jcuda.driver.CUdeviceptr copyToDeviceMemory(float[] data)
data
- the float arraypublic static void fetchFromDeviceMemory(float[] data, jcuda.driver.CUdeviceptr deviceX)
data
- the float array to write todeviceX
- the pointer to the device memorypublic static jcuda.driver.CUdeviceptr allocateSpace(Volume3D vol)
vol
- the volumepublic static void moveToDevice(Volume3D vol, jcuda.driver.CUdeviceptr deviceX)
vol
- the volumedeviceX
- the memory pointerpublic static void fetchFromDevice(Volume3D vol, jcuda.driver.CUdeviceptr deviceX)
vol
- the volume objectdeviceX
- the pointer to the memory on the deivce.public static int iDivUp(int a, int b)
a
- Dividendb
- Divisorpublic static jcuda.driver.CUdeviceptr copyFloatArrayToDevice(float[] array, jcuda.driver.CUmodule module, java.lang.String nameInCode)
public static void updateFloatArrayOnDevice(jcuda.driver.CUdeviceptr devptr, float[] array, jcuda.driver.CUmodule module)
public static long correctMemoryValue(int memory)
public static jcuda.driver.CUdevice getBestDevice()
public static jcuda.driver.CUdevice getSmallestDevice()