Class ImmutablePlatform
java.lang.Object
net.bmahe.genetics4j.gpu.opencl.model.ImmutablePlatform
- All Implemented Interfaces:
Platform
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutablePlatform
extends Object
implements Platform
Immutable implementation of
Platform
.
Use the builder to create immutable instances:
ImmutablePlatform.builder()
.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
private final int
private final org.jocl.cl_platform_id
private final PlatformProfile
private final String
private final String
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ImmutablePlatform
(org.jocl.cl_platform_id platformId, PlatformProfile profile, String version, String name, String vendor, Set<String> extensions, int numDevices) -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutablePlatform.Builder
builder()
Creates a builder forImmutablePlatform
.static ImmutablePlatform
Creates an immutable copy of aPlatform
value.private static <T> List
<T> createSafeList
(Iterable<? extends T> iterable, boolean checkNulls, boolean skipNulls) private static <T> Set
<T> createUnmodifiableSet
(List<T> list) Unmodifiable set constructed from list to avoid rehashing.boolean
This instance is equal to all instances ofImmutablePlatform
that have equal attribute values.private boolean
equalTo
(int synthetic, ImmutablePlatform another) Returns the set of OpenCL extensions supported by this platform.int
hashCode()
Computes a hash code from attributes:platformId
,profile
,version
,name
,vendor
,extensions
,numDevices
.name()
Returns the platform name provided by the vendor.int
Returns the number of OpenCL devices available on this platform.org.jocl.cl_platform_id
Returns the native OpenCL platform identifier.profile()
Returns the OpenCL profile supported by this platform.toString()
Prints the immutable valuePlatform
with attribute values.vendor()
Returns the platform vendor name.version()
Returns the OpenCL version string supported by this platform.final ImmutablePlatform
withExtensions
(Iterable<String> elements) Copy the current immutable object with elements that replace the content ofextensions
.final ImmutablePlatform
withExtensions
(String... elements) Copy the current immutable object with elements that replace the content ofextensions
.final ImmutablePlatform
Copy the current immutable object by setting a value for thename
attribute.final ImmutablePlatform
withNumDevices
(int value) Copy the current immutable object by setting a value for thenumDevices
attribute.final ImmutablePlatform
withPlatformId
(org.jocl.cl_platform_id value) Copy the current immutable object by setting a value for theplatformId
attribute.final ImmutablePlatform
withProfile
(PlatformProfile value) Copy the current immutable object by setting a value for theprofile
attribute.final ImmutablePlatform
withVendor
(String value) Copy the current immutable object by setting a value for thevendor
attribute.final ImmutablePlatform
withVersion
(String value) Copy the current immutable object by setting a value for theversion
attribute.
-
Field Details
-
platformId
private final org.jocl.cl_platform_id platformId -
profile
-
version
-
name
-
vendor
-
extensions
-
numDevices
private final int numDevices
-
-
Constructor Details
-
ImmutablePlatform
-
-
Method Details
-
platformId
public org.jocl.cl_platform_id platformId()Returns the native OpenCL platform identifier.- Specified by:
platformId
in interfacePlatform
- Returns:
- the OpenCL platform ID for low-level operations
-
profile
Returns the OpenCL profile supported by this platform. -
version
Returns the OpenCL version string supported by this platform. -
name
Returns the platform name provided by the vendor. -
vendor
Returns the platform vendor name. -
extensions
Returns the set of OpenCL extensions supported by this platform.- Specified by:
extensions
in interfacePlatform
- Returns:
- set of extension names (e.g., "cl_khr_fp64", "cl_khr_global_int32_base_atomics")
-
numDevices
public int numDevices()Returns the number of OpenCL devices available on this platform.- Specified by:
numDevices
in interfacePlatform
- Returns:
- the count of devices that can be used for computation
-
withPlatformId
Copy the current immutable object by setting a value for theplatformId
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for platformId- Returns:
- A modified copy of the
this
object
-
withProfile
Copy the current immutable object by setting a value for theprofile
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for profile- Returns:
- A modified copy of the
this
object
-
withVersion
Copy the current immutable object by setting a value for theversion
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for version- Returns:
- A modified copy of the
this
object
-
withName
Copy the current immutable object by setting a value for thename
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for name- Returns:
- A modified copy of the
this
object
-
withVendor
Copy the current immutable object by setting a value for thevendor
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for vendor- Returns:
- A modified copy of the
this
object
-
withExtensions
Copy the current immutable object with elements that replace the content ofextensions
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withExtensions
Copy the current immutable object with elements that replace the content ofextensions
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of extensions elements to set- Returns:
- A modified copy of
this
object
-
withNumDevices
Copy the current immutable object by setting a value for thenumDevices
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for numDevices- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutablePlatform
that have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:platformId
,profile
,version
,name
,vendor
,extensions
,numDevices
. -
toString
Prints the immutable valuePlatform
with attribute values. -
copyOf
Creates an immutable copy of aPlatform
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 Platform instance
-
builder
Creates a builder forImmutablePlatform
.ImmutablePlatform.builder() .platformId(org.jocl.cl_platform_id) // required
platformId
.profile(net.bmahe.genetics4j.gpu.opencl.model.PlatformProfile) // requiredprofile
.version(String) // requiredversion
.name(String) // requiredname
.vendor(String) // requiredvendor
.addExtensions|addAllExtensions(String) //extensions
elements .numDevices(int) // requirednumDevices
.build();- Returns:
- A new ImmutablePlatform builder
-
createSafeList
-
createUnmodifiableSet
Unmodifiable set constructed from list to avoid rehashing.
-