Skip to content

Profiling Options for CUDA and HIP


Quiz Questions and Answers

Question 1

What API is used in CUDA to calculate elapsed execution time?

  • A) cudaEventElapsedTime
  • B) cudaEventSynchronize
  • C) cudaEventRecord
  • D) cudaDeviceSynchronize

Answer:
A) cudaEventElapsedTime


Question 2

True or False: HIP and CUDA use the same APIs for event-based time measurement.

Answer:
False
Explanation: HIP provides analogous APIs (hipEvent_t, hipEventCreate, etc.) but not identical to CUDA.


Question 3

What tool would you use for system-wide profiling in ROCm?

  • A) Nsight Systems
  • B) Nsight Compute
  • C) rocprof
  • D) rocminfo

Answer:
C) rocprof


Question 4

True or False: The CUDA Occupancy Calculator determines the percentage of GPU memory used by the application.

Answer:
False
Explanation: The CUDA Occupancy Calculator determines the ratio of active warps to the maximum number of warps supported per multiprocessor.


Question 5

Which of the following is NOT a step in using CUDA events for timing?

  • A) Record start and stop events using cudaEventRecord
  • B) Calculate elapsed time using cudaEventElapsedTime
  • C) Free memory using cudaFreeEvent
  • D) Synchronize events using cudaEventSynchronize

Answer:
C) Free memory using cudaFreeEvent
Explanation: cudaEventDestroy is used to destroy events, not cudaFreeEvent.