2d-matmul-simd ( vec1: float-array vec2: float-array res: float-array m: fixnum n: fixnum p: fixnum -- )


Vocabulary
tensors.private

Inputs
vec1a float-array
vec2a float-array
resa float-array
ma fixnum
na fixnum
pa fixnum


Outputs
None

Definition


TYPED:: 2d-matmul-simd
( vec1: float-array vec2: float-array res: float-array m: fixnum n: fixnum p: fixnum -- )
{ n p } vec2 <tensor> 2d-transpose vec>> :> vec2 m [
:> i i n * :> in i p * :> ip vec1 in n make-subseq
float-4 cast-array p [
:> j dup vec2 j n * n make-subseq float-4 cast-array
0.0 [ vdot + ] 2reduce ip j + res set-nth-unsafe
] each-integer drop
] each-integer ;