Question: Please make this function as four-way loop unrolling with four parallel accumulators (the revised one should run faster than original one with larger data length).
Please make this function as four-way loop unrolling with four parallel accumulators (the revised one should run faster than original one with larger data length).
void inner (float *u, float *v, int length, float *dest) {
int i;
float sum = 0.0f;
for (i = 0; i < length; ++i) {
sum += u[i] * v[i];
}
*dest = sum;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
