Question: Consider the following CUDA kernel and the corresponding host function that calls it: void foo _ kernel ( int * a , int * b

Consider the following CUDA kernel and the corresponding host function that
calls it:
void foo_kernel(int* a, int* b){
unsigned int i= blockIdx.x*blockDim.x + threadIdx.x;
if (threadIdx.x 40|| threadIdx.x 104
b[i]=a[i]+1;
}
if
a[i]=b[i]**2;
}
for (unsigned int
b[i]+=j;
}
}
void foo(int* a_d, int* b_d){
unsigned int N=1024bar(; )
foo_kernel a_d, b_d) ;
}
a. What is the number of warps per block?
b. What is the number of warps in the grid?
c. For the statement on line 04:
i. How many warps in the grid are active?
ii. How many warps in the grid are divergent?
iii. What is the SIMD efficiency (in %) of warp 0 of block 0?
iv. What is the SIMD efficiency (in %) of warp 1 of block 0?
v. What is the SIMD efficiency (in %) of warp 3 of block 0?
d. For the statement on line 07:
i. How many warps in the grid are active?
ii. How many warps in the grid are divergent?
iii. What is the SIMD efficiency (in %) of warp 0 of block 0?
e. For the loop on line 09 :
i. How many iterations have no divergence?
ii. How many iterations have divergence?
 Consider the following CUDA kernel and the corresponding host function that

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!