Skip to content

Commit c7b9d6e

Browse files
authored
Fixed all C[tid] = A[tid] + B[tid]
1 parent 9da8270 commit c7b9d6e

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

cuda_core/docs/source/release/0.X.Y-notes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,4 @@ Fixes and enhancements
5252
- Fixed a bug in :class:`Stream` and other classes where object cleanup would error during interpreter shutdown.
5353
- :class:`StridedMemoryView` of an underlying array using the DLPack protocol will no longer leak memory.
5454
- General performance improvement.
55+
- Fixed incorrect index usage in vector_add example

cuda_core/examples/simple_multi_gpu_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
size_t N) {
3636
const unsigned int tid = threadIdx.x + blockIdx.x * blockDim.x;
3737
for (size_t i=tid; i<N; i+=gridDim.x*blockDim.x) {
38-
C[tid] = A[tid] + B[tid];
38+
C[i] = A[i] + B[i];
3939
}
4040
}
4141
"""

cuda_core/examples/vector_add.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
size_t N) {
2222
const unsigned int tid = threadIdx.x + blockIdx.x * blockDim.x;
2323
for (size_t i=tid; i<N; i+=gridDim.x*blockDim.x) {
24-
C[tid] = A[tid] + B[tid];
24+
C[i] = A[i] + B[i];
2525
}
2626
}
2727
"""

0 commit comments

Comments
 (0)