Skip to main content

simd

Standard library Module View source
class Vec
@tuple
class Vec[T, N]
Fields 2
T type
N Literal[int]
Constructors 4
__new__
__new__[check: Literal[bool] = True](x) -> Vec[(T, N)]
__new__
__new__[check: Literal[bool] = True](x: str, offset: int = 0) -> Vec[(T, N)]
__new__
__new__[check: Literal[bool] = True](x: bytes, offset: int = 0) -> Vec[(T, N)]
__new__
__new__[check: Literal[bool] = True](x: List[T], offset: int = 0) -> Vec[(T, N)]
Methods 46
load
load[alignment: Literal[int] = 1](data: Ptr[T], offset: int = 0, mask = NoneType(), passthrough = NoneType()) -> Vec[(T, N)]
store
store[alignment: Literal[int] = 1](self: Self, data: Ptr[T], offset: int = 0, mask = NoneType())
gather
gather[alignment: Literal[int] = 1](data: Ptr[T], indices: Vec[(int, N)], mask = NoneType(), passthrough = NoneType()) -> Vec[(T, N)]
scatter
scatter[alignment: Literal[int] = 1](self: Self, data: Ptr[T], indices: Vec[(int, N)], mask = NoneType())
scatter(self: Vec[(T, N)]) -> List[T]
cast
cast[T2: type](self: Self) -> Vec[(T2, N)]
cast_ptr
@pure @llvm
cast_ptr[T: type, T2: type](ptr: Ptr[T]) -> Ptr[T2]
ret ptr %ptr
extract
extract[check: Literal[bool] = True](self: Self, index: int) -> T
insert
insert[check: Literal[bool] = True](self: Self, index: int, value: T) -> Vec[(T, N)]
shuffle
shuffle[check: Literal[bool] = True](self: Self, indices, other = NoneType())
interleave
interleave(self: Self, other: Vec[(T, N)]) -> Vec[(T, (2 * N))]
lshift
lshift[check: Literal[bool] = True](self: Self, other: Vec[(T, N)]) -> Vec[(T, N)]
lshift[check: Literal[bool] = True](self: Self, other: T) -> Vec[(T, N)]
lshift[check: Literal[bool] = True](self: Self, other: int) -> Vec[(T, N)]
lsh
lsh[other: Literal[int]](self: Self) -> Vec[(T, N)]
rshift
rshift[check: Literal[bool] = True](self: Self, other: Vec[(T, N)]) -> Vec[(T, N)]
rshift[check: Literal[bool] = True](self: Self, other: T) -> Vec[(T, N)]
rshift[check: Literal[bool] = True](self: Self, other: int) -> Vec[(T, N)]
rsh
rsh[other: Literal[int]](self: Self) -> Vec[(T, N)]
any
any(self: Self) -> bool
all
all(self: Self) -> bool
count
count(self: Self) -> int
to_bits
to_bits(self: Self) -> UInt[N]
from_bits
from_bits(bits: UInt[N]) -> Vec[(T, N)]
floordiv
floordiv[check: Literal[bool] = True](self: Self, other: Vec[(T, N)]) -> Vec[(T, N)]
floordiv[check: Literal[bool] = True](self: Self, other: T) -> Vec[(T, N)]
mod
mod[check: Literal[bool] = True](self: Self, other: Vec[(T, N)]) -> Vec[(T, N)]
mod[check: Literal[bool] = True](self: Self, other: T) -> Vec[(T, N)]
sqrt
sqrt(self: Self)
log
log(self: Self)
sin
sin(self: Self)
cos
cos(self: Self)
min
min(self: Self, other: Vec[(T, N)]) -> Vec[(T, N)]
min(self: Self, other: T) -> Vec[(T, N)]
min(self: Self) -> T
max
max(self: Self, other: Vec[(T, N)]) -> Vec[(T, N)]
max(self: Self, other: T) -> Vec[(T, N)]
max(self: Self) -> T
mask
mask(self: Self, other: Vec[(T, N)], mask) -> Vec[(T, N)]
add
add[overflow: Literal[bool] = False](self: Self, other: Vec[(T, N)])
sub
sub[overflow: Literal[bool] = False](self: Self, other: Vec[(T, N)])
sum
sum(self: Self) -> T
prod
prod(self: Self) -> T
fma
fma(self: Self, other, addend) -> Vec[(T, N)]
exp
exp(self: Self) -> Vec[(T, N)]
exp2
exp2(self: Self) -> Vec[(T, N)]
log2
log2(self: Self) -> Vec[(T, N)]
log10
log10(self: Self) -> Vec[(T, N)]
floor
floor(self: Self) -> Vec[(T, N)]
ceil
ceil(self: Self) -> Vec[(T, N)]
trunc
trunc(self: Self) -> Vec[(T, N)]
round
round(self: Self) -> Vec[(T, N)]
isnan
isnan(self: Self) -> Vec[(u1, N)]
isinf
isinf(self: Self) -> Vec[(u1, N)]
isfinite
isfinite(self: Self) -> Vec[(u1, N)]
signbit
signbit(self: Self) -> Vec[(u1, N)]
bitflip
bitflip(self: Self) -> Vec[(T, N)]
Special methods 35
__copy__
__copy__(self: Self) -> Vec[(T, N)]
__len__
__len__(self: Self) -> int
__neg__
__neg__(self: Self) -> Vec[(T, N)]
__getitem__
__getitem__(self: Self, index: int) -> T
__getitem__[n: Literal[int]](self: Self) -> T
__repr__
__repr__(self: Self)
__eq__
__eq__(self: Self, other: Vec[(T, N)]) -> Vec[(u1, N)]
__eq__(self: Self, other: T) -> Vec[(u1, N)]
__ne__
__ne__(self: Vec[(T, N)], other: Vec[(T, N)]) -> Vec[(u1, N)]
__ne__(self: Self, other: T) -> Vec[(u1, N)]
__and__
__and__(self: Self, other: Vec[(T, N)]) -> Vec[(T, N)]
__and__(self: Self, other: T) -> Vec[(T, N)]
__or__
__or__(self: Self, other: Vec[(T, N)]) -> Vec[(T, N)]
__or__(self: Self, other: T) -> Vec[(T, N)]
__xor__
__xor__(self: Self, other: Vec[(T, N)]) -> Vec[(T, N)]
__xor__(self: Self, other: T) -> Vec[(T, N)]
__rand__
__rand__(self: Self, other: T) -> Vec[(T, N)]
__ror__
__ror__(self: Self, other: T) -> Vec[(T, N)]
__rxor__
__rxor__(self: Self, other: T) -> Vec[(T, N)]
__invert__
__invert__(self: Self) -> Vec[(T, N)]
__lshift__
__lshift__(self: Self, other: Vec[(T, N)]) -> Vec[(T, N)]
__lshift__(self: Self, other: T) -> Vec[(T, N)]
__lshift__(self: Self, other: int) -> Vec[(T, N)]
__rlshift__
__rlshift__(self: Self, other: T) -> Vec[(T, N)]
__rshift__
__rshift__(self: Self, other: Vec[(T, N)]) -> Vec[(T, N)]
__rshift__(self: Self, other: T) -> Vec[(T, N)]
__rshift__(self: Self, other: int) -> Vec[(T, N)]
__rrshift__
__rrshift__(self: Self, other: T) -> Vec[(T, N)]
__add__
__add__(self: Self, other: Vec[(T, N)]) -> Vec[(T, N)]
__add__(self: Self, other: T) -> Vec[(T, N)]
__radd__
__radd__(self: Self, other: T) -> Vec[(T, N)]
__sub__
__sub__(self: Self, other: Vec[(T, N)]) -> Vec[(T, N)]
__sub__(self: Self, other: T) -> Vec[(T, N)]
__rsub__
__rsub__(self: Self, other: T) -> Vec[(T, N)]
__mul__
__mul__(self: Self, other: Vec[(T, N)]) -> Vec[(T, N)]
__mul__(self: Self, other: T) -> Vec[(T, N)]
__rmul__
__rmul__(self: Self, other: T) -> Vec[(T, N)]
__truediv__
__truediv__(self: Self, other: Vec[(T, N)]) -> Vec[(T, N)]
__truediv__(self: Self, other: T) -> Vec[(T, N)]
__rtruediv__
__rtruediv__(self: Self, other: T) -> Vec[(T, N)]
__floordiv__
__floordiv__(self: Self, other: Vec[(T, N)]) -> Vec[(T, N)]
__floordiv__(self: Self, other: T) -> Vec[(T, N)]
__rfloordiv__
__rfloordiv__(self: Self, other: T) -> Vec[(T, N)]
__mod__
__mod__(self: Self, other: Vec[(T, N)]) -> Vec[(T, N)]
__mod__(self: Self, other: T) -> Vec[(T, N)]
__rmod__
__rmod__(self: Self, other: T) -> Vec[(T, N)]
__lt__
__lt__(self: Self, other: Vec[(T, N)]) -> Vec[(u1, N)]
__lt__(self: Self, other: T) -> Vec[(u1, N)]
__le__
__le__(self: Self, other: Vec[(T, N)]) -> Vec[(u1, N)]
__le__(self: Self, other: T) -> Vec[(u1, N)]
__gt__
__gt__(self: Self, other: Vec[(T, N)]) -> Vec[(u1, N)]
__gt__(self: Self, other: T) -> Vec[(u1, N)]
__ge__
__ge__(self: Self, other: Vec[(T, N)]) -> Vec[(u1, N)]
__ge__(self: Self, other: T) -> Vec[(u1, N)]
__abs__
__abs__(self: Self)
class Ptr
@extend
class Ptr[T]
Special methods 2
__getitem__
@pure @derives @llvm
__getitem__[S: type, M: Literal[int]](self: Ptr[Vec[(S, M)]], index: int) -> Vec[(S, M)]
%address = getelementptr <{=M} x {=S}>, ptr %self, i64 %index
%result = load <{=M} x {=S}>, ptr %address, align 1
ret <{=M} x {=S}> %result
__setitem__
@self_captures @llvm
__setitem__[S: type, M: Literal[int]](self: Ptr[Vec[(S, M)]], index: int, what: Vec[(S, M)]) -> None
%address = getelementptr <{=M} x {=S}>, ptr %self, i64 %index
store <{=M} x {=S}> %what, ptr %address, align 1
ret {} zeroinitializer