Interface CUDA


public interface CUDA
NVIDIA CUDA helper functions.
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static long[]
    allocatorStats(int deviceIndex)
    Returns CUDACachingAllocator live and reserved bytes for a device.
    static Device
    Returns the default CUDA device.
    static Device
    device(byte index)
    Returns the CUDA device of given index.
    static long
    Returns the number of CUDA devices.
    static long
    freeMemory(int deviceIndex)
    Returns the currently free device memory of a CUDA device in bytes.
    static boolean
    Returns true if CUDA is available.
    static long
    totalMemory(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 -1 on 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

      static Device device()
      Returns the default CUDA device.
      Returns:
      the default CUDA device.
    • device

      static Device device(byte index)
      Returns the CUDA device of given index.
      Parameters:
      index - the CUDA device index.
      Returns:
      the CUDA device.