Skip to content

Commit 0f9a935

Browse files
authored
Merge pull request #62 from xianyi/develop
rebase
2 parents dd7a650 + 79cd69f commit 0f9a935

File tree

11 files changed

+1703
-365
lines changed

11 files changed

+1703
-365
lines changed

.github/workflows/dynamic_arch.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: continuous build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
os: [ubuntu-latest, macos-latest]
12+
build: [cmake, make]
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v2
16+
17+
- name: Compilation cache
18+
uses: actions/cache@v2
19+
with:
20+
path: ~/.ccache
21+
# We include the commit sha in the cache key, as new cache entries are
22+
# only created if there is no existing entry for the key yet.
23+
key: ${{ runner.os }}-ccache-${{ github.sha }}
24+
# Restore any ccache cache entry, if none for
25+
# ${{ runner.os }}-ccache-${{ github.sha }} exists
26+
restore-keys: |
27+
${{ runner.os }}-ccache
28+
29+
- name: Print system information
30+
run: |
31+
if [ "$RUNNER_OS" == "Linux" ]; then
32+
cat /proc/cpuinfo
33+
elif [ "$RUNNER_OS" == "macOS" ]; then
34+
sysctl -a | grep machdep.cpu
35+
else
36+
echo "$RUNNER_OS not supported"
37+
exit 1
38+
fi
39+
40+
- name: Install Dependencies
41+
run: |
42+
if [ "$RUNNER_OS" == "Linux" ]; then
43+
sudo apt-get install -y gfortran cmake ccache
44+
elif [ "$RUNNER_OS" == "macOS" ]; then
45+
brew install coreutils cmake ccache
46+
else
47+
echo "$RUNNER_OS not supported"
48+
exit 1
49+
fi
50+
ccache -M 300M # Limit the ccache size; Github's overall cache limit is 5GB
51+
52+
- name: Build
53+
if: matrix.build == 'make'
54+
run: |
55+
if [ "$RUNNER_OS" == "Linux" ]; then
56+
export PATH="/usr/lib/ccache:${PATH}"
57+
elif [ "$RUNNER_OS" == "macOS" ]; then
58+
export PATH="$(brew --prefix)/opt/ccache/libexec:${PATH}"
59+
else
60+
echo "$RUNNER_OS not supported"
61+
exit 1
62+
fi
63+
64+
make -j$(nproc) DYNAMIC_ARCH=1 USE_OPENMP=0
65+
66+
- name: CMake build
67+
if: matrix.build == 'cmake'
68+
run: |
69+
if [ "$RUNNER_OS" == "Linux" ]; then
70+
export PATH="/usr/lib/ccache:${PATH}"
71+
elif [ "$RUNNER_OS" == "macOS" ]; then
72+
export PATH="$(brew --prefix)/opt/ccache/libexec:${PATH}"
73+
else
74+
echo "$RUNNER_OS not supported"
75+
exit 1
76+
fi
77+
78+
mkdir build
79+
cd build
80+
cmake -DDYNAMIC_ARCH=1 -DNOFORTRAN=0 -DBUILD_WITHOUT_LAPACK=0 -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Release ..
81+
make -j$(nproc)

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ option(BUILD_WITHOUT_CBLAS "Do not build the C interface (CBLAS) to the BLAS fun
2323
option(DYNAMIC_ARCH "Include support for multiple CPU targets, with automatic selection at runtime (x86/x86_64, aarch64 or ppc only)" OFF)
2424
option(DYNAMIC_OLDER "Include specific support for older x86 cpu models (Penryn,Dunnington,Atom,Nano,Opteron) with DYNAMIC_ARCH" OFF)
2525
option(BUILD_RELAPACK "Build with ReLAPACK (recursive implementation of several LAPACK functions on top of standard LAPACK)" OFF)
26+
option(USE_LOCKING "Use locks even in single-threaded builds to make them callable from multiple threads" OFF)
2627
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
2728
option(NO_AFFINITY "Disable support for CPU affinity masks to avoid binding processes from e.g. R or numpy/scipy to a single core" ON)
2829
else()

cmake/os.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
88
set(NO_EXPRECISION 1)
99
endif ()
1010

11-
if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|OpenBSD|NetBSD|DragonFly")
11+
if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|OpenBSD|NetBSD|DragonFly|Darwin")
1212
set(EXTRALIB "${EXTRALIB} -lm")
1313
set(NO_EXPRECISION 1)
1414
endif ()

cmake/system.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,16 @@ if (USE_SIMPLE_THREADED_LEVEL3)
297297
set(CCOMMON_OPT "${CCOMMON_OPT} -DUSE_SIMPLE_THREADED_LEVEL3")
298298
endif ()
299299

300+
if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
301+
if (DEFINED MAX_STACK_ALLOC)
302+
if (NOT ${MAX_STACK_ALLOC} EQUAL 0)
303+
set(CCOMMON_OPT "${CCOMMON_OPT} -DMAX_STACK_ALLOC=${MAX_STACK_ALLOC}")
304+
endif ()
305+
else ()
306+
set(CCOMMON_OPT "${CCOMMON_OPT} -DMAX_STACK_ALLOC=2048")
307+
endif ()
308+
endif ()
309+
300310
if (DEFINED LIBNAMESUFFIX)
301311
set(LIBPREFIX "libopenblas_${LIBNAMESUFFIX}")
302312
else ()

kernel/arm64/KERNEL.CORTEXA53

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,9 @@ endif
126126
SGEMMINCOPYOBJ = sgemm_incopy$(TSUFFIX).$(SUFFIX)
127127
SGEMMITCOPYOBJ = sgemm_itcopy$(TSUFFIX).$(SUFFIX)
128128
endif
129-
ifeq ($(SGEMM_UNROLL_N), 16)
129+
130130
SGEMMOTCOPY = sgemm_tcopy_$(SGEMM_UNROLL_N).S
131-
else
132-
SGEMMOTCOPY = ../generic/gemm_tcopy_$(SGEMM_UNROLL_N).c
133-
endif
134-
ifeq ($(SGEMM_UNROLL_N), 4)
135131
SGEMMONCOPY = sgemm_ncopy_$(SGEMM_UNROLL_N).S
136-
else
137-
SGEMMONCOPY = ../generic/gemm_ncopy_$(SGEMM_UNROLL_N).c
138-
endif
139132
SGEMMONCOPYOBJ = sgemm_oncopy$(TSUFFIX).$(SUFFIX)
140133
SGEMMOTCOPYOBJ = sgemm_otcopy$(TSUFFIX).$(SUFFIX)
141134

0 commit comments

Comments
 (0)