Top 250+ Solved High Performance Computing (HPC) MCQ Questions Answer

From 211 to 225 of 294

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

  • a. add() will execute on device, add() will be called from host

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 ) )

  • c. cudamalloc( (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 );

  • b. cudamemcpy( dev_a, &a, size, cudamemcpyhosttodevice );

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

  • a. a call from host code to device code

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

  • 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

  • a. internal sorting

Q. ______ can be comparison-based or noncomparison-based.

a. searching

b. sorting

c. both a and b

d. none of above

  • b. sorting

Q. The fundamental operation of comparison-based sorting is ________.

a. compare-exchange

b. searching

c. sorting

d. swapping

  • a. compare-exchange

Q. Scaling Characteristics of Parallel Programs Ts is

a. increase

b. constant

c. decreases

d. none

  • b. constant

Q. Speedup tends to saturate and efficiency _____ as a consequence of Amdahl’s law.

a. increase

b. constant

c. decreases

d. none

  • c. decreases

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

  • a. increase

Q. cost-optimal parallel systems have an efficiency of ___

a. 1

b. n

c. logn

d. complex

Subscribe Now

Get All Updates & News