We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be2a371 commit 80cf30fCopy full SHA for 80cf30f
1 file changed
oneapi-rs/examples/async.rs
@@ -0,0 +1,31 @@
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
+#[tokio::main]
12
+async fn main() {
13
+ let mut queue = Queue::new();
14
+ let mut buffer = queue.alloc_shared::<u32>(10).await;
15
16
+ for e in buffer.iter() {
17
+ print!("{e} ")
18
+ }
19
20
+ println!();
21
22
+ for i in 0..buffer.len() {
23
+ buffer[i] = i as u32;
24
25
26
27
28
29
30
31
+}
0 commit comments