Skip to content

Commit a5d99e9

Browse files
committed
Add basic test
1 parent afa0453 commit a5d99e9

2 files changed

Lines changed: 23 additions & 2 deletions

File tree

.github/workflows/basic.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ jobs:
5858
- name: Build
5959
run: cargo build --verbose
6060

61-
- name: Run tests
62-
run: cargo test --verbose
61+
- name: Run workspace tests
62+
run: cargo test --workspace --verbose
6363

6464
- name: Generate documentation
6565
run: |

oneapi-rs/tests/alloc.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//
2+
// Copyright (C) 2026 Intel Corporation
3+
//
4+
// Under the MIT License or the Apache License v2.0.
5+
// See LICENSE-MIT and LICENSE-APACHE for license information.
6+
// SPDX-License-Identifier: MIT OR Apache-2.0
7+
//
8+
9+
use oneapi_rs::queue::Queue;
10+
11+
#[test]
12+
fn shared_allocation_host_values() {
13+
let queue = Queue::new();
14+
let mut buffer = unsafe { queue.alloc_uninit_shared::<u32>(10) };
15+
16+
for (index, value) in buffer.iter_mut().enumerate() {
17+
*value = index as u32;
18+
}
19+
20+
assert_eq!(buffer.as_ref(), &[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
21+
}

0 commit comments

Comments
 (0)