t-bop-simd ( tensor1 tensor2 simd-quot: ( x y -- z ) quot: ( x y -- z ) -- tensor )


Vocabulary
tensors.private

Inputs
tensor1an object
tensor2an object
simd-quota quotation with stack effect ( x y -- z )
quota quotation with stack effect ( x y -- z )


Outputs
tensoran object


Definition


:: t-bop-simd
( tensor1 tensor2 simd-quot: ( x y -- z ) quot: ( x y -- z ) -- tensor )
tensor1 shape>> tensor2 shape>> check-bop-shape
tensor1 vec>> tensor2 vec>> dup length (float-array) dup
:> vec3 [ simd-for-bop ] tri@
:> ( simd1 rest1 simd2 rest2 simd3 rest3 ) simd1 simd2
simd-quot simd3 2map-into rest1 rest2 quot rest3 2map-into
vec3 <tensor> ; inline