.. default-domain:: chpl .. module:: Vector Vector ====== **Usage** .. code-block:: chapel use Vector; or .. code-block:: chapel import Vector; **Submodules** .. toctree:: :maxdepth: 1 :glob: Vector/* .. function:: proc numBits(type t) param: int where isSubtype(t, vector) .. function:: proc min(type t): t where isSubtype(t, vector) .. function:: proc max(type t): t where isSubtype(t, vector) .. record:: vector : writeSerializable .. attribute:: type eltType .. attribute:: param numElts: int .. attribute:: var data: Intrin.vectorType(eltType, numElts) .. method:: proc init(type eltType, param numElts: int) type init .. method:: proc init(type eltType, param numElts: int, value: ?valEltType) where isCoercible(valEltType, eltType) init to single value .. method:: proc init(param numElts: int, value: ?eltType) init to single value, infer type .. method:: proc init(value: vector(?eltType, ?numElts)) .. method:: proc init(type eltType, param numElts: int, value: vector(eltType, numElts)) .. method:: proc init=(value: vector(?)) .. method:: operator = (ref lhs: vector(?), rhs: lhs.type) .. method:: proc ref set(value: vector(eltType, numElts)) .. method:: proc init(type eltType, param numElts: int, values: numElts*?tupEltType) where isCoercible(tupEltType, eltType) .. method:: proc init(values) where isHomogeneousTupleType(values.type) .. method:: proc init=(values) where isHomogeneousTupleType(values.type) .. method:: operator = (ref lhs, rhs) where isSubtype(lhs.type, vector) && isHomogeneousTupleType(rhs.type) && isCoercible(rhs(0).type, lhs.eltType) && lhs.numElts == rhs.size .. method:: operator :(x: ?tupType, type t: vector(?)) where isHomogeneousTupleType(tupType) && isCoercible(x(0).type, t.eltType) && x.size == t.numElts .. method:: operator :(x: ?eltType, type t: vector(?)) where isCoercible(eltType, t.eltType) .. method:: operator :(x: vector(?eltType, ?numElts), type tupType) where isHomogeneousTupleType(tupType) && isCoercible(eltType, tupType(0)) && tupType.size == numElts .. method:: proc toTuple(): numElts*eltType .. method:: proc type toTuple() type .. method:: proc ref set(value) where isCoercible(value.type, eltType) .. method:: proc ref set(values) where isHomogeneousTupleType(values.type) && isCoercible(values(0).type, eltType) && values.size == numElts .. method:: proc ref set(param idx: integral, value) where isCoercible(value.type, eltType) .. method:: proc this(param idx: integral): eltType .. itermethod:: iter these(): eltType .. method:: proc ref load(ptr: c_ptrConst(eltType), idx: integral = 0, param aligned: bool = false) .. method:: proc ref load(container: ?, idx: integral = 0, param aligned: bool = false) where isValidContainer(container, eltType) .. method:: proc store(ptr: c_ptr(eltType), idx: integral = 0, param aligned: bool = false) .. method:: proc store(ref container: ?, idx: integral = 0, param aligned: bool = false) where isValidContainerForStore(container, eltType) .. method:: proc type load(container: ?, idx: integral = 0, param aligned: bool = false): this .. method:: proc type loadMasked(mask: vector(?), container: ?, idx: integral = 0): this loadMasked is not bounds checked .. method:: proc ref loadMasked(mask: vector(?), ptr: c_ptrConst(eltType), idx: integral = 0) where this.type.isValidLoadMask(mask.type) loadMasked is not bounds checked .. method:: proc ref loadMasked(mask: vector(?), container: ?, idx: integral = 0) where this.type.isValidLoadMask(mask.type) && isValidContainer(container, eltType) loadMasked is not bounds checked .. method:: proc type indexVectorType type .. method:: proc type gather(container: ?, startIdx: integral, indexVector: this.indexVectorType, param scale: int = 0, mask: ? = none): this gather is not bounds checked .. method:: proc ref gather(ptr: c_ptrConst(eltType), startIdx: integral, indexVector: this.type.indexVectorType, param scale: int = 0, mask: ? = none) where mask.type == nothing || this.type.isValidLoadMask(mask.type, onlyInts = false) gather is not bounds checked .. method:: proc ref gather(arr: [] eltType, startIdx: integral, indexVector: this.type.indexVectorType, param scale: int = 0, mask: ? = none) where (mask.type == nothing || this.type.isValidLoadMask(mask.type, onlyInts = false)) && isValidContainer(arr, eltType) gather is not bounds checked .. method:: proc ref gather(tup, startIdx: integral, indexVector: this.type.indexVectorType, param scale: int = 0, mask: ? = none) where (mask.type == nothing || this.type.isValidLoadMask(mask.type, onlyInts = false)) && isValidContainer(tup, eltType) && isHomogeneousTuple(tup) gather is not bounds checked .. method:: proc transmute(type t): t where isSubtype(t, vector) && numBits(t) == numBits(this.type) .. method:: proc transmute(type t): t where !isSubtype(t, vector) .. method:: proc transmute(type t): t where isSubtype(t, vector) && numBits(t) != numBits(this.type) .. method:: proc convert(type t): t where isSubtype(t, vector) && numBits(t) == numBits(this.type) .. method:: proc type indices(rng: range(?)): range(strides = strideKind.positive) .. method:: proc type indices(dom: domain(?)): domain(?) .. method:: proc type indices(container: ?): range(strides = strideKind.positive) where isHomogeneousTuple(container) .. method:: proc type indices(container: ?): domain(?) where isArray(container) .. itermethod:: iter type vectors(container: ?, param aligned: bool = false): this where isValidContainer(container, eltType) .. itermethod:: iter type vectors(param tag: iterKind, container: ?, param aligned: bool = false): this where tag == iterKind.standalone && __primitive("resolves", indices(container).these(tag = tag)) && isValidContainer(container, eltType) .. itermethod:: iter type vectors(param tag: iterKind, container: ?, param aligned: bool = false) where tag == iterKind.leader && isValidContainer(container, eltType) .. itermethod:: iter type vectors(param tag: iterKind, followThis, container: ?, param aligned: bool = false): this where tag == iterKind.follower && isValidContainer(container, eltType) .. itermethod:: iter type vectorsRef(ref container: ?, param aligned: bool = false) ref: vectorRef(?) where isValidContainer(container, eltType) .. itermethod:: iter type vectorsRef(param tag: iterKind, ref container: ?, param aligned: bool = false) ref: vectorRef(?) where tag == iterKind.standalone && __primitive("resolves", indices(container).these(tag = tag)) && isValidContainer(container, eltType) .. itermethod:: iter type vectorsRef(param tag: iterKind, ref container: ?, param aligned: bool = false) where tag == iterKind.leader && isValidContainer(container, eltType) .. itermethod:: iter type vectorsRef(param tag: iterKind, followThis, ref container: ?, param aligned: bool = false) ref: vectorRef(?) where tag == iterKind.follower && isValidContainer(container, eltType) .. itermethod:: iter type vectorsJagged(arr: ?, pad: eltType = 0, param aligned: bool = false): this .. method:: proc serialize(writer, ref serializer) throws .. function:: proc swapPairs(x: vector(?eltType, ?numElts)): x.type .. function:: proc swapLowHigh(x: vector(?eltType, ?numElts)): x.type .. function:: proc reverse(x: vector(?eltType, ?numElts)): x.type .. function:: proc rotateLeft(x: vector(?eltType, ?numElts)): x.type .. function:: proc rotateRight(x: vector(?eltType, ?numElts)): x.type .. function:: proc interleaveLower(x: vector(?eltType, ?numElts), y: x.type): x.type .. function:: proc interleaveUpper(x: vector(?eltType, ?numElts), y: x.type): x.type .. function:: proc deinterleaveLower(x: vector(?eltType, ?numElts), y: x.type): x.type .. function:: proc deinterleaveUpper(x: vector(?eltType, ?numElts), y: x.type): x.type .. function:: proc pairwiseAdd(x: vector(?eltType, ?numElts), y: x.type): x.type pairwise add adjacent elements x: [a, b, c, d] y: [e, f, g, h] returns: [a+b, e+f, c+d, g+h] .. function:: proc blendLowHigh(x: vector(?eltType, ?numElts), y: x.type): x.type takes the low half of x and the high half of y .. method:: proc vector.isZero(): bool .. method:: proc vector.moveMask(): c_int .. method:: proc type vector.ones(): this .. method:: proc type vector.zeros(): this .. method:: proc vector.shiftLeft(param amount: int): this.type Shift each lane left by the given amount, shifting in zeros. .. method:: proc vector.shiftLeft(amount: this.type): this.type .. method:: proc vector.shiftRight(param amount: int): this.type Shift each lane right by the given amount, shifting in zeros. .. method:: proc vector.shiftRight(amount: this.type): this.type .. method:: proc vector.shiftRightArith(param amount: int): this.type Shift each lane right by the given amount, shifting in sign bits. .. method:: proc vector.shiftRightArith(amount: this.type): this.type .. function:: proc sqrt(x: vector(?eltType, ?numElts)): x.type .. function:: proc rsqrt(x: vector(?eltType, ?numElts)): x.type .. function:: proc fma(x: vector(?eltType, ?numElts), y: x.type, z: x.type): x.type .. function:: proc fms(x: vector(?eltType, ?numElts), y: x.type, z: x.type): x.type .. function:: proc bitSelect(mask: vector(?), x: vector(?eltType, ?numElts), y: x.type): x.type where numBits(mask.type) == numBits(x.type) .. function:: proc andNot(x: vector(?eltType, ?numElts), y: x.type): x.type .. function:: proc andNot(x: vector(?eltType, ?numElts), y: ?scalarType): x.type where isCoercible(scalarType, eltType) .. function:: proc andNot(x: ?scalarType, y: vector(?eltType, ?numElts)): y.type where isCoercible(scalarType, eltType) .. function:: proc min(x: vector(?eltType, ?numElts), y: x.type): x.type .. function:: proc max(x: vector(?eltType, ?numElts), y: x.type): x.type .. function:: proc abs(x: vector(?eltType, ?numElts)): x.type .. function:: proc sin(x: vector(?eltType, ?numElts)): x.type .. function:: proc cos(x: vector(?eltType, ?numElts)): x.type .. function:: proc tan(x: vector(?eltType, ?numElts)): x.type .. function:: proc asin(x: vector(?eltType, ?numElts)): x.type .. function:: proc acos(x: vector(?eltType, ?numElts)): x.type .. function:: proc atan(x: vector(?eltType, ?numElts)): x.type