Top 250+ Solved High Performance Computing (HPC) MCQ Questions Answer
Q. A simple kernel for adding two integers: __global__ void add( int *a, int *b, int *c ) { *c = *a + *b; } where __global__ is a CUDA C keyword which indicates that:
a. add() will execute on device, add() will be called from host
b. add() will execute on host, add() will be called from device
c. add() will be called and executed on host
d. add() will be called and executed on device
Q. If variable a is host variable and dev_a is a device (GPU) variable, to allocate memory to dev_a select correct statement:
a. cudamalloc( &dev_a, sizeof( int ) )
b. malloc( &dev_a, sizeof( int ) )
c. cudamalloc( (void**) &dev_a, sizeof( int ) )
d. malloc( (void**) &dev_a, sizeof( int ) )
Q. If variable a is host variable and dev_a is a device (GPU) variable, to copy input from variable a to variable dev_a select correct statement:
a. memcpy( dev_a, &a, size);
b. cudamemcpy( dev_a, &a, size, cudamemcpyhosttodevice );
c. memcpy( (void*) dev_a, &a, size);
d. cudamemcpy( (void*) &dev_a, &a, size, cudamemcpydevicetohost );
Q. Triple angle brackets mark in a statement inside main function, what does it indicates?
a. a call from host code to device code
b. a call from device code to host code
c. less than comparison
d. greater than comparison
Q. What makes a CUDA code runs in parallel
a. __global__ indicates parallel execution of code
b. main() function indicates parallel execution of code
c. kernel name outside triple angle bracket indicates excecution of kernel n times in parallel
d. first parameter value inside triple angle bracket (n) indicates excecution of kernel n times in parallel
Q. In ___________, the number of elements to be sorted is small enough to fit into the process's main memory.
a. internal sorting
b. internal searching
c. external sorting
d. external searching
Q. ______________ algorithms use auxiliary storage (such as tapes and hard disks) for sorting because the number of elements to be sorted is too large to fit into memory.
a. internal sorting
b. internal searching
c. external sorting
d. external searching
Q. ______ can be comparison-based or noncomparison-based.
a. searching
b. sorting
c. both a and b
d. none of above
Q. The fundamental operation of comparison-based sorting is ________.
a. compare-exchange
b. searching
c. sorting
d. swapping
Q. Speedup tends to saturate and efficiency _____ as a consequence of Amdahl’s law.
a. increase
b. constant
c. decreases
d. none
Q. Speedup obtained when the problem size is _______ linearlywith the number of processing elements.
a. increase
b. constant
c. decreases
d. depend on problem size
Q. The n × n matrix is partitioned among n processors, with each processor storing complete ___ of the matrix.
a. row
b. column
c. both
d. depend on processor
Q. The n × n matrix is partitioned among n2 processors such that each processor owns a _____ element.
a. n
b. 2n
c. single
d. double