Skip to content

Commit 7f01d1f

Browse files
madhav-madhusoodananLegNeato
authored andcommitted
fix: replace manual increment operation with +=
1 parent eb59fe1 commit 7f01d1f

File tree

1 file changed

+1
-1
lines changed
  • samples/introduction/async_api/kernels/src

1 file changed

+1
-1
lines changed

samples/introduction/async_api/kernels/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ pub unsafe fn increment(g_data: *mut u32, inc_value: u32) {
1010
+ cuda_std::thread::thread_idx().x) as usize;
1111

1212
let elem: &mut u32 = unsafe { &mut *g_data.add(idx) };
13-
*elem = *elem + inc_value;
13+
*elem += inc_value;
1414
}

0 commit comments

Comments
 (0)