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 Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.jocl.cl_command_queueprivate final org.jocl.cl_contextprivate final org.jocl.cl_programprivate final Deviceprivate final Map<String, KernelInfo> private final Platform -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateImmutableOpenCLExecutionContext(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) privateImmutableOpenCLExecutionContext(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_queueReturns the OpenCL command queue for kernel execution and memory operations.org.jocl.cl_contextReturns the OpenCL context for this execution environment.org.jocl.cl_programReturns the compiled OpenCL program containing all kernels.static OpenCLExecutionContextcopyOf(OpenCLExecutionContext instance) Creates an immutable copy of aOpenCLExecutionContextvalue.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.booleanThis instance is equal to all instances ofImmutableOpenCLExecutionContextthat have equal attribute values.private booleaninthashCode()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.static OpenCLExecutionContextof(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 immutableOpenCLExecutionContextinstance.platform()Returns the OpenCL platform associated with this execution context.toString()Prints the immutable valueOpenCLExecutionContextwith attribute values.withClCommandQueue(org.jocl.cl_command_queue value) Copy the current immutable object by setting a value for theclCommandQueueattribute.withClContext(org.jocl.cl_context value) Copy the current immutable object by setting a value for theclContextattribute.withClProgram(org.jocl.cl_program value) Copy the current immutable object by setting a value for theclProgramattribute.withDevice(Device value) Copy the current immutable object by setting a value for thedeviceattribute.withKernelInfos(Map<String, ? extends KernelInfo> entries) Copy the current immutable object by replacing thekernelInfosmap with the specified map.withKernels(Map<String, ? extends org.jocl.cl_kernel> entries) Copy the current immutable object by replacing thekernelsmap with the specified map.withPlatform(Platform value) Copy the current immutable object by setting a value for theplatformattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:
platformin interfaceOpenCLExecutionContext- Returns:
- the platform containing the device for this context
-
device
Returns the OpenCL device associated with this execution context.- Specified by:
devicein 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:
clContextin 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:
clCommandQueuein 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:
clProgramin interfaceOpenCLExecutionContext- Returns:
- the compiled OpenCL program object
-
kernels
Returns a map of kernel names to compiled kernel objects.- Specified by:
kernelsin interfaceOpenCLExecutionContext- Returns:
- map from kernel names to executable kernel objects
-
kernelInfos
Returns a map of kernel names to kernel execution information.- Specified by:
kernelInfosin interfaceOpenCLExecutionContext- Returns:
- map from kernel names to kernel metadata and execution parameters
-
withPlatform
Copy the current immutable object by setting a value for theplatformattribute. 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
thisobject
-
withDevice
Copy the current immutable object by setting a value for thedeviceattribute. 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
thisobject
-
withClContext
Copy the current immutable object by setting a value for theclContextattribute. 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
thisobject
-
withClCommandQueue
Copy the current immutable object by setting a value for theclCommandQueueattribute. 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
thisobject
-
withClProgram
Copy the current immutable object by setting a value for theclProgramattribute. 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
thisobject
-
withKernels
public final ImmutableOpenCLExecutionContext withKernels(Map<String, ? extends org.jocl.cl_kernel> entries) Copy the current immutable object by replacing thekernelsmap 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
thisif not changed
-
withKernelInfos
public final ImmutableOpenCLExecutionContext withKernelInfos(Map<String, ? extends KernelInfo> entries) Copy the current immutable object by replacing thekernelInfosmap 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
thisif not changed
-
equals
This instance is equal to all instances ofImmutableOpenCLExecutionContextthat 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 valueOpenCLExecutionContextwith attribute values. -
of
public static OpenCLExecutionContext 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 immutableOpenCLExecutionContextinstance.- Parameters:
platform- The value for theplatformattributedevice- The value for thedeviceattributeclContext- The value for theclContextattributeclCommandQueue- The value for theclCommandQueueattributeclProgram- The value for theclProgramattributekernels- The value for thekernelsattributekernelInfos- The value for thekernelInfosattribute- Returns:
- An immutable OpenCLExecutionContext instance
-
copyOf
Creates an immutable copy of aOpenCLExecutionContextvalue. 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
-