Class LwjglDevice

java.lang.Object
com.jme3.opencl.lwjgl.LwjglDevice
All Implemented Interfaces:
Device

public final class LwjglDevice extends Object implements Device
  • Constructor Details

    • LwjglDevice

      public LwjglDevice(org.lwjgl.opencl.CLDevice device, LwjglPlatform platform)
  • Method Details

    • getDevice

      public org.lwjgl.opencl.CLDevice getDevice()
    • getPlatform

      public LwjglPlatform getPlatform()
      Specified by:
      getPlatform in interface Device
      Returns:
      the platform associated with this device
    • getDeviceType

      public Device.DeviceType getDeviceType()
      Specified by:
      getDeviceType in interface Device
      Returns:
      queries the device type
    • getVendorId

      public int getVendorId()
      Specified by:
      getVendorId in interface Device
      Returns:
      the vendor id
    • isAvailable

      public boolean isAvailable()
      Description copied from interface: Device
      checks if this device is available at all, must always be tested
      Specified by:
      isAvailable in interface Device
      Returns:
      checks if this device is available at all, must always be tested
    • hasCompiler

      public boolean hasCompiler()
      Specified by:
      hasCompiler in interface Device
      Returns:
      if this device has a compiler for kernel code
    • hasDouble

      public boolean hasDouble()
      Specified by:
      hasDouble in interface Device
      Returns:
      supports double precision floats (64 bit)
    • hasHalfFloat

      public boolean hasHalfFloat()
      Specified by:
      hasHalfFloat in interface Device
      Returns:
      supports half precision floats (16 bit)
    • hasErrorCorrectingMemory

      public boolean hasErrorCorrectingMemory()
      Specified by:
      hasErrorCorrectingMemory in interface Device
      Returns:
      supports error correction for every access to global or constant memory
    • hasUnifiedMemory

      public boolean hasUnifiedMemory()
      Specified by:
      hasUnifiedMemory in interface Device
      Returns:
      supports unified virtual memory (OpenCL 2.0)
    • hasImageSupport

      public boolean hasImageSupport()
      Specified by:
      hasImageSupport in interface Device
      Returns:
      supports images
    • hasWritableImage3D

      public boolean hasWritableImage3D()
      Specified by:
      hasWritableImage3D in interface Device
      Returns:
      supports writes to 3d images (this is an extension)
    • hasOpenGLInterop

      public boolean hasOpenGLInterop()
      Specified by:
      hasOpenGLInterop in interface Device
      Returns:
      supports sharing with OpenGL
    • hasExtension

      public boolean hasExtension(String extension)
      Description copied from interface: Device
      Explicitly tests for the availability of the specified extension
      Specified by:
      hasExtension in interface Device
      Parameters:
      extension - the name of the extension
      Returns:
      true iff this extension is supported
    • getExtensions

      public Collection<? extends String> getExtensions()
      Description copied from interface: Device
      Lists all available extensions
      Specified by:
      getExtensions in interface Device
      Returns:
      all available extensions
    • getComputeUnits

      public int getComputeUnits()
      Description copied from interface: Device
      Returns the number of parallel compute units on the OpenCL device. A work-group executes on a single compute unit. The minimum value is 1.
      Specified by:
      getComputeUnits in interface Device
      Returns:
      the number of parallel compute units
      See Also:
    • getClockFrequency

      public int getClockFrequency()
      Specified by:
      getClockFrequency in interface Device
      Returns:
      maximum clock frequency of the device in MHz
    • getAddressBits

      public int getAddressBits()
      Description copied from interface: Device
      Returns the default compute device address space size specified as an unsigned integer value in bits. The values currently supported are 32 and 64.
      Specified by:
      getAddressBits in interface Device
      Returns:
      the size of an address
    • isLittleEndian

      public boolean isLittleEndian()
      Specified by:
      isLittleEndian in interface Device
      Returns:
      true if this device is little endian
    • getMaximumWorkItemDimensions

      public long getMaximumWorkItemDimensions()
      Description copied from interface: Device
      The maximum dimension that specify the local and global work item ids. You can always assume to be this at least 3. Therefore, the ids are always three integers x,y,z.
      Specified by:
      getMaximumWorkItemDimensions in interface Device
      Returns:
      the maximum dimension of work item ids
    • getMaximumWorkItemSizes

      public long[] getMaximumWorkItemSizes()
      Description copied from interface: Device
      Maximum number of work-items that can be specified in each dimension of the work-group to Kernel.Run2(com.jme3.opencl.CommandQueue, com.jme3.opencl.Kernel.WorkSize, com.jme3.opencl.Kernel.WorkSize, java.lang.Object...). The array has a length of at least 3.
      Specified by:
      getMaximumWorkItemSizes in interface Device
      Returns:
      the maximum size of the work group in each dimension
    • getMaxiumWorkItemsPerGroup

      public long getMaxiumWorkItemsPerGroup()
      Description copied from interface: Device
      Maximum number of work-items in a work-group executing a kernel on a single compute unit, using the data parallel execution model.
      Specified by:
      getMaxiumWorkItemsPerGroup in interface Device
      Returns:
      maximum number of work-items in a work-group
    • getMaximumSamplers

      public int getMaximumSamplers()
      Specified by:
      getMaximumSamplers in interface Device
      Returns:
      the maximum number of samples that can be used in a kernel
    • getMaximumReadImages

      public int getMaximumReadImages()
      Specified by:
      getMaximumReadImages in interface Device
      Returns:
      the maximum number of images that can be used for reading in a kernel
    • getMaximumWriteImages

      public int getMaximumWriteImages()
      Specified by:
      getMaximumWriteImages in interface Device
      Returns:
      the maximum number of images that can be used for writing in a kernel
    • getMaximumImage2DSize

      public long[] getMaximumImage2DSize()
      Description copied from interface: Device
      Queries the maximal size of a 2D image
      Specified by:
      getMaximumImage2DSize in interface Device
      Returns:
      an array of length 2 with the maximal size of a 2D image
    • getMaximumImage3DSize

      public long[] getMaximumImage3DSize()
      Description copied from interface: Device
      Queries the maximal size of a 3D image
      Specified by:
      getMaximumImage3DSize in interface Device
      Returns:
      an array of length 3 with the maximal size of a 3D image
    • getMaximumAllocationSize

      public long getMaximumAllocationSize()
      Specified by:
      getMaximumAllocationSize in interface Device
      Returns:
      the maximal size of a memory object (buffer and image) in bytes
    • getGlobalMemorySize

      public long getGlobalMemorySize()
      Specified by:
      getGlobalMemorySize in interface Device
      Returns:
      the total available global memory in bytes
    • getLocalMemorySize

      public long getLocalMemorySize()
      Specified by:
      getLocalMemorySize in interface Device
      Returns:
      the total available local memory in bytes
    • getMaximumConstantBufferSize

      public long getMaximumConstantBufferSize()
      Description copied from interface: Device
      Returns the maximal size of a constant buffer.
      Constant buffers are normal buffer objects, but passed to the kernel with the special declaration __constant BUFFER_TYPE* BUFFER_NAME. Because they have a special caching, their size is usually very limited.
      Specified by:
      getMaximumConstantBufferSize in interface Device
      Returns:
      the maximal size of a constant buffer
    • getMaximumConstantArguments

      public int getMaximumConstantArguments()
      Specified by:
      getMaximumConstantArguments in interface Device
      Returns:
      the maximal number of constant buffer arguments in a kernel call
    • getProfile

      public String getProfile()
      Description copied from interface: Device
      OpenCL profile string. Returns the profile name supported by the device. The profile name returned can be one of the following strings:
      FULL_PROFILE – if the device supports the OpenCL specification (functionality defined as part of the core specification and does not require any extensions to be supported).
      EMBEDDED_PROFILE - if the device supports the OpenCL embedded profile.
      Specified by:
      getProfile in interface Device
      Returns:
      the profile string
    • getVersion

      public String getVersion()
      Description copied from interface: Device
      OpenCL version string. Returns the OpenCL version supported by the device. This version string has the following format: OpenCL space major_version.minor_version space vendor-specific information.
      E.g. OpenCL 1.1, OpenCL 1.2, OpenCL 2.0
      Specified by:
      getVersion in interface Device
      Returns:
      the version string
    • getVersionMajor

      public int getVersionMajor()
      Description copied from interface: Device
      Extracts the major version from the version string
      Specified by:
      getVersionMajor in interface Device
      Returns:
      the major version
      See Also:
    • getVersionMinor

      public int getVersionMinor()
      Description copied from interface: Device
      Extracts the minor version from the version string
      Specified by:
      getVersionMinor in interface Device
      Returns:
      the minor version
      See Also:
    • getCompilerVersion

      public String getCompilerVersion()
      Description copied from interface: Device
      OpenCL C version string. Returns the highest OpenCL C version supported by the compiler for this device that is not of type CL_DEVICE_TYPE_CUSTOM. This version string has the following format: OpenCL space C space major_version.minor_version space vendor-specific information.
      The major_version.minor_version value returned must be 1.2 if CL_DEVICE_VERSION is OpenCL 1.2. The major_version.minor_version value returned must be 1.1 if CL_DEVICE_VERSION is OpenCL 1.1. The major_version.minor_version value returned can be 1.0 or 1.1 if CL_DEVICE_VERSION is OpenCL 1.0.
      Specified by:
      getCompilerVersion in interface Device
      Returns:
      the compiler version
    • getCompilerVersionMajor

      public int getCompilerVersionMajor()
      Description copied from interface: Device
      Extracts the major version from the compiler version
      Specified by:
      getCompilerVersionMajor in interface Device
      Returns:
      the major compiler version
      See Also:
    • getCompilerVersionMinor

      public int getCompilerVersionMinor()
      Description copied from interface: Device
      Extracts the minor version from the compiler version
      Specified by:
      getCompilerVersionMinor in interface Device
      Returns:
      the minor compiler version
      See Also:
    • getDriverVersion

      public String getDriverVersion()
      Specified by:
      getDriverVersion in interface Device
      Returns:
      the OpenCL software driver version string in the form major_number.minor_number
    • getDriverVersionMajor

      public int getDriverVersionMajor()
      Description copied from interface: Device
      Extracts the major version from the driver version
      Specified by:
      getDriverVersionMajor in interface Device
      Returns:
      the major driver version
      See Also:
    • getDriverVersionMinor

      public int getDriverVersionMinor()
      Description copied from interface: Device
      Extracts the minor version from the driver version
      Specified by:
      getDriverVersionMinor in interface Device
      Returns:
      the minor driver version
      See Also:
    • getName

      public String getName()
      Specified by:
      getName in interface Device
      Returns:
      the device name
    • getVendor

      public String getVendor()
      Specified by:
      getVendor in interface Device
      Returns:
      the vendor
    • toString

      public String toString()
      Overrides:
      toString in class Object