.travis.yml: try to run tests in -mavx2 mode if the CPU supports it
And modify settings so as to hae a AVX2 compatible CPU
This commit is contained in:
parent
8fa405ee15
commit
69a001819c
|
@ -27,9 +27,11 @@ matrix:
|
|||
|
||||
# Test compilation with AVX2
|
||||
- os: linux
|
||||
# "sudo: yes" and "dist: trusty" give us a worker with the AVX2 instruction set
|
||||
sudo: yes
|
||||
dist: trusty
|
||||
compiler: clang-3.8
|
||||
# skip tests since Travis doesn't have AVX2 compatible machines
|
||||
env: OPJ_CI_CC=clang-3.8 OPJ_CI_CXX=clang-3.8 OPJ_CI_INSTRUCTION_SETS="-mavx2" OPJ_CI_BUILD_CONFIGURATION=Release OPJ_CI_SKIP_TESTS=1
|
||||
env: OPJ_CI_CC=clang-3.8 OPJ_CI_CXX=clang-3.8 OPJ_CI_INSTRUCTION_SETS="-mavx2" OPJ_CI_BUILD_CONFIGURATION=Release
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
|
|
|
@ -111,6 +111,17 @@ elif [ "${TRAVIS_OS_NAME}" == "linux" ]; then
|
|||
else
|
||||
echo "Compiler not supported: ${CC}"; exit 1
|
||||
fi
|
||||
if [ "${OPJ_CI_INSTRUCTION_SETS-:}" == "-mavx2" ]; then
|
||||
AVX2_AVAIL=1
|
||||
cat /proc/cpuinfo | grep avx2 >/dev/null || AVX2_AVAIL=0
|
||||
if [[ "${AVX2_AVAIL}" == "1" ]]; then
|
||||
echo "AVX2 available on CPU"
|
||||
else
|
||||
echo "AVX2 not available on CPU. Disabling tests"
|
||||
cat /proc/cpuinfo | grep flags | head -n 1
|
||||
export OPJ_CI_SKIP_TESTS=1
|
||||
fi
|
||||
fi
|
||||
elif [ "${TRAVIS_OS_NAME}" == "windows" ]; then
|
||||
OPJ_OS_NAME=windows
|
||||
if which cl > /dev/null; then
|
||||
|
|
Loading…
Reference in New Issue