Class ImmutableDevice
java.lang.Object
net.bmahe.genetics4j.gpu.opencl.model.ImmutableDevice
- All Implemented Interfaces:
Device
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableDevice
extends Object
implements Device
Immutable implementation of
Device
.
Use the builder to create immutable instances:
ImmutableDevice.builder()
.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate final org.jocl.cl_device_id
private final Set
<DeviceType> private final String
private final String
private final boolean
private final int
private final int
private final long
private final int
private final long[]
private final String
private final int
private final String
-
Constructor Summary
ModifierConstructorDescriptionprivate
ImmutableDevice
(org.jocl.cl_device_id deviceId, String name, String vendor, String deviceVersion, String driverVersion, int maxClockFrequency, Set<DeviceType> deviceType, Set<String> builtInKernels, int maxComputeUnits, int maxWorkItemDimensions, long maxWorkGroupSize, long[] maxWorkItemSizes, boolean imageSupport, int preferredVectorWidthFloat) -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableDevice.Builder
builder()
Creates a builder forImmutableDevice
.static ImmutableDevice
Creates an immutable copy of aDevice
value.private static <T> List
<T> createSafeList
(Iterable<? extends T> iterable, boolean checkNulls, boolean skipNulls) createUnmodifiableEnumSet
(Iterable<T> iterable) private static <T> Set
<T> createUnmodifiableSet
(List<T> list) Unmodifiable set constructed from list to avoid rehashing.org.jocl.cl_device_id
deviceId()
boolean
This instance is equal to all instances ofImmutableDevice
that have equal attribute values.private boolean
equalTo
(int synthetic, ImmutableDevice another) int
hashCode()
Computes a hash code from attributes:deviceId
,name
,vendor
,deviceVersion
,driverVersion
,maxClockFrequency
,deviceType
,builtInKernels
,maxComputeUnits
,maxWorkItemDimensions
,maxWorkGroupSize
,maxWorkItemSizes
,imageSupport
,preferredVectorWidthFloat
.boolean
int
int
long
int
long[]
name()
int
toString()
Prints the immutable valueDevice
with attribute values.vendor()
final ImmutableDevice
withBuiltInKernels
(Iterable<String> elements) Copy the current immutable object with elements that replace the content ofbuiltInKernels
.final ImmutableDevice
withBuiltInKernels
(String... elements) Copy the current immutable object with elements that replace the content ofbuiltInKernels
.final ImmutableDevice
withDeviceId
(org.jocl.cl_device_id value) Copy the current immutable object by setting a value for thedeviceId
attribute.final ImmutableDevice
withDeviceType
(Iterable<DeviceType> elements) Copy the current immutable object with elements that replace the content ofdeviceType
.final ImmutableDevice
withDeviceType
(DeviceType... elements) Copy the current immutable object with elements that replace the content ofdeviceType
.final ImmutableDevice
withDeviceVersion
(String value) Copy the current immutable object by setting a value for thedeviceVersion
attribute.final ImmutableDevice
withDriverVersion
(String value) Copy the current immutable object by setting a value for thedriverVersion
attribute.final ImmutableDevice
withImageSupport
(boolean value) Copy the current immutable object by setting a value for theimageSupport
attribute.final ImmutableDevice
withMaxClockFrequency
(int value) Copy the current immutable object by setting a value for themaxClockFrequency
attribute.final ImmutableDevice
withMaxComputeUnits
(int value) Copy the current immutable object by setting a value for themaxComputeUnits
attribute.final ImmutableDevice
withMaxWorkGroupSize
(long value) Copy the current immutable object by setting a value for themaxWorkGroupSize
attribute.final ImmutableDevice
withMaxWorkItemDimensions
(int value) Copy the current immutable object by setting a value for themaxWorkItemDimensions
attribute.final ImmutableDevice
withMaxWorkItemSizes
(long... elements) Copy the current immutable object with elements that replace the content ofmaxWorkItemSizes
.final ImmutableDevice
Copy the current immutable object by setting a value for thename
attribute.final ImmutableDevice
withPreferredVectorWidthFloat
(int value) Copy the current immutable object by setting a value for thepreferredVectorWidthFloat
attribute.final ImmutableDevice
withVendor
(String value) Copy the current immutable object by setting a value for thevendor
attribute.
-
Field Details
-
deviceId
private final org.jocl.cl_device_id deviceId -
name
-
vendor
-
deviceVersion
-
driverVersion
-
maxClockFrequency
private final int maxClockFrequency -
deviceType
-
builtInKernels
-
maxComputeUnits
private final int maxComputeUnits -
maxWorkItemDimensions
private final int maxWorkItemDimensions -
maxWorkGroupSize
private final long maxWorkGroupSize -
maxWorkItemSizes
private final long[] maxWorkItemSizes -
imageSupport
private final boolean imageSupport -
preferredVectorWidthFloat
private final int preferredVectorWidthFloat
-
-
Constructor Details
-
ImmutableDevice
private ImmutableDevice(org.jocl.cl_device_id deviceId, String name, String vendor, String deviceVersion, String driverVersion, int maxClockFrequency, Set<DeviceType> deviceType, Set<String> builtInKernels, int maxComputeUnits, int maxWorkItemDimensions, long maxWorkGroupSize, long[] maxWorkItemSizes, boolean imageSupport, int preferredVectorWidthFloat)
-
-
Method Details
-
deviceId
public org.jocl.cl_device_id deviceId() -
name
-
vendor
-
deviceVersion
- Specified by:
deviceVersion
in interfaceDevice
- Returns:
- The value of the
deviceVersion
attribute
-
driverVersion
- Specified by:
driverVersion
in interfaceDevice
- Returns:
- The value of the
driverVersion
attribute
-
maxClockFrequency
public int maxClockFrequency()- Specified by:
maxClockFrequency
in interfaceDevice
- Returns:
- The value of the
maxClockFrequency
attribute
-
deviceType
- Specified by:
deviceType
in interfaceDevice
- Returns:
- The value of the
deviceType
attribute
-
builtInKernels
- Specified by:
builtInKernels
in interfaceDevice
- Returns:
- The value of the
builtInKernels
attribute
-
maxComputeUnits
public int maxComputeUnits()- Specified by:
maxComputeUnits
in interfaceDevice
- Returns:
- The value of the
maxComputeUnits
attribute
-
maxWorkItemDimensions
public int maxWorkItemDimensions()- Specified by:
maxWorkItemDimensions
in interfaceDevice
- Returns:
- The value of the
maxWorkItemDimensions
attribute
-
maxWorkGroupSize
public long maxWorkGroupSize()- Specified by:
maxWorkGroupSize
in interfaceDevice
- Returns:
- The value of the
maxWorkGroupSize
attribute
-
maxWorkItemSizes
public long[] maxWorkItemSizes()- Specified by:
maxWorkItemSizes
in interfaceDevice
- Returns:
- A cloned
maxWorkItemSizes
array
-
imageSupport
public boolean imageSupport()- Specified by:
imageSupport
in interfaceDevice
- Returns:
- The value of the
imageSupport
attribute
-
preferredVectorWidthFloat
public int preferredVectorWidthFloat()- Specified by:
preferredVectorWidthFloat
in interfaceDevice
- Returns:
- The value of the
preferredVectorWidthFloat
attribute
-
withDeviceId
Copy the current immutable object by setting a value for thedeviceId
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for deviceId- 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
-
withDeviceVersion
Copy the current immutable object by setting a value for thedeviceVersion
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for deviceVersion- Returns:
- A modified copy of the
this
object
-
withDriverVersion
Copy the current immutable object by setting a value for thedriverVersion
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for driverVersion- Returns:
- A modified copy of the
this
object
-
withMaxClockFrequency
Copy the current immutable object by setting a value for themaxClockFrequency
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for maxClockFrequency- Returns:
- A modified copy of the
this
object
-
withDeviceType
Copy the current immutable object with elements that replace the content ofdeviceType
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withDeviceType
Copy the current immutable object with elements that replace the content ofdeviceType
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of deviceType elements to set- Returns:
- A modified copy of
this
object
-
withBuiltInKernels
Copy the current immutable object with elements that replace the content ofbuiltInKernels
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withBuiltInKernels
Copy the current immutable object with elements that replace the content ofbuiltInKernels
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of builtInKernels elements to set- Returns:
- A modified copy of
this
object
-
withMaxComputeUnits
Copy the current immutable object by setting a value for themaxComputeUnits
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for maxComputeUnits- Returns:
- A modified copy of the
this
object
-
withMaxWorkItemDimensions
Copy the current immutable object by setting a value for themaxWorkItemDimensions
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for maxWorkItemDimensions- Returns:
- A modified copy of the
this
object
-
withMaxWorkGroupSize
Copy the current immutable object by setting a value for themaxWorkGroupSize
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for maxWorkGroupSize- Returns:
- A modified copy of the
this
object
-
withMaxWorkItemSizes
Copy the current immutable object with elements that replace the content ofmaxWorkItemSizes
. The array is cloned before being saved as attribute values.- Parameters:
elements
- The non-null elements for maxWorkItemSizes- Returns:
- A modified copy of
this
object
-
withImageSupport
Copy the current immutable object by setting a value for theimageSupport
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for imageSupport- Returns:
- A modified copy of the
this
object
-
withPreferredVectorWidthFloat
Copy the current immutable object by setting a value for thepreferredVectorWidthFloat
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for preferredVectorWidthFloat- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutableDevice
that have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:deviceId
,name
,vendor
,deviceVersion
,driverVersion
,maxClockFrequency
,deviceType
,builtInKernels
,maxComputeUnits
,maxWorkItemDimensions
,maxWorkGroupSize
,maxWorkItemSizes
,imageSupport
,preferredVectorWidthFloat
. -
toString
Prints the immutable valueDevice
with attribute values. -
copyOf
Creates an immutable copy of aDevice
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 Device instance
-
builder
Creates a builder forImmutableDevice
.ImmutableDevice.builder() .deviceId(org.jocl.cl_device_id) // required
deviceId
.name(String) // requiredname
.vendor(String) // requiredvendor
.deviceVersion(String) // requireddeviceVersion
.driverVersion(String) // requireddriverVersion
.maxClockFrequency(int) // requiredmaxClockFrequency
.addDeviceType|addAllDeviceType(net.bmahe.genetics4j.gpu.opencl.model.DeviceType) //deviceType
elements .addBuiltInKernels|addAllBuiltInKernels(String) //builtInKernels
elements .maxComputeUnits(int) // requiredmaxComputeUnits
.maxWorkItemDimensions(int) // requiredmaxWorkItemDimensions
.maxWorkGroupSize(long) // requiredmaxWorkGroupSize
.maxWorkItemSizes(long) // requiredmaxWorkItemSizes
.imageSupport(boolean) // requiredimageSupport
.preferredVectorWidthFloat(int) // requiredpreferredVectorWidthFloat
.build();- Returns:
- A new ImmutableDevice builder
-
createSafeList
-
createUnmodifiableSet
Unmodifiable set constructed from list to avoid rehashing. -
createUnmodifiableEnumSet
-