2022-10-04 13:56:31 +09:00
|
|
|
#include <immintrin.h>
|
|
|
|
#include <math.h>
|
|
|
|
|
|
|
|
float vectordot_naive(float *A, float *B, int N) {
|
|
|
|
float c = 0.f;
|
2022-10-14 03:59:35 +09:00
|
|
|
for (int i = 0; i < N; ++i) {
|
|
|
|
c += A[i] * B[i];
|
|
|
|
}
|
2022-10-04 13:56:31 +09:00
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
|
|
|
float vectordot_fma(float *A, float *B, int N) {
|
|
|
|
float c = 0.f;
|
|
|
|
/*
|
2022-10-04 21:07:02 +09:00
|
|
|
TODO: FILL IN HERE
|
2022-10-04 13:56:31 +09:00
|
|
|
*/
|
|
|
|
return c;
|
|
|
|
}
|