Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions oneapi-rs/examples/kernel_launch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ namespace syclexp = sycl::ext::oneapi::experimental;

extern "C"
SYCL_EXT_ONEAPI_FUNCTION_PROPERTY((syclexp::nd_range_kernel<1>))
void iota(double start, double *ptr) {
void iota(float start, float *ptr) {
size_t id = syclext::this_work_item::get_nd_item<1>().get_global_linear_id();
ptr[id] = start + static_cast<double>(id);
ptr[id] = start + static_cast<float>(id);
}
"#;

#[tokio::main]
async fn main() {
let mut queue = Queue::new();
let mut device_buffer = queue.alloc_device::<f64>(1024).await;
let mut device_buffer = queue.alloc_device::<f32>(1024).await;

let kernel = queue
.get_context()
Expand All @@ -36,12 +36,12 @@ async fn main() {
queue.launch(
NdRange::new([1024], [16]),
&kernel,
(3.14, &mut device_buffer),
(3.14_f32, &mut device_buffer),
)
}
.await;

let mut host_buffer = queue.alloc_host::<f64>(1024).await;
let mut host_buffer = queue.alloc_host::<f32>(1024).await;

queue.copy(&device_buffer, &mut host_buffer).await;

Expand Down
8 changes: 4 additions & 4 deletions oneapi-rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@
//! be written using modern ISO C++, and provides APIs and abstractions to find devices
//! (CPUs, GPUs, FPGAs ...) on which code can be executed, and to manage data resources and code
//! execution on those devices.
//!
//!
//! # System dependencies
//! Make sure to install the [Intel oneAPI toolkit](https://www.intel.com/content/www/us/en/developer/tools/oneapi/oneapi-toolkit-download.html).
//! Then source the `setvars.sh` file:
//! ```bash
//! source <oneapi_install_directory>/setvars.sh
//! ```
//!
//!
//! # Getting started
//! ### Building the crate
//! Before building this crate you need to source the `setvars.sh` file. You can then build it as
//! usual with cargo:
//! ```bash
//! cargo build --release
//! ```
//!
//!
//! You must also source `setvars.sh` before running any SYCL program.
//!
//!
//! ### Hello world
//! 1. Create a [`Queue`](crate::queue::Queue). It's the main entry point to the SYCL API.
//! ```
Expand Down
Loading