(a: &[f32], b: &[f32], c: *mut f32)
| 10 | #[kernel] |
| 11 | #[allow(improper_ctypes_definitions, clippy::missing_safety_doc)] |
| 12 | pub unsafe fn add(a: &[f32], b: &[f32], c: *mut f32) { |
| 13 | let idx = thread::index_1d() as usize; |
| 14 | if idx < a.len() { |
| 15 | let elem = &mut *c.add(idx); |
| 16 | *elem = a[idx] + b[idx]; |
| 17 | } |
| 18 | } |
no test coverage detected