Class ImmutableKernelExecutionContext
java.lang.Object
net.bmahe.genetics4j.gpu.spec.fitness.kernelcontext.ImmutableKernelExecutionContext
- All Implemented Interfaces:
KernelExecutionContext
@Generated(from="KernelExecutionContext",
generator="Immutables")
@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().
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate final long[]private final long[] -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateImmutableKernelExecutionContext(long[] globalWorkSize, long[] workGroupSize) -
Method Summary
Modifier and TypeMethodDescriptionstatic KernelExecutionContextcopyOf(KernelExecutionContext instance) Creates an immutable copy of aKernelExecutionContextvalue.booleanThis instance is equal to all instances ofImmutableKernelExecutionContextthat have equal attribute values.private booleanintlong[]inthashCode()Computes a hash code from attributes:globalWorkSize,workGroupSize,globalWorkDimensions.toString()Prints the immutable valueKernelExecutionContextwith attribute values.withGlobalWorkSize(long... elements) Copy the current immutable object with elements that replace the content ofglobalWorkSize.withWorkGroupSize(long[] value) Copy the current immutable object by setting a present value for the optionalworkGroupSizeattribute.withWorkGroupSize(Optional<? extends long[]> optional) Copy the current immutable object by setting an optional value for theworkGroupSizeattribute.Optional<long[]>
-
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:
globalWorkSizein interfaceKernelExecutionContext- Returns:
- A cloned
globalWorkSizearray
-
workGroupSize
- Specified by:
workGroupSizein interfaceKernelExecutionContext- Returns:
- The value of the
workGroupSizeattribute
-
globalWorkDimensions
public int globalWorkDimensions()- Specified by:
globalWorkDimensionsin interfaceKernelExecutionContext- Returns:
- The computed-at-construction value of the
globalWorkDimensionsattribute
-
withGlobalWorkSize
Copy the current immutable object with elements that replace the content ofglobalWorkSize. The array is cloned before being saved as attribute values.- Parameters:
elements- The elements for globalWorkSize- Returns:
- A modified copy of
thisobject
-
withWorkGroupSize
Copy the current immutable object by setting a present value for the optionalworkGroupSizeattribute.- Parameters:
value- The value for workGroupSize- Returns:
- A modified copy or
thisif not changed
-
withWorkGroupSize
Copy the current immutable object by setting an optional value for theworkGroupSizeattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for workGroupSize- Returns:
- A modified copy or
thisif not changed
-
equals
This instance is equal to all instances ofImmutableKernelExecutionContextthat have equal attribute values. -
equalsByValue
-
hashCode
public int hashCode()Computes a hash code from attributes:globalWorkSize,workGroupSize,globalWorkDimensions. -
toString
Prints the immutable valueKernelExecutionContextwith attribute values. -
copyOf
Creates an immutable copy of aKernelExecutionContextvalue. 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
-