Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ permissions:
# amd64/arm64/ppc64le/loong64 ship SIMD kernels (ppc64le's and loong64's were
# also run on real POWER8/POWER9 and a Loongson 3C5000L); riscv64 ships RVV
# kernels (used when the CPU reports V) and s390x vector-facility kernels (used
# when AT_HWCAP reports it). Under qemu the riscv64 lane runs with V and the
# loong64 lane on la464 (LSX+LASX), and each FAILS if its CPU does not report
# the extension (NDARRAY_REQUIRE_RVV / _LASX): until 2026-10-26 both lanes ran
# qemu's default CPUs and so only ever tested the scalar fallbacks.
# when AT_HWCAP reports it). Under qemu the riscv64 lane runs with V, the
# loong64 lane on la464 (LSX+LASX) and the s390x lane on max (VX+VXE), and each
# FAILS if its CPU does not report the extension (NDARRAY_REQUIRE_RVV / _LASX /
# _VXE): until 2026-10-26 they ran qemu's default CPUs, and the riscv64 and
# loong64 lanes only ever tested the scalar fallbacks.
jobs:
test:
name: test (${{ matrix.os }})
Expand Down Expand Up @@ -108,9 +109,9 @@ jobs:

# qemu-user execution for the targets without a hosted runner, plus 32-bit
# arm. It runs their SIMD kernels where qemu emulates the extension: RVV on
# riscv64, LSX/LASX on loong64, VSX on ppc64le, and the vector facility on
# s390x (when the emulated CPU reports it). It is also the endianness and
# word-size guard.
# riscv64, LSX/LASX on loong64, VSX on ppc64le, and the vector facility with
# its z14 enhancements on s390x. It is also the endianness and word-size
# guard.
arch-qemu:
name: arch ${{ matrix.goarch }} (qemu)
runs-on: ubuntu-latest
Expand All @@ -126,7 +127,9 @@ jobs:
# not report LASX fail the lane (TestLASXWhenRequired).
- { goarch: loong64, qemu: qemu-loongarch64-static, cpu: "la464", require: NDARRAY_REQUIRE_LASX }
- { goarch: ppc64le, qemu: qemu-ppc64le-static }
- { goarch: s390x, qemu: qemu-s390x-static }
# max includes z14's vector enhancements (VXE), which the float32
# kernels need; NDARRAY_REQUIRE_VXE fails the lane without them.
- { goarch: s390x, qemu: qemu-s390x-static, cpu: "max", require: NDARRAY_REQUIRE_VXE }
# 32-bit: int is 32 bits, so shape/size overflow paths differ.
- { goarch: arm, qemu: qemu-arm-static }
steps:
Expand Down
17 changes: 17 additions & 0 deletions internal/kernels/vxe_required_s390x_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package kernels

import (
"os"
"testing"
)

// TestVXEWhenRequired fails when NDARRAY_REQUIRE_VXE is set and the CPU does
// not report the vector facility and its enhancements (z14). CI sets it on the
// s390x qemu lane, so the VX and VXE kernels (the float32 ones need z14)
// cannot go untested behind a green tick there.
func TestVXEWhenRequired(t *testing.T) {
t.Logf("useVX = %v, useVXE = %v", useVX, useVXE)
if os.Getenv("NDARRAY_REQUIRE_VXE") != "" && !(useVX && useVXE) {
t.Fatal("NDARRAY_REQUIRE_VXE is set but the CPU does not report VX and VXE: the vector kernels did not all run")
}
}
Loading