Handbook
Glossary
t-bop-simd ( tensor1 tensor2 simd-quot: ( x y -- z ) quot: ( x y -- z ) -- tensor )
Vocabulary
tensors
.
private
Inputs
tensor1
an
object
tensor2
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
sequences
sequences.extras
specialized-arrays.instances.alien.c-types.float
;
IN:
tensors.private
::
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