Question: 9 . Consider the following CUDA kernel and the corresponding host function that calls it: 0 1 N ) { 0 2 x; 0 3

9. Consider the following CUDA kernel and the corresponding host function
that calls it:
01
N){
02
x;
03
04
05
06
07
08
09
b_d, N);
10
__global__ void foo_kernel(float a, float b, unsigned int
unsigned int i=blockIdx.x blockDim.x + threadIdx.
if(i , N){
b[i]=2.7f a[i]-4.3f;
}
}
void foo(float a_d, float b_d){
unsigned int N=200000;
foo_kernel ,,,(N +1281)/128,128...(a_d,
}
a. What is the number of threads per block?
b. What is the number of threads in the grid?
c. What is the number of blocks in the grid?
d. What is the number of threads that execute the code on line 02?
e. What is the number of threads that execute the code on line 04?

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!