Skip to content

Commit

Permalink
Merge pull request #560 from robertknight/fix-x86-macos-build
Browse files Browse the repository at this point in the history
Fix x86 macOS build and run `cargo check` for Intel macOS in CI
  • Loading branch information
robertknight authored Jan 29, 2025
2 parents cfb3acc + 85b93b9 commit ceb3f33
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ jobs:
- name: Install Rust nightly toolchain
run: rustup toolchain install nightly
if: ${{ matrix.os == 'ubuntu-latest' }}
- name: Install Rust x86_64-apple-darwin target
run: rustup target add x86_64-apple-darwin
if: ${{ matrix.os == 'macos-14' }}
- name: Cache
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -57,6 +60,9 @@ jobs:
run: |
make wasm-test wasm-test-simd
if: ${{ matrix.os == 'ubuntu-latest' }}
- name: Build (Intel macOS)
run: cargo check --workspace --target x86_64-apple-darwin
if: ${{ matrix.os == 'macos-14' }}
- name: Lint
run: |
make checkformatting
Expand Down
4 changes: 2 additions & 2 deletions rten-simd/src/isa_detection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub mod macos {
/// See https://github.com/golang/go/issues/43089. Go chose to use the
/// `commpage` to get the info. We use `sysctlbyname` instead since it is
/// a documented API.
fn test_for_avx512_on_macos() -> bool {
pub(super) fn test_for_avx512_on_macos() -> bool {
use std::sync::OnceLock;

static AVX512_AVAILABLE: OnceLock<bool> = OnceLock::new();
Expand Down Expand Up @@ -54,7 +54,7 @@ pub mod macos {
let sysctl_ret = unsafe {
sysctlbyname(
name.as_ptr(),
std::mem::transmute(&mut result),
&mut result as *mut i64 as *mut c_void,
&mut size,
std::ptr::null(),
0,
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
//!
//! - `f32`, `i32`, `i8`, `u8`
//! - `i64` and `bool` tensors are supported by converting them to `i32` as
//! part of the model conversion process. When preparing model inputs that
//! expect these data types in ONNX, you will need to convert them to `i32`.
//! part of the model conversion process. When preparing model inputs that
//! expect these data types in ONNX, you will need to convert them to `i32`.
//!
//! Some operators support a more limited set of data types than described in
//! the ONNX specification. Please file an issue if you need an operator to
Expand Down

0 comments on commit ceb3f33

Please sign in to comment.