Package net.bmahe.genetics4j.gpu.opencl
Class ImmutableOpenCLExecutionContext
java.lang.Object
net.bmahe.genetics4j.gpu.opencl.ImmutableOpenCLExecutionContext
- All Implemented Interfaces:
OpenCLExecutionContext
@Generated(from="OpenCLExecutionContext",
generator="Immutables")
@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
Nested ClassesModifier and TypeClassDescriptionstatic class
Builds instances of typeImmutableOpenCLExecutionContext
. -
Field Summary
FieldsModifier 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
ConstructorsModifierConstructorDescriptionprivate
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
Returns the OpenCL command queue for kernel execution and memory operations.org.jocl.cl_context
Returns the OpenCL context for this execution environment.org.jocl.cl_program
Returns the compiled OpenCL program containing all kernels.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()
Returns the OpenCL device associated with this execution context.boolean
This instance is equal to all instances ofImmutableOpenCLExecutionContext
that have equal attribute values.private boolean
int
hashCode()
Computes a hash code from attributes:platform
,device
,clContext
,clCommandQueue
,clProgram
,kernels
,kernelInfos
.Returns a map of kernel names to kernel execution information.kernels()
Returns a map of kernel names to compiled kernel objects.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()
Returns the OpenCL platform associated with this execution context.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
Returns the OpenCL platform associated with this execution context.- Specified by:
platform
in interfaceOpenCLExecutionContext
- Returns:
- the platform containing the device for this context
-
device
Returns the OpenCL device associated with this execution context.- Specified by:
device
in interfaceOpenCLExecutionContext
- Returns:
- the device on which kernels will be executed
-
clContext
public org.jocl.cl_context clContext()Returns the OpenCL context for this execution environment.- Specified by:
clContext
in interfaceOpenCLExecutionContext
- Returns:
- the OpenCL context for memory and resource management
-
clCommandQueue
public org.jocl.cl_command_queue clCommandQueue()Returns the OpenCL command queue for kernel execution and memory operations.- Specified by:
clCommandQueue
in interfaceOpenCLExecutionContext
- Returns:
- the command queue for submitting OpenCL operations
-
clProgram
public org.jocl.cl_program clProgram()Returns the compiled OpenCL program containing all kernels.- Specified by:
clProgram
in interfaceOpenCLExecutionContext
- Returns:
- the compiled OpenCL program object
-
kernels
Returns a map of kernel names to compiled kernel objects.- Specified by:
kernels
in interfaceOpenCLExecutionContext
- Returns:
- map from kernel names to executable kernel objects
-
kernelInfos
Returns a map of kernel names to kernel execution information.- Specified by:
kernelInfos
in interfaceOpenCLExecutionContext
- Returns:
- map from kernel names to kernel metadata and execution parameters
-
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 or 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 or 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 or 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 or 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 or 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 replace the kernels map- Returns:
- A modified copy or
this
if not changed
-
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 replace the kernelInfos map- Returns:
- A modified copy or
this
if not changed
-
equals
This instance is equal to all instances ofImmutableOpenCLExecutionContext
that have equal attribute values. -
equalsByValue
-
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
-