Docsity

Solutions Manual FOR Multicore AND GPU Programming Certification Evaluation Test Full 2026, Exams of Nursing

Toggle sidebar
bg1
Solutions Manual FOR Multicore AND GPU Programming
Certification Evaluation Test Full 2026 Exam Questions with Correct
Answers
Question 1.
TB lifecycle residency rule
Correct Answer: Thread blocks reside on their assigned SMs for their entire
lifecycle (from assignment to end of execution).
Question 2.
dim3 syntax (C)
Correct Answer: dim3 my_xyz(x_value, y_value, z_value);
Question 3.
Built-in CUDA indexing variables
Correct Answer: threadIdx.(x, y, z), blockDim.(x, y, z), blockIdx.(x, y, z),
gridDim.(x, y, z)
Question 4.
TB mapping order assumption
Correct Answer: Thread blocks may be assigned to SMs in random order; do not
assume a specific mapping order.
Question 5.
Where does synchronize go in C?
Correct Answer: In C, the synchronize call appears after the kernel launch line.
Question 6.
Instruction Decoder (CPU core)
Correct Answer: CPU core component that decodes instructions into control
signals/operations (as shown in the diagram).
Question 7.
Global thread index formula (1D grid of 1D blocks)
Correct Answer: i = blockIdx. x * blockDim. x + threadIdx. x
Question 8.
Thread index in a 1D block
Correct Answer: i = threadIdx. x
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16

Partial preview of the text

Download Solutions Manual FOR Multicore AND GPU Programming Certification Evaluation Test Full 2026 and more Exams Nursing in PDF only on Docsity!

Solutions Manual FOR Multicore AND GPU Programming

Certification Evaluation Test Full 2026 Exam Questions with Correct

Answers

Question 1.

TB lifecycle residency rule

Correct Answer: Thread blocks reside on their assigned SMs for their entire lifecycle (from assignment to end of execution).

Question 2.

dim3 syntax (C)

Correct Answer: dim3 my_xyz(x_value, y_value, z_value);

Question 3.

Built-in CUDA indexing variables

Correct Answer: threadIdx.(x, y, z), blockDim.(x, y, z), blockIdx.(x, y, z), gridDim.(x, y, z)

Question 4.

TB mapping order assumption

Correct Answer: Thread blocks may be assigned to SMs in random order; do not assume a specific mapping order.

Question 5.

Where does synchronize go in C?

Correct Answer: In C, the synchronize call appears after the kernel launch line.

Question 6.

Instruction Decoder (CPU core)

Correct Answer: CPU core component that decodes instructions into control signals/operations (as shown in the diagram).

Question 7.

Global thread index formula (1D grid of 1D blocks)

Correct Answer: i = blockIdx. x * blockDim. x + threadIdx. x

Question 8.

Thread index in a 1D block

Correct Answer: i = threadIdx. x

Question 9.

Why CUDA synchronization is needed

Correct Answer: To ensure all threads finish processing before collecting results.

Question 10.

Extra threads problem

Correct Answer: More threads may be allocated than needed for the data size.

Question 11.

Kernel (definition)

Correct Answer: A kernel is a device-only function that must be explicitly designated in code.

Question 12.

CUDA cores contain what units?

Correct Answer: CUDA cores are a cluster of units including INT, FP32/FP64, Tensor, and special function units.

Question 13.

CUDA kernel (basic idea)

Correct Answer: A CUDA kernel is the GPU function you deploy across the grid of threads (as part of CUDA programming).

Question 14.

CPU core (hardware blocks shown)

Correct Answer: A CPU core includes ALU/FPU, Control Unit, Cache, Registers, Program Counter, MMU, Prefetch Buffer, Instruction Decoder, and Branch Predictor.

Question 15.

Thread identification for vector addition

Correct Answer: The first N threads handle the vector addition, where N is the vector length.

Question 16.

Can multiple thread blocks share the same SM?

Correct Answer: Yes, multiple thread blocks may share the same SM (if resources allow).

Question 17.

What if SM resource capacity does not meet a TB's requirement?

Correct Answer: The job will not be launched.

Question 27.

Tuple-like example (2D grid, 2D block)

Correct Answer: 2D grid of 2 by 4 blocks and 2D blocks of 4 by 2 threads (y by x): blocks_per_grid(4,2,1); threads_per_block(2,4,1)

Question 28.

blockDim values in 1D block

Correct Answer: blockDim. x=N; blockDim. y=1; blockDim. z=

Question 29.

Built-in CUDA variables (block dimensions)

Correct Answer: blockDim. x, blockDim. y, blockDim. z

Question 30.

Two key quantities when requesting a grid

