GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

To access the midterm questions, go to: Password: EX2 EXAM L…

To access the midterm questions, go to: Password: EX2 EXAM LINK

Read Details

[CPU-OpenMP-question-step1] We aim to develop a GPU performa…

[CPU-OpenMP-question-step1] We aim to develop a GPU performance projection based on the given CPU code, which is written in OpenMP. The CPU has 8 cores, each running at 1 GHz, and GPU has 128 SMs, each running at 1GHz.  To predict the performance, various modeling methods are required. Please follow the instructions to simplify the problem: To estimate the execution time on the CPU, assume that each element requires 10 instructions on average for each loop iteration, and the CPU has an IPC 4 per each core. Please ignore the array initialization code, as it needs to be executed on the CPU anyway. Assume infinite computational speedup from running this code on the GPU, but take into account the data transfer overhead and kernel launch overhead. The CPU and GPU are connected via an external bus with a bandwidth of 16 GB/s, and each floating-point number is 4 bytes in size. Additionally, there is a 50 ns kernel launch overhead per kernel invocation. Given these conditions, determine the minimum array size N that will allow the GPU to outperform the CPU. Assume that the data sent to the GPU’s global memory can remain there throughout the computation, and only the final results need to be transferred back to the CPU after computation.   Choose the closest number . To help solve the problem, we break down the question into 5 parts.  Please see the example OpenMP program below.    #include #include #include #include #define N ? // Array size to be find out int main() { int i; float sum = 0.0; double product = 0.0; float max_element = 0.0; float arr[N]; // Seed the random number generator srand(time(NULL)); // Initialize the array with random values between 0 and 1 for (i = 0; i

Read Details

#define N 10000 #define STRIDE __global__ void vectorAdd(fl…

#define N 10000 #define STRIDE __global__ void vectorAdd(float *a, float *b, float *c) { int idx = blockIdx.x * blockDim.x + threadIdx.x; if (idx

Read Details

[CPU-OpenMP-question-step1: part b] Now choose the minimum a…

[CPU-OpenMP-question-step1: part b] Now choose the minimum array size N that will allow the GPU to outperform the CPU.   Choose the closest number. If two numbers are equally close, choose the larger number.

Read Details

Given a class, SomeClass what cmethod is being called for ‘a…

Given a class, SomeClass what cmethod is being called for ‘a’ on the indicated line? void SomeFunction(const SomeClass &f){ SomeClass x = f; SomeClass a;

Read Details

Assuming that an integer (int) requires 4 bytes of memory, h…

Assuming that an integer (int) requires 4 bytes of memory, how much memory is leaked by the following code (i.e. how many bytes)? int x = 0;int* y = new int[3];y = new int[2];y = new int[4];delete[] y;y = &x;

Read Details

A const class method protects:

A const class method protects:

Read Details

Given a class, SomeClass what method is being called on the…

Given a class, SomeClass what method is being called on the indicated line? void SomeFunction(const SomeClass &f){ SomeClass x = f; SomeClass *a; a = &x;}

Read Details

A bone disease that develops when bone mineral density and b…

A bone disease that develops when bone mineral density and bone mass decreases is called

Read Details

Match each of the following qualitative (i.e., nonfinancial)…

Match each of the following qualitative (i.e., nonfinancial) concerns to one of the following types of business decisions: special order; make or buy; and sell, scrap, or rebuild. For this section only, use each decision type only once.

Read Details

Posts pagination

Newer posts 1 … 38,393 38,394 38,395 38,396 38,397 … 75,281 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top