Computer Science  >  QUESTIONS & ANSWERS  >  University of California, BerkeleyCS 61C61chw10. (All)

University of California, BerkeleyCS 61C61chw10.

Document Content and Description Below

Q1 Parallelism Principles 7 Points The Hamming distance between two bitstrings of equal length is the number of locations in which the bits differ. For example, hamming(0b1011101, 0b1001001) == 2 ... . Consider the following Hamming distance code: uint32_t hamming(uint32_t x, uint32_t y) { uint32_t mask, ham_dist = 0; #pragma omp for for (int i = 0; i <= 31; i++) { mask = 1 << i; if ((y & mask) != (x & mask)) { ham_dist++; } } return ham_dist; } Q1.1 Shared/Private Variables 4 Points For each variable below, decide whether it SHOULD be "shared" or "private" among threads. Do not mark a variable as private if it can be safely shared. x y mask  shared  private  shared  private9/11/2020 View Submission | Gradescope https://www.gradescope.com/courses/92697/assignments/512318/submissions/40847486 2/24 i Q 1.2 Data Race 2 Points Is a data race on ham_dist possible? Make sure you can explain why or why not. If yes, think about how to fix the code. Based on your answer above, which variables could be incorrect as a result of the data race? Q1.3 False Sharing 1 Point  shared  private  shared  private  Yes  No x y m ask i h  am_dist None of the above. There was no data race. [Show More]

Last updated: 3 years ago

Preview 1 out of 24 pages

Buy Now

Instant download

We Accept:

Payment methods accepted on Scholarfriends (We Accept)
Preview image of University of California, BerkeleyCS 61C61chw10. document

Buy this document to get the full access instantly

Instant Download Access after purchase

Buy Now

Instant download

We Accept:

Payment methods accepted on Scholarfriends (We Accept)

Reviews( 0 )

$7.00

Buy Now

We Accept:

Payment methods accepted on Scholarfriends (We Accept)

Instant download

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

71
0

Document information


Connected school, study & course


About the document


Uploaded On

Apr 25, 2021

Number of pages

24

Written in

All

Seller


Profile illustration for Cheryshev
Cheryshev

Member since 4 years

102 Documents Sold

Reviews Received
6
4
1
0
1
Additional information

This document has been written for:

Uploaded

Apr 25, 2021

Downloads

 0

Views

 71

Document Keyword Tags


$7.00
What is Scholarfriends

Scholarfriends.com Online Platform by Browsegrades Inc. 651N South Broad St, Middletown DE. United States.

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 © Scholarfriends · High quality services·