diff --git a/oneapi-rs/examples/kernel_launch.rs b/oneapi-rs/examples/kernel_launch.rs index 10bf4f8..83940f3 100644 --- a/oneapi-rs/examples/kernel_launch.rs +++ b/oneapi-rs/examples/kernel_launch.rs @@ -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(id); + ptr[id] = start + static_cast(id); } "#; #[tokio::main] async fn main() { let mut queue = Queue::new(); - let mut device_buffer = queue.alloc_device::(1024).await; + let mut device_buffer = queue.alloc_device::(1024).await; let kernel = queue .get_context() @@ -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::(1024).await; + let mut host_buffer = queue.alloc_host::(1024).await; queue.copy(&device_buffer, &mut host_buffer).await; diff --git a/oneapi-rs/src/lib.rs b/oneapi-rs/src/lib.rs index 28271b5..9b85471 100644 --- a/oneapi-rs/src/lib.rs +++ b/oneapi-rs/src/lib.rs @@ -12,14 +12,14 @@ //! 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 /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 @@ -27,9 +27,9 @@ //! ```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. //! ```