Class ImmutableKernelExecutionContext.Builder

java.lang.Object
net.bmahe.genetics4j.gpu.spec.fitness.kernelcontext.ImmutableKernelExecutionContext.Builder
Direct Known Subclasses:
KernelExecutionContext.Builder
Enclosing class:
ImmutableKernelExecutionContext

public static class ImmutableKernelExecutionContext.Builder extends Object
Builds instances of type ImmutableKernelExecutionContext. Initialize attributes and then invoke the build() method to create an immutable instance.

Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

  • Field Details

    • INIT_BIT_GLOBAL_WORK_SIZE

      private static final long INIT_BIT_GLOBAL_WORK_SIZE
      See Also:
    • initBits

      private long initBits
    • globalWorkSize

      private long[] globalWorkSize
    • workGroupSize

      private long[] workGroupSize
  • Constructor Details

  • Method Details

    • from

      Fill a builder with attribute values from the provided KernelExecutionContext instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • globalWorkSize

      public final KernelExecutionContext.Builder globalWorkSize(long... globalWorkSize)
      Initializes the value for the globalWorkSize attribute.
      Parameters:
      globalWorkSize - The elements for globalWorkSize
      Returns:
      this builder for use in a chained invocation
    • workGroupSize

      public final KernelExecutionContext.Builder workGroupSize(long[] workGroupSize)
      Initializes the optional value workGroupSize to workGroupSize.
      Parameters:
      workGroupSize - The value for workGroupSize
      Returns:
      this builder for chained invocation
    • workGroupSize

      public final KernelExecutionContext.Builder workGroupSize(Optional<? extends long[]> workGroupSize)
      Initializes the optional value workGroupSize to workGroupSize.
      Parameters:
      workGroupSize - The value for workGroupSize
      Returns:
      this builder for use in a chained invocation
    • build

      Returns:
      An immutable instance of KernelExecutionContext
      Throws:
      IllegalStateException - if any required attributes are missing
    • formatRequiredAttributesMessage

      private String formatRequiredAttributesMessage()