База ответов ИНТУИТ

Introduction to performance optimization using Intel SW tools

<<- Назад к вопросам

Choose the code resulting to the loop peeling for:
p = 10; for (i=0; i<10; ++i) {     y[i] = x[i] + x[p];   p = i;} 

(Отметьте один правильный вариант ответа.)

Варианты ответа
y[0] = x[0] + x[10];  for (i=1; i<10; ++i) {  y[i] = x[i] + x[i-1];}
(Верный ответ)
y[0] = x[0] + x[10];  for (i=1; i<9; ++i) {  y[i] = x[i] + x[i-1];}
p = 10;   for (i=1; i<9; ++i) {   y[i] = x[i] + x[p];  p = i;} 
Похожие вопросы
What is loop peeling?
Choose the correct statements for the code:
DO I=1,N  S1 A(I) = B(I) + 1   S2 B(I+1) = A(I) – 5END DO
Choose the correct statements for this code:
S1 PI = 3.14S2 R  = 5S3 AREA = PI*R **2
Choose code fragments which are good for optimizing
Loop invariant code motion
Is there any dependence in this code?
DO I=1,N  S1 A(I)=…  S2 …=A(I)END DO
Is there any dependence in this code?
DO I=1,N  S1 A(I+1) =F(I)  S2 F(I+1) = A(I)END DO
Choose scalar optimizations
Choose the correct statement(s)
Choose the correct statements