Skip to content

Commit

Permalink
fix mkl for amd cpu
Browse files Browse the repository at this point in the history
  • Loading branch information
hczhai committed Jan 10, 2024
1 parent a2b90dd commit 583515c
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@ jobs:
sudo apt-get install libopenmpi-dev
python -m pip install mpi4py
- name: fix mkl for amd cpu
if: matrix.os == 'ubuntu-latest'
run: |
lscpu
export CPUTYPE=$(lscpu | grep 'Vendor ID' | awk '{print $3}')
echo $CPUTYPE
if [ "$CPUTYPE" = "AuthenticAMD" ]; then
echo "int mkl_serv_intel_cpu_true() { return 1; }" > fixcpu.c
$CC -shared -fPIC -o libfixcpu.so fixcpu.c
fi
getconf LONG_BIT
- name: build test
env:
MKLROOT: ~/.local
Expand All @@ -64,7 +76,20 @@ jobs:
cd ..
echo "PYTHONPATH=./build:${PYTHONPATH}" >> $GITHUB_ENV
- name: run test (serial)
- name: run test (serial, linux)
if: matrix.os == 'ubuntu-latest'
env:
MKLROOT: ~/.local
run: |
export CPUTYPE=$(lscpu | grep 'Vendor ID' | awk '{print $3}')
if [ "$CPUTYPE" = "AuthenticAMD" ]; then
export LD_PRELOAD=$PWD/libfixcpu.so
fi
py.test pyblock3/algebra
py.test pyblock3/algorithms --ignore=pyblock3/algorithms/tests/test_soc.py
- name: run test (serial, macos)
if: matrix.os == 'macos-12'
env:
MKLROOT: ~/.local
run: |
Expand Down

0 comments on commit 583515c

Please sign in to comment.