Class ImmutableKernelExecutionContext.Builder
java.lang.Object
net.bmahe.genetics4j.gpu.spec.fitness.kernelcontext.ImmutableKernelExecutionContext.Builder
- Direct Known Subclasses:
KernelExecutionContext.Builder
- Enclosing class:
ImmutableKernelExecutionContext
@Generated(from="KernelExecutionContext",
generator="Immutables")
public static class ImmutableKernelExecutionContext.Builder
extends Object
Builds instances of type
KernelExecutionContext.
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 Summary
FieldsModifier and TypeFieldDescriptionprivate long[]private static final longprivate longprivate long[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newKernelExecutionContext.private Stringfrom(KernelExecutionContext instance) Fill a builder with attribute values from the providedKernelExecutionContextinstance.globalWorkSize(long... globalWorkSize) Initializes the value for theglobalWorkSizeattribute.workGroupSize(long[] workGroupSize) Initializes the optional valueworkGroupSizeto workGroupSize.workGroupSize(Optional<? extends long[]> workGroupSize) Initializes the optional valueworkGroupSizeto workGroupSize.
-
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
-
Builder
public Builder()Creates a builder forKernelExecutionContextinstances.new KernelExecutionContext.Builder() .globalWorkSize(long[]) // requiredglobalWorkSize.workGroupSize(Optional<long[]>) // optionalworkGroupSize.build();
-
-
Method Details
-
from
Fill a builder with attribute values from the providedKernelExecutionContextinstance. 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:
thisbuilder for use in a chained invocation
-
globalWorkSize
Initializes the value for theglobalWorkSizeattribute.- Parameters:
globalWorkSize- The elements for globalWorkSize- Returns:
thisbuilder for use in a chained invocation
-
workGroupSize
Initializes the optional valueworkGroupSizeto workGroupSize.- Parameters:
workGroupSize- The value for workGroupSize- Returns:
thisbuilder for chained invocation
-
workGroupSize
Initializes the optional valueworkGroupSizeto workGroupSize.- Parameters:
workGroupSize- The value for workGroupSize- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newKernelExecutionContext.- Returns:
- An immutable instance of KernelExecutionContext
- Throws:
IllegalStateException- if any required attributes are missing
-
formatRequiredAttributesMessage
-