Class ImmutableDevice

java.lang.Object
net.bmahe.genetics4j.gpu.opencl.model.ImmutableDevice
All Implemented Interfaces:
Device

@Generated("org.immutables.processor.ProxyProcessor") public final class ImmutableDevice extends Object implements Device
Immutable implementation of Device.

Use the builder to create immutable instances: ImmutableDevice.builder().

  • Field Details

    • deviceId

      private final org.jocl.cl_device_id deviceId
    • name

      private final String name
    • vendor

      private final String vendor
    • deviceVersion

      private final String deviceVersion
    • driverVersion

      private final String driverVersion
    • maxClockFrequency

      private final int maxClockFrequency
    • deviceType

      private final Set<DeviceType> deviceType
    • builtInKernels

      private final Set<String> builtInKernels
    • maxComputeUnits

      private final int maxComputeUnits
    • maxWorkItemDimensions

      private final int maxWorkItemDimensions
    • maxWorkGroupSize

      private final long maxWorkGroupSize
    • maxWorkItemSizes

      private final long[] maxWorkItemSizes
    • imageSupport

      private final boolean imageSupport
    • preferredVectorWidthFloat

      private final int preferredVectorWidthFloat
  • Constructor Details

    • ImmutableDevice

      private ImmutableDevice(org.jocl.cl_device_id deviceId, String name, String vendor, String deviceVersion, String driverVersion, int maxClockFrequency, Set<DeviceType> deviceType, Set<String> builtInKernels, int maxComputeUnits, int maxWorkItemDimensions, long maxWorkGroupSize, long[] maxWorkItemSizes, boolean imageSupport, int preferredVectorWidthFloat)
  • Method Details

    • deviceId

      public org.jocl.cl_device_id deviceId()
      Specified by:
      deviceId in interface Device
      Returns:
      The value of the deviceId attribute
    • name

      public String name()
      Specified by:
      name in interface Device
      Returns:
      The value of the name attribute
    • vendor

      public String vendor()
      Specified by:
      vendor in interface Device
      Returns:
      The value of the vendor attribute
    • deviceVersion

      public String deviceVersion()
      Specified by:
      deviceVersion in interface Device
      Returns:
      The value of the deviceVersion attribute
    • driverVersion

      public String driverVersion()
      Specified by:
      driverVersion in interface Device
      Returns:
      The value of the driverVersion attribute
    • maxClockFrequency

      public int maxClockFrequency()
      Specified by:
      maxClockFrequency in interface Device
      Returns:
      The value of the maxClockFrequency attribute
    • deviceType

      public Set<DeviceType> deviceType()
      Specified by:
      deviceType in interface Device
      Returns:
      The value of the deviceType attribute
    • builtInKernels

      public Set<String> builtInKernels()
      Specified by:
      builtInKernels in interface Device
      Returns:
      The value of the builtInKernels attribute
    • maxComputeUnits

      public int maxComputeUnits()
      Specified by:
      maxComputeUnits in interface Device
      Returns:
      The value of the maxComputeUnits attribute
    • maxWorkItemDimensions

      public int maxWorkItemDimensions()
      Specified by:
      maxWorkItemDimensions in interface Device
      Returns:
      The value of the maxWorkItemDimensions attribute
    • maxWorkGroupSize

      public long maxWorkGroupSize()
      Specified by:
      maxWorkGroupSize in interface Device
      Returns:
      The value of the maxWorkGroupSize attribute
    • maxWorkItemSizes

      public long[] maxWorkItemSizes()
      Specified by:
      maxWorkItemSizes in interface Device
      Returns:
      A cloned maxWorkItemSizes array
    • imageSupport

      public boolean imageSupport()
      Specified by:
      imageSupport in interface Device
      Returns:
      The value of the imageSupport attribute
    • preferredVectorWidthFloat

      public int preferredVectorWidthFloat()
      Specified by:
      preferredVectorWidthFloat in interface Device
      Returns:
      The value of the preferredVectorWidthFloat attribute
    • withDeviceId

      public final ImmutableDevice withDeviceId(org.jocl.cl_device_id value)
      Copy the current immutable object by setting a value for the deviceId attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for deviceId
      Returns:
      A modified copy of the this object
    • withName

      public final ImmutableDevice withName(String value)
      Copy the current immutable object by setting a value for the name attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for name
      Returns:
      A modified copy of the this object
    • withVendor

      public final ImmutableDevice withVendor(String value)
      Copy the current immutable object by setting a value for the vendor attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for vendor
      Returns:
      A modified copy of the this object
    • withDeviceVersion

      public final ImmutableDevice withDeviceVersion(String value)
      Copy the current immutable object by setting a value for the deviceVersion attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for deviceVersion
      Returns:
      A modified copy of the this object
    • withDriverVersion

      public final ImmutableDevice withDriverVersion(String value)
      Copy the current immutable object by setting a value for the driverVersion attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for driverVersion
      Returns:
      A modified copy of the this object
    • withMaxClockFrequency

      public final ImmutableDevice withMaxClockFrequency(int value)
      Copy the current immutable object by setting a value for the maxClockFrequency attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for maxClockFrequency
      Returns:
      A modified copy of the this object
    • withDeviceType

      public final ImmutableDevice withDeviceType(DeviceType... elements)
      Copy the current immutable object with elements that replace the content of deviceType.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withDeviceType

      public final ImmutableDevice withDeviceType(Iterable<DeviceType> elements)
      Copy the current immutable object with elements that replace the content of deviceType. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of deviceType elements to set
      Returns:
      A modified copy of this object
    • withBuiltInKernels

      public final ImmutableDevice withBuiltInKernels(String... elements)
      Copy the current immutable object with elements that replace the content of builtInKernels.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withBuiltInKernels

      public final ImmutableDevice withBuiltInKernels(Iterable<String> elements)
      Copy the current immutable object with elements that replace the content of builtInKernels. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of builtInKernels elements to set
      Returns:
      A modified copy of this object
    • withMaxComputeUnits

      public final ImmutableDevice withMaxComputeUnits(int value)
      Copy the current immutable object by setting a value for the maxComputeUnits attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for maxComputeUnits
      Returns:
      A modified copy of the this object
    • withMaxWorkItemDimensions

      public final ImmutableDevice withMaxWorkItemDimensions(int value)
      Copy the current immutable object by setting a value for the maxWorkItemDimensions attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for maxWorkItemDimensions
      Returns:
      A modified copy of the this object
    • withMaxWorkGroupSize

      public final ImmutableDevice withMaxWorkGroupSize(long value)
      Copy the current immutable object by setting a value for the maxWorkGroupSize attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for maxWorkGroupSize
      Returns:
      A modified copy of the this object
    • withMaxWorkItemSizes

      public final ImmutableDevice withMaxWorkItemSizes(long... elements)
      Copy the current immutable object with elements that replace the content of maxWorkItemSizes. The array is cloned before being saved as attribute values.
      Parameters:
      elements - The non-null elements for maxWorkItemSizes
      Returns:
      A modified copy of this object
    • withImageSupport

      public final ImmutableDevice withImageSupport(boolean value)
      Copy the current immutable object by setting a value for the imageSupport attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for imageSupport
      Returns:
      A modified copy of the this object
    • withPreferredVectorWidthFloat

      public final ImmutableDevice withPreferredVectorWidthFloat(int value)
      Copy the current immutable object by setting a value for the preferredVectorWidthFloat attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for preferredVectorWidthFloat
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableDevice that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • equalTo

      private boolean equalTo(int synthetic, ImmutableDevice another)
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: deviceId, name, vendor, deviceVersion, driverVersion, maxClockFrequency, deviceType, builtInKernels, maxComputeUnits, maxWorkItemDimensions, maxWorkGroupSize, maxWorkItemSizes, imageSupport, preferredVectorWidthFloat.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value Device with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableDevice copyOf(Device instance)
      Creates an immutable copy of a Device value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable Device instance
    • builder

      public static ImmutableDevice.Builder builder()
      Creates a builder for ImmutableDevice.
       ImmutableDevice.builder()
          .deviceId(org.jocl.cl_device_id) // required deviceId
          .name(String) // required name
          .vendor(String) // required vendor
          .deviceVersion(String) // required deviceVersion
          .driverVersion(String) // required driverVersion
          .maxClockFrequency(int) // required maxClockFrequency
          .addDeviceType|addAllDeviceType(net.bmahe.genetics4j.gpu.opencl.model.DeviceType) // deviceType elements
          .addBuiltInKernels|addAllBuiltInKernels(String) // builtInKernels elements
          .maxComputeUnits(int) // required maxComputeUnits
          .maxWorkItemDimensions(int) // required maxWorkItemDimensions
          .maxWorkGroupSize(long) // required maxWorkGroupSize
          .maxWorkItemSizes(long) // required maxWorkItemSizes
          .imageSupport(boolean) // required imageSupport
          .preferredVectorWidthFloat(int) // required preferredVectorWidthFloat
          .build();
       
      Returns:
      A new ImmutableDevice builder
    • createSafeList

      private static <T> List<T> createSafeList(Iterable<? extends T> iterable, boolean checkNulls, boolean skipNulls)
    • createUnmodifiableSet

      private static <T> Set<T> createUnmodifiableSet(List<T> list)
      Unmodifiable set constructed from list to avoid rehashing.
    • createUnmodifiableEnumSet

      private static <T extends Enum<T>> Set<T> createUnmodifiableEnumSet(Iterable<T> iterable)