.. default-domain:: chpl .. module:: CVL CVL === **Usage** .. code-block:: chapel use CVL; or .. code-block:: chapel import CVL; .. data:: config param implementationWarnings = true .. function:: proc numBits(type t) param: int 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: eltType) init to single value .. method:: proc init(param numElts: int, value: ?eltType) init to single value, infer type .. 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(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:: operator +(x: vector(?eltType, ?numElts), y: x.type): x.type VECTOR + VECTOR .. method:: operator +=(ref x: vector(?eltType, ?numElts), y: x.type) .. method:: operator +(x: vector(?eltType, ?numElts), y: ?scalarType): x.type where isCoercible(scalarType, eltType) VECTOR + SCALAR .. method:: operator +=(ref x: vector(?eltType, ?numElts), y: ?scalarType) where isCoercible(scalarType, eltType) .. method:: operator +(x: ?scalarType, y: vector(?eltType, ?numElts)): y.type where isCoercible(scalarType, eltType) SCALAR + VECTOR .. method:: operator -(x: vector(?eltType, ?numElts), y: x.type): x.type VECTOR - VECTOR .. method:: operator -=(ref x: vector(?eltType, ?numElts), y: x.type) .. method:: operator -(x: vector(?eltType, ?numElts), y: ?scalarType): x.type where isCoercible(scalarType, eltType) VECTOR - SCALAR .. method:: operator -=(ref x: vector(?eltType, ?numElts), y: ?scalarType) where isCoercible(scalarType, eltType) .. method:: operator -(x: ?scalarType, y: vector(?eltType, ?numElts)): y.type where isCoercible(scalarType, eltType) SCALAR - VECTOR .. method:: operator -(x: vector(?eltType, ?numElts)): x.type .. method:: operator *(x: vector(?eltType, ?numElts), y: x.type): x.type VECTOR * VECTOR .. method:: operator *=(ref x: vector(?eltType, ?numElts), y: x.type) .. method:: operator *(x: vector(?eltType, ?numElts), y: ?scalarType): x.type where isCoercible(scalarType, eltType) VECTOR * SCALAR .. method:: operator *=(ref x: vector(?eltType, ?numElts), y: ?scalarType) where isCoercible(scalarType, eltType) .. method:: operator *(x: ?scalarType, y: vector(?eltType, ?numElts)): y.type where isCoercible(scalarType, eltType) SCALAR * VECTOR .. method:: operator /(x: vector(?eltType, ?numElts), y: x.type): x.type VECTOR / VECTOR .. method:: operator /=(ref x: vector(?eltType, ?numElts), y: x.type) .. method:: operator /(x: vector(?eltType, ?numElts), y: ?scalarType): x.type where isCoercible(scalarType, eltType) VECTOR / SCALAR .. method:: operator /=(ref x: vector(?eltType, ?numElts), y: ?scalarType) where isCoercible(scalarType, eltType) .. method:: operator /(x: ?scalarType, y: vector(?eltType, ?numElts)): y.type where isCoercible(scalarType, eltType) SCALAR / VECTOR .. method:: operator &(x: vector(?eltType, ?numElts), y: x.type): x.type VECTOR & VECTOR .. method:: operator &=(ref x: vector(?eltType, ?numElts), y: x.type) .. method:: operator &(x: vector(?eltType, ?numElts), y: ?scalarType): x.type where isCoercible(scalarType, eltType) VECTOR & SCALAR .. method:: operator &=(ref x: vector(?eltType, ?numElts), y: ?scalarType) where isCoercible(scalarType, eltType) .. method:: operator &(x: ?scalarType, y: vector(?eltType, ?numElts)): y.type where isCoercible(scalarType, eltType) SCALAR & VECTOR .. method:: operator |(x: vector(?eltType, ?numElts), y: x.type): x.type VECTOR | VECTOR .. method:: operator |=(ref x: vector(?eltType, ?numElts), y: x.type) .. method:: operator |(x: vector(?eltType, ?numElts), y: ?scalarType): x.type where isCoercible(scalarType, eltType) VECTOR | SCALAR .. method:: operator |=(ref x: vector(?eltType, ?numElts), y: ?scalarType) where isCoercible(scalarType, eltType) .. method:: operator |(x: ?scalarType, y: vector(?eltType, ?numElts)): y.type where isCoercible(scalarType, eltType) SCALAR | VECTOR .. method:: operator ^(x: vector(?eltType, ?numElts), y: x.type): x.type VECTOR ^ VECTOR .. method:: operator ^=(ref x: vector(?eltType, ?numElts), y: x.type) .. method:: operator ^(x: vector(?eltType, ?numElts), y: ?scalarType): x.type where isCoercible(scalarType, eltType) VECTOR ^ SCALAR .. method:: operator ^=(ref x: vector(?eltType, ?numElts), y: ?scalarType) where isCoercible(scalarType, eltType) .. method:: operator ^(x: ?scalarType, y: vector(?eltType, ?numElts)): y.type where isCoercible(scalarType, eltType) SCALAR ^ VECTOR .. method:: operator ~(x: vector(?eltType, ?numElts)): x.type ~VECTOR .. method:: operator ==(x: vector(?eltType, ?numElts), y: x.type): x.type VECTOR == VECTOR .. method:: operator ==(x: vector(?eltType, ?), y: ?scalarType): x.type where isCoercible(scalarType, eltType) VECTOR == SCALAR .. method:: operator ==(x: ?scalarType, y: vector(?eltType, ?)): y.type where isCoercible(scalarType, eltType) SCALAR == VECTOR .. method:: operator !=(x: vector(?eltType, ?numElts), y: x.type): x.type VECTOR != VECTOR .. method:: operator !=(x: vector(?eltType, ?), y: ?scalarType): x.type where isCoercible(scalarType, eltType) VECTOR != SCALAR .. method:: operator !=(x: ?scalarType, y: vector(?eltType, ?)): y.type where isCoercible(scalarType, eltType) SCALAR != VECTOR .. method:: operator <(x: vector(?eltType, ?numElts), y: x.type): x.type VECTOR < VECTOR .. method:: operator <(x: vector(?eltType, ?), y: ?scalarType): x.type where isCoercible(scalarType, eltType) VECTOR < SCALAR .. method:: operator <(x: ?scalarType, y: vector(?eltType, ?)): y.type where isCoercible(scalarType, eltType) SCALAR < VECTOR .. method:: operator <=(x: vector(?eltType, ?numElts), y: x.type): x.type VECTOR <= VECTOR .. method:: operator <=(x: vector(?eltType, ?), y: ?scalarType): x.type where isCoercible(scalarType, eltType) VECTOR <= SCALAR .. method:: operator <=(x: ?scalarType, y: vector(?eltType, ?)): y.type where isCoercible(scalarType, eltType) SCALAR <= VECTOR .. method:: operator >(x: vector(?eltType, ?numElts), y: x.type): x.type VECTOR > VECTOR .. method:: operator >(x: vector(?eltType, ?), y: ?scalarType): x.type where isCoercible(scalarType, eltType) VECTOR > SCALAR .. method:: operator >(x: ?scalarType, y: vector(?eltType, ?)): y.type where isCoercible(scalarType, eltType) SCALAR > VECTOR .. method:: operator >=(x: vector(?eltType, ?numElts), y: x.type): x.type VECTOR >= VECTOR .. method:: operator >=(x: vector(?eltType, ?), y: ?scalarType): x.type where isCoercible(scalarType, eltType) VECTOR >= SCALAR .. method:: operator >=(x: ?scalarType, y: vector(?eltType, ?)): y.type where isCoercible(scalarType, eltType) SCALAR >= VECTOR .. 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(arr: [] eltType, idx: integral = 0, param aligned: bool = false) where isValidContainer(arr, eltType) .. method:: proc ref load(tup, idx: integral = 0, param aligned: bool = false) where isValidContainer(tup, eltType) && isHomogeneousTuple(tup) .. method:: proc store(ptr: c_ptr(eltType), idx: integral = 0, param aligned: bool = false) .. method:: proc store(ref arr: [] eltType, idx: integral = 0, param aligned: bool = false) where isValidContainer(arr, eltType) .. method:: proc store(ref tup, idx: integral = 0, param aligned: bool = false) where isValidContainer(tup, eltType) && isHomogeneousTuple(tup) .. 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(?), arr: [] eltType, idx: integral = 0) where this.type.isValidLoadMask(mask.type) && isValidContainer(arr, eltType) loadMasked is not bounds checked .. method:: proc ref loadMasked(mask: vector(?), tup, idx: integral = 0) where this.type.isValidLoadMask(mask.type) && isValidContainer(tup, eltType) && isHomogeneousTuple(tup) loadMasked is not bounds checked .. 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 type indices(rng: range(?)): range(?) .. method:: proc type indices(dom: domain(?)): domain(?) .. method:: proc type indices(container: ?): range(?) 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 && isValidContainer(container, eltType) .. itermethod:: iter type vectors(param tag: iterKind, container: ?, param aligned: bool = false): this 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: this where isValidContainer(container, eltType) .. itermethod:: iter type vectorsRef(param tag: iterKind, ref container: ?, param aligned: bool = false) ref: this where tag == iterKind.standalone && isValidContainer(container, eltType) .. itermethod:: iter type vectorsRef(param tag: iterKind, ref container: ?, param aligned: bool = false) ref: this where tag == iterKind.leader && isValidContainer(container, eltType) .. itermethod:: iter type vectorsRef(param tag: iterKind, followThis, ref container: ?, param aligned: bool = false) ref: this 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 .. 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 .. record:: vectorRef : writeSerializable a transparent record that iterators can yield, takes in modifications to the yielded vector and then writes them back out to the raw address when this goes out of scope .. attribute:: type vectorType .. attribute:: param aligned: bool .. attribute:: var vec: vectorType .. attribute:: var address: c_ptr(vectorType.eltType) .. method:: proc init(type vectorType, param aligned: bool = false) .. method:: proc init(vec: ?vecType, address: c_ptr(vecType.eltType), param aligned: bool = false) .. method:: proc init(type vectorType, address: c_ptr(vectorType.eltType), param aligned: bool = false) .. method:: proc deinit() .. method:: proc commitChanges() .. method:: proc serialize(writer, ref serializer) throws .. method:: operator +(lhs: ?lhsType, rhs: ?rhsType): returnTypeForOpTypes(lhsType, rhsType) where returnTypeForOpTypes(lhsType, rhsType) != nothing .. method:: operator +=(ref lhs: vectorRef(?), rhs: ?rhsType) where validEqOperatorTypes(lhs.type, rhsType) .. method:: operator -(lhs: ?lhsType, rhs: ?rhsType): returnTypeForOpTypes(lhsType, rhsType) where returnTypeForOpTypes(lhsType, rhsType) != nothing .. method:: operator -=(ref lhs: vectorRef(?), rhs: ?rhsType) where validEqOperatorTypes(lhs.type, rhsType) .. method:: operator *(lhs: ?lhsType, rhs: ?rhsType): returnTypeForOpTypes(lhsType, rhsType) where returnTypeForOpTypes(lhsType, rhsType) != nothing .. method:: operator *=(ref lhs: vectorRef(?), rhs: ?rhsType) where validEqOperatorTypes(lhs.type, rhsType) .. function:: proc validEqOperatorTypes(type lhsType, type rhsType) param: bool