Serializable
, Comparable<VectorShape>
, Constable
public enum VectorShape extends Enum<VectorShape>
VectorShape
selects a particular implementation of Vector
s. A shape in combination with the element type determines a particular vector species object.VectorShape.preferredShape()
and VectorSpecies.ofPreferred()
to select the shape that is usually preferable for most uses.Enum.EnumDesc<E extends Enum<E>>
Enum Constant | Description |
---|---|
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_64_BIT |
Shape of length 64 bits |
S_Max_BIT |
Shape of maximum length supported on the platform |
Modifier and Type | Method | Description |
---|---|---|
static VectorShape |
forBitSize |
Finds an appropriate shape depending on the proposed bit-size of a vector. |
static VectorShape |
forIndexBitSize |
Finds an appropriate index shape depending on the proposed index-bit-size and element-size of a vector. |
static VectorShape |
preferredShape() |
Finds the vector shape preferred by the current platform for all vector element types. |
static VectorShape |
valueOf |
Returns 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. |
int |
vectorBitSize() |
Returns the size, in bits, of vectors of this shape. |
<E> VectorSpecies |
withLanes |
Finds a vector species with the given element type and the current shape. |
public static final VectorShape S_64_BIT
public static final VectorShape S_128_BIT
public static final VectorShape S_256_BIT
public static final VectorShape S_512_BIT
public static final VectorShape S_Max_BIT
public static VectorShape[] values()
public static VectorShape valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is nullpublic int vectorBitSize()
public <E> VectorSpecies<E> withLanes(Class<E> elementType)
VectorSpecies.of(elementType, this)
.E
- the boxed element typeelementType
- the required element typepublic static VectorShape forBitSize(int bitSize)
bitSize
- the proposed vector size in bitsIllegalArgumentException
- if no such vector shape existspublic static VectorShape forIndexBitSize(int indexBitSize, int elementSize)
indexBitSize
- the proposed index vector size in bitselementSize
- the proposed element size in bitsIllegalArgumentException
- if no such vector shape existspublic static VectorShape preferredShape()
The preferred shape by the platform has the largest possible bit-size, under the constraint that all lane sizes are supported, from byte
to double
. Thus, all the preferred vector species for various lane types will have a common underlying shape.
UnsupportedOperationException
- if no such shape exists
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/jdk.incubator.vector/jdk/incubator/vector/VectorShape.html