Question: just answer ( E ) part please 1. A matrix addition takes two input matrices A and B and produces one output matrix C. Each

just answer ( E ) part please just answer ( E ) part please 1. A matrix addition takes

1. A matrix addition takes two input matrices A and B and produces one output matrix C. Each element of the output matrix C is the sum of the corresponding elements of the input matrices A and B, i.e., C[i][j] = A[1][j] + B[][j]. For simplicity, we will only handle square matrices whose elements are single-precision floating-point numbers. Write a matrix addition kernel and the host stub function that can be called with four parameters: pointer- to-the-output matrix, pointer-to-the-first-input matrix, pointer-to-the-second- input matrix, and the number of elements in each dimension. Follow the instructions below: A. Write the host stub function by allocating memory for the input and output matrices, transferring input data to device; launch the kernel, transferring the output data to host and freeing the device memory for the input and output data. Leave the execution configuration parameters open for this step. 68 CHAPTER 3 Scalable parallel execution B. Write a kernel that has each thread to produce one output matrix element. Fill in the execution configuration parameters for this design. C. Write a kernel that has each thread to produce one output matrix row. Fill in the execution configuration parameters for the design. D. Write a kernel that has each thread to produce one output matrix column. Fill in the execution configuration parameters for the design. E. Analyze the pros and cons of each kernel design above. n

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!