Computer Science > QUESTIONS & ANSWERS > University of Illinois, Urbana ChampaignECE 408Solutions 2021 (All)

University of Illinois, Urbana ChampaignECE 408Solutions 2021

Document Content and Description Below

MP1 1 . (Fall 2020) How many floating operations are being performed in the vector add kernel? Give your answer in terms of N and explain. Answer: N 2. How many global memory bytes are read and wr... itten by the vector add kernel? Give your answer in terms of N. Please give separate answers for the bytes read and written. Answer: Reads = 2 * N * 4, Writes = N * 4 3 . Assume that we want to use each thread to calculate 2 (adjacent) elements of a vector addition. What would be the expression for mapping the thread/block indices to i, the data index of the second element to be processed by a thread? (A) i=blockIdx.x*blockDim.x + threadIdx.x +1 (B) i=blockIdx.x*blockDim.x*2 + threadIdx.x - 1 (C) i=(blockIdx.x*blockDim.x + threadIdx.x)*2 +1 (D) i=blockIdx.x*threadIdx.x*2 + 1 Answer: C 4. We want to use each thread to calculate sixteen (16) output elements of a vector addition. Each block processes 16*blockDim.x consecutive elements that form 16 sections. All threads in each block will first process a section with each thread processing one element. They will then all move to the next section with each thread processing one element. For each section, consecutive threads should process consecutive elements. What would be the kernel code expression for forming the value of i, the data index of the first element to be processed by each thread? (A) i=blockIdx.x*blockDim.x *16 (B) i=blockIdx.x*threadIdx.x + threadIdx.x (C) i=blockIdx.x*blockDim.x*16 + threadIdx.x (D) i=blockIdx.x*blockDim.x + threadIdx.x*16 Answer: C [Show More]

Last updated: 1 year ago

Preview 1 out of 8 pages

Reviews( 0 )

$10.00

Add to cart

Instant download

Can't find what you want? Try our AI powered Search

OR

GET ASSIGNMENT HELP
100
0

Document information


Connected school, study & course


About the document


Uploaded On

Sep 10, 2021

Number of pages

8

Written in

Seller


seller-icon
Dr Medina Reed

Member since 2 years

54 Documents Sold


Additional information

This document has been written for:

Uploaded

Sep 10, 2021

Downloads

 0

Views

 100

Document Keyword Tags

More From Dr Medina Reed

View all Dr Medina Reed's documents »

Recommended For You


$10.00
What is Browsegrades

In Browsegrades, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.

We are here to help

We're available through e-mail, Twitter, Facebook, and live chat.
 FAQ
 Questions? Leave a message!

Follow us on
 Twitter

Copyright © Browsegrades · High quality services·