t-uop-simd ( tensor n simd-quot: ( x y -- z ) quot: ( x y -- z ) -- tensor )


Vocabulary
tensors.private

Inputs
tensoran object
nan object
simd-quota quotation with stack effect ( x y -- z )
quota quotation with stack effect ( x y -- z )


Outputs
tensoran object


Definition


:: 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