Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

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?
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions