Class ImmutableKernelInfo.Builder

java.lang.Object
net.bmahe.genetics4j.gpu.opencl.model.ImmutableKernelInfo.Builder
Enclosing class:
ImmutableKernelInfo

public static final class ImmutableKernelInfo.Builder extends Object
Builds instances of type ImmutableKernelInfo. 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_NAME

      private static final long INIT_BIT_NAME
      See Also:
    • INIT_BIT_WORK_GROUP_SIZE

      private static final long INIT_BIT_WORK_GROUP_SIZE
      See Also:
    • INIT_BIT_PREFERRED_WORK_GROUP_SIZE_MULTIPLE

      private static final long INIT_BIT_PREFERRED_WORK_GROUP_SIZE_MULTIPLE
      See Also:
    • INIT_BIT_LOCAL_MEM_SIZE

      private static final long INIT_BIT_LOCAL_MEM_SIZE
      See Also:
    • INIT_BIT_PRIVATE_MEM_SIZE

      private static final long INIT_BIT_PRIVATE_MEM_SIZE
      See Also:
    • initBits

      private long initBits
    • name

      private String name
    • workGroupSize

      private long workGroupSize
    • preferredWorkGroupSizeMultiple

      private long preferredWorkGroupSizeMultiple
    • localMemSize

      private long localMemSize
    • privateMemSize

      private long privateMemSize
  • Constructor Details

    • Builder

      private Builder()
  • Method Details

    • from

      public final ImmutableKernelInfo.Builder from(KernelInfo instance)
      Fill a builder with attribute values from the provided KernelInfo 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
    • name

      public final ImmutableKernelInfo.Builder name(String name)
      Initializes the value for the name attribute.
      Parameters:
      name - The value for name
      Returns:
      this builder for use in a chained invocation
    • workGroupSize

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

      public final ImmutableKernelInfo.Builder preferredWorkGroupSizeMultiple(long preferredWorkGroupSizeMultiple)
      Initializes the value for the preferredWorkGroupSizeMultiple attribute.
      Parameters:
      preferredWorkGroupSizeMultiple - The value for preferredWorkGroupSizeMultiple
      Returns:
      this builder for use in a chained invocation
    • localMemSize

      public final ImmutableKernelInfo.Builder localMemSize(long localMemSize)
      Initializes the value for the localMemSize attribute.
      Parameters:
      localMemSize - The value for localMemSize
      Returns:
      this builder for use in a chained invocation
    • privateMemSize

      public final ImmutableKernelInfo.Builder privateMemSize(long privateMemSize)
      Initializes the value for the privateMemSize attribute.
      Parameters:
      privateMemSize - The value for privateMemSize
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutableKernelInfo build()
      Builds a new ImmutableKernelInfo.
      Returns:
      An immutable instance of KernelInfo
      Throws:
      IllegalStateException - if any required attributes are missing
    • formatRequiredAttributesMessage

      private String formatRequiredAttributesMessage()