Class ImmutableCLData
java.lang.Object
net.bmahe.genetics4j.gpu.spec.fitness.cldata.ImmutableCLData
- All Implemented Interfaces:
CLData
@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
ConstructorsModifierConstructorDescriptionprivate
ImmutableCLData
(ImmutableCLData original, org.jocl.cl_mem clMem, int clType, int size) private
ImmutableCLData
(org.jocl.cl_mem clMem, int clType, int size) -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableCLData.Builder
builder()
Creates a builder forImmutableCLData
.org.jocl.cl_mem
clMem()
Returns the OpenCL memory object that references the data stored on the device.int
clType()
Returns the OpenCL data type of the elements stored in the memory buffer.static ImmutableCLData
Creates an immutable copy of aCLData
value.boolean
This instance is equal to all instances ofImmutableCLData
that have equal attribute values.private boolean
equalTo
(int synthetic, ImmutableCLData another) int
hashCode()
Computes a hash code from attributes:clMem
,clType
,size
.static ImmutableCLData
of
(org.jocl.cl_mem clMem, int clType, int size) Construct a new immutableCLData
instance.int
size()
Returns the number of elements stored in the OpenCL memory buffer.toString()
Prints the immutable valueCLData
with attribute values.final ImmutableCLData
withClMem
(org.jocl.cl_mem value) Copy the current immutable object by setting a value for theclMem
attribute.final ImmutableCLData
withClType
(int value) Copy the current immutable object by setting a value for theclType
attribute.final ImmutableCLData
withSize
(int value) Copy the current immutable object by setting a value for thesize
attribute.
-
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 theclMem
attribute. 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 of the
this
object
-
withClType
Copy the current immutable object by setting a value for theclType
attribute. 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 of the
this
object
-
withSize
Copy the current immutable object by setting a value for thesize
attribute. 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 of the
this
object
-
equals
This instance is equal to all instances ofImmutableCLData
that have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:clMem
,clType
,size
. -
toString
Prints the immutable valueCLData
with attribute values. -
of
Construct a new immutableCLData
instance.- Parameters:
clMem
- The value for theclMem
attributeclType
- The value for theclType
attributesize
- The value for thesize
attribute- Returns:
- An immutable CLData instance
-
copyOf
Creates an immutable copy of aCLData
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 CLData instance
-
builder
Creates a builder forImmutableCLData
.ImmutableCLData.builder() .clMem(org.jocl.cl_mem) // required
clMem
.clType(int) // requiredclType
.size(int) // requiredsize
.build();- Returns:
- A new ImmutableCLData builder
-