Class ImmutableCLData
java.lang.Object
net.bmahe.genetics4j.gpu.spec.fitness.cldata.ImmutableCLData
- All Implemented Interfaces:
CLData
@Generated(from="CLData",
generator="Immutables")
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableCLData
extends Object
implements CLData
Immutable implementation of
CLData.
Use the builder to create immutable instances:
ImmutableCLData.builder().
Use the static factory method to create immutable instances:
ImmutableCLData.of().
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateImmutableCLData(ImmutableCLData original, org.jocl.cl_mem clMem, int clType, int size) privateImmutableCLData(org.jocl.cl_mem clMem, int clType, int size) -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableCLData.Builderbuilder()Creates a builder forCLData.org.jocl.cl_memclMem()Returns the OpenCL memory object that references the data stored on the device.intclType()Returns the OpenCL data type of the elements stored in the memory buffer.static CLDataCreates an immutable copy of aCLDatavalue.booleanThis instance is equal to all instances ofImmutableCLDatathat have equal attribute values.private booleanequalsByValue(ImmutableCLData another) inthashCode()Computes a hash code from attributes:clMem,clType,size.static CLDataof(org.jocl.cl_mem clMem, int clType, int size) Construct a new immutableCLDatainstance.intsize()Returns the number of elements stored in the OpenCL memory buffer.toString()Prints the immutable valueCLDatawith attribute values.final ImmutableCLDatawithClMem(org.jocl.cl_mem value) Copy the current immutable object by setting a value for theclMemattribute.final ImmutableCLDatawithClType(int value) Copy the current immutable object by setting a value for theclTypeattribute.final ImmutableCLDatawithSize(int value) Copy the current immutable object by setting a value for thesizeattribute.
-
Field Details
-
clMem
private final org.jocl.cl_mem clMem -
clType
private final int clType -
size
private final int size
-
-
Constructor Details
-
ImmutableCLData
private ImmutableCLData(org.jocl.cl_mem clMem, int clType, int size) -
ImmutableCLData
-
-
Method Details
-
clMem
public org.jocl.cl_mem clMem()Returns the OpenCL memory object that references the data stored on the device. -
clType
public int clType()Returns the OpenCL data type of the elements stored in the memory buffer.Common OpenCL types include CL_FLOAT, CL_DOUBLE, CL_INT, and CL_CHAR. This information is used for proper kernel parameter binding and type checking.
-
size
public int size()Returns the number of elements stored in the OpenCL memory buffer.This represents the count of individual data elements (not bytes) contained in the memory object. For example, a buffer containing 1000 floating-point values would have a size of 1000, regardless of the actual byte size.
-
withClMem
Copy the current immutable object by setting a value for theclMemattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for clMem- Returns:
- A modified copy or the
thisobject
-
withClType
Copy the current immutable object by setting a value for theclTypeattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for clType- Returns:
- A modified copy or the
thisobject
-
withSize
Copy the current immutable object by setting a value for thesizeattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for size- Returns:
- A modified copy or the
thisobject
-
equals
This instance is equal to all instances ofImmutableCLDatathat have equal attribute values. -
equalsByValue
-
hashCode
public int hashCode()Computes a hash code from attributes:clMem,clType,size. -
toString
Prints the immutable valueCLDatawith attribute values. -
of
Construct a new immutableCLDatainstance.- Parameters:
clMem- The value for theclMemattributeclType- The value for theclTypeattributesize- The value for thesizeattribute- Returns:
- An immutable CLData instance
-
copyOf
Creates an immutable copy of aCLDatavalue. 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 CLData instance
-
builder
Creates a builder forCLData.ImmutableCLData.builder() .clMem(org.jocl.cl_mem) // requiredclMem.clType(int) // requiredclType.size(int) // requiredsize.build();- Returns:
- A new CLData builder
-