apple-accelerate 0.1.0

Safe Rust bindings for Apple's Accelerate framework on macOS using pure C FFI
Documentation
  • Coverage
  • 24.64%
    17 out of 69 items documented1 out of 37 items with examples
  • Size
  • Source code size: 44.46 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.77 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 44s Average build duration of successful builds.
  • all releases: 47s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • doom-fish/accelerate-rs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • 1313

accelerate-rs

Safe Rust bindings for Apple's Accelerate framework on macOS using pure C FFI.

The GitHub repository is accelerate-rs; the published crates.io package is apple-accelerate.

Install

cargo add apple-accelerate

Quick start

use apple_accelerate::{add_f32, sgemm_row_major};

let added = add_f32(&[1.0, 2.0, 3.0], &[4.0, 5.0, 6.0]).expect("vector add");
assert_eq!(added, vec![5.0, 7.0, 9.0]);

let mut output = vec![0.0_f32; 4];
sgemm_row_major(
    2,
    2,
    3,
    1.0,
    &[1.0, 2.0, 3.0, 4.0, 5.0, 6.0],
    &[7.0, 8.0, 9.0, 10.0, 11.0, 12.0],
    0.0,
    &mut output,
)
.expect("sgemm");
assert_eq!(output, vec![58.0, 64.0, 139.0, 154.0]);

v0.1 surface

  • Safe vDSP helpers for FFT setup, vector arithmetic, dot product, reductions, and window generation
  • Safe CBLAS helpers for sdot, row-major sgemv, and row-major sgemm
  • Safe vImage helpers for ARGB8888 rotate / box-convolve / scale and Planar8 contrast stretch
  • Thin unsafe BNNS filter wrapper for convolution / fully connected create-apply-destroy workflows
  • Raw ffi module exposing the underlying C types and functions

Smoke examples

cargo run --example 01_vdsp_fft
cargo run --example 02_blas_vimage