Examlex

Solved

Consider the Following Code That Adds Two Matrices a and B

question 10

Essay

Consider the following code that adds two matrices A and B and stores the result in a matrix C:
for (i= 0 to 15) {
for (j= 0 to 63) {
C[i][j] = A[i][j] + B[i][j];
}
}
If we had a quad-core multiprocessor, where the elements of the matrices A, B, C are stored in row major order, which one of the following two parallelizations is better and why ? What about when they are stored in column major order ?
(a) For each Pk in {0, 1, 2, 3}:
for (i= 0 to 15) {
for (j= Pk*15 + Pk to (Pk+1)*15 + Pk)
{
// Inner Loop Parallelization C[i][j] = A[i][j] + B[i][j];
}
}
(b) For each Pk in {0, 1, 2, 3}:
for (i= Pk*3 + Pk to (Pk+1)*3 + Pk) {
// Outer Loop Parallelization for (j= 0 to 63) {
C[i][j] = A[i][j] + B[i][j];
}
}

Identify liver function tests and their significance.
Understand the role of creatine kinase in indicating muscle damage.
Relate elevated cholesterol levels to plaque formation and cardiovascular disease.
Understand projective techniques and their use in understanding personality.

Definitions:

Machine Sales

Transactions involving the selling of machinery, which can be a significant source of revenue and profit for manufacturing and equipment companies.

Modified Cash Basis

An accounting method that combines elements of both cash and accrual accounting techniques.

Warranty Expense

Costs recognized by a company in accordance with its policy to repair or replace defective products during a warranty period.

Matching Concept

The Matching Concept in accounting states that expenses should be matched with the revenues that they helped to generate, in the same reporting period.

Related Questions