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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!