File: pythran-blas

package info (click to toggle)
pythran 0.17.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 12,700 kB
  • sloc: cpp: 65,021; python: 41,083; sh: 137; makefile: 87
file content (57 lines) | stat: -rw-r--r-- 2,053 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh
#
# This autopkgtest runs a minimal  only specific test files instead of the full
# suite, as upstream test suite is very time consuming.

set -e -u

DEB_HOST_ARCH=$( dpkg-architecture -qDEB_HOST_ARCH )

if [ "${DEB_HOST_ARCH}" = "riscv64" ] ; then
    # riscv64 runs extremely slowly, run on default python only
    PYVERS=$(py3versions -d)
else
    PYVERS=$(py3versions -s)
fi

# use XSIMD acceleration on supported architectures
CXXFLAGS=
case " amd64 arm64 i386 " in
  *\ ${DEB_HOST_ARCH}\ *)  export CXXFLAGS=-DUSE_XSIMD;;
esac

if [ "${DEB_HOST_ARCH}" = "i386" ] ; then
    export CXXFLAGS="${CXXFLAGS} -march=native"
fi

# Set blas as the alternative.
MACHINE=$(dpkg-architecture -qDEB_HOST_MULTIARCH)
BLASLIB=$(update-alternatives --list libblas.so.3-$MACHINE | grep "blas/")
update-alternatives --set libblas.so.3-$MACHINE $BLASLIB

TEST_FILES="test_base.py test_numpy_func3.py"
# * test_base: basic tests.
# * test_numpy_func3: suggested during initial sponsorship, for
#   additional blas-specific coverage.

# Additionally, some tests are excluded manually, based on the output
# of "pytest --durations=0".
#
# TestNumpyFunc3.test_interp is flakey at levels 6,7,8
# especially with complex numbers (_7c etc) and depending on BLAS implementation
# i386 is flakey also in the real variant, so skip all _6,_7,_8
# see https://github.com/serge-sans-paille/pythran/issues/2000
TEST_SELECTOR="not test__rbfinterp and not test_shallow_water and not test_compute_subpix_2d_gaussian2 and not ( test_interp_6 or interp_7 or test_interp_8)"

# Copy upstream "pythran.tests" to a new package, as it is not part of
# the installed packages but the test files import from it.
cp -r pythran/tests $AUTOPKGTEST_TMP/pythran_tests
cd $AUTOPKGTEST_TMP/pythran_tests
find . -type f -name "*.py" -print0 | xargs -0 sed -i 's|pythran.tests|pythran_tests|g'

for py in ${PYVERS}; do
    echo "Running testsuite with $py using CXXFLAGS=${CXXFLAGS}"
    for test_file in $TEST_FILES; do
        $py -m pytest $test_file -k "${TEST_SELECTOR}"
    done
done