Enum Class VectorShape
- All Implemented Interfaces:
Serializable, Comparable<VectorShape>, Constable
A
VectorShape selects a particular implementation of
Vectors.
A shape in combination with the element type determines
a particular
vector species
object.- API Note:
- Because not all shapes are supported by all platforms,
shape-agnostic code is more portable.
User code that selects particular shapes may
fail to run, or run slowly, on some platforms.
Use
VectorShape.preferredShape()andVectorSpecies.ofPreferred()to select the shape that is usually preferable for most uses.
-
Nested Class Summary
Nested classes/interfaces declared in class Enum
Enum.EnumDesc<E>Modifier and TypeClassDescriptionstatic final classEnum.EnumDesc<E extends Enum<E>>A nominal descriptor for anenumconstant. -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic VectorShapeforBitSize(int bitSize) Finds an appropriate shape depending on the proposed bit-size of a vector.static VectorShapeforIndexBitSize(int indexBitSize, int elementSize) Finds an appropriate index shape depending on the proposed index-bit-size and element-size of a vector.static VectorShapelargestShapeFor(Class<?> etype) Finds the largest vector shape supported by the current platform for the element typeetype.static VectorShapeFinds the vector shape preferred by the current platform for all vector element types.static VectorShapeReturns the enum constant of this class with the specified name.static VectorShape[]values()Returns an array containing the constants of this enum class, in the order they are declared.intReturns the size, in bits, of vectors of this shape.<E> VectorSpecies<E> Finds a vector species with the given element type and the current shape.Methods declared in class Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfModifier and TypeMethodDescriptionprotected final Objectclone()Throws CloneNotSupportedException.final intCompares this enum with the specified object for order.final Optional<Enum.EnumDesc<VectorShape>> Returns an enum descriptorEnumDescfor this instance, if one can be constructed, or an emptyOptionalif one cannot be.final booleanReturns true if the specified object is equal to this enum constant.protected final voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.Finalization has been deprecated for removal.final Class<VectorShape> Returns the Class object corresponding to this enum constant's enum type.final inthashCode()Returns a hash code for this enum constant.final Stringname()Returns the name of this enum constant, exactly as declared in its enum declaration.final intordinal()Returns the ordinal of this enumeration constant (its position in its enum declaration, where the initial constant is assigned an ordinal of zero).toString()Returns the name of this enum constant, as contained in the declaration.static <T extends Enum<T>>
TReturns the enum constant of the specified enum class with the specified name.Methods declared in class Object
getClass, notify, notifyAll, wait, wait, waitModifier and TypeMethodDescriptionfinal Class<?> getClass()Returns the runtime class of thisObject.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.final voidwait()Causes the current thread to wait until it is awakened, typically by being notified or interrupted.final voidwait(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.final voidwait(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Enum Constant Details
-
S_64_BIT
Shape of length 64 bits -
S_128_BIT
Shape of length 128 bits -
S_256_BIT
Shape of length 256 bits -
S_512_BIT
Shape of length 512 bits -
S_Max_BIT
Shape of maximum length supported on the platform
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
vectorBitSize
public int vectorBitSize()Returns the size, in bits, of vectors of this shape.- Returns:
- the size, in bits, of vectors of this shape.
-
withLanes
Finds a vector species with the given element type and the current shape. Returns the same value asVectorSpecies.of(elementType, this).- Type Parameters:
E- the boxed element type- Parameters:
elementType- the required element type- Returns:
- a species for the given element type and this shape
- See Also:
-
forBitSize
Finds an appropriate shape depending on the proposed bit-size of a vector.- Parameters:
bitSize- the proposed vector size in bits- Returns:
- a shape corresponding to the vector bit-size
- Throws:
IllegalArgumentException- if no such vector shape exists- See Also:
-
forIndexBitSize
Finds an appropriate index shape depending on the proposed index-bit-size and element-size of a vector.- Parameters:
indexBitSize- the proposed index vector size in bitselementSize- the proposed element size in bits- Returns:
- a shape corresponding to the index vector bit-size and element size.
- Throws:
IllegalArgumentException- if no such vector shape exists- See Also:
-
largestShapeFor
Finds the largest vector shape supported by the current platform for the element typeetype.- Parameters:
etype- the element type- Returns:
- the largest vector shape supported by the platform
for
etype - Throws:
IllegalArgumentException- if no such vector shape exists for the element type or the type is not a validETYPE.
-
preferredShape
Finds the vector shape preferred by the current platform for all vector element types.The preferred shape by the platform has the largest possible bit-size, under the constraint that all lane sizes are supported, from
bytetodouble. Thus, all the preferred vector species for various lane types will have a common underlying shape.- Returns:
- a preferred shape for all element types
- Throws:
UnsupportedOperationException- if no such shape exists- See Also:
-