Information Technology > QUESTIONS & ANSWERS > Gradescope Q1 Parallelism Principles ( questions with verified correct answers) (All)
Gradescope Q1 Parallelism Principles ( questions with verified correct answers)The Hamming distance between two bitstrings of equal length is the number of locations in which the bits differ. For exa... mple, 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 private [Show More]
Last updated: 2 years ago
Preview 1 out of 24 pages
Buy this document to get the full access instantly
Instant Download Access after purchase
Buy NowInstant download
We Accept:
Can't find what you want? Try our AI powered Search
Connected school, study & course
About the document
Uploaded On
Sep 23, 2022
Number of pages
24
Written in
This document has been written for:
Uploaded
Sep 23, 2022
Downloads
0
Views
44
In Scholarfriends, 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're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Scholarfriends · High quality services·