Class ImmutablePlatform
java.lang.Object
net.bmahe.genetics4j.gpu.opencl.model.ImmutablePlatform
- All Implemented Interfaces:
Platform
@Generated(from="Platform",
generator="Immutables")
@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 Stringprivate final intprivate final org.jocl.cl_platform_idprivate final PlatformProfileprivate final Stringprivate final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateImmutablePlatform(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.Builderbuilder()Creates a builder forPlatform.static PlatformCreates an immutable copy of aPlatformvalue.private static <T> List<T> createSafeList(Iterable<? extends T> iterable, boolean checkNulls, boolean skipNulls) private static <T> Set<T> createUnmodifiableSet(List<? extends T> list) Unmodifiable set constructed from list to avoid rehashing.booleanThis instance is equal to all instances ofImmutablePlatformthat have equal attribute values.private booleanequalsByValue(ImmutablePlatform another) Returns the set of OpenCL extensions supported by this platform.inthashCode()Computes a hash code from attributes:platformId,profile,version,name,vendor,extensions,numDevices.name()Returns the platform name provided by the vendor.intReturns the number of OpenCL devices available on this platform.org.jocl.cl_platform_idReturns the native OpenCL platform identifier.profile()Returns the OpenCL profile supported by this platform.toString()Prints the immutable valuePlatformwith attribute values.vendor()Returns the platform vendor name.version()Returns the OpenCL version string supported by this platform.final ImmutablePlatformwithExtensions(Iterable<String> elements) Copy the current immutable object with elements that replace the content ofextensions.final ImmutablePlatformwithExtensions(String... elements) Copy the current immutable object with elements that replace the content ofextensions.final ImmutablePlatformCopy the current immutable object by setting a value for thenameattribute.final ImmutablePlatformwithNumDevices(int value) Copy the current immutable object by setting a value for thenumDevicesattribute.final ImmutablePlatformwithPlatformId(org.jocl.cl_platform_id value) Copy the current immutable object by setting a value for theplatformIdattribute.final ImmutablePlatformwithProfile(PlatformProfile value) Copy the current immutable object by setting a value for theprofileattribute.final ImmutablePlatformwithVendor(String value) Copy the current immutable object by setting a value for thevendorattribute.final ImmutablePlatformwithVersion(String value) Copy the current immutable object by setting a value for theversionattribute.
-
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:
platformIdin 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:
extensionsin 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:
numDevicesin interfacePlatform- Returns:
- the count of devices that can be used for computation
-
withPlatformId
Copy the current immutable object by setting a value for theplatformIdattribute. 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 or the
thisobject
-
withProfile
Copy the current immutable object by setting a value for theprofileattribute. 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 or the
thisobject
-
withVersion
Copy the current immutable object by setting a value for theversionattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for version- Returns:
- A modified copy or the
thisobject
-
withName
Copy the current immutable object by setting a value for thenameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name- Returns:
- A modified copy or the
thisobject
-
withVendor
Copy the current immutable object by setting a value for thevendorattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for vendor- Returns:
- A modified copy or the
thisobject
-
withExtensions
Copy the current immutable object with elements that replace the content ofextensions.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
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 or
thisif not changed
-
withNumDevices
Copy the current immutable object by setting a value for thenumDevicesattribute. 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 or the
thisobject
-
equals
This instance is equal to all instances ofImmutablePlatformthat have equal attribute values. -
equalsByValue
-
hashCode
public int hashCode()Computes a hash code from attributes:platformId,profile,version,name,vendor,extensions,numDevices. -
toString
Prints the immutable valuePlatformwith attribute values. -
copyOf
Creates an immutable copy of aPlatformvalue. 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 forPlatform.ImmutablePlatform.builder() .platformId(org.jocl.cl_platform_id) // requiredplatformId.profile(net.bmahe.genetics4j.gpu.opencl.model.PlatformProfile) // requiredprofile.version(String) // requiredversion.name(String) // requiredname.vendor(String) // requiredvendor.addExtensions|addAllExtensions(String) //extensionselements .numDevices(int) // requirednumDevices.build();- Returns:
- A new Platform builder
-
createSafeList
-
createUnmodifiableSet
Unmodifiable set constructed from list to avoid rehashing.
-