Class ImmutableKernelExecutionContext

java.lang.Object
net.bmahe.genetics4j.gpu.spec.fitness.kernelcontext.ImmutableKernelExecutionContext
All Implemented Interfaces:
KernelExecutionContext

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

Use the builder to create immutable instances: new KernelExecutionContext.Builder().

  • Field Details

    • globalWorkSize

      private final long[] globalWorkSize
    • workGroupSize

      private final long[] workGroupSize
    • globalWorkDimensions

      private final transient int globalWorkDimensions
  • Constructor Details

    • ImmutableKernelExecutionContext

      private ImmutableKernelExecutionContext(long[] globalWorkSize, long[] workGroupSize)
  • Method Details

    • globalWorkSize

      public long[] globalWorkSize()
      Specified by:
      globalWorkSize in interface KernelExecutionContext
      Returns:
      A cloned globalWorkSize array
    • workGroupSize

      public Optional<long[]> workGroupSize()
      Specified by:
      workGroupSize in interface KernelExecutionContext
      Returns:
      The value of the workGroupSize attribute
    • globalWorkDimensions

      public int globalWorkDimensions()
      Specified by:
      globalWorkDimensions in interface KernelExecutionContext
      Returns:
      The computed-at-construction value of the globalWorkDimensions attribute
    • withGlobalWorkSize

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

      public final ImmutableKernelExecutionContext withWorkGroupSize(long[] value)
      Copy the current immutable object by setting a present value for the optional workGroupSize attribute.
      Parameters:
      value - The value for workGroupSize
      Returns:
      A modified copy of this object
    • withWorkGroupSize

      public final ImmutableKernelExecutionContext withWorkGroupSize(Optional<? extends long[]> optional)
      Copy the current immutable object by setting an optional value for the workGroupSize attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for workGroupSize
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableKernelExecutionContext 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, ImmutableKernelExecutionContext another)
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: globalWorkSize, workGroupSize, globalWorkDimensions.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      Creates an immutable copy of a KernelExecutionContext 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 KernelExecutionContext instance