Class CUDA

  • public final class CUDA
    extends java.lang.Object
    CUDA utilities.

    The CUDA Driver API can be used immediately, without any configuration.

    LWJGL does not bundle CUDA Toolkit libraries. For the bindings of such a library to work, LWJGL must be able to find the corresponding shared libraries that export the library's API. By default, LWJGL scans the standard CUDA Toolkit installation directory and loads the shared libraries of the CUDA Toolkit with the greatest version it can detect. This process can be overridden with the Configuration.CUDA_TOOLKIT_VERSION and Configuration.CUDA_TOOLKIT_PATH options.

    In the case of a custom CUDA Toolkit library distribution:

    • Add the path that contains the shared libraries to either -Djava.library.path or -Dorg.lwjgl.librarypath.

      Note that, on Windows, the shared libraries should be renamed to drop the <bits>_<version> suffix. For example nvgraph64_100.dll should be renamed to just nvgraph.dll. On Linux & macOS, either rename the shared libraries or include the unversioned symbolic links.

    • Use individual Configuration options to set the name or path of each shared library, e.g. Configuration.CUDA_NVRTC_LIBRARY_NAME.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isPerThreadDefaultStreamSupported()
      Returns true if the CUDA driver supports per-thread synchronization for the default stream.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • isPerThreadDefaultStreamSupported

        public static boolean isPerThreadDefaultStreamSupported()
        Returns true if the CUDA driver supports per-thread synchronization for the default stream.

        CUDA defaults to the legacy default stream. If this method returns true and per-thread synchronization is desired, set Configuration.CUDA_API_PER_THREAD_DEFAULT_STREAM to true before initializing the driver.

        true if per-thread synchronization is supported, false if only the legacy default stream is supported