Package org.jocl

Class LibInitializer


  • class LibInitializer
    extends java.lang.Object
    Utility class for initializing the OpenCL implementation library
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.logging.Level level
      The default log level
      private static java.util.logging.Logger logger
      The logger used in this class
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private LibInitializer()
      Private constructor to prevent instantiation
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.lang.String[] createImplementationNameCandidates()
      Create a list of OpenCL shared library candidates that will be passed to the dlopen/LoadLibrary call on native side.
      (package private) static void initNativeLibrary()
      Initialize the native library by passing the name of the OpenCL implementation to the CL.initNativeLibrary(String) method.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        private static final java.util.logging.Logger logger
        The logger used in this class
      • level

        private static final java.util.logging.Level level
        The default log level
    • Constructor Detail

      • LibInitializer

        private LibInitializer()
        Private constructor to prevent instantiation
    • Method Detail

      • initNativeLibrary

        static void initNativeLibrary()
        Initialize the native library by passing the name of the OpenCL implementation to the CL.initNativeLibrary(String) method.
        Throws:
        java.lang.UnsatisfiedLinkError - If the implementation library could not be loaded.
      • createImplementationNameCandidates

        private static java.lang.String[] createImplementationNameCandidates()
        Create a list of OpenCL shared library candidates that will be passed to the dlopen/LoadLibrary call on native side. For Windows and Linux, this will be the name of the OpenCL library itself. For MacOS, it will be the path to the OpenCL framework. For Android, this will be an absolute path to the shared library.
        Returns:
        A list of candidate paths / names.