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 ClassesModifier and TypeClassDescriptionstatic class
Builds instances of typeImmutableKernelExecutionContext
. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private final long[]
private final long[]
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ImmutableKernelExecutionContext
(long[] globalWorkSize, long[] workGroupSize) -
Method Summary
Modifier and TypeMethodDescriptioncopyOf
(KernelExecutionContext instance) Creates an immutable copy of aKernelExecutionContext
value.boolean
This instance is equal to all instances ofImmutableKernelExecutionContext
that have equal attribute values.private boolean
int
long[]
int
hashCode()
Computes a hash code from attributes:globalWorkSize
,workGroupSize
,globalWorkDimensions
.toString()
Prints the immutable valueKernelExecutionContext
with 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 optionalworkGroupSize
attribute.withWorkGroupSize
(Optional<? extends long[]> optional) Copy the current immutable object by setting an optional value for theworkGroupSize
attribute.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:
globalWorkSize
in interfaceKernelExecutionContext
- Returns:
- A cloned
globalWorkSize
array
-
workGroupSize
- Specified by:
workGroupSize
in interfaceKernelExecutionContext
- Returns:
- The value of the
workGroupSize
attribute
-
globalWorkDimensions
public int globalWorkDimensions()- Specified by:
globalWorkDimensions
in interfaceKernelExecutionContext
- Returns:
- The computed-at-construction value of the
globalWorkDimensions
attribute
-
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
this
object
-
withWorkGroupSize
Copy the current immutable object by setting a present value for the optionalworkGroupSize
attribute.- Parameters:
value
- The value for workGroupSize- Returns:
- A modified copy or
this
if not changed
-
withWorkGroupSize
Copy the current immutable object by setting an optional value for theworkGroupSize
attribute. 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
this
if not changed
-
equals
This instance is equal to all instances ofImmutableKernelExecutionContext
that have equal attribute values. -
equalsByValue
-
hashCode
public int hashCode()Computes a hash code from attributes:globalWorkSize
,workGroupSize
,globalWorkDimensions
. -
toString
Prints the immutable valueKernelExecutionContext
with attribute values. -
copyOf
Creates an immutable copy of aKernelExecutionContext
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
-