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().

  • Field Details

    • platform

      private final Platform platform
    • device

      private final Device 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

      private final Map<String,org.jocl.cl_kernel> kernels
    • kernelInfos

      private final Map<String,KernelInfo> kernelInfos
  • Constructor Details

    • ImmutableOpenCLExecutionContext

      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)
    • 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

      public Platform platform()
      Specified by:
      platform in interface OpenCLExecutionContext
      Returns:
      The value of the platform attribute
    • device

      public Device device()
      Specified by:
      device in interface OpenCLExecutionContext
      Returns:
      The value of the device attribute
    • clContext

      public org.jocl.cl_context clContext()
      Specified by:
      clContext in interface OpenCLExecutionContext
      Returns:
      The value of the clContext attribute
    • clCommandQueue

      public org.jocl.cl_command_queue clCommandQueue()
      Specified by:
      clCommandQueue in interface OpenCLExecutionContext
      Returns:
      The value of the clCommandQueue attribute
    • clProgram

      public org.jocl.cl_program clProgram()
      Specified by:
      clProgram in interface OpenCLExecutionContext
      Returns:
      The value of the clProgram attribute
    • kernels

      public Map<String,org.jocl.cl_kernel> kernels()
      Specified by:
      kernels in interface OpenCLExecutionContext
      Returns:
      The value of the kernels attribute
    • kernelInfos

      public Map<String,KernelInfo> kernelInfos()
      Specified by:
      kernelInfos in interface OpenCLExecutionContext
      Returns:
      The value of the kernelInfos attribute
    • withPlatform

      public final ImmutableOpenCLExecutionContext withPlatform(Platform value)
      Copy the current immutable object by setting a value for the platform attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for platform
      Returns:
      A modified copy of the this object
    • withDevice

      public final ImmutableOpenCLExecutionContext withDevice(Device value)
      Copy the current immutable object by setting a value for the device attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for device
      Returns:
      A modified copy of the this object
    • withClContext

      public final ImmutableOpenCLExecutionContext withClContext(org.jocl.cl_context value)
      Copy the current immutable object by setting a value for the clContext attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for clContext
      Returns:
      A modified copy of the this object
    • withClCommandQueue

      public final ImmutableOpenCLExecutionContext withClCommandQueue(org.jocl.cl_command_queue value)
      Copy the current immutable object by setting a value for the clCommandQueue attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for clCommandQueue
      Returns:
      A modified copy of the this object
    • withClProgram

      public final ImmutableOpenCLExecutionContext withClProgram(org.jocl.cl_program value)
      Copy the current immutable object by setting a value for the clProgram attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      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 the kernels 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 returning this.
      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 the kernelInfos 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 returning this.
      Parameters:
      entries - The entries to be added to the kernelInfos map
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableOpenCLExecutionContext that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • equalTo

      private boolean equalTo(int synthetic, ImmutableOpenCLExecutionContext another)
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: platform, device, clContext, clCommandQueue, clProgram, kernels, kernelInfos.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value OpenCLExecutionContext with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • 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 immutable OpenCLExecutionContext instance.
      Parameters:
      platform - The value for the platform attribute
      device - The value for the device attribute
      clContext - The value for the clContext attribute
      clCommandQueue - The value for the clCommandQueue attribute
      clProgram - The value for the clProgram attribute
      kernels - The value for the kernels attribute
      kernelInfos - The value for the kernelInfos attribute
      Returns:
      An immutable OpenCLExecutionContext instance
    • copyOf

      Creates an immutable copy of a OpenCLExecutionContext 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

      private static <K, V> Map<K,V> createUnmodifiableMap(boolean checkNulls, boolean skipNulls, Map<? extends K,? extends V> map)