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
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Changelog

All notable changes to this project will be documented in this file.

## Semantic versioning policy

oneAPI-rs follows Semantic Versioning. Before 1.0.0, the public API is
experimental: minor releases may contain breaking API changes, while patch
releases are intended for compatible fixes.

## Unreleased

This is the first release of oneAPI-rs, a set of (mostly) safe Rust bindings
for SYCL - an open, royalty-free, cross-platform abstraction layer that
enables code for heterogeneous and offload processors to 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.

Documentation of oneAPI-rs including API description, architecture, and examples
can be found at: <https://oneapi-src.github.io/oneapi-rs/oneapi_rs/>

### Added

- Initial Rust API for discovering SYCL platforms and devices.
- Queues, events, contexts, USM allocations, and host/device memory operations.
- Runtime kernel bundle compilation and one-, two-, and three-dimensional
kernel launch support.
- Derive support for typed kernel argument lists.
62 changes: 56 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,63 @@
# Contributing
# Contributing to oneAPI-rs

### License
## Development setup

<PROJECT NAME> is licensed under the terms in [LICENSE]<link to license file in repo>. By contributing to the project, you agree to the license and copyright terms therein and release your contribution under these terms.
Install a Rust toolchain with Rust 2024 edition support and Intel oneAPI Toolkit
2026.1. Clone the repository and initialize the oneAPI environment:

### Sign your work
```bash
git clone https://github.com/oneapi-src/oneapi-rs.git
cd oneapi-rs
source /opt/intel/oneapi/setvars.sh
cargo build --workspace
```

Replace `/opt/intel/oneapi` if the toolkit is installed elsewhere. To select a
specific SYCL compiler, set `ONEAPI_CXX` to its full path.

## Formatting

Check Rust formatting:

```bash
cargo fmt --all -- --check
```

Check tracked C and C++ sources with `clang-format`:

```bash
git ls-files -z -- ':(glob)**/*.cpp' ':(glob)**/*.hpp' ':(glob)**/*.h' \
| xargs -0 --no-run-if-empty clang-format --dry-run --Werror
```

To apply Rust formatting, run `cargo fmt --all`. Apply C++ formatting with the
project's installed `clang-format` before rerunning the check above.

## Tests and examples

Initialize the oneAPI environment in the current shell, then run the workspace
tests:

```bash
source /opt/intel/oneapi/setvars.sh
cargo test --workspace --verbose
```

The tests and examples require a working SYCL runtime and visible compatible
device.

## License

oneAPI-rs is licensed under either the [Apache License 2.0](LICENSE-APACHE) or
the [MIT License](LICENSE-MIT), at your option. By contributing to the project,
you agree to the license and copyright terms therein and release your contribution
under these terms.

## Sign your work

Please use the sign-off line at the end of the patch. Your signature certifies that you wrote the patch or otherwise have the right to pass it on as an open-source patch. The rules are pretty simple: if you can certify
the below (from [developercertificate.org](http://developercertificate.org/)):
Please use the sign-off line at the end of the patch. Your signature certifies
that you wrote the patch or otherwise have the right to pass it on as an open-source patch.
The rules are pretty simple: if you can certify the below (from [developercertificate.org](http://developercertificate.org/)):

```
Developer Certificate of Origin
Expand Down
72 changes: 72 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# oneAPI-rs

Rust bindings for SYCL and the Intel oneAPI programming environment.

> [!WARNING]
> oneAPI-rs is experimental, has not released version 0.1.0, and is not ready
> for production use. Its API may change without notice.

## Supported platforms

The tested configuration is:

- Linux
- Intel oneAPI Toolkit 2026.1
- A SYCL device supported by the installed oneAPI runtime

Other operating systems, oneAPI releases, and SYCL implementations are not
currently tested or supported.

## Prerequisites

- A Rust toolchain with Rust 2024 edition support
- Intel oneAPI Toolkit 2026.1, including the DPC++/C++ compiler and SYCL runtime

Initialize the oneAPI environment before building or running the project:

```bash
source /opt/intel/oneapi/setvars.sh
```

Replace `/opt/intel/oneapi` if the toolkit is installed elsewhere. The build
also accepts an explicit compiler through `ONEAPI_CXX`; the compiler must
support C++17 and SYCL.

## Installation

The crates are not yet published. To build the workspace from source:

```bash
git clone https://github.com/oneapi-src/oneapi-rs.git
cd oneapi-rs
source /opt/intel/oneapi/setvars.sh
cargo build --workspace
```

## Quick start

List the SYCL devices visible to the runtime:

```bash
source /opt/intel/oneapi/setvars.sh
cargo run -p oneapi-rs --example sycl-ls
```

The kernel launch examples demonstrate allocation, runtime kernel compilation,
kernel submission, and copying results back to the host:

```bash
cargo run -p oneapi-rs --example kernel_launch
```

## Documentation

- [API documentation](https://oneapi-src.github.io/oneapi-rs/oneapi_rs/)
- [Examples](oneapi-rs/examples)
- [Contributing](CONTRIBUTING.md)
- [Changelog](CHANGELOG.md)

## License

Licensed under either the [Apache License 2.0](LICENSE-APACHE) or the
[MIT License](LICENSE-MIT), at your option.