Package net.bmahe.genetics4j.gpu.opencl
Class ImmutableOpenCLExecutionContext.Builder
java.lang.Object
net.bmahe.genetics4j.gpu.opencl.ImmutableOpenCLExecutionContext.Builder
- Direct Known Subclasses:
OpenCLExecutionContext.Builder
- Enclosing class:
ImmutableOpenCLExecutionContext
@Generated(from="OpenCLExecutionContext",
generator="Immutables")
public static class ImmutableOpenCLExecutionContext.Builder
extends Object
Builds instances of type
OpenCLExecutionContext.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.jocl.cl_command_queueprivate org.jocl.cl_contextprivate org.jocl.cl_programprivate Deviceprivate static final longprivate static final longprivate static final longprivate static final longprivate static final longprivate longprivate Map<String, KernelInfo> private Platform -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newOpenCLExecutionContext.clCommandQueue(org.jocl.cl_command_queue clCommandQueue) Initializes the value for theclCommandQueueattribute.clContext(org.jocl.cl_context clContext) Initializes the value for theclContextattribute.clProgram(org.jocl.cl_program clProgram) Initializes the value for theclProgramattribute.Initializes the value for thedeviceattribute.private Stringfrom(OpenCLExecutionContext instance) Fill a builder with attribute values from the providedOpenCLExecutionContextinstance.kernelInfos(Map<String, ? extends KernelInfo> entries) Sets or replaces all mappings from the specified map as entries for thekernelInfosmap.Sets or replaces all mappings from the specified map as entries for thekernelsmap.Initializes the value for theplatformattribute.putAllKernelInfos(Map<String, ? extends KernelInfo> entries) Put all mappings from the specified map as entries tokernelInfosmap.putAllKernels(Map<String, ? extends org.jocl.cl_kernel> entries) Put all mappings from the specified map as entries tokernelsmap.putKernelInfos(String key, KernelInfo value) Put one entry to thekernelInfosmap.putKernelInfos(Map.Entry<String, ? extends KernelInfo> entry) Put one entry to thekernelInfosmap.putKernels(String key, org.jocl.cl_kernel value) Put one entry to thekernelsmap.putKernels(Map.Entry<String, ? extends org.jocl.cl_kernel> entry) Put one entry to thekernelsmap.
-
Field Details
-
INIT_BIT_PLATFORM
private static final long INIT_BIT_PLATFORM- See Also:
-
INIT_BIT_DEVICE
private static final long INIT_BIT_DEVICE- See Also:
-
INIT_BIT_CL_CONTEXT
private static final long INIT_BIT_CL_CONTEXT- See Also:
-
INIT_BIT_CL_COMMAND_QUEUE
private static final long INIT_BIT_CL_COMMAND_QUEUE- See Also:
-
INIT_BIT_CL_PROGRAM
private static final long INIT_BIT_CL_PROGRAM- See Also:
-
initBits
private long initBits -
platform
-
device
-
clContext
private org.jocl.cl_context clContext -
clCommandQueue
private org.jocl.cl_command_queue clCommandQueue -
clProgram
private org.jocl.cl_program clProgram -
kernels
-
kernelInfos
-
-
Constructor Details
-
Builder
public Builder()Creates a builder forOpenCLExecutionContextinstances.new OpenCLExecutionContext.Builder() .platform(net.bmahe.genetics4j.gpu.opencl.model.Platform) // requiredplatform.device(net.bmahe.genetics4j.gpu.opencl.model.Device) // requireddevice.clContext(org.jocl.cl_context) // requiredclContext.clCommandQueue(org.jocl.cl_command_queue) // requiredclCommandQueue.clProgram(org.jocl.cl_program) // requiredclProgram.putKernels|putAllKernels(String => org.jocl.cl_kernel) //kernelsmappings .putKernelInfos|putAllKernelInfos(String => net.bmahe.genetics4j.gpu.opencl.model.KernelInfo) //kernelInfosmappings .build();
-
-
Method Details
-
from
Fill a builder with attribute values from the providedOpenCLExecutionContextinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
platform
Initializes the value for theplatformattribute.- Parameters:
platform- The value for platform- Returns:
thisbuilder for use in a chained invocation
-
device
Initializes the value for thedeviceattribute.- Parameters:
device- The value for device- Returns:
thisbuilder for use in a chained invocation
-
clContext
Initializes the value for theclContextattribute.- Parameters:
clContext- The value for clContext- Returns:
thisbuilder for use in a chained invocation
-
clCommandQueue
public final OpenCLExecutionContext.Builder clCommandQueue(org.jocl.cl_command_queue clCommandQueue) Initializes the value for theclCommandQueueattribute.- Parameters:
clCommandQueue- The value for clCommandQueue- Returns:
thisbuilder for use in a chained invocation
-
clProgram
Initializes the value for theclProgramattribute.- Parameters:
clProgram- The value for clProgram- Returns:
thisbuilder for use in a chained invocation
-
putKernels
Put one entry to thekernelsmap.- Parameters:
key- The key in the kernels mapvalue- The associated value in the kernels map- Returns:
thisbuilder for use in a chained invocation
-
putKernels
public final OpenCLExecutionContext.Builder putKernels(Map.Entry<String, ? extends org.jocl.cl_kernel> entry) Put one entry to thekernelsmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
kernels
public final OpenCLExecutionContext.Builder kernels(Map<String, ? extends org.jocl.cl_kernel> entries) Sets or replaces all mappings from the specified map as entries for thekernelsmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the kernels map- Returns:
thisbuilder for use in a chained invocation
-
putAllKernels
public final OpenCLExecutionContext.Builder putAllKernels(Map<String, ? extends org.jocl.cl_kernel> entries) Put all mappings from the specified map as entries tokernelsmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the kernels map- Returns:
thisbuilder for use in a chained invocation
-
putKernelInfos
Put one entry to thekernelInfosmap.- Parameters:
key- The key in the kernelInfos mapvalue- The associated value in the kernelInfos map- Returns:
thisbuilder for use in a chained invocation
-
putKernelInfos
public final OpenCLExecutionContext.Builder putKernelInfos(Map.Entry<String, ? extends KernelInfo> entry) Put one entry to thekernelInfosmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
kernelInfos
Sets or replaces all mappings from the specified map as entries for thekernelInfosmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the kernelInfos map- Returns:
thisbuilder for use in a chained invocation
-
putAllKernelInfos
public final OpenCLExecutionContext.Builder putAllKernelInfos(Map<String, ? extends KernelInfo> entries) Put all mappings from the specified map as entries tokernelInfosmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the kernelInfos map- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newOpenCLExecutionContext.- Returns:
- An immutable instance of OpenCLExecutionContext
- Throws:
IllegalStateException- if any required attributes are missing
-
formatRequiredAttributesMessage
-