From 8c8fff0a0404486d215442ebdd719a96b3e5dd8b Mon Sep 17 00:00:00 2001 From: Ulrik Sverdrup Date: Sat, 27 Jul 2024 15:46:46 +0200 Subject: [PATCH] Fix alignment in s390x and cross test Requested 32-alignment for s390x but thread local storage does not supply it. Lower requested align to 16 in general to avoid having this problem pop up on other platforms too. --- .github/workflows/ci.yml | 10 +++++++++- src/gemm.rs | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39dd7a3..17efc9c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,7 @@ env: CARGO_TERM_COLOR: always CARGO_INCREMENTAL: 0 MATMUL_NUM_THREADS: 4 + RUST_BACKTRACE: full jobs: tests: @@ -119,6 +120,9 @@ jobs: strategy: matrix: include: + - rust: stable + target: s390x-unknown-linux-gnu + features: constconf cgemm threading - rust: stable target: aarch64-unknown-linux-gnu features: constconf cgemm threading @@ -146,7 +150,11 @@ jobs: run: cross test --target "${{ matrix.target }}" --features "${{ matrix.features }}" env: MMTEST_FAST_TEST: 1 - RUSTFLAGS: -Copt-level=2 + - name: Tests (Release) + run: cross test --release --target "${{ matrix.target }}" --features "${{ matrix.features }}" + env: + MMTEST_FAST_TEST: 1 + cargo-careful: runs-on: ubuntu-latest diff --git a/src/gemm.rs b/src/gemm.rs index 63dbdcd..f7605d5 100644 --- a/src/gemm.rs +++ b/src/gemm.rs @@ -344,7 +344,8 @@ const MASK_BUF_SIZE: usize = KERNEL_MAX_SIZE + KERNEL_MAX_ALIGN - 1; // bugs we have seen on certain platforms (macos) that look like // we don't get aligned allocations out of TLS - 16- and 8-byte // allocations have been seen, make the minimal align request we can. -#[cfg_attr(not(target_os = "macos"), repr(align(32)))] +// Align(32) would not work with TLS for s390x. +#[cfg_attr(not(target_os = "macos"), repr(align(16)))] struct MaskBuffer { buffer: [u8; MASK_BUF_SIZE], }