Interface CUDA
public interface CUDA
NVIDIA CUDA helper functions.
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic long[]allocatorStats(int deviceIndex) Returns CUDACachingAllocator live and reserved bytes for a device.static Devicedevice()Returns the default CUDA device.static Devicedevice(byte index) Returns the CUDA device of given index.static longReturns the number of CUDA devices.static longfreeMemory(int deviceIndex) Returns the currently free device memory of a CUDA device in bytes.static booleanReturns true if CUDA is available.static longtotalMemory(int deviceIndex) Returns the total global memory of a CUDA device in bytes.
-
Method Details
-
isAvailable
static boolean isAvailable()Returns true if CUDA is available.- Returns:
- true if CUDA is available.
-
deviceCount
static long deviceCount()Returns the number of CUDA devices.- Returns:
- the number of CUDA devices.
-
totalMemory
static long totalMemory(int deviceIndex) Returns the total global memory of a CUDA device in bytes.- Parameters:
deviceIndex- the CUDA device index.- Returns:
- total memory in bytes, or
-1on error.
-
freeMemory
static long freeMemory(int deviceIndex) Returns the currently free device memory of a CUDA device in bytes.- Parameters:
deviceIndex- the CUDA device index.- Returns:
- free memory in bytes.
-
allocatorStats
static long[] allocatorStats(int deviceIndex) Returns CUDACachingAllocator live and reserved bytes for a device.- Parameters:
deviceIndex- the CUDA device index.- Returns:
long[2]of{allocatedBytes, reservedBytes}.
-
device
-
device
Returns the CUDA device of given index.- Parameters:
index- the CUDA device index.- Returns:
- the CUDA device.
-