Document CUDA programming issues in GPU_Microbenchmark folder #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds comprehensive documentation of potential CUDA programming issues found in the
src/cuda/GPU_Microbenchmarkfolder. The analysis scanned all 62 CUDA source files and identified 14 distinct categories of issues ranging from critical bugs to code maintainability concerns.What's Changed
Added
CUDA_ISSUES.mdto the repository root containing:Key Issues Documented
Critical Issues (High Priority)
Memory Leaks - 55+ files allocate memory with
malloc()andcudaMalloc()but never free it withfree()orcudaFree(), causing resource leaks in long-running or repeated executions.Uninitialized Variables - Critical undefined behavior in files like
ubench/atomics/Atomic_add_bw/atomic_add_bw.cuwhere accumulator variables are used without initialization:Type Mismatches - Wrong sizeof used in cudaMemcpy operations, e.g., copying
uint64_tarrays usingsizeof(uint32_t), resulting in only half the data being transferred.Undefined warpSize - 9 files use the variable
warpSizein kernel code without declaring it, relying on CUDA's built-in constant without documentation.Spinlock Deadlock Risk -
ubench/atomics/Spinlock_simple/spinlock_simple.cuuses__syncthreads()inside a spinlock loop, which can cause deadlock when some threads hold the lock while others wait.Medium Priority Issues
1instead of0for success)Low Priority Issues
intilizeDevicePropshould beinitializeDevicePropStatistics
Purpose
This documentation serves as:
Next Steps
The issues documented here can be addressed in follow-up PRs based on priority:
No code changes are made in this PR - this is purely documentation to inform future improvements.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.