onednnl-sys 0.0.1

sys bindings to oneDNN Deep Learning Library
Documentation
name: Build onednnl-sys for Intel

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  build:
    runs-on: ubuntu-24.04
    env:
      RUSTFLAGS: -D warnings
      CACHE_NUMBER: 1
    strategy:
      matrix:
        rust:
          - stable
          - nightly

    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{ matrix.rust }}

      - name: Cache oneAPI installation
        id: cache-oneapi
        uses: actions/cache@v3
        with:
          path: /opt/intel/oneapi
          key: oneapi-${{ env.CACHE_NUMBER }}
          restore-keys: |
            oneapi-

      - name: Set up Intel oneAPI APT repository
        if: steps.cache-oneapi.outputs.cache-hit != 'true'
        run: |
          wget -qO- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | sudo gpg --dearmor -o /usr/share/keyrings/oneapi-archive-keyring.gpg
          echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
          sudo apt update

      - name: Install Intel oneAPI DNNL version 2025.0.1
        if: steps.cache-oneapi.outputs.cache-hit != 'true'
        run: sudo apt install -y intel-oneapi-dnnl-devel=2025.0.1-* intel-oneapi-compiler-dpcpp-cpp-common-2025.0

      - name: Build onednnl-sys bindings
        run: |
          source /opt/intel/oneapi/setvars.sh
          cargo build
          cargo build --all-features

      - name: Run tests
        run: |
          source /opt/intel/oneapi/setvars.sh
          cargo test
          cargo test --all-features
      
      - name: Run docs
        run: |
          source /opt/intel/oneapi/setvars.sh
          cargo doc
          cargo doc --all-features