Explore Westonci.ca, the leading Q&A site where experts provide accurate and helpful answers to all your questions. Experience the convenience of getting reliable answers to your questions from a vast network of knowledgeable experts. Explore comprehensive solutions to your questions from a wide range of professionals on our user-friendly platform.

void inner4(vec_ptr u, vec_ptr v, data_t *dest) { long int i; int length = vec_length(u); data_t *udata = get_vec_start(u); data_t *vdata = get_vec_start(v); data_t sum = (data_t) 0; for (i = 0; i < length; i++) { sum = sum + udata[i] * vdata[i]; } *dest = sum; } and you modify the code to the form below. /* Accumulate in temporary */ void inner4(vec_ptr u, vec_ptr v, data_t *dest) { long int i; int length = vec_length(u); data_t *udata = get_vec_start(u); data_t *vdata = get_vec_start(v); data_t sum = (data_t) 0; for (i = 0; i < length; i += 4) { sum = sum + udata[i] * vdata[i] + udata[i+1] * vdata[i+1] + udata[i+2] * vdata[i+2] + udata[i+3] * vdata[i+3]; } for (i = 0; i < length; i++) { sum = sum + udata[i] * vdata[i]; } *dest = sum; } What type of optimizations is being applied? Select one: a. Parallel accumulators b. Unrolling and multiple accumulators c. Strength reduction d. Loop unrolling e. Machine independent optimization

Sagot :

Lanuel

The type of optimization that is being applied to this programming code is: D. Loop unrolling.

What is loop unrolling?

Loop unrolling is also referred to as loop unwinding and it can be defined as loop transformation technique that is typically designed and developed to optimize the number of instructions that are executed by a software program at a given period of time, especially at the expense of its binary size (space-time tradeoff).

This ultimately implies that, loop unrolling can be used by programmers to optimize the execution time of a software program, in order to reduce the number of branches and loop maintenance instructions.

Read more on loop unrolling here: https://brainly.com/question/26098908