Package net.bmahe.genetics4j.gpu.opencl
Class ImmutableOpenCLExecutionContext
java.lang.Object
net.bmahe.genetics4j.gpu.opencl.ImmutableOpenCLExecutionContext
- All Implemented Interfaces:
OpenCLExecutionContext
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableOpenCLExecutionContext
extends Object
implements OpenCLExecutionContext
Immutable implementation of
OpenCLExecutionContext
.
Use the builder to create immutable instances:
new OpenCLExecutionContext.Builder()
.
Use the static factory method to create immutable instances:
ImmutableOpenCLExecutionContext.of()
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builds instances of typeImmutableOpenCLExecutionContext
. -
Field Summary
Modifier and TypeFieldDescriptionprivate final org.jocl.cl_command_queue
private final org.jocl.cl_context
private final org.jocl.cl_program
private final Device
private final Map
<String, KernelInfo> private final Platform
-
Constructor Summary
ModifierConstructorDescriptionprivate
ImmutableOpenCLExecutionContext
(ImmutableOpenCLExecutionContext original, Platform platform, Device device, org.jocl.cl_context clContext, org.jocl.cl_command_queue clCommandQueue, org.jocl.cl_program clProgram, Map<String, org.jocl.cl_kernel> kernels, Map<String, KernelInfo> kernelInfos) private
ImmutableOpenCLExecutionContext
(Platform platform, Device device, org.jocl.cl_context clContext, org.jocl.cl_command_queue clCommandQueue, org.jocl.cl_program clProgram, Map<String, ? extends org.jocl.cl_kernel> kernels, Map<String, ? extends KernelInfo> kernelInfos) -
Method Summary
Modifier and TypeMethodDescriptionorg.jocl.cl_command_queue
org.jocl.cl_context
org.jocl.cl_program
copyOf
(OpenCLExecutionContext instance) Creates an immutable copy of aOpenCLExecutionContext
value.private static <K,
V> Map <K, V> createUnmodifiableMap
(boolean checkNulls, boolean skipNulls, Map<? extends K, ? extends V> map) device()
boolean
This instance is equal to all instances ofImmutableOpenCLExecutionContext
that have equal attribute values.private boolean
equalTo
(int synthetic, ImmutableOpenCLExecutionContext another) int
hashCode()
Computes a hash code from attributes:platform
,device
,clContext
,clCommandQueue
,clProgram
,kernels
,kernelInfos
.kernels()
of
(Platform platform, Device device, org.jocl.cl_context clContext, org.jocl.cl_command_queue clCommandQueue, org.jocl.cl_program clProgram, Map<String, ? extends org.jocl.cl_kernel> kernels, Map<String, ? extends KernelInfo> kernelInfos) Construct a new immutableOpenCLExecutionContext
instance.platform()
toString()
Prints the immutable valueOpenCLExecutionContext
with attribute values.withClCommandQueue
(org.jocl.cl_command_queue value) Copy the current immutable object by setting a value for theclCommandQueue
attribute.withClContext
(org.jocl.cl_context value) Copy the current immutable object by setting a value for theclContext
attribute.withClProgram
(org.jocl.cl_program value) Copy the current immutable object by setting a value for theclProgram
attribute.withDevice
(Device value) Copy the current immutable object by setting a value for thedevice
attribute.withKernelInfos
(Map<String, ? extends KernelInfo> entries) Copy the current immutable object by replacing thekernelInfos
map with the specified map.withKernels
(Map<String, ? extends org.jocl.cl_kernel> entries) Copy the current immutable object by replacing thekernels
map with the specified map.withPlatform
(Platform value) Copy the current immutable object by setting a value for theplatform
attribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.bmahe.genetics4j.gpu.opencl.OpenCLExecutionContext
kernelInfo
-
Field Details
-
platform
-
device
-
clContext
private final org.jocl.cl_context clContext -
clCommandQueue
private final org.jocl.cl_command_queue clCommandQueue -
clProgram
private final org.jocl.cl_program clProgram -
kernels
-
kernelInfos
-
-
Constructor Details
-
ImmutableOpenCLExecutionContext
-
ImmutableOpenCLExecutionContext
private ImmutableOpenCLExecutionContext(ImmutableOpenCLExecutionContext original, Platform platform, Device device, org.jocl.cl_context clContext, org.jocl.cl_command_queue clCommandQueue, org.jocl.cl_program clProgram, Map<String, org.jocl.cl_kernel> kernels, Map<String, KernelInfo> kernelInfos)
-
-
Method Details
-
platform
- Specified by:
platform
in interfaceOpenCLExecutionContext
- Returns:
- The value of the
platform
attribute
-
device
- Specified by:
device
in interfaceOpenCLExecutionContext
- Returns:
- The value of the
device
attribute
-
clContext
public org.jocl.cl_context clContext()- Specified by:
clContext
in interfaceOpenCLExecutionContext
- Returns:
- The value of the
clContext
attribute
-
clCommandQueue
public org.jocl.cl_command_queue clCommandQueue()- Specified by:
clCommandQueue
in interfaceOpenCLExecutionContext
- Returns:
- The value of the
clCommandQueue
attribute
-
clProgram
public org.jocl.cl_program clProgram()- Specified by:
clProgram
in interfaceOpenCLExecutionContext
- Returns:
- The value of the
clProgram
attribute
-
kernels
- Specified by:
kernels
in interfaceOpenCLExecutionContext
- Returns:
- The value of the
kernels
attribute
-
kernelInfos
- Specified by:
kernelInfos
in interfaceOpenCLExecutionContext
- Returns:
- The value of the
kernelInfos
attribute
-
withPlatform
Copy the current immutable object by setting a value for theplatform
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for platform- Returns:
- A modified copy of the
this
object
-
withDevice
Copy the current immutable object by setting a value for thedevice
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for device- Returns:
- A modified copy of the
this
object
-
withClContext
Copy the current immutable object by setting a value for theclContext
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for clContext- Returns:
- A modified copy of the
this
object
-
withClCommandQueue
Copy the current immutable object by setting a value for theclCommandQueue
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for clCommandQueue- Returns:
- A modified copy of the
this
object
-
withClProgram
Copy the current immutable object by setting a value for theclProgram
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for clProgram- Returns:
- A modified copy of the
this
object
-
withKernels
public final ImmutableOpenCLExecutionContext withKernels(Map<String, ? extends org.jocl.cl_kernel> entries) Copy the current immutable object by replacing thekernels
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 kernels map- Returns:
- A modified copy of
this
object
-
withKernelInfos
public final ImmutableOpenCLExecutionContext withKernelInfos(Map<String, ? extends KernelInfo> entries) Copy the current immutable object by replacing thekernelInfos
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 kernelInfos map- Returns:
- A modified copy of
this
object
-
equals
This instance is equal to all instances ofImmutableOpenCLExecutionContext
that have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:platform
,device
,clContext
,clCommandQueue
,clProgram
,kernels
,kernelInfos
. -
toString
Prints the immutable valueOpenCLExecutionContext
with attribute values. -
of
public static ImmutableOpenCLExecutionContext of(Platform platform, Device device, org.jocl.cl_context clContext, org.jocl.cl_command_queue clCommandQueue, org.jocl.cl_program clProgram, Map<String, ? extends org.jocl.cl_kernel> kernels, Map<String, ? extends KernelInfo> kernelInfos) Construct a new immutableOpenCLExecutionContext
instance.- Parameters:
platform
- The value for theplatform
attributedevice
- The value for thedevice
attributeclContext
- The value for theclContext
attributeclCommandQueue
- The value for theclCommandQueue
attributeclProgram
- The value for theclProgram
attributekernels
- The value for thekernels
attributekernelInfos
- The value for thekernelInfos
attribute- Returns:
- An immutable OpenCLExecutionContext instance
-
copyOf
Creates an immutable copy of aOpenCLExecutionContext
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 OpenCLExecutionContext instance
-
createUnmodifiableMap
-