Skip to content

Commit 4bc6a8e

Browse files
committed
Initial commit, removed comments
Signed-off-by: syedshazli <syed.abdu1818@gmail.com>
1 parent 562590d commit 4bc6a8e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

_posts/2025-08-11-cuda-debugging.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,13 @@ __global__ void illegalMemoryAccessKernel(int* data, int size) {
9696
}
9797
}
9898

99-
// Kernel with illegal memory access - accesses memory beyond allocated bounds
99+
// Simple kernel with no errors
100100
__global__ void normalKernel(int* data, int size) {
101101
int idx = blockIdx.x * blockDim.x + threadIdx.x;
102102

103-
// This will cause illegal memory access - accessing beyond allocated memory
104-
// We allocate 'size' elements but access up to size * 2
105-
if (idx < size) { // Access twice the allocated size
106-
data[idx] = idx; //
103+
104+
if (idx < size) {
105+
data[idx] = idx;
107106
}
108107
}
109108

0 commit comments

Comments
 (0)