Handbook
Glossary
t-uop-simd ( tensor n simd-quot: ( x y -- z ) quot: ( x y -- z ) -- tensor )
Vocabulary
tensors
.
private
Inputs
tensor
an
object
n
an
object
simd-quot
a
quotation
with stack effect
( x y -- z )
quot
a
quotation
with stack effect
( x y -- z )
Outputs
tensor
an
object
Definition
USING:
accessors
kernel
math.vectors.simd
sequences
sequences.private
specialized-arrays.instances.alien.c-types.float
;
IN:
tensors.private
::
t-uop-simd
( tensor n simd-quot: ( x y -- z ) quot: ( x y -- z ) -- tensor )
tensor
dup
[
shape>>
]
[
vec>>
]
bi*
dup
length
(float-array)
dup
:>
vec2
[
simd-for-bop
]
bi@
:>
( simd1 rest1 simd2 rest2 ) simd1 n n n n
float-4-boa
simd-quot
curry
simd2
map-into
rest1 n quot
curry
rest2
map-into
vec2
<tensor>
;
inline