Skip to content
Open
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: 18 additions & 11 deletions .github/workflows/basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ permissions:
contents: read

jobs:
build:
build-and-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Check if oneAPI is already installed
id: check-oneapi
Expand Down Expand Up @@ -57,9 +57,16 @@ jobs:

- name: Build
run: cargo build --verbose

- name: Run tests
run: cargo test --verbose

- name: Run workspace tests
run: cargo test --workspace --verbose

- name: Run examples
run: |
for example_path in oneapi-rs/examples/*.rs; do
example="$(basename "$example_path" .rs)"
cargo run -p oneapi-rs --example "$example" --verbose
done

- name: Generate documentation
run: |
Expand All @@ -79,14 +86,14 @@ jobs:
HTML

- name: Upload documentation artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: documentation
path: target/doc

deploy-documentation:
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch' && inputs.deploy_documentation == 'true')
needs: build
needs: build-and-test
runs-on: ubuntu-latest

permissions:
Expand All @@ -100,19 +107,19 @@ jobs:

steps:
- name: Download documentation artifact
uses: actions/download-artifact@v4
uses: actions/download-artifact@v7
with:
name: documentation
path: target/doc

- name: Configure GitHub Pages
uses: actions/configure-pages@v5
uses: actions/configure-pages@v6

- name: Upload documentation to GitHub Pages
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@v5
with:
path: target/doc

- name: Deploy documentation to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v5
21 changes: 21 additions & 0 deletions oneapi-rs/tests/alloc.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// Copyright (C) 2026 Intel Corporation
//
// Under the MIT License or the Apache License v2.0.
// See LICENSE-MIT and LICENSE-APACHE for license information.
// SPDX-License-Identifier: MIT OR Apache-2.0
//

use oneapi_rs::queue::Queue;

#[test]
fn shared_allocation_host_values() {
let queue = Queue::new();
let mut buffer = unsafe { queue.alloc_uninit_shared::<u32>(10) };

for (index, value) in buffer.iter_mut().enumerate() {
*value = index as u32;
}

assert_eq!(buffer.as_ref(), &[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
}