Skip to content

Commit

Permalink
Fix alignment in s390x and cross test
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bluss committed Jul 27, 2024
1 parent c7ab1ac commit 8c8fff0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
MATMUL_NUM_THREADS: 4
RUST_BACKTRACE: full

jobs:
tests:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/gemm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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],
}
Expand Down

0 comments on commit 8c8fff0

Please sign in to comment.