Correct Answer: (1) Number of threads per thread block, and (2) Number of thread blocks.

Question 31.

Special function unit (inside CUDA cores)

Correct Answer: Hardware for special math functions (as listed in the lecture's CUDA core unit cluster).

Question 32.

Built-in CUDA variables (threads)

Correct Answer: threadIdx. x, threadIdx. y, threadIdx. z

Question 33.

Thread block dimensionality options

Correct Answer: A thread block can be organized in 1D, 2D, or 3D.

Question 34.

Cost per execution unit (GPU vs CPU)

Correct Answer: On average, each GPU execution unit ("CUDA core") costs less than a CPU execution unit.

Question 35.

2D thread block shape

Correct Answer: (N, M, 1)

Question 36.

Prefetch Buffer (CPU core)

Correct Answer: CPU core buffer that preloads upcoming instructions/data (as shown in the diagram).

Question 37.

Multi-dimensional launch coordinates

Correct Answer: For multi- dimensional arrangement, use a coordinate like (x, y, z).

Question 38.

How is a multidimensional grid executed on SMs?

Correct Answer: CUDA internally linearizes a multidimensional grid and executes it as a 1D grid.

Question 39.

How to handle extra threads

Correct Answer: Pass a memory bound to the kernel, and inside the kernel check if the mapped index exceeds the bound before doing work.

Question 40.

CPU parallelism measurement

Correct Answer: CPU parallelism is commonly measured by the number of CPU cores.

Question 41.

What if you allocate more threads than needed?

Correct Answer: Pass a memory bound to the kernel and check inside the kernel whether the mapped index exceeds the bound before doing work.

Question 42.

Cleaning memory in C + CUDA

Correct Answer: Memory must be cleaned in C, and CUDA memory must also be cleaned manually.

Question 43.

Multidimensional indexing idea

Correct Answer: CPU core component that tracks the next instruction to execute (as shown in the diagram).

Question 53.

Tuple-like example (1D)

Correct Answer: dim3 blocks_per_grid(1,1,1); dim3 threads_per_block(2,1,1); then <<>>

Question 54.

Organization example: Thread block 1 with Grid 2

Correct Answer: Thread block stays (x=8, y=1, z=1) while grid is (x=4, y=2, z=1).

Question 55.

Grid request (CUDA programming topic)

Correct Answer: Specifying the grid/thread-block configuration before launching a kernel (listed as a topic).

Question 56.

Kernel (CUDA term)

Correct Answer: Each worker function in CUDA is called a "kernel".

Question 57.

mem_bound meaning in 1D

Correct Answer: mem_bound is the size of the array.

Question 58.

gridDim values in 1D grid

Correct Answer: gridDim. x=N; gridDim. y=1; gridDim. z=

Question 59.

When do "on hold" TBs run?

Correct Answer: When active TBs finish and release SM resources, TBs on the waitlist get assigned to available SMs.

Question 60.

Python multi-dimensional dims

Correct Answer: In Python, a simple tuple (x, y, z) is used for dimensional parameters.

Question 61.

Independent execution: start times

Correct Answer: Thread blocks execute independently-some may start early or late depending on the scheduler.

Question 62.

Grid/block organization dimensions

Correct Answer: Both grids and thread blocks can be organized as 1D, 2D, or 3D (and they can differ in dimensionality).

Question 63.

gridDim values in 3D grid

Correct Answer: gridDim. x=N; gridDim. y=M; gridDim. z=K

Question 64.

Python multi-dim kernel params

Correct Answer: In Python, a simple tuple (x, y, z) works for multi-dimensional settings.

Question 65.

CUDA core vs CPU core (functionality mapping)

Correct Answer: A CUDA core is like an execution unit on a CPU core; one SM (collection of CUDA cores) is like one CPU core.

Question 66.

Built-ins in Python access

Correct Answer: In Python, use cuda. threadIdx. x etc. (prefix with cuda.)

Question 67.

GPU parallelism measurement

Correct Answer: GPU parallelism is commonly measured by (# of CUDA cores) × (# of SMs).

Question 68.

After GPU job finishes, how access results on CPU?

Correct Answer: Copy results from GPU memory back to CPU memory before accessing them.

Question 69.

What does "# of threads per block" represent?

Correct Answer: # of threads per block is the block dimension.

Correct Answer: Grid 1: dimension=4 with coordinates (x=1, y=1, z=1) (as shown in the table).

Question 79.

Assumption to avoid about SM sharing

Correct Answer: Do not assume how multiple thread blocks will share the same SM (or which ones will share).

Question 80.

Where to place synchronize in Python

Correct Answer: In Python, the synchronize call appears at the end of the kernel function.

Question 81.

When do "on hold" TBs run?

Correct Answer: When active TBs finish and release SM resources, TBs on the waitlist are assigned to available SMs.

Question 82.

Grid (definition)

Correct Answer: A grid is a collection of threads grouped into thread blocks; deploying a function on GPU deploys the job on a grid.

Question 83.

dim3 argument type warning

Correct Answer: dim3 arguments are unsigned integers; be mindful when computing values.

Question 84.

Global index: 1D grid of 1D blocks

Correct Answer: i = blockIdx. x * blockDim. x + threadIdx. x

Question 85.

After GPU work, how do you access results on CPU?

Correct Answer: Copy results from GPU memory back to CPU memory.

Question 86.

TB lifecycle rule

Correct Answer: Thread blocks stay on their assigned; SMs for their entire lifecycle (assignment → completion).

Question 87.

FP64 unit (inside CUDA cores)

Correct Answer: Floating-point (64-bit) arithmetic/operations hardware inside a CUDA core.

Question 88.

Built-in variables in Python (access)

Correct Answer: In Python, add "cuda." before built-in variables (e. g., cuda. threadIdx. x).

Question 89.

2D grid shape

Correct Answer: (N, M, 1)

Question 90.

Scalar example: <<<1, 2>>>

Correct Answer: 1D grid of a 1D block of 2 threads.

Question 91.

Matrix linear index formula (x, y) in MxN

Correct Answer: y * N + x

Question 92.

1D grid shape

Correct Answer: (N, 1, 1)

Question 93.

C coordinate types for launch dims (dimX)

Correct Answer: In C, CUDA uses dimX types where X ∈ {2,3,4}; most commonly dim3.

Question 94.

Why GPU tends to have more "cores" than CPU

Correct Answer: Compared to a CPU, a GPU has more execution units ("CUDA cores").

Question 95.

Kernel launch concept

Correct Answer: Launching a kernel is like calling a function, except you must specify grid/block dimensions.

Question 105.

Thread (definition)

Correct Answer: A thread is the smallest execution unit ("the hard worker").

Question 106.

Kernel-to-thread mapping

Correct Answer: Each kernel instance is mapped to a thread.

Question 107.

Vector addition (goal)

Correct Answer: Implement vector addition by parallelizing the work across GPU threads.

Question 108.

1D thread block shape

Correct Answer: (N, 1, 1)

Question 109.

Built-in CUDA variables (grid dimensions)

Correct Answer: gridDim. x, gridDim. y, gridDim. z

Question 110.

How CPU vs GPU parallelism is measured

Correct Answer: CPU parallelism is often measured by number of CPU cores; GPU parallelism is often measured by (# CUDA cores × # SMs).

Question 111.

Built-in CUDA variables (block indices)

Correct Answer: blockIdx. x, blockIdx. y, blockIdx. z

Question 112.

Linear index of (x, y) in an M×N matrix

Correct Answer: y * N + x

Question 113.

Ampere A100 (context on slide)

Correct Answer: A named example GPU architecture/model referenced in the lecture slide: "Ampere A100".

Question 114.

When do thread blocks share the same SM?

Correct Answer: When there are too many TBs and an SM has enough resources to handle more than one TB's resource needs.

Question 115.

Organization example: Grid 2 (x, y, z)

Correct Answer: Grid 2: (x=4, y=2, z=1).

Question 116.

Why request a grid before running GPU work?

Correct Answer: You must request a grid with the right amount of threads before deploying the job.

Question 117.

Global index: 1D grid of 2D blocks

Correct Answer: i = blockIdx. x * blockDim. x * blockDim. y + threadIdx. y * blockDim. x + threadIdx. x

Question 118.

threadIdx ranges in 1D block

Correct Answer: threadIdx. x: 0... N-1; threadIdx. y always 0; threadIdx. z always 0

Question 119.

TB mapping order guarantee?

Correct Answer: There is no guaranteed order: thread blocks may be assigned to SMs in a random order; do not assume a specific mapping order.

Question 120.

TB lifecycle on an SM

Correct Answer: Thread blocks stay on their assigned SMs for their entire lifecycle (from assignment to completion).

Question 121.

Cache (CPU core)

Correct Answer: On-chip memory in a CPU core used to store frequently accessed data/instructions (as shown in the diagram).

Question 122.

C multi-dim coordinate type for kernel params

C kernel specifier

Correct Answer: In C, a kernel function must be declared with the "global" specifier.

Question 132.

Before passing CPU data to GPU, what must you do?

Correct Answer: Allocate GPU memory of the same size and copy data from CPU memory to GPU memory.

Question 133.

What is inside a "CUDA core" (high level)?

Correct Answer: CUDA cores are a cluster of units including INT, FP32/FP64, Tensor, and special function units.

Question 134.

MMU (CPU core)

Correct Answer: Memory Management Unit; handles memory address translation/management (as shown in the diagram).

Question 135.

Data transfer (CUDA programming topic)

Correct Answer: Moving data between CPU memory and GPU memory is a required part of many CUDA programs (listed as a topic).

Question 136.

TB→SM mapping rule

Correct Answer: A thread block (TB) is mapped to a single SM.

Question 137.

FP32 unit (inside CUDA cores)

Correct Answer: Floating-point (32-bit) arithmetic/operations hardware inside a CUDA core.

Question 138.

Kernel launch syntax (Python)

Correct Answer: kernel_name# of blocks, # of threads per block

Question 139.

Scalar launch assumption

Correct Answer: Using scalars makes the system assume a 1D dimension.

Question 140.

Deploying a function on GPU means what?

Correct Answer: Each time we deploy a function on the GPU, we deploy the job on a grid.

Question 141.

CPU vs GPU tasks (high level)

Correct Answer: CPU is sequential & complex; GPU is parallel & simple.

Question 142.

Streaming Multiprocessor (SM)

Correct Answer: An SM is a major processing unit on a GPU chip; each GPU chip contains multiple SMs.

Question 143.

CPU/GPU memory sharing

Correct Answer: GPU and CPU cannot share memory.

Question 144.

Grid/block dimensionality options

Correct Answer: Both grids and thread blocks can be organized in 1D, 2D, or 3D (and they can have different dimensionalities).

Question 145.

TB splitting rule

Correct Answer: A thread block cannot be split across multiple SMs.

Question 146.

blockIdx ranges in 1D grid

Correct Answer: blockIdx. x: 0... N-1; blockIdx. y always 0; blockIdx. z always 0

Question 147.

Tensor unit (inside CUDA cores)

Correct Answer: Specialized hardware units used for tensor/matrix-style operations (as listed in the lecture's CUDA core unit cluster).

Question 148.

gridDim values in 2D grid

Correct Answer: gridDim. x=N; gridDim. y=M; gridDim. z=

Question 158.

Who can call a device function?

Correct Answer: Only kernels can call a device function.

Question 159.

"Linearized by CUDA internally" means what?

Correct Answer: Even if the grid is defined in multiple dimensions, CUDA flattens it into a 1D ordering for execution.

Question 160.

TB independent execution (finish times)

Correct Answer: Depending on workload, some thread blocks may finish early or late.

Question 161.

Why "use GPU" in application code?

Correct Answer: To parallelize work: keep sequential/complex parts on CPU and offload parallel/simple parts to GPU.

Question 162.

Organization example: Grid 3 (x, y, z)

Correct Answer: Grid 3: (x=4, y=2, z=4).

Question 163.

When do multiple TBs share one SM?

Correct Answer: When there are too many TBs AND one SM has enough resources to handle more than one TB's resource requirements.

Question 164.

GPU Hardware Model (hierarchy)

Correct Answer: A GPU has a two-level hierarchy: GPU chip → multiple Streaming Multiprocessors (SMs) → each SM has multiple (non-identical) "CUDA cores".

Question 165.

TB→SM mapping rule (core rule)

Correct Answer: A thread block (TB) is mapped to a single SM and cannot be split across multiple SMs.

Question 166.

Can grid and thread blocks have different dimensions?

Correct Answer: Yes. A grid and its thread blocks can have different numbers of dimensions.

Question 167.

What if there are more than NK TBs on the grid?

Correct Answer: At most NK TBs run; the remaining TBs are put on hold (waitlist).

Question 168.

Why multi-block > single-block (same total threads)?

Correct Answer: Because each thread block maps to an SM; multi-block uses multiple SMs in parallel.

Question 169.

Total threads in a grid (basic idea)

Correct Answer: Total threads = (# thread blocks) × (# threads per thread block) (taking dimensionality into account).

Question 170.

INT unit (inside CUDA cores)

Correct Answer: Integer arithmetic/operations hardware inside a CUDA core.

Question 171.

CUDA core (in the GPU model)

Correct Answer: A CUDA core is a processing/execution unit within an SM; CUDA cores in an SM can be non-identical.

Question 172.

host specifier (CUDA C)

Correct Answer: Non-kernel (CPU) functions can be marked with "host" (optional to write).

Question 173.

Two ways to specify dimensional parameters

Correct Answer: Use scalars for 1D; use tuple-like objects for multi-dimensional structures.

Question 174.

Thread block (definition)