Class ImmutableStageDescriptor
java.lang.Object
net.bmahe.genetics4j.gpu.spec.fitness.multistage.ImmutableStageDescriptor
- All Implemented Interfaces:
StageDescriptor
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableStageDescriptor
extends Object
implements StageDescriptor
Immutable implementation of
StageDescriptor
.
Use the builder to create immutable instances:
new StageDescriptor.Builder()
.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Map
<Integer, DataLoader> private final KernelExecutionContextComputer
private final String
private final Map
<Integer, LocalMemoryAllocator> private final Map
<Integer, ResultAllocator> -
Constructor Summary
ModifierConstructorDescriptionprivate
ImmutableStageDescriptor
(String kernelName, KernelExecutionContextComputer kernelExecutionContextComputer, Map<Integer, DataLoader> dataLoaders, Map<Integer, LocalMemoryAllocator> localMemoryAllocators, Map<Integer, ResultAllocator> resultAllocators, Map<Integer, Integer> reusePreviousResultAsArguments, Map<Integer, Integer> reusePreviousResultSizeAsArguments, Map<String, Integer> mapStaticDataAsArgument) -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableStageDescriptor
copyOf
(StageDescriptor instance) Creates an immutable copy of aStageDescriptor
value.private static <K,
V> Map <K, V> createUnmodifiableMap
(boolean checkNulls, boolean skipNulls, Map<? extends K, ? extends V> map) Association of kernel argument index and a data loaderboolean
This instance is equal to all instances ofImmutableStageDescriptor
that have equal attribute values.private boolean
equalTo
(int synthetic, ImmutableStageDescriptor another) int
hashCode()
Computes a hash code from attributes:kernelName
,kernelExecutionContextComputer
,dataLoaders
,localMemoryAllocators
,resultAllocators
,reusePreviousResultAsArguments
,reusePreviousResultSizeAsArguments
,mapStaticDataAsArgument
.Computer for the kernel execution context (ex: globak work size)Kernel nameAssociation of kernel argument index and a local memory allocatorAssociation of static data to a kernel argument indexAssociation of kernel argument index and a result allocatorAssociation of the kernel argument used for a result of the previous stage to the kernel argument for this executionAssociation of the size of the data from the result of the previous stage to the kernel argument for this executiontoString()
Prints the immutable valueStageDescriptor
with attribute values.final ImmutableStageDescriptor
withDataLoaders
(Map<Integer, ? extends DataLoader> entries) Copy the current immutable object by replacing thedataLoaders
map with the specified map.final ImmutableStageDescriptor
Copy the current immutable object by setting a value for thekernelExecutionContextComputer
attribute.final ImmutableStageDescriptor
withKernelName
(String value) Copy the current immutable object by setting a value for thekernelName
attribute.final ImmutableStageDescriptor
withLocalMemoryAllocators
(Map<Integer, ? extends LocalMemoryAllocator> entries) Copy the current immutable object by replacing thelocalMemoryAllocators
map with the specified map.final ImmutableStageDescriptor
withMapStaticDataAsArgument
(Map<String, ? extends Integer> entries) Copy the current immutable object by replacing themapStaticDataAsArgument
map with the specified map.final ImmutableStageDescriptor
withResultAllocators
(Map<Integer, ? extends ResultAllocator> entries) Copy the current immutable object by replacing theresultAllocators
map with the specified map.final ImmutableStageDescriptor
withReusePreviousResultAsArguments
(Map<Integer, ? extends Integer> entries) Copy the current immutable object by replacing thereusePreviousResultAsArguments
map with the specified map.final ImmutableStageDescriptor
withReusePreviousResultSizeAsArguments
(Map<Integer, ? extends Integer> entries) Copy the current immutable object by replacing thereusePreviousResultSizeAsArguments
map with the specified map.
-
Field Details
-
kernelName
-
kernelExecutionContextComputer
-
dataLoaders
-
localMemoryAllocators
-
resultAllocators
-
reusePreviousResultAsArguments
-
reusePreviousResultSizeAsArguments
-
mapStaticDataAsArgument
-
-
Constructor Details
-
ImmutableStageDescriptor
private ImmutableStageDescriptor(String kernelName, KernelExecutionContextComputer kernelExecutionContextComputer, Map<Integer, DataLoader> dataLoaders, Map<Integer, LocalMemoryAllocator> localMemoryAllocators, Map<Integer, ResultAllocator> resultAllocators, Map<Integer, Integer> reusePreviousResultAsArguments, Map<Integer, Integer> reusePreviousResultSizeAsArguments, Map<String, Integer> mapStaticDataAsArgument)
-
-
Method Details
-
kernelName
Kernel name- Specified by:
kernelName
in interfaceStageDescriptor
- Returns:
-
kernelExecutionContextComputer
Computer for the kernel execution context (ex: globak work size)- Specified by:
kernelExecutionContextComputer
in interfaceStageDescriptor
- Returns:
-
dataLoaders
Association of kernel argument index and a data loader- Specified by:
dataLoaders
in interfaceStageDescriptor
- Returns:
-
localMemoryAllocators
Association of kernel argument index and a local memory allocator- Specified by:
localMemoryAllocators
in interfaceStageDescriptor
- Returns:
-
resultAllocators
Association of kernel argument index and a result allocator- Specified by:
resultAllocators
in interfaceStageDescriptor
- Returns:
-
reusePreviousResultAsArguments
Association of the kernel argument used for a result of the previous stage to the kernel argument for this execution- Specified by:
reusePreviousResultAsArguments
in interfaceStageDescriptor
- Returns:
-
reusePreviousResultSizeAsArguments
Association of the size of the data from the result of the previous stage to the kernel argument for this execution- Specified by:
reusePreviousResultSizeAsArguments
in interfaceStageDescriptor
- Returns:
-
mapStaticDataAsArgument
Association of static data to a kernel argument index- Specified by:
mapStaticDataAsArgument
in interfaceStageDescriptor
-
withKernelName
Copy the current immutable object by setting a value for thekernelName
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for kernelName- Returns:
- A modified copy of the
this
object
-
withKernelExecutionContextComputer
public final ImmutableStageDescriptor withKernelExecutionContextComputer(KernelExecutionContextComputer value) Copy the current immutable object by setting a value for thekernelExecutionContextComputer
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for kernelExecutionContextComputer- Returns:
- A modified copy of the
this
object
-
withDataLoaders
Copy the current immutable object by replacing thedataLoaders
map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
entries
- The entries to be added to the dataLoaders map- Returns:
- A modified copy of
this
object
-
withLocalMemoryAllocators
public final ImmutableStageDescriptor withLocalMemoryAllocators(Map<Integer, ? extends LocalMemoryAllocator> entries) Copy the current immutable object by replacing thelocalMemoryAllocators
map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
entries
- The entries to be added to the localMemoryAllocators map- Returns:
- A modified copy of
this
object
-
withResultAllocators
public final ImmutableStageDescriptor withResultAllocators(Map<Integer, ? extends ResultAllocator> entries) Copy the current immutable object by replacing theresultAllocators
map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
entries
- The entries to be added to the resultAllocators map- Returns:
- A modified copy of
this
object
-
withReusePreviousResultAsArguments
public final ImmutableStageDescriptor withReusePreviousResultAsArguments(Map<Integer, ? extends Integer> entries) Copy the current immutable object by replacing thereusePreviousResultAsArguments
map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
entries
- The entries to be added to the reusePreviousResultAsArguments map- Returns:
- A modified copy of
this
object
-
withReusePreviousResultSizeAsArguments
public final ImmutableStageDescriptor withReusePreviousResultSizeAsArguments(Map<Integer, ? extends Integer> entries) Copy the current immutable object by replacing thereusePreviousResultSizeAsArguments
map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
entries
- The entries to be added to the reusePreviousResultSizeAsArguments map- Returns:
- A modified copy of
this
object
-
withMapStaticDataAsArgument
public final ImmutableStageDescriptor withMapStaticDataAsArgument(Map<String, ? extends Integer> entries) Copy the current immutable object by replacing themapStaticDataAsArgument
map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
entries
- The entries to be added to the mapStaticDataAsArgument map- Returns:
- A modified copy of
this
object
-
equals
This instance is equal to all instances ofImmutableStageDescriptor
that have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:kernelName
,kernelExecutionContextComputer
,dataLoaders
,localMemoryAllocators
,resultAllocators
,reusePreviousResultAsArguments
,reusePreviousResultSizeAsArguments
,mapStaticDataAsArgument
. -
toString
Prints the immutable valueStageDescriptor
with attribute values. -
copyOf
Creates an immutable copy of aStageDescriptor
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 StageDescriptor instance
-
createUnmodifiableMap
-