< prev index next >
src/jdk.incubator.vector/share/classes/jdk/incubator/vector/package-info.java
Print this page
rev 54660 : Javadoc changes
*** 61,85 ****
* The combination of element type and shape determines a <em>vector species</em>,
* represented by {@link jdk.incubator.vector.Vector.Species}. The various typed
* vector classes expose static constants corresponding to the supported species,
* and static methods on these types generally take a species as a parameter.
* For example,
! * {@link jdk.incubator.vector.FloatVector#fromArray(Species<Float>, float[], int) FloatVector.fromArray()}
* creates and returns a float vector of the specified species, with elements
* loaded from the specified float array.
*
* <p>
* The species instance for a specific combination of element type and shape
* can be obtained by reading the appropriate static field, as follows:
* <p>
! * {@code Vector.Species<Float> s = FloatVector.SPECIES_256;
* <p>
*
* Code that is agnostic to species can request the "preferred" species for a
* given element type, where the optimal size is selected for the current platform:
* <p>
! * {@code Vector.Species<Float> s = FloatVector.SPECIES_PREFERRED;
* <p>
*
* <p>
* Here is an example of multiplying elements of two float arrays {@code a and b} using vector computation
* and storing result in array {@code c}.
--- 61,85 ----
* The combination of element type and shape determines a <em>vector species</em>,
* represented by {@link jdk.incubator.vector.Vector.Species}. The various typed
* vector classes expose static constants corresponding to the supported species,
* and static methods on these types generally take a species as a parameter.
* For example,
! * {@link jdk.incubator.vector.FloatVector#fromArray(Vector.Species, float[], int) FloatVector.fromArray()}
* creates and returns a float vector of the specified species, with elements
* loaded from the specified float array.
*
* <p>
* The species instance for a specific combination of element type and shape
* can be obtained by reading the appropriate static field, as follows:
* <p>
! * {@code Vector.Species<Float> s = FloatVector.SPECIES_256};
* <p>
*
* Code that is agnostic to species can request the "preferred" species for a
* given element type, where the optimal size is selected for the current platform:
* <p>
! * {@code Vector.Species<Float> s = FloatVector.SPECIES_PREFERRED};
* <p>
*
* <p>
* Here is an example of multiplying elements of two float arrays {@code a and b} using vector computation
* and storing result in array {@code c}.
*** 119,129 ****
* type {@code Float} and shape {@code Shape.S_256_BIT} has eight lanes.
* Vector operations can be grouped into various categories and their behavior
* generally specified as follows:
* <ul>
* <li>
! * A vector unary operation operates on one input vector to produce a
* result vector.
* For each lane of the input vector the
* lane element is operated on using the specified scalar unary operation and
* the element result is placed into the vector result at the same lane.
* The following pseudocode expresses the behavior of this operation category,
--- 119,129 ----
* type {@code Float} and shape {@code Shape.S_256_BIT} has eight lanes.
* Vector operations can be grouped into various categories and their behavior
* generally specified as follows:
* <ul>
* <li>
! * A lane-wise unary operation operates on one input vector and produce a
* result vector.
* For each lane of the input vector the
* lane element is operated on using the specified scalar unary operation and
* the element result is placed into the vector result at the same lane.
* The following pseudocode expresses the behavior of this operation category,
*** 141,151 ****
*
* Unless otherwise specified the input and result vectors will have the same
* element type and shape.
*
* <li>
! * A vector binary operation operates on two input
* vectors to produce a result vector.
* For each lane of the two input vectors,
* a and b say, the corresponding lane elements from a and b are operated on
* using the specified scalar binary operation and the element result is placed
* into the vector result at the same lane.
--- 141,151 ----
*
* Unless otherwise specified the input and result vectors will have the same
* element type and shape.
*
* <li>
! * A lane-wise binary operation operates on two input
* vectors to produce a result vector.
* For each lane of the two input vectors,
* a and b say, the corresponding lane elements from a and b are operated on
* using the specified scalar binary operation and the element result is placed
* into the vector result at the same lane.
*** 163,173 ****
*
* Unless otherwise specified the two input and result vectors will have the
* same element type and shape.
*
* <li>
! * Generalizing from unary and binary operations, a vector n-ary
* operation operates on n input vectors to produce a
* result vector.
* N lane elements from each input vector are operated on
* using the specified n-ary scalar operation and the element result is placed
* into the vector result at the same lane.
--- 163,173 ----
*
* Unless otherwise specified the two input and result vectors will have the
* same element type and shape.
*
* <li>
! * Generalizing from unary and binary operations, a lane-wise n-ary
* operation operates on n input vectors to produce a
* result vector.
* N lane elements from each input vector are operated on
* using the specified n-ary scalar operation and the element result is placed
* into the vector result at the same lane.
*** 195,205 ****
*
* Unless otherwise specified the scalar result type and element type will be
* the same.
*
* <li>
! * A vector binary test operation operates on two input vectors to produce a
* result mask. For each lane of the two input vectors, a and b say, the
* the corresponding lane elements from a and b are operated on using the
* specified scalar binary test operation and the boolean result is placed
* into the mask at the same lane.
* The following pseudocode expresses the behavior of this operation category:
--- 195,205 ----
*
* Unless otherwise specified the scalar result type and element type will be
* the same.
*
* <li>
! * A lane-wise binary test operation operates on two input vectors to produce a
* result mask. For each lane of the two input vectors, a and b say, the
* the corresponding lane elements from a and b are operated on using the
* specified scalar binary test operation and the boolean result is placed
* into the mask at the same lane.
* The following pseudocode expresses the behavior of this operation category:
*** 208,218 ****
* EVector b = ...;
* boolean[] ar = new boolean[a.length()];
* for (int i = 0; i < a.length(); i++) {
* ar[i] = scalar_binary_test_op(a.get(i), b.get(i));
* }
! * Mask<E> r = EVector.maskFromArray(a.species(), ar, 0);
* }</pre>
*
* Unless otherwise specified the two input vectors and result mask will have
* the same element type and shape.
*
--- 208,218 ----
* EVector b = ...;
* boolean[] ar = new boolean[a.length()];
* for (int i = 0; i < a.length(); i++) {
* ar[i] = scalar_binary_test_op(a.get(i), b.get(i));
* }
! * Mask<E> r = Mask.fromArray(a.species(), ar, 0);
* }</pre>
*
* Unless otherwise specified the two input vectors and result mask will have
* the same element type and shape.
*
*** 227,239 ****
* controlled by a {@link jdk.incubator.vector.Vector.Shuffle}) or by blending (commonly controlled by a
* {@link jdk.incubator.vector.Vector.Mask}). Such an operation explicitly specifies how it rearranges lane
* elements.
* </ul>
*
- * Some vector operations are specified as instance methods (such as adding
- * one vector to another); others are specified as static methods (such as
- * loading vector values from an array.)
* <p>
* If a vector operation does not belong to one of the above categories then
* the operation explicitly specifies how it processes the lane elements of
* input vectors, and where appropriate expresses the behavior using
* pseudocode.
--- 227,236 ----
*** 247,269 ****
* <p>
* For certain operation categories the mask accepting variants can be specified
* in generic terms. If a lane of the mask is set then the scalar operation is
* applied to corresponding lane elements, otherwise if a lane of a mask is not
* set then a default scalar operation is applied and its result is placed into
! * the vector result at the same lane. The default operation is specified for
! * the following operation categories:
* <ul>
* <li>
! * For a vector n-ary operation the default operation is a function that returns
! * it's first argument, specifically a lane element of the first input vector.
* <li>
* For an associative vector reduction operation the default operation is a
* function that returns the identity value.
* <li>
! * For vector binary test operation the default operation is a function that
* returns false.
! *</ul>
* Otherwise, the mask accepting variant of the operation explicitly specifies
* how it processes the lane elements of input vectors, and where appropriate
* expresses the behavior using pseudocode.
*
* <p>
--- 244,265 ----
* <p>
* For certain operation categories the mask accepting variants can be specified
* in generic terms. If a lane of the mask is set then the scalar operation is
* applied to corresponding lane elements, otherwise if a lane of a mask is not
* set then a default scalar operation is applied and its result is placed into
! * the vector result at the same lane. The default operation is specified as follows:
* <ul>
* <li>
! * For a lane-wise n-ary operation the default operation is a function that returns
! * it's first argument, specifically the lane element of the first input vector.
* <li>
* For an associative vector reduction operation the default operation is a
* function that returns the identity value.
* <li>
! * For lane-wise binary test operation the default operation is a function that
* returns false.
! * </ul>
* Otherwise, the mask accepting variant of the operation explicitly specifies
* how it processes the lane elements of input vectors, and where appropriate
* expresses the behavior using pseudocode.
*
* <p>
< prev index next >