Module notzed.zcl
Package au.notzed.zcl

Class CLPlatform

java.lang.Object
api.Native
au.notzed.zcl.CLObject
au.notzed.zcl.CLPlatform

public class CLPlatform
extends CLObject
Interface for cl_platform_id
  • Field Details

  • Constructor Details

    • CLPlatform

      public CLPlatform​(jdk.incubator.foreign.MemoryAddress p)
  • Method Details

    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • requireAPIVersion

      public static void requireAPIVersion​(int apiVersion, int required) throws java.lang.UnsupportedOperationException
      Throws:
      java.lang.UnsupportedOperationException
    • getPlatforms

      public static CLPlatform[] getPlatforms()
      Calls clGetPlatformIDs.
      Returns:
      List of all available platforms.
      Throws:
      CLRuntimeException
    • getDevices

      public CLDevice[] getDevices​(long type)
      Calls clGetDeviceIDs.

      All devices of the given type will be listed.

      Parameters:
      type - CL_DEVICE_TYPE_*.
      Returns:
      List of matching devices in this platform.
      Throws:
      CLRuntimeException
    • getBestDevice

      public static CLDevice getBestDevice​(long type, java.util.function.ToDoubleFunction<CLDevice> scoreFunc)
      Find the 'best' device using supplied statistic.
      Parameters:
      type - CL_DEVICE_TYPE_*.
      scoreFunc - return a higher value for a better score.
      Returns:
      A device, if found.
    • getBestDevice

      public static CLDevice getBestDevice​(long type)
      Find the 'best' device based on number of compute units. GPUs are assumed to have 64 FPUs per compute unit.
      Parameters:
      type - CL_DEVICE_TYPE_*.
      Returns:
      A device, if found.
    • unloadPlatformCompiler

      public void unloadPlatformCompiler() throws CLRuntimeException
      Calls clUnloadPlatformCompiler.
      Throws:
      CLRuntimeException
    • getAPIVersion

      public int getAPIVersion()
      Get the platform api versiom. This may be compared to the version constants VERSION_1_0, VERSION_1_1, and so on.
      Returns:
      platform api version.
    • getProfile

      public java.lang.String getProfile()
      get CL_PLATFORM_PROFILE.
      Returns:
      platform profile
    • getVersion

      public java.lang.String getVersion()
      get CL_PLATFORM_VERSION.
      Returns:
      platform version
    • getName

      public java.lang.String getName()
      get CL_PLATFORM_NAME.
      Returns:
      platform name
    • getVendor

      public java.lang.String getVendor()
      get CL_PLATFORM_VENDOR.
      Returns:
      platform vendor
    • getExtensions

      public java.lang.String getExtensions()
      get CL_PLATFORM_EXTENSIONS
      Returns:
      platform extensions