Compare commits
302
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99c077a3a7 | ||
|
|
fc042d928b | ||
|
|
cdeac0a3ae | ||
|
|
eb931deb22 | ||
|
|
79a1f38770 | ||
|
|
becda2faa4 | ||
|
|
b61a2d7648 | ||
|
|
8b7e4c2b5c | ||
|
|
2265318d3e | ||
|
|
43fdff7f14 | ||
|
|
826cb4588f | ||
|
|
53d7452cdf | ||
|
|
bd45b82ed0 | ||
|
|
7aa183bb56 | ||
|
|
708d586599 | ||
|
|
2953c7d244 | ||
|
|
2a95564500 | ||
|
|
cb6c4392a5 | ||
|
|
a55535b01f | ||
|
|
66cc27e75f | ||
|
|
5ab143736f | ||
|
|
2fee943edb | ||
|
|
90f6dd43c5 | ||
|
|
7b1f9bedf8 | ||
|
|
e2f9f57433 | ||
|
|
c31861ea62 | ||
|
|
57c2936a43 | ||
|
|
6d070820fc | ||
|
|
1c7251ca20 | ||
|
|
a1331406a3 | ||
|
|
c42fccccb5 | ||
|
|
4c1a4e60a6 | ||
|
|
7fcad02dc2 | ||
|
|
ce79fe12fd | ||
|
|
06c09deee9 | ||
|
|
da7d0f4a38 | ||
|
|
c2cc7a3602 | ||
|
|
e23f9c6642 | ||
|
|
b3f247ae5a | ||
|
|
855945befb | ||
|
|
7c1839899e | ||
|
|
9c43301b6d | ||
|
|
9d6df1dd3e | ||
|
|
f3b2a15fad | ||
|
|
64401b4417 | ||
|
|
5e43ba948c | ||
|
|
c00afc86a6 | ||
|
|
3a6b79c50f | ||
|
|
803e8d4838 | ||
|
|
5f47b872f1 | ||
|
|
114316f361 | ||
|
|
75c6ab4036 | ||
|
|
5c5f852ee3 | ||
|
|
f1ee61ea30 | ||
|
|
b3ffd5524a | ||
|
|
d23680b81d | ||
|
|
b4cc4be2ce | ||
|
|
0968dddf1a | ||
|
|
eddfe1e6b3 | ||
|
|
30d11bc92c | ||
|
|
a3b9c933c5 | ||
|
|
72f082f31d | ||
|
|
7e29f11396 | ||
|
|
9a64b32b44 | ||
|
|
b66a01f909 | ||
|
|
a5e7c0e3e0 | ||
|
|
6356190d06 | ||
|
|
4c8dcb3a8f | ||
|
|
33b50548eb | ||
|
|
c504aedca1 | ||
|
|
b9e107932a | ||
|
|
2f89a5970e | ||
|
|
a9e8fa06bf | ||
|
|
b4c2b34a45 | ||
|
|
c9204f7b6f | ||
|
|
a55e65dba9 | ||
|
|
0bc79da587 | ||
|
|
720a4743b9 | ||
|
|
05fc88180c | ||
|
|
965463f177 | ||
|
|
4272cf8c7f | ||
|
|
87247daadc | ||
|
|
ea2faf0c9a | ||
|
|
a5b55f6fe3 | ||
|
|
a4f4662459 | ||
|
|
82954ba4ca | ||
|
|
392d38168e | ||
|
|
41f9701ebc | ||
|
|
f4caa61e47 | ||
|
|
444d03db9c | ||
|
|
2c3cdaf74e | ||
|
|
7d908564fe | ||
|
|
2f81d6e60c | ||
|
|
e2d941e9af | ||
|
|
8214700930 | ||
|
|
4ae8707b54 | ||
|
|
b24212f5df | ||
|
|
6ff06f5483 | ||
|
|
d92f151634 | ||
|
|
30dbca5051 | ||
|
|
38e6999295 | ||
|
|
3df503cafd | ||
|
|
39c90f9859 | ||
|
|
eae0abfdb6 | ||
|
|
ac8cbfdd8e | ||
|
|
1742decdcb | ||
|
|
08df0f02d9 | ||
|
|
7d7757acd1 | ||
|
|
947d7af4c9 | ||
|
|
72d2ebb4dd | ||
|
|
e105411460 | ||
|
|
666e1081ac | ||
|
|
3ea6322eff | ||
|
|
848e9e6ba7 | ||
|
|
09a016fdf6 | ||
|
|
3f110c8272 | ||
|
|
cb2c726716 | ||
|
|
c8d41e4a32 | ||
|
|
81b30d4538 | ||
|
|
aad97c7763 | ||
|
|
7acb122a98 | ||
|
|
740efd71c4 | ||
|
|
e927373f62 | ||
|
|
9a272fece6 | ||
|
|
b54aec804e | ||
|
|
343830c26f | ||
|
|
b37516add6 | ||
|
|
d030f81380 | ||
|
|
b746f0eda3 | ||
|
|
b8f66ba0ee | ||
|
|
cdebb4fd4b | ||
|
|
ff614575c9 | ||
|
|
0e11537cab | ||
|
|
8cd4be8d47 | ||
|
|
66d9185ebe | ||
|
|
98aefb70b4 | ||
|
|
fd37406817 | ||
|
|
48394384ef | ||
|
|
73bf0b941a | ||
|
|
f95e7b0e32 | ||
|
|
15d6e58510 | ||
|
|
04bb5acd79 | ||
|
|
3d31887073 | ||
|
|
0ddf8ebd42 | ||
|
|
d2ea9bbb6d | ||
|
|
4ff549a450 | ||
|
|
309c48e327 | ||
|
|
552e1c7a7a | ||
|
|
46b9b7a080 | ||
|
|
eaaa628af2 | ||
|
|
7a97c4ca97 | ||
|
|
ee6560c89f | ||
|
|
8d11e4630c | ||
|
|
03a4afcf14 | ||
|
|
901de8f33a | ||
|
|
ce6991780a | ||
|
|
df013c5e28 | ||
|
|
f7ad906b49 | ||
|
|
7f360001f9 | ||
|
|
36c2589d3a | ||
|
|
14107e37d9 | ||
|
|
a06bcf836b | ||
|
|
5253c8f165 | ||
|
|
8f0a1a3f82 | ||
|
|
2c0dd2468e | ||
|
|
7ae24d0b85 | ||
|
|
5aeca597fe | ||
|
|
dcb289539b | ||
|
|
9bcffbd655 | ||
|
|
334cd242d4 | ||
|
|
bba75d5e45 | ||
|
|
4062c10370 | ||
|
|
b78d1dc0ae | ||
|
|
83a01d29ca | ||
|
|
560fa88c96 | ||
|
|
55bb5ef867 | ||
|
|
b37889e52d | ||
|
|
1dde4a13c0 | ||
|
|
11ce79a4f0 | ||
|
|
0904a42fa4 | ||
|
|
d24195e9a1 | ||
|
|
134b21ae60 | ||
|
|
d96daa220d | ||
|
|
fdc1c32340 | ||
|
|
5aa483e16c | ||
|
|
12591caa91 | ||
|
|
ee26caffb3 | ||
|
|
8b08df5c5a | ||
|
|
3bba35b8f7 | ||
|
|
8953ba9c2f | ||
|
|
aa90ab4142 | ||
|
|
46b0dfef8f | ||
|
|
83efceb3cd | ||
|
|
b4945057b7 | ||
|
|
b3904aeed7 | ||
|
|
721c80644b | ||
|
|
badef1d32e | ||
|
|
4e6da5ed34 | ||
|
|
8dff37827e | ||
|
|
c055c36b40 | ||
|
|
993fad6aeb | ||
|
|
3382763df6 | ||
|
|
e81fca06dd | ||
|
|
d339bd5515 | ||
|
|
157273fda0 | ||
|
|
1546599a13 | ||
|
|
79b4dd0fb0 | ||
|
|
c2342fc2d0 | ||
|
|
e541bf68f5 | ||
|
|
5ad6435660 | ||
|
|
e684e36377 | ||
|
|
3318a2b904 | ||
|
|
84730068af | ||
|
|
85337c5160 | ||
|
|
53cd6e7ff7 | ||
|
|
1dd396033a | ||
|
|
3b1ac29b77 | ||
|
|
be68ef03b4 | ||
|
|
f1097d1cba | ||
|
|
3fe7f196e6 | ||
|
|
bad47bd024 | ||
|
|
7f3093a0ad | ||
|
|
1804ff58d7 | ||
|
|
906b9df316 | ||
|
|
f4e5177050 | ||
|
|
2a6beac88f | ||
|
|
d8a2324699 | ||
|
|
874744976c | ||
|
|
9f13b2c6ac | ||
|
|
ec14e1648c | ||
|
|
0ea173ec8c | ||
|
|
5e393f207c | ||
|
|
162591af47 | ||
|
|
dbd5643d37 | ||
|
|
31ef2cbbb3 | ||
|
|
e338d34ce1 | ||
|
|
d36093d084 | ||
|
|
cc4b04a684 | ||
|
|
b3c90564d7 | ||
|
|
6bdc7f9eb7 | ||
|
|
63272b6c82 | ||
|
|
73af02b89f | ||
|
|
549a9f1dbb | ||
|
|
ca1ce84ee5 | ||
|
|
58eeb9041c | ||
|
|
7c77537b25 | ||
|
|
63287e1855 | ||
|
|
d2855d3dab | ||
|
|
1408be5fe0 | ||
|
|
1589d0b21e | ||
|
|
a86419fb66 | ||
|
|
11ff18bb0f | ||
|
|
2e2691b34b | ||
|
|
f4194fc65f | ||
|
|
e12132abd4 | ||
|
|
1cefbea7ea | ||
|
|
8279e68805 | ||
|
|
f18b7a46bf | ||
|
|
fe220a0d7d | ||
|
|
bbdc265798 | ||
|
|
5442aff218 | ||
|
|
83fcab7578 | ||
|
|
2ae019161a | ||
|
|
fb89820f20 | ||
|
|
4e1a381e5b | ||
|
|
fa2b08b378 | ||
|
|
670ec6f757 | ||
|
|
02267d86f5 | ||
|
|
d2003dc886 | ||
|
|
45fd2d9b07 | ||
|
|
0a967797a1 | ||
|
|
fb8dc8ff5c | ||
|
|
2996c25c94 | ||
|
|
cf06250d36 | ||
|
|
28f8fdaf0f | ||
|
|
669c847ceb | ||
|
|
0163143fdd | ||
|
|
20f2ba0141 | ||
|
|
e2e6a4d90a | ||
|
|
9ef5995c22 | ||
|
|
42b7d1f897 | ||
|
|
bd573a9d38 | ||
|
|
2351a98005 | ||
|
|
a5f701c4ab | ||
|
|
4ca76d9de4 | ||
|
|
846a5436e7 | ||
|
|
8779eac3b8 | ||
|
|
3473118213 | ||
|
|
f2022c23ac | ||
|
|
b5456c1b41 | ||
|
|
5a322f21af | ||
|
|
6680e0592f | ||
|
|
0b0bb9951d | ||
|
|
7732a55200 | ||
|
|
be9f7550b5 | ||
|
|
4d213653d8 | ||
|
|
7321444660 | ||
|
|
2da86b80c9 | ||
|
|
5392f6df69 | ||
|
|
b2117bb2ca | ||
|
|
6954845d8d | ||
|
|
e114880dc4 |
@@ -44,7 +44,7 @@ jobs:
|
||||
elif [ "$RUNNER_OS" == "macOS" ]; then
|
||||
# It looks like "gfortran" isn't working correctly unless "gcc" is re-installed.
|
||||
brew reinstall gcc
|
||||
brew install coreutils cmake ccache
|
||||
brew install coreutils ccache
|
||||
brew install llvm
|
||||
else
|
||||
echo "::error::$RUNNER_OS not supported"
|
||||
@@ -87,10 +87,16 @@ jobs:
|
||||
echo "max_size = 300M" > ~/.ccache/ccache.conf
|
||||
echo "compression = true" >> ~/.ccache/ccache.conf
|
||||
ccache -s
|
||||
|
||||
- name: Add gfortran runtime to link path
|
||||
if: matrix.build == 'make' && runner.os == 'macOS'
|
||||
run: |
|
||||
GFORTRAN_LIBDIR=$(gfortran -print-file-name=libgfortran.dylib | xargs dirname)
|
||||
echo "Using gfortran runtime in $GFORTRAN_LIBDIR"
|
||||
echo "LDFLAGS=-L/opt/homebrew/opt/llvm/lib -L$GFORTRAN_LIBDIR" >> $GITHUB_ENV
|
||||
|
||||
- name: Build OpenBLAS
|
||||
run: |
|
||||
export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
|
||||
export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
|
||||
export CC="/opt/homebrew/opt/llvm/bin/clang"
|
||||
case "${{ matrix.build }}" in
|
||||
|
||||
@@ -88,13 +88,14 @@ jobs:
|
||||
run: |
|
||||
case "${{ matrix.build }}" in
|
||||
"make")
|
||||
make -j$(nproc) DYNAMIC_ARCH=1 USE_OPENMP=0 FC="ccache ${{ matrix.fortran }}"
|
||||
make -j$(nproc) DYNAMIC_ARCH=1 BUILD_BFLOAT16=1 USE_OPENMP=0 FC="ccache ${{ matrix.fortran }}"
|
||||
;;
|
||||
"cmake")
|
||||
mkdir build && cd build
|
||||
cmake -DDYNAMIC_ARCH=1 \
|
||||
-DNOFORTRAN=0 \
|
||||
-DBUILD_WITHOUT_LAPACK=0 \
|
||||
-DBUILD_BFLOAT16=1 \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_Fortran_COMPILER=${{ matrix.fortran }} \
|
||||
|
||||
@@ -83,9 +83,39 @@ jobs:
|
||||
|
||||
- name: test
|
||||
run: |
|
||||
export PATH=$GITHUB_WORKSPACE/qemu-install/bin/:$PATH
|
||||
qemu-riscv64 ./utest/openblas_utest
|
||||
qemu-riscv64 ./utest/openblas_utest_ext
|
||||
run_with_retry() {
|
||||
local cmd="$1"
|
||||
local time_out=10
|
||||
local retries=10
|
||||
local attempt=0
|
||||
|
||||
for ((i=1; i<=retries; i++)); do
|
||||
attempt=$((i))
|
||||
if timeout -s 12 --preserve-status $time_out $cmd; then
|
||||
echo "Command succeeded on attempt $i."
|
||||
return 0
|
||||
else
|
||||
local exit_code=$?
|
||||
if [ $exit_code -eq 140 ]; then
|
||||
echo "Attempt $i timed out (retrying...)"
|
||||
time_out=$((time_out + 5))
|
||||
else
|
||||
echo "Attempt $i failed with exit code $exit_code. Aborting workflow."
|
||||
exit $exit_code
|
||||
fi
|
||||
fi
|
||||
done
|
||||
echo "All $retries attempts failed, giving up."
|
||||
echo "Final failure was due to timeout."
|
||||
echo "Aborting workflow."
|
||||
exit $exit_code
|
||||
}
|
||||
export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
|
||||
which qemu-riscv64
|
||||
export QEMU_BIN=$(which qemu-riscv64)
|
||||
run_with_retry "$QEMU_BIN ./utest/openblas_utest"
|
||||
run_with_retry "$QEMU_BIN ./utest/openblas_utest_ext"
|
||||
|
||||
OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./ctest/xscblat1
|
||||
OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./ctest/xdcblat1
|
||||
OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./ctest/xccblat1
|
||||
|
||||
@@ -49,7 +49,7 @@ jobs:
|
||||
elif [ "$RUNNER_OS" == "macOS" ]; then
|
||||
# It looks like "gfortran" isn't working correctly unless "gcc" is re-installed.
|
||||
brew reinstall gcc
|
||||
brew install coreutils cmake ccache
|
||||
brew install coreutils ccache
|
||||
else
|
||||
echo "::error::$RUNNER_OS not supported"
|
||||
exit 1
|
||||
@@ -89,6 +89,14 @@ jobs:
|
||||
echo "max_size = 300M" > ~/.ccache/ccache.conf
|
||||
echo "compression = true" >> ~/.ccache/ccache.conf
|
||||
ccache -s
|
||||
|
||||
- name: Add gfortran runtime to link path
|
||||
if: matrix.build == 'make' && runner.os == 'macOS'
|
||||
run: |
|
||||
GFORTRAN_LIBDIR=$(gfortran -print-file-name=libgfortran.dylib | xargs dirname)
|
||||
echo "Using gfortran runtime in $GFORTRAN_LIBDIR"
|
||||
# Preserve whatever LDFLAGS may already contain
|
||||
echo "LDFLAGS=${LDFLAGS:+$LDFLAGS }-L$GFORTRAN_LIBDIR" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Build OpenBLAS
|
||||
run: |
|
||||
|
||||
@@ -35,7 +35,7 @@ jobs:
|
||||
|
||||
- name: Install libffi6
|
||||
run: |
|
||||
wget http://ftp.ca.debian.org/debian/pool/main/libf/libffi/libffi6_3.2.1-9_amd64.deb
|
||||
wget https://download.nvidia.com/cumulus/apt.cumulusnetworks.com/pool/upstream/libf/libffi/libffi6_3.2.1-9_amd64.deb
|
||||
sudo dpkg -i libffi6_3.2.1-9_amd64.deb
|
||||
|
||||
- name: Install APT deps
|
||||
|
||||
@@ -17,7 +17,7 @@ jobs:
|
||||
triple: riscv64-unknown-linux-gnu
|
||||
riscv_gnu_toolchain: https://github.com/riscv-collab/riscv-gnu-toolchain
|
||||
riscv_gnu_toolchain_version: 13.2.0
|
||||
riscv_gnu_toolchain_nightly_download_path: /releases/download/2024.02.02/riscv64-glibc-ubuntu-22.04-llvm-nightly-2024.02.02-nightly.tar.gz
|
||||
riscv_gnu_toolchain_nightly_download_path: /releases/download/2025.08.29/riscv64-glibc-ubuntu-22.04-llvm-nightly-2025.08.29-nightly.tar.xz
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
name: Windows ARM64 CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
pull_request:
|
||||
branches:
|
||||
- develop
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read # to fetch code (actions/checkout)
|
||||
|
||||
jobs:
|
||||
build:
|
||||
if: "github.repository == 'OpenMathLib/OpenBLAS'"
|
||||
runs-on: windows-11-arm
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install LLVM for Win-ARM64
|
||||
shell: pwsh
|
||||
run: |
|
||||
Invoke-WebRequest https://github.com/llvm/llvm-project/releases/download/llvmorg-20.1.8/LLVM-20.1.8-woa64.exe -UseBasicParsing -OutFile LLVM-woa64.exe
|
||||
Start-Process -FilePath ".\LLVM-woa64.exe" -ArgumentList "/S" -Wait
|
||||
echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
#dir "C:\Program Files\LLVM\include\flang"
|
||||
#rmdir /Q /S "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/Llvm/ARM64"
|
||||
|
||||
- name: Install CMake and Ninja for Win-ARM64
|
||||
shell: pwsh
|
||||
run: |
|
||||
Invoke-WebRequest https://github.com/Kitware/CMake/releases/download/v3.29.4/cmake-3.29.4-windows-arm64.msi -OutFile cmake-arm64.msi
|
||||
Start-Process msiexec.exe -ArgumentList "/i cmake-arm64.msi /quiet /norestart" -Wait
|
||||
echo "C:\Program Files\CMake\bin" >> $env:GITHUB_PATH
|
||||
|
||||
Invoke-WebRequest https://github.com/ninja-build/ninja/releases/download/v1.13.1/ninja-winarm64.zip -OutFile ninja-winarm64.zip
|
||||
Expand-Archive ninja-winarm64.zip -DestinationPath ninja
|
||||
Copy-Item ninja\ninja.exe -Destination "C:\Windows\System32"
|
||||
|
||||
- name: Configure OpenBLAS
|
||||
shell: cmd
|
||||
run: |
|
||||
CALL "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsarm64.bat"
|
||||
set PATH=C:\Program Files\LLVM\bin;%PATH%
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -G Ninja ^
|
||||
-DCMAKE_BUILD_TYPE=Release ^
|
||||
-DTARGET=ARMV8 ^
|
||||
-DBINARY=64 ^
|
||||
-DCMAKE_C_COMPILER=clang-cl ^
|
||||
-DCMAKE_Fortran_COMPILER=flang-new ^
|
||||
-DBUILD_SHARED_LIBS=ON ^
|
||||
-DCMAKE_SYSTEM_PROCESSOR=arm64 ^
|
||||
-DCMAKE_SYSTEM_NAME=Windows ^
|
||||
-DCMAKE_INSTALL_PREFIX=C:/opt
|
||||
|
||||
- name: Build OpenBLAS
|
||||
shell: cmd
|
||||
run: |
|
||||
cd build
|
||||
ninja -j16
|
||||
|
||||
- name: Install OpenBLAS
|
||||
shell: cmd
|
||||
run: |
|
||||
cd build
|
||||
cmake --install .
|
||||
|
||||
- name: Run ctests
|
||||
shell: pwsh
|
||||
run: |
|
||||
$env:PATH = "C:\opt\bin;$env:PATH"
|
||||
cd build
|
||||
ctest
|
||||
|
||||
|
||||
+7
-1
@@ -13,8 +13,8 @@ lapack-3.4.1.tgz
|
||||
lapack-3.4.2
|
||||
lapack-3.4.2.tgz
|
||||
lapack-netlib/make.inc
|
||||
lapack-netlib/lapacke/include/lapacke_mangling.h
|
||||
lapack-netlib/SRC/la_constants.mod
|
||||
lapack-netlib/SRC/la_xisnan.mod
|
||||
lapack-netlib/TESTING/testing_results.txt
|
||||
lapack-netlib/INSTALL/test*
|
||||
lapack-netlib/TESTING/xeigtstc
|
||||
@@ -81,7 +81,10 @@ test/ZBLAT2.SUMM
|
||||
test/ZBLAT3.SUMM
|
||||
test/ZBLAT3_3M.SUMM
|
||||
test/SHBLAT3.SUMM
|
||||
test/SBBLAT2.SUMM
|
||||
test/SBBLAT3.SUMM
|
||||
test/BBLAT2.SUMM
|
||||
test/BBLAT3.SUMM
|
||||
test/cblat1
|
||||
test/cblat2
|
||||
test/cblat3
|
||||
@@ -96,6 +99,9 @@ test/sblat3
|
||||
test/sblat3_3m
|
||||
test/test_shgemm
|
||||
test/test_sbgemm
|
||||
test/test_sbgemv
|
||||
test/test_bgemm
|
||||
test/test_bgemv
|
||||
test/zblat1
|
||||
test/zblat2
|
||||
test/zblat3
|
||||
|
||||
+17
-7
@@ -9,7 +9,7 @@ project(OpenBLAS C ASM)
|
||||
|
||||
set(OpenBLAS_MAJOR_VERSION 0)
|
||||
set(OpenBLAS_MINOR_VERSION 3)
|
||||
set(OpenBLAS_PATCH_VERSION 29.dev)
|
||||
set(OpenBLAS_PATCH_VERSION 30.dev)
|
||||
|
||||
set(OpenBLAS_VERSION "${OpenBLAS_MAJOR_VERSION}.${OpenBLAS_MINOR_VERSION}.${OpenBLAS_PATCH_VERSION}")
|
||||
|
||||
@@ -62,6 +62,7 @@ option(CPP_THREAD_SAFETY_TEST "Run a massively parallel DGEMM test to confirm th
|
||||
|
||||
option(CPP_THREAD_SAFETY_GEMV "Run a massively parallel DGEMV test to confirm thread safety of the library (requires OpenMP)" OFF)
|
||||
option(BUILD_STATIC_LIBS "Build static library" OFF)
|
||||
option(BUILD_SHARED_LIBS "Build shared library" OFF)
|
||||
if(NOT BUILD_STATIC_LIBS AND NOT BUILD_SHARED_LIBS)
|
||||
set(BUILD_STATIC_LIBS ON CACHE BOOL "Build static library" FORCE)
|
||||
endif()
|
||||
@@ -123,7 +124,12 @@ message(WARNING "CMake support is experimental. It does not yet support all buil
|
||||
include("${PROJECT_SOURCE_DIR}/cmake/utils.cmake")
|
||||
include("${PROJECT_SOURCE_DIR}/cmake/system.cmake")
|
||||
|
||||
set(OpenBLAS_LIBNAME ${LIBNAMEPREFIX}openblas${LIBNAMESUFFIX}${SUFFIX64_UNDERSCORE})
|
||||
string(FIND "${LIBNAMESUFFIX}" "${SUFFIX64_UNDERSCORE}" HAVE64)
|
||||
if (${HAVE64} GREATER -1)
|
||||
set(OpenBLAS_LIBNAME ${LIBNAMEPREFIX}openblas${LIBNAMESUFFIX})
|
||||
else ()
|
||||
set(OpenBLAS_LIBNAME ${LIBNAMEPREFIX}openblas${LIBNAMESUFFIX}${SUFFIX64_UNDERSCORE})
|
||||
endif ()
|
||||
|
||||
set(BLASDIRS interface driver/level2 driver/level3 driver/others)
|
||||
|
||||
@@ -146,6 +152,9 @@ endif ()
|
||||
if (NOT DEFINED BUILD_BFLOAT16)
|
||||
set (BUILD_BFLOAT16 false)
|
||||
endif ()
|
||||
if (NOT DEFINED BUILD_HFLOAT16)
|
||||
set (BUILD_HFLOAT16 false)
|
||||
endif ()
|
||||
# set which float types we want to build for
|
||||
if (NOT DEFINED BUILD_SINGLE AND NOT DEFINED BUILD_DOUBLE AND NOT DEFINED BUILD_COMPLEX AND NOT DEFINED BUILD_COMPLEX16)
|
||||
# if none are defined, build for all
|
||||
@@ -299,8 +308,8 @@ if (USE_OPENMP)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Fix "Argument list too long" for macOS with Intel CPUs and DYNAMIC_ARCH turned on
|
||||
if(APPLE AND DYNAMIC_ARCH AND (NOT CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "arm64"))
|
||||
# Fix "Argument list too long" for macOS with POWERPC or Intel CPUs
|
||||
if(APPLE AND (NOT CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "arm64"))
|
||||
# Use response files
|
||||
set(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1)
|
||||
# Always build static library first
|
||||
@@ -535,13 +544,13 @@ message(STATUS "adding postbuild instruction to rename syms")
|
||||
if (NOT USE_PERL)
|
||||
add_custom_command(TARGET ${OpenBLAS_LIBNAME}_shared POST_BUILD
|
||||
COMMAND sh ${PROJECT_SOURCE_DIR}/exports/gensymbol "objcopy" "${ARCH}" "${BU}" "${EXPRECISION_IN}" "${NO_CBLAS_IN}" "${NO_LAPACK_IN}" "${NO_LAPACKE_IN}" "${NEED2UNDERSCORES_IN}" "${ONLY_CBLAS_IN}" \"${SYMBOLPREFIX}\" \"${SYMBOLSUFFIX}\" "${BLD}" "${BBF16}" "${BS}" "${BD}" "${BC}" "${BZ}" > ${PROJECT_BINARY_DIR}/objcopy.def
|
||||
COMMAND objcopy -v --redefine-syms ${PROJECT_BINARY_DIR}/objcopy.def ${PROJECT_BINARY_DIR}/lib/${OpenBLAS_LIBNAME}.so
|
||||
COMMAND objcopy --redefine-syms ${PROJECT_BINARY_DIR}/objcopy.def ${PROJECT_BINARY_DIR}/lib/${OpenBLAS_LIBNAME}.so
|
||||
COMMENT "renaming symbols"
|
||||
)
|
||||
else()
|
||||
add_custom_command(TARGET ${OpenBLAS_LIBNAME}_shared POST_BUILD
|
||||
COMMAND perl ${PROJECT_SOURCE_DIR}/exports/gensymbol.pl "objcopy" "${ARCH}" "${BU}" "${EXPRECISION_IN}" "${NO_CBLAS_IN}" "${NO_LAPACK_IN}" "${NO_LAPACKE_IN}" "${NEED2UNDERSCORES_IN}" "${ONLY_CBLAS_IN}" \"${SYMBOLPREFIX}\" \"${SYMBOLSUFFIX}\" "${BLD}" "${BBF16}" "${BS}" "${BD}" "${BC}" "${BZ}" > ${PROJECT_BINARY_DIR}/objcopy.def
|
||||
COMMAND objcopy -v --redefine-syms ${PROJECT_BINARY_DIR}/objcopy.def ${PROJECT_BINARY_DIR}/lib/lib${OpenBLAS_LIBNAME}.so
|
||||
COMMAND objcopy --redefine-syms ${PROJECT_BINARY_DIR}/objcopy.def ${PROJECT_BINARY_DIR}/lib/lib${OpenBLAS_LIBNAME}.so
|
||||
COMMENT "renaming symbols"
|
||||
)
|
||||
endif()
|
||||
@@ -716,4 +725,5 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PN}ConfigVersion.cmake
|
||||
DESTINATION ${CMAKECONFIG_INSTALL_DIR})
|
||||
install(EXPORT "${PN}${SUFFIX64}Targets"
|
||||
NAMESPACE "${PN}${SUFFIX64}::"
|
||||
DESTINATION ${CMAKECONFIG_INSTALL_DIR})
|
||||
DESTINATION ${CMAKECONFIG_INSTALL_DIR})
|
||||
|
||||
|
||||
+14
-1
@@ -251,6 +251,19 @@ In chronological order:
|
||||
* Ye Tao <ye.tao@arm.com>
|
||||
* [2025-02-03] Optimize SBGEMM kernel on NEOVERSEV1
|
||||
* [2025-02-27] Add sbgemv_n_neon kernel
|
||||
* [2025-05-17] Impl prototype of BGEMM inferface
|
||||
|
||||
* Abhishek Kumar <https://github.com/abhishek-iitmadras>
|
||||
* [2025-04-22] Optimise dot kernel for NEOVERSE V1
|
||||
* [2025-04-22] Optimise dot kernel for NEOVERSE V1
|
||||
* [2025-07-23] ARM64-Enable bfloat16 kernels by default
|
||||
|
||||
* Sharif Inamdar <sharif.inamdar@arm.com>
|
||||
* [2025-06-05] Optimize gemv_n_sve_v1x3 kernel
|
||||
|
||||
* Guoyuan Li <https://github.com/guoyuanplct>
|
||||
* [2025-04-11] Optimise gemv kernel for RISCV64_ZVL256B
|
||||
* [2025-05-01] Optimise zgemv kernel for RISCV64_ZVL256B
|
||||
* [2025-05-17] Optimise omatcopy/zomatcopy kernel for RISCV64_ZVL256B
|
||||
* [2025-05-29] Optimise axpby kernel for RISCV64_ZVL256B
|
||||
* [2025-06-05] Optimise hbmv kernel for RISCV64_ZVL256B
|
||||
|
||||
|
||||
+134
@@ -1,4 +1,138 @@
|
||||
OpenBLAS ChangeLog
|
||||
====================================================================
|
||||
Version 0.3.30
|
||||
19-Jun-2025
|
||||
|
||||
general:
|
||||
- fixed an installation problem with the thread safety test in gmake builds
|
||||
- fixed spurious overwriting of an input array in complex GEMMT/GEMMTR
|
||||
- fixed naming of GEMMTR in error messages from XERBLA
|
||||
- fixed compilation of SBGEMMT/SBGEMMTR in CMake builds
|
||||
- fixed the implementation of ?NRM2 to handle INCX=0 correctly
|
||||
- removed tests for CSROT and ZDROT that relied on unspecified behavior
|
||||
- fixed a performance regression in multithreaded GEMM that was particularly
|
||||
serious on POWER targets
|
||||
- fixed linking issues when using LLVM's flang-new with gmake
|
||||
- fixed a potential thread safety problem with C11 atomic operations
|
||||
- further improved the workload partitioning in parallel GEMM
|
||||
- fixed omission of LAPACKE interfaces for CGESVDQ,CTRSYL3 and ?GEQPF in
|
||||
CMake builds
|
||||
- fixed mishandling of setting NO_LAPACK to FALSE, and incorrect dependencies
|
||||
for LAPACK function SPMV in CMake builds
|
||||
- added explicit CMake options for building LAPACKE and shared libraries
|
||||
- simplified and improved handling of OpenMP options in CMake builds
|
||||
- reworked Windows DLL generation in CMake builds to ensure correct symbol
|
||||
renaming (pre/postfixing) and optional generation of PDB files for debugging
|
||||
- updated the Perl script version of the gensymbol utility for use with
|
||||
Windows-on-Arm
|
||||
- Fixed building with (Mingw) gmake on Windows to ensure completeness of the
|
||||
LAPACK included in the static library (potential race condition due to the
|
||||
Windows version of the "ln" utility creating snapshot copies rather than links)
|
||||
- fixed unwanted deletion of the lapacke_mangling.h file by "make clean"
|
||||
- fixed potential duplication of a _64 suffix on library names in CMake builds
|
||||
- fixed compilation of the C fallback copies of the LAPACK code with GCC 15
|
||||
- included fixed from the Reference-LAPACK project:
|
||||
- fixed a truncated error message in the EIG part of the testsuite
|
||||
(Reference-LAPACK PR 1119)
|
||||
- fixed too strict check in LAPACKE_?gesdd_work (PR #1126)
|
||||
- fixed memory corruption when calling ?GEEV with non-finite data (PR #1128)
|
||||
- fixed missing initialization of a variable in C/GEQP3RK (PR #1131)
|
||||
- fixed 2nd dimension chosen in C/ZUNMLQ transposition operation (PR #1135)
|
||||
|
||||
x86_64:
|
||||
- fixed an error in the SBGEMV kernel for Cooper Lake/Sapphire Rapids
|
||||
- fixed corner cases of NAN and INF input handling in CSCAL and ZSCAL
|
||||
- improved the compiler identification code for flang-new
|
||||
- fixed a potential build issue in the ZSUM kernel
|
||||
- fixed "argument list too long" errors when building on MacOS
|
||||
- added cpu autodetection support for several new Arrow Lake models
|
||||
- fixed conditional inclusion of the fast path SGEMM kernel in DYNAMIC_ARCH
|
||||
- fixed compilation with the MinGW build of GCC 15
|
||||
|
||||
arm64:
|
||||
- fixed cpu type detection of A64FX and some ThunderX models (broken in 0.3.29)
|
||||
- added support for the AmpereOne/1A cpus in DYNAMIC_ ARCH builds
|
||||
- added an optimized SBGEMM kernel for NEOVERSEV1
|
||||
- improved 1xN SBGEMM performance by forwarding to SBGEMV
|
||||
- introduced a stepwise increase of the thread count used for
|
||||
SGEMM and SGEMV on NEOVERSEV1/V2 in relation to problem size
|
||||
- introduced a stepwise increase of the thread count used for
|
||||
DGEMV on NEOVERSEV1 in relation to problem size
|
||||
- introduced a stepwise increase of the thread count used for
|
||||
SDOT and DDOT on NEOVERSEV1 in relation to problem size
|
||||
- worked around assembler limitations in LLVM for Windows-on-Arm
|
||||
- enabled cpu type autodetection from the registry on Windows-on-Arm
|
||||
- improved multithreading threshold for GEMV and GESV on Windows-on-Arm
|
||||
- fixed overoptimization issues with LLVM's flang in Windows-on-Arm
|
||||
- fixed corner cases of NAN and INF input handling in CSCAL and ZSCAL
|
||||
- added a fast path SGEMM kernel for small workloads on SME capable targets
|
||||
- improved performance of SGEMM and DGEMM kernels for small workloads
|
||||
- improved performance of SGEMV and DGEMV on SVE-capable targets
|
||||
- improved performance of SGEMV on NEOVERSEN1 and Apple M
|
||||
- added optimized SSYMV and DSYMV kernels for NEOVERSEN1, Apple M and all
|
||||
SVE capable targets
|
||||
- added optimized SBGEMV kernels for NEOVERSEV1/V2/N2
|
||||
- improved performance of SGEMM through faster NCOPY kernels
|
||||
- added compiler options for the NVIDIA HPC Compiler Suite
|
||||
- fixed compilation on OSX with XCode 16.3 and later
|
||||
- fixed cpu core type and cache size detection on Apple M4
|
||||
- updated GEMM parameter settings for Neoverse cpus in cross-builds with CMake
|
||||
- fixed default compiler options for NEOVERSEN1 and CORTEXX2 in CMake builds
|
||||
- fixed conditional inclusion of the fast path SGEMM kernel in DYNAMIC_ARCH
|
||||
- fixed potential miscompilation of the non-SVE SDOT kernel
|
||||
|
||||
riscv64:
|
||||
- added optimized SROTM and DROTM kernels for x280
|
||||
- fixed corner cases of NAN and INF input handling in CSCAL and ZSCAL
|
||||
- improved performance of GEMM_TCOPY on RVV1.0 targets with
|
||||
VLEN of 128 or 256
|
||||
- improved performance of OMATCOPY on targets with VLEN 256
|
||||
- greatly improved performance of SGEMV/DGEMV
|
||||
- improved performance of CGEMV and ZGEMV on C910V and all RVV targets
|
||||
with VLEN 256
|
||||
- improved performance of SAXPBY and DAXPBY on C910V and all RVV targets
|
||||
with VLEN 256
|
||||
- improved performance of AXPY and DOT on C910V and ZVL256B targets by
|
||||
falling back to non-vectorized code for very small N. (Thereby fixing
|
||||
poor performance of CHBMV/ZHBMV for very small K)
|
||||
- fixed CMake build failures of the TRMM kernels
|
||||
|
||||
loongarch64:
|
||||
- improved performance of the LSX versions of SSYMV/DSYMV
|
||||
- made the LASX versions of the DSYMV and SSYMV kernels
|
||||
compatible with hardware changes in LA664 and future targets
|
||||
- fixed inaccuracies in several LASX kernels
|
||||
- improved compatibility of LSX kernels with LA264 targets
|
||||
- fixed handling of deprecated target names in CMake builds
|
||||
- fixed corner cases of NAN and INF input handling in CSCAL and ZSCAL
|
||||
|
||||
power:
|
||||
- fixed building for PPCG4 with CMake
|
||||
- fixed SSCAL/DSCAL on PPC970 running FreeBSD
|
||||
- fixed a potential alignment issue in the POWER8 SGEMV kernel
|
||||
- fixed corner cases of NAN and INF input handling in CSCAL and ZSCAL
|
||||
|
||||
zarch:
|
||||
- fixed corner cases of NAN and INF input handling in CSCAL and ZSCAL
|
||||
- fixed unwanted generation of object files with a writable stack
|
||||
|
||||
x86:
|
||||
- fixed corner cases of NAN and INF input handling in CSCAL and ZSCAL
|
||||
- worked around potential miscompilation of CDOT with very old binutils
|
||||
|
||||
arm:
|
||||
- fixed corner cases of NAN and INF input handling in CSCAL and ZSCAL
|
||||
- fixed unwanted generation of object files with a writable stack
|
||||
|
||||
sparc:
|
||||
- fixed corner cases of NAN and INF input handling in CSCAL and ZSCAL
|
||||
|
||||
alpha:
|
||||
- fixed build failure caused by spurious Windows-only typecasts
|
||||
|
||||
cell:
|
||||
- fixed probable build issue caused by spurious Windows-only typecasts
|
||||
|
||||
====================================================================
|
||||
Version 0.3.29
|
||||
12-Jan-2025
|
||||
|
||||
Vendored
+5
@@ -10,5 +10,10 @@ pipeline {
|
||||
sh 'make clean && make'
|
||||
}
|
||||
}
|
||||
stage('CMakeBuild') {
|
||||
steps {
|
||||
sh 'sudo apt update && sudo apt install cmake -y && make clean && rm -rf build && mkdir build && cd build && cmake -DDYNAMIC_ARCH=1 .. && make'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+46
-3
@@ -1,3 +1,31 @@
|
||||
###############################################################################
|
||||
# Copyright (c) 2025, The OpenBLAS Project
|
||||
# All rights reserved.
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name of the OpenBLAS project nor the names of
|
||||
# its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
###############################################################################
|
||||
|
||||
ifneq ($(C_COMPILER), PGI)
|
||||
|
||||
ifeq ($(C_COMPILER), CLANG)
|
||||
@@ -183,10 +211,25 @@ endif
|
||||
|
||||
# Detect ARM Neoverse V2.
|
||||
ifeq ($(CORE), NEOVERSEV2)
|
||||
ifeq (1, $(filter 1,$(GCCVERSIONGTEQ12) $(ISCLANG)))
|
||||
CCOMMON_OPT += -march=armv9-a -mtune=neoverse-v2
|
||||
ifeq (1, $(filter 1,$(GCCVERSIONGTEQ13) $(ISCLANG)))
|
||||
CCOMMON_OPT += -mcpu=neoverse-v2
|
||||
ifneq ($(F_COMPILER), NAG)
|
||||
FCOMMON_OPT += -march=armv9-a -mtune=neoverse-v2
|
||||
FCOMMON_OPT += -mcpu=neoverse-v2
|
||||
endif
|
||||
else
|
||||
CCOMMON_OPT += -march=armv8.2-a+sve+bf16 -mtune=neoverse-n1
|
||||
ifneq ($(F_COMPILER), NAG)
|
||||
FCOMMON_OPT += -march=armv8.2-a -mtune=neoverse-n1
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# Detect Ampere AmpereOne(ampere1,ampere1a) processors.
|
||||
ifeq ($(CORE), AMPERE1)
|
||||
ifeq (1, $(filter 1,$(GCCVERSIONGTEQ12) $(ISCLANG)))
|
||||
CCOMMON_OPT += -march=armv8.6-a+crypto+crc+fp16+sha3+rng
|
||||
ifneq ($(F_COMPILER), NAG)
|
||||
FCOMMON_OPT += -march=armv8.6-a+crypto+crc+fp16+sha3+rng
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
+24
-1
@@ -71,7 +71,7 @@ install : lib.grd
|
||||
@cat common_interface.h >> "$(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/f77blas.h"
|
||||
@echo \#endif >> "$(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/f77blas.h"
|
||||
|
||||
ifndef NO_CBLAS
|
||||
ifneq ($(NO_CBLAS),1)
|
||||
@echo Generating cblas.h in $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)
|
||||
@cp cblas.h cblas.tmp
|
||||
ifdef SYMBOLPREFIX
|
||||
@@ -189,6 +189,8 @@ endif
|
||||
|
||||
|
||||
#Generating OpenBLASConfig.cmake
|
||||
ifneq ($(origin _OpenBLAS_ROOT_DIR),"undefined")
|
||||
|
||||
@echo Generating $(OPENBLAS_CMAKE_CONFIG) in $(DESTDIR)$(OPENBLAS_CMAKE_DIR)
|
||||
@echo "SET(OpenBLAS_VERSION \"${VERSION}\")" > "$(DESTDIR)$(OPENBLAS_CMAKE_DIR)/$(OPENBLAS_CMAKE_CONFIG)"
|
||||
@echo "file(REAL_PATH \"../../..\" _OpenBLAS_ROOT_DIR BASE_DIRECTORY \$${CMAKE_CURRENT_LIST_DIR} )" >> "$(DESTDIR)$(OPENBLAS_CMAKE_DIR)/$(OPENBLAS_CMAKE_CONFIG)"
|
||||
@@ -215,6 +217,27 @@ else
|
||||
#only static
|
||||
@echo "SET(OpenBLAS_LIBRARIES \$${_OpenBLAS_ROOT_DIR}/lib/$(LIBPREFIX).$(LIBSUFFIX))" >> "$(DESTDIR)$(OPENBLAS_CMAKE_DIR)/$(OPENBLAS_CMAKE_CONFIG)"
|
||||
endif
|
||||
else
|
||||
echo Generating $(OPENBLAS_CMAKE_CONFIG) in $(DESTDIR)$(OPENBLAS_CMAKE_DIR)
|
||||
@echo "SET(OpenBLAS_VERSION \"${VERSION}\")" > "$(DESTDIR)$(OPENBLAS_CMAKE_DIR)/$(OPENBLAS_CMAKE_CONFIG)"
|
||||
@echo "SET(OpenBLAS_INCLUDE_DIRS ${OPENBLAS_INCLUDE_DIR})" >> "$(DESTDIR)$(OPENBLAS_CMAKE_DIR)/$(OPENBLAS_CMAKE_CONFIG)"
|
||||
ifneq ($(NO_SHARED),1)
|
||||
#ifeq logical or
|
||||
ifeq ($(OSNAME), $(filter $(OSNAME),Linux FreeBSD NetBSD OpenBSD DragonFly))
|
||||
@echo "SET(OpenBLAS_LIBRARIES ${OPENBLAS_LIBRARY_DIR}/$(LIBPREFIX)$(SYMBOLSUFFIX).so)" >> "$(DESTDIR)$(OPENBLAS_CMAKE_DIR)/$(OPENBLAS_CMAKE_CONFIG)"
|
||||
endif
|
||||
ifeq ($(OSNAME), $(filter $(OSNAME),WINNT CYGWIN_NT))
|
||||
@echo "SET(OpenBLAS_LIBRARIES ${OPENBLAS_BINARY_DIR}/$(LIBDLLNAME))" >> "$(DESTDIR)$(OPENBLAS_CMAKE_DIR)/$(OPENBLAS_CMAKE_CONFIG)"
|
||||
ifeq ($(OSNAME), Darwin)
|
||||
@echo "SET(OpenBLAS_LIBRARIES ${OPENBLAS_LIBRARY_DIR}/$(LIBPREFIX).dylib)" >> "$(DESTDIR)$(OPENBLAS_CMAKE_DIR)/$(OPENBLAS_CMAKE_CONFIG)"
|
||||
endif
|
||||
else
|
||||
#only static
|
||||
@echo "SET(OpenBLAS_LIBRARIES ${OPENBLAS_LIBRARY_DIR}/$(LIBPREFIX).$(LIBSUFFIX))" >> "$(DESTDIR)$(OPENBLAS_CMAKE_DIR)/$(OPENBLAS_CMAKE_CONFIG)"
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
#Generating OpenBLASConfigVersion.cmake
|
||||
@echo Generating $(OPENBLAS_CMAKE_CONFIG_VERSION) in $(DESTDIR)$(OPENBLAS_CMAKE_DIR)
|
||||
@echo "set (PACKAGE_VERSION \"${VERSION}\")" > "$(DESTDIR)$(OPENBLAS_CMAKE_DIR)/$(OPENBLAS_CMAKE_CONFIG_VERSION)"
|
||||
|
||||
+6
-6
@@ -13,16 +13,16 @@ ifeq ($(CORE), POWER10)
|
||||
ifneq ($(C_COMPILER), PGI)
|
||||
ifeq ($(C_COMPILER), GCC)
|
||||
ifeq ($(GCCVERSIONGTEQ10), 1)
|
||||
CCOMMON_OPT += -Ofast -mcpu=power10 -mtune=power10 -mvsx -fno-fast-math
|
||||
CCOMMON_OPT += -O3 -mcpu=power10 -mtune=power10 -mvsx -fno-fast-math
|
||||
else ifneq ($(GCCVERSIONGT4), 1)
|
||||
$(warning your compiler is too old to fully support POWER9, getting a newer version of gcc is recommended)
|
||||
CCOMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -fno-fast-math
|
||||
CCOMMON_OPT += -O3 -mcpu=power8 -mtune=power8 -mvsx -fno-fast-math
|
||||
else
|
||||
$(warning your compiler is too old to fully support POWER10, getting a newer version of gcc is recommended)
|
||||
CCOMMON_OPT += -Ofast -mcpu=power9 -mtune=power9 -mvsx -fno-fast-math
|
||||
CCOMMON_OPT += -O3 -mcpu=power9 -mtune=power9 -mvsx -fno-fast-math
|
||||
endif
|
||||
else
|
||||
CCOMMON_OPT += -Ofast -mcpu=power10 -mtune=power10 -mvsx -fno-fast-math
|
||||
CCOMMON_OPT += -O3 -mcpu=power10 -mtune=power10 -mvsx -fno-fast-math
|
||||
endif
|
||||
ifeq ($(F_COMPILER), IBM)
|
||||
FCOMMON_OPT += -O2 -qrecur -qnosave -qarch=pwr10 -qtune=pwr10 -qfloat=nomaf -qzerosize
|
||||
@@ -34,7 +34,7 @@ endif
|
||||
|
||||
ifeq ($(CORE), POWER9)
|
||||
ifneq ($(C_COMPILER), PGI)
|
||||
CCOMMON_OPT += -Ofast -mvsx -fno-fast-math
|
||||
CCOMMON_OPT += -O3 -mvsx -fno-fast-math
|
||||
ifeq ($(C_COMPILER), GCC)
|
||||
ifneq ($(GCCVERSIONGT4), 1)
|
||||
$(warning your compiler is too old to fully support POWER9, getting a newer version of gcc is recommended)
|
||||
@@ -70,7 +70,7 @@ endif
|
||||
|
||||
ifeq ($(CORE), POWER8)
|
||||
ifneq ($(C_COMPILER), PGI)
|
||||
CCOMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -fno-fast-math
|
||||
CCOMMON_OPT += -O3 -mcpu=power8 -mtune=power8 -mvsx -fno-fast-math
|
||||
else
|
||||
CCOMMON_OPT += -fast -Mvect=simd -Mcache_align
|
||||
endif
|
||||
|
||||
+11
-1
@@ -7,13 +7,23 @@ CCOMMON_OPT += -march=rv64imafdcv_zba_zbb_zfh_zvl512b -mabi=lp64d
|
||||
FCOMMON_OPT += -march=rv64imafdcv_zba_zbb_zfh -mabi=lp64d -static
|
||||
endif
|
||||
ifeq ($(CORE), RISCV64_ZVL256B)
|
||||
ifeq ($(BUILD_HFLOAT16), 1)
|
||||
CCOMMON_OPT += -march=rv64imafdcv_zvl256b_zvfh_zfh -mabi=lp64d
|
||||
FCOMMON_OPT += -march=rv64imafdcv_zvfh_zfh -mabi=lp64d
|
||||
else
|
||||
CCOMMON_OPT += -march=rv64imafdcv_zvl256b -mabi=lp64d
|
||||
FCOMMON_OPT += -march=rv64imafdcv -mabi=lp64d
|
||||
endif
|
||||
endif
|
||||
ifeq ($(CORE), RISCV64_ZVL128B)
|
||||
CCOMMON_OPT += -march=rv64imafdcv -mabi=lp64d
|
||||
ifeq ($(BUILD_HFLOAT16), 1)
|
||||
CCOMMON_OPT += -march=rv64imafdcv_zvfh_zfh -mabi=lp64d
|
||||
FCOMMON_OPT += -march=rv64imafdcv_zvfh_zfh -mabi=lp64d
|
||||
else
|
||||
CCOMMON_OPT += -march=rv64imafdcv -mabi=lp64d
|
||||
FCOMMON_OPT += -march=rv64imafdcv -mabi=lp64d
|
||||
endif
|
||||
endif
|
||||
ifeq ($(CORE), RISCV64_GENERIC)
|
||||
CCOMMON_OPT += -march=rv64imafdc -mabi=lp64d
|
||||
FCOMMON_OPT += -march=rv64imafdc -mabi=lp64d
|
||||
|
||||
+3
-1
@@ -3,7 +3,7 @@
|
||||
#
|
||||
|
||||
# This library's version
|
||||
VERSION = 0.3.29.dev
|
||||
VERSION = 0.3.30.dev
|
||||
|
||||
# If you set this prefix, the library name will be lib$(LIBNAMESUFFIX)openblas.a
|
||||
# and lib$(LIBNAMESUFFIX)openblas.so, with a matching soname in the shared library
|
||||
@@ -308,6 +308,8 @@ COMMON_PROF = -pg
|
||||
# If you want to enable the experimental BFLOAT16 support
|
||||
# BUILD_BFLOAT16 = 1
|
||||
|
||||
# If you want to enable the experimental HFLOAT16 support
|
||||
# BUILD_HFLOAT16 = 1
|
||||
|
||||
# Set the thread number threshold beyond which the job array for the threaded level3 BLAS
|
||||
# will be allocated on the heap rather than the stack. (This array alone requires
|
||||
|
||||
+26
-7
@@ -270,19 +270,22 @@ SMALL_MATRIX_OPT = 1
|
||||
BUILD_BFLOAT16 = 1
|
||||
else ifeq ($(ARCH), arm64)
|
||||
SMALL_MATRIX_OPT = 1
|
||||
BUILD_BFLOAT16 = 1
|
||||
endif
|
||||
ifeq ($(ARCH), loongarch64)
|
||||
SMALL_MATRIX_OPT = 1
|
||||
endif
|
||||
ifeq ($(ARCH), arm64)
|
||||
GEMM_GEMV_FORWARD = 1
|
||||
SBGEMM_GEMV_FORWARD = 1
|
||||
BGEMM_GEMV_FORWARD = 1
|
||||
endif
|
||||
ifeq ($(ARCH), riscv)
|
||||
GEMM_GEMV_FORWARD = 1
|
||||
endif
|
||||
ifeq ($(ARCH), power)
|
||||
GEMM_GEMV_FORWARD = 1
|
||||
GEMM_GEMV_FORWARD_BF16 = 1
|
||||
SBGEMM_GEMV_FORWARD = 1
|
||||
endif
|
||||
|
||||
ifeq ($(SMALL_MATRIX_OPT), 1)
|
||||
@@ -292,8 +295,11 @@ ifneq ($(ONLY_CBLAS), 1)
|
||||
ifeq ($(GEMM_GEMV_FORWARD), 1)
|
||||
CCOMMON_OPT += -DGEMM_GEMV_FORWARD
|
||||
endif
|
||||
ifeq ($(GEMM_GEMV_FORWARD_BF16), 1)
|
||||
CCOMMON_OPT += -DGEMM_GEMV_FORWARD_BF16
|
||||
ifeq ($(SBGEMM_GEMV_FORWARD), 1)
|
||||
CCOMMON_OPT += -DSBGEMM_GEMV_FORWARD
|
||||
endif
|
||||
ifeq ($(BGEMM_GEMV_FORWARD), 1)
|
||||
CCOMMON_OPT += -DBGEMM_GEMV_FORWARD
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -392,6 +398,8 @@ GCCVERSIONGTEQ9 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 9)
|
||||
GCCVERSIONGTEQ10 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 10)
|
||||
GCCVERSIONGTEQ11 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 11)
|
||||
GCCVERSIONGTEQ12 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 12)
|
||||
GCCVERSIONGTEQ13 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 13)
|
||||
GCCVERSIONGTEQ14 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 14)
|
||||
# Note that the behavior of -dumpversion is compile-time-configurable for
|
||||
# gcc-7.x and newer. Use -dumpfullversion there
|
||||
ifeq ($(GCCVERSIONGTEQ7),1)
|
||||
@@ -418,10 +426,8 @@ ifeq ($(OSNAME), Darwin)
|
||||
ifndef MACOSX_DEPLOYMENT_TARGET
|
||||
ifeq ($(ARCH), arm64)
|
||||
export MACOSX_DEPLOYMENT_TARGET=11.0
|
||||
ifeq ($(C_COMPILER), GCC)
|
||||
export NO_SVE = 1
|
||||
export NO_SME = 1
|
||||
endif
|
||||
else
|
||||
export MACOSX_DEPLOYMENT_TARGET=10.8
|
||||
endif
|
||||
@@ -436,11 +442,9 @@ CCOMMON_OPT += -Wl,-ld_classic
|
||||
FCOMMON_OPT += -Wl,-ld_classic
|
||||
endif
|
||||
ifeq (x$(XCVER), x 16)
|
||||
ifeq ($(F_COMPILER), GFORTRAN)
|
||||
override CEXTRALIB := $(filter-out(-lto_library, $(CEXTRALIB)))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring $(OSNAME), FreeBSD OpenBSD DragonFly))
|
||||
MD5SUM = md5 -r
|
||||
@@ -1190,6 +1194,13 @@ endif
|
||||
else ifeq ($(ARCH), $(filter $(ARCH),mips))
|
||||
FCOMMON_OPT += -mabi=32
|
||||
endif
|
||||
ifeq ($(ARCH), $(filter $(ARCH),loongarch64))
|
||||
ifdef INTERFACE64
|
||||
ifneq ($(INTERFACE64), 0)
|
||||
FCOMMON_OPT += -fdefault-integer-8
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
else
|
||||
ifdef BINARY64
|
||||
ifneq ($(OSNAME), AIX)
|
||||
@@ -1546,6 +1557,9 @@ endif
|
||||
ifeq ($(BUILD_BFLOAT16), 1)
|
||||
CCOMMON_OPT += -DBUILD_BFLOAT16
|
||||
endif
|
||||
ifeq ($(BUILD_HFLOAT16), 1)
|
||||
CCOMMON_OPT += -DBUILD_HFLOAT16
|
||||
endif
|
||||
ifeq ($(BUILD_SINGLE), 1)
|
||||
CCOMMON_OPT += -DBUILD_SINGLE=1
|
||||
endif
|
||||
@@ -1888,11 +1902,16 @@ export TARGET_CORE
|
||||
export NO_AVX512
|
||||
export NO_AVX2
|
||||
export BUILD_BFLOAT16
|
||||
export BUILD_HFLOAT16
|
||||
export NO_LSX
|
||||
export NO_LASX
|
||||
|
||||
export BGEMM_UNROLL_M
|
||||
export BGEMM_UNROLL_N
|
||||
export SBGEMM_UNROLL_M
|
||||
export SBGEMM_UNROLL_N
|
||||
export SHGEMM_UNROLL_M
|
||||
export SHGEMM_UNROLL_N
|
||||
export SGEMM_UNROLL_M
|
||||
export SGEMM_UNROLL_N
|
||||
export DGEMM_UNROLL_M
|
||||
|
||||
+36
-2
@@ -1,4 +1,34 @@
|
||||
###############################################################################
|
||||
# Copyright (c) 2025, The OpenBLAS Project
|
||||
# All rights reserved.
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name of the OpenBLAS project nor the names of
|
||||
# its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
###############################################################################
|
||||
|
||||
BBLASOBJS_P = $(BBLASOBJS:.$(SUFFIX)=.$(PSUFFIX))
|
||||
SBBLASOBJS_P = $(SBBLASOBJS:.$(SUFFIX)=.$(PSUFFIX))
|
||||
SHBLASPBJS_P = $(SHBLASOBJS:.$(SUFFIX)=.$(PSUFFIX))
|
||||
SBLASOBJS_P = $(SBLASOBJS:.$(SUFFIX)=.$(PSUFFIX))
|
||||
DBLASOBJS_P = $(DBLASOBJS:.$(SUFFIX)=.$(PSUFFIX))
|
||||
QBLASOBJS_P = $(QBLASOBJS:.$(SUFFIX)=.$(PSUFFIX))
|
||||
@@ -11,8 +41,8 @@ COMMONOBJS_P = $(COMMONOBJS:.$(SUFFIX)=.$(PSUFFIX))
|
||||
|
||||
HPLOBJS_P = $(HPLOBJS:.$(SUFFIX)=.$(PSUFFIX))
|
||||
|
||||
BLASOBJS = $(SBEXTOBJS) $(SBBLASOBJS) $(SBLASOBJS) $(DBLASOBJS) $(CBLASOBJS) $(ZBLASOBJS) $(CBAUXOBJS)
|
||||
BLASOBJS_P = $(SBEXTOBJS_P) $(SBBLASOBJS_P) $(SBLASOBJS_P) $(DBLASOBJS_P) $(CBLASOBJS_P) $(ZBLASOBJS_P) $(CBAUXOBJS_P)
|
||||
BLASOBJS = $(SHBLASOBJS) $(BBLASOBJS) $(SBEXTOBJS) $(SBBLASOBJS) $(SBLASOBJS) $(DBLASOBJS) $(CBLASOBJS) $(ZBLASOBJS) $(CBAUXOBJS)
|
||||
BLASOBJS_P = $(SHBLASPBJS_P) $(BBLASOBJS_P) $(SBEXTOBJS_P) $(SBBLASOBJS_P) $(SBLASOBJS_P) $(DBLASOBJS_P) $(CBLASOBJS_P) $(ZBLASOBJS_P) $(CBAUXOBJS_P)
|
||||
|
||||
ifdef EXPRECISION
|
||||
BLASOBJS += $(QBLASOBJS) $(XBLASOBJS)
|
||||
@@ -24,6 +54,8 @@ BLASOBJS += $(QBLASOBJS) $(XBLASOBJS)
|
||||
BLASOBJS_P += $(QBLASOBJS_P) $(XBLASOBJS_P)
|
||||
endif
|
||||
|
||||
$(SHBLASOBJS) $(SHBLASOBJS_P) : override CFLAGS += -DHFLOAT16 -UDOUBLE -UCOMPLEX
|
||||
$(BBLASOBJS) $(BBLASOBJS_P) : override CFLAGS += -DBFLOAT16 -DBGEMM -UDOUBLE -UCOMPLEX
|
||||
$(SBBLASOBJS) $(SBBLASOBJS_P) : override CFLAGS += -DBFLOAT16 -UDOUBLE -UCOMPLEX
|
||||
$(SBLASOBJS) $(SBLASOBJS_P) : override CFLAGS += -UDOUBLE -UCOMPLEX
|
||||
$(DBLASOBJS) $(DBLASOBJS_P) : override CFLAGS += -DDOUBLE -UCOMPLEX
|
||||
@@ -33,6 +65,8 @@ $(ZBLASOBJS) $(ZBLASOBJS_P) : override CFLAGS += -DDOUBLE -DCOMPLEX
|
||||
$(XBLASOBJS) $(XBLASOBJS_P) : override CFLAGS += -DXDOUBLE -DCOMPLEX
|
||||
$(SBEXTOBJS) $(SBEXTOBJS_P) : override CFLAGS += -DBFLOAT16 -UDOUBLE -UCOMPLEX
|
||||
|
||||
$(SHBLASOBJS_P) : override CFLAGS += -DPROFILE $(COMMON_PROF)
|
||||
$(BBLASOBJS_P) : override CFLAGS += -DPROFILE $(COMMON_PROF)
|
||||
$(SBBLASOBJS_P) : override CFLAGS += -DPROFILE $(COMMON_PROF)
|
||||
$(SBLASOBJS_P) : override CFLAGS += -DPROFILE $(COMMON_PROF)
|
||||
$(DBLASOBJS_P) : override CFLAGS += -DPROFILE $(COMMON_PROF)
|
||||
|
||||
@@ -29,6 +29,7 @@ For a general introduction to the BLAS routines, please refer to the extensive d
|
||||
We provide official binary packages for the following platform:
|
||||
|
||||
* Windows x86/x86_64
|
||||
* Windows arm64 (woa)
|
||||
|
||||
You can download them from [file hosting on sourceforge.net](https://sourceforge.net/projects/openblas/files/) or from the [Releases section of the GitHub project page](https://github.com/OpenMathLib/OpenBLAS/releases).
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ POWER7
|
||||
POWER8
|
||||
POWER9
|
||||
POWER10
|
||||
POWER11
|
||||
PPCG4
|
||||
PPC970
|
||||
PPC970MP
|
||||
@@ -101,6 +102,7 @@ CORTEXX2
|
||||
NEOVERSEN1
|
||||
NEOVERSEV1
|
||||
NEOVERSEN2
|
||||
NEOVERSEV2
|
||||
CORTEXA55
|
||||
EMAG8180
|
||||
FALKOR
|
||||
|
||||
+20
-6
@@ -25,14 +25,28 @@ jobs:
|
||||
echo "FROM quay.io/pypa/manylinux1_x86_64
|
||||
COPY . /tmp/openblas
|
||||
RUN cd /tmp/openblas && \
|
||||
COMMON_FLAGS='DYNAMIC_ARCH=1 TARGET=NEHALEM NUM_THREADS=32' && \
|
||||
BTYPE='BINARY=64' CC=gcc && \
|
||||
make QUIET_MAKE=1 $COMMON_FLAGS $BTYPE && \
|
||||
make -C test $COMMON_FLAGS $BTYPE && \
|
||||
make -C ctest $COMMON_FLAGS $BTYPE && \
|
||||
make -C utest $COMMON_FLAGS $BTYPE" > Dockerfile
|
||||
CC=gcc && \
|
||||
make QUIET_MAKE=1 BINARY=64 DYNAMIC_ARCH=1 TARGET=NEHALEM NUM_THREADS=32 && \
|
||||
make -C test BINARY=64 DYNAMIC_ARCH=1 TARGET=NEHALEM NUM_THREADS=32 && \
|
||||
make -C ctest BINARY=64 DYNAMIC_ARCH=1 TARGET=NEHALEM NUM_THREADS=32 && \
|
||||
make -C utest BINARY=64 DYNAMIC_ARCH=1 TARGET=NEHALEM NUM_THREADS=32" > Dockerfile
|
||||
docker build .
|
||||
displayName: Run manylinux1 docker build
|
||||
- job: manylinux_32bit
|
||||
pool:
|
||||
vmImage: 'ubuntu-latest'
|
||||
steps:
|
||||
- script: |
|
||||
echo "FROM quay.io/pypa/manylinux2014_i686
|
||||
COPY . /tmp/openblas
|
||||
RUN cd /tmp/openblas && \
|
||||
CC=gcc && \
|
||||
make QUIET_MAKE=1 BINARY=32 TARGET=NEHALEM NUM_THREADS=32 && \
|
||||
make -C test BINARY=32 TARGET=NEHALEM NUM_THREADS=32 && \
|
||||
make -C ctest BINARY=32 TARGET=NEHALEM NUM_THREADS=32 && \
|
||||
make -C utest BINARY=32 TARGET=NEHALEM NUM_THREADS=32" > Dockerfile
|
||||
docker build .
|
||||
displayName: Run manylinux 32bit docker build
|
||||
- job: Intel_SDE_skx
|
||||
pool:
|
||||
vmImage: 'ubuntu-latest'
|
||||
|
||||
+64
-5
@@ -1,3 +1,31 @@
|
||||
###############################################################################
|
||||
# Copyright (c) 2025, The OpenBLAS Project
|
||||
# All rights reserved.
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name of the OpenBLAS project nor the names of
|
||||
# its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
###############################################################################
|
||||
|
||||
TOPDIR = ..
|
||||
include $(TOPDIR)/Makefile.system
|
||||
|
||||
@@ -56,9 +84,15 @@ GOTO_LAPACK_TARGETS=
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16),1)
|
||||
GOTO_HALF_TARGETS=sbgemm.goto
|
||||
GOTO_BFLOAT_TARGETS=bgemm.goto sbgemm.goto bgemv.goto sbgemv.goto
|
||||
else
|
||||
GOTO_HALF_TARGETS=
|
||||
GOTO_BFLOAT_TARGETS=
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_HFLOAT16),1)
|
||||
GOTO_HFLOAT_TARGETS=shgemm.goto
|
||||
else
|
||||
GOTO_HFLOAT_TARGETS=
|
||||
endif
|
||||
|
||||
ifeq ($(OSNAME), WINNT)
|
||||
@@ -104,7 +138,7 @@ goto :: slinpack.goto dlinpack.goto clinpack.goto zlinpack.goto \
|
||||
spotrf.goto dpotrf.goto cpotrf.goto zpotrf.goto \
|
||||
ssymm.goto dsymm.goto csymm.goto zsymm.goto \
|
||||
somatcopy.goto domatcopy.goto comatcopy.goto zomatcopy.goto \
|
||||
saxpby.goto daxpby.goto caxpby.goto zaxpby.goto $(GOTO_HALF_TARGETS)
|
||||
saxpby.goto daxpby.goto caxpby.goto zaxpby.goto $(GOTO_BFLOAT_TARGETS) $(GOTO_HFLOAT_TARGETS)
|
||||
|
||||
acml :: slinpack.acml dlinpack.acml clinpack.acml zlinpack.acml \
|
||||
scholesky.acml dcholesky.acml ccholesky.acml zcholesky.acml \
|
||||
@@ -278,7 +312,7 @@ goto :: sgemm.goto dgemm.goto cgemm.goto zgemm.goto \
|
||||
smin.goto dmin.goto \
|
||||
saxpby.goto daxpby.goto caxpby.goto zaxpby.goto \
|
||||
somatcopy.goto domatcopy.goto comatcopy.goto zomatcopy.goto \
|
||||
snrm2.goto dnrm2.goto scnrm2.goto dznrm2.goto $(GOTO_LAPACK_TARGETS) $(GOTO_HALF_TARGETS)
|
||||
snrm2.goto dnrm2.goto scnrm2.goto dznrm2.goto $(GOTO_LAPACK_TARGETS) $(GOTO_BFLOAT_TARGETS) $(GOTO_HFLOAT_TARGETS)
|
||||
|
||||
acml :: slinpack.acml dlinpack.acml clinpack.acml zlinpack.acml \
|
||||
scholesky.acml dcholesky.acml ccholesky.acml zcholesky.acml \
|
||||
@@ -629,8 +663,19 @@ zcholesky.essl : zcholesky.$(SUFFIX)
|
||||
|
||||
##################################### Sgemm ####################################################
|
||||
ifeq ($(BUILD_BFLOAT16),1)
|
||||
bgemm.goto : bgemm.$(SUFFIX) ../$(LIBNAME)
|
||||
$(CC) $(CFLAGS) -o $(@F) $^ $(CEXTRALIB) $(EXTRALIB) $(FEXTRALIB) -lm
|
||||
sbgemm.goto : sbgemm.$(SUFFIX) ../$(LIBNAME)
|
||||
$(CC) $(CFLAGS) -o $(@F) $^ $(CEXTRALIB) $(EXTRALIB) $(FEXTRALIB) -lm
|
||||
bgemv.goto : bgemv.$(SUFFIX) ../$(LIBNAME)
|
||||
$(CC) $(CFLAGS) -o $(@F) $^ $(CEXTRALIB) $(EXTRALIB) $(FEXTRALIB) -lm
|
||||
sbgemv.goto : sbgemv.$(SUFFIX) ../$(LIBNAME)
|
||||
$(CC) $(CFLAGS) -o $(@F) $^ $(CEXTRALIB) $(EXTRALIB) $(FEXTRALIB) -lm
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_HFLOAT16),1)
|
||||
shgemm.goto : shgemm.$(SUFFIX) ../$(LIBNAME)
|
||||
$(CC) $(CFLAGS) -o $(@F) $^ $(CEXTRALIB) $(EXTRALIB) $(FEXTRALIB) -lm
|
||||
endif
|
||||
|
||||
sgemm.goto : sgemm.$(SUFFIX) ../$(LIBNAME)
|
||||
@@ -2959,8 +3004,15 @@ zcholesky.$(SUFFIX) : cholesky.c
|
||||
$(CC) $(CFLAGS) -c -DCOMPLEX -DDOUBLE -o $(@F) $^
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16),1)
|
||||
bgemm.$(SUFFIX) : gemm.c
|
||||
$(CC) $(CFLAGS) -c -DBFLOAT16 -DBGEMM -UCOMPLEX -UDOUBLE -o $(@F) $^
|
||||
sbgemm.$(SUFFIX) : gemm.c
|
||||
$(CC) $(CFLAGS) -c -DHALF -UCOMPLEX -UDOUBLE -o $(@F) $^
|
||||
$(CC) $(CFLAGS) -c -DBFLOAT16 -UCOMPLEX -UDOUBLE -o $(@F) $^
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_HFLOAT16),1)
|
||||
shgemm.$(SUFFIX) : gemm.c
|
||||
$(CC) $(CFLAGS) -c -DHFLOAT16 -UCOMPLEX -UDOUBLE -o $(@F) $^
|
||||
endif
|
||||
|
||||
sgemm.$(SUFFIX) : gemm.c
|
||||
@@ -3098,6 +3150,13 @@ dgemv.$(SUFFIX) : gemv.c
|
||||
cgemv.$(SUFFIX) : gemv.c
|
||||
$(CC) $(CFLAGS) -c -DCOMPLEX -UDOUBLE -o $(@F) $^
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16),1)
|
||||
bgemv.$(SUFFIX) : gemv.c
|
||||
$(CC) $(CFLAGS) -c -DBFLOAT16 -DBGEMM -UCOMPLEX -UDOUBLE -o $(@F) $^
|
||||
sbgemv.$(SUFFIX) : gemv.c
|
||||
$(CC) $(CFLAGS) -c -DBFLOAT16 -UCOMPLEX -UDOUBLE -o $(@F) $^
|
||||
endif ()
|
||||
|
||||
zgemv.$(SUFFIX) : gemv.c
|
||||
$(CC) $(CFLAGS) -c -DCOMPLEX -DDOUBLE -o $(@F) $^
|
||||
|
||||
|
||||
+20
-1
@@ -33,10 +33,19 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#ifdef DOUBLE
|
||||
#define GEMM BLASFUNC(dgemm)
|
||||
#elif defined(HALF)
|
||||
#elif defined(BFLOAT16) && defined(BGEMM)
|
||||
#define GEMM BLASFUNC(bgemm)
|
||||
#elif defined(BFLOAT16)
|
||||
#define GEMM BLASFUNC(sbgemm)
|
||||
#undef IFLOAT
|
||||
#define IFLOAT bfloat16
|
||||
#elif defined(HFLOAT16)
|
||||
#define GEMM BLASFUNC(shgemm)
|
||||
#undef IFLOAT
|
||||
#define IFLOAT hfloat16
|
||||
#else
|
||||
#define GEMM BLASFUNC(sgemm)
|
||||
#define IFLOAT float
|
||||
#endif
|
||||
|
||||
#else
|
||||
@@ -53,8 +62,18 @@ int main(int argc, char *argv[]){
|
||||
|
||||
IFLOAT *a, *b;
|
||||
FLOAT *c;
|
||||
#ifdef BGEMM
|
||||
blasint one=1;
|
||||
blasint two=2;
|
||||
float alpha_in[] = {1.0, 0.0};
|
||||
float beta_in[] = {0.0, 0.0};
|
||||
FLOAT alpha[2], beta[2];
|
||||
sbstobf16_(&two, alpha_in, &one, alpha, &one);
|
||||
sbstobf16_(&two, beta_in, &one, beta, &one);
|
||||
#else
|
||||
FLOAT alpha[] = {1.0, 0.0};
|
||||
FLOAT beta [] = {0.0, 0.0};
|
||||
#endif
|
||||
char transa = 'N';
|
||||
char transb = 'N';
|
||||
blasint m, n, k, i, j, lda, ldb, ldc;
|
||||
|
||||
+25
-8
@@ -1,5 +1,5 @@
|
||||
/***************************************************************************
|
||||
Copyright (c) 2014, The OpenBLAS Project
|
||||
Copyright (c) 2014, 2025 The OpenBLAS Project
|
||||
All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
@@ -34,6 +34,12 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#ifdef DOUBLE
|
||||
#define GEMV BLASFUNC(dgemv)
|
||||
#elif defined(BFLOAT16) && defined(BGEMM)
|
||||
#define GEMV BLASFUNC(bgemv)
|
||||
#elif defined(BFLOAT16)
|
||||
#define GEMV BLASFUNC(sbgemv)
|
||||
#undef IFLOAT
|
||||
#define IFLOAT bfloat16
|
||||
#else
|
||||
#define GEMV BLASFUNC(sgemv)
|
||||
#endif
|
||||
@@ -49,9 +55,20 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#endif
|
||||
int main(int argc, char *argv[]){
|
||||
|
||||
FLOAT *a, *x, *y;
|
||||
FLOAT alpha[] = {1.0, 1.0};
|
||||
FLOAT beta [] = {1.0, 0.0};
|
||||
IFLOAT *a, *x;
|
||||
FLOAT *y;
|
||||
#ifdef BGEMM
|
||||
blasint one=1;
|
||||
blasint two=2;
|
||||
float alpha_in[] = {1.0, 0.0};
|
||||
float beta_in[] = {0.0, 0.0};
|
||||
FLOAT alpha[2], beta[2];
|
||||
sbstobf16_(&two, alpha_in, &one, alpha, &one);
|
||||
sbstobf16_(&two, beta_in, &one, beta, &one);
|
||||
#else
|
||||
FLOAT alpha[] = {1.0, 0.0};
|
||||
FLOAT beta [] = {0.0, 0.0};
|
||||
#endif
|
||||
char trans='N';
|
||||
blasint m, i, j;
|
||||
blasint inc_x=1,inc_y=1;
|
||||
@@ -97,11 +114,11 @@ int main(int argc, char *argv[]){
|
||||
|
||||
fprintf(stderr, "From : %3d To : %3d Step = %3d Trans = '%c' Inc_x = %d Inc_y = %d Loops = %d\n", from, to, step,trans,inc_x,inc_y,loops);
|
||||
|
||||
if (( a = (FLOAT *)malloc(sizeof(FLOAT) * tomax * tomax * COMPSIZE)) == NULL){
|
||||
if (( a = (IFLOAT *)malloc(sizeof(IFLOAT) * tomax * tomax * COMPSIZE)) == NULL){
|
||||
fprintf(stderr,"Out of Memory!!\n");exit(1);
|
||||
}
|
||||
|
||||
if (( x = (FLOAT *)malloc(sizeof(FLOAT) * tomax * abs(inc_x) * COMPSIZE)) == NULL){
|
||||
if (( x = (IFLOAT *)malloc(sizeof(IFLOAT) * tomax * abs(inc_x) * COMPSIZE)) == NULL){
|
||||
fprintf(stderr,"Out of Memory!!\n");exit(1);
|
||||
}
|
||||
|
||||
@@ -125,7 +142,7 @@ int main(int argc, char *argv[]){
|
||||
fprintf(stderr, " %6dx%d : ", (int)m,(int)n);
|
||||
for(j = 0; j < m; j++){
|
||||
for(i = 0; i < n * COMPSIZE; i++){
|
||||
a[(long)i + (long)j * (long)m * COMPSIZE] = ((FLOAT) rand() / (FLOAT) RAND_MAX) - 0.5;
|
||||
a[(long)i + (long)j * (long)m * COMPSIZE] = ((IFLOAT) rand() / (FLOAT) RAND_MAX) - 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,7 +150,7 @@ int main(int argc, char *argv[]){
|
||||
{
|
||||
|
||||
for(i = 0; i < n * COMPSIZE * abs(inc_x); i++){
|
||||
x[i] = ((FLOAT) rand() / (FLOAT) RAND_MAX) - 0.5;
|
||||
x[i] = ((IFLOAT) rand() / (FLOAT) RAND_MAX) - 0.5;
|
||||
}
|
||||
|
||||
for(i = 0; i < m * COMPSIZE * abs(inc_y); i++){
|
||||
|
||||
@@ -1,3 +1,31 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2025, The OpenBLAS Project
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name of the OpenBLAS project nor the names of
|
||||
* its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
* *****************************************************************************/
|
||||
|
||||
#ifndef CBLAS_H
|
||||
#define CBLAS_H
|
||||
|
||||
@@ -437,15 +465,22 @@ void cblas_sbdtobf16(OPENBLAS_CONST blasint n, OPENBLAS_CONST double *in, OPEN
|
||||
void cblas_sbf16tos(OPENBLAS_CONST blasint n, OPENBLAS_CONST bfloat16 *in, OPENBLAS_CONST blasint incin, float *out, OPENBLAS_CONST blasint incout);
|
||||
/* convert BFLOAT16 array to double array */
|
||||
void cblas_dbf16tod(OPENBLAS_CONST blasint n, OPENBLAS_CONST bfloat16 *in, OPENBLAS_CONST blasint incin, double *out, OPENBLAS_CONST blasint incout);
|
||||
void cblas_bgemv(OPENBLAS_CONST enum CBLAS_ORDER order, OPENBLAS_CONST enum CBLAS_TRANSPOSE trans, OPENBLAS_CONST blasint m, OPENBLAS_CONST blasint n, OPENBLAS_CONST bfloat16 alpha, OPENBLAS_CONST bfloat16 *a, OPENBLAS_CONST blasint lda, OPENBLAS_CONST bfloat16 *x, OPENBLAS_CONST blasint incx, OPENBLAS_CONST bfloat16 beta, bfloat16 *y, OPENBLAS_CONST blasint incy);
|
||||
/* dot production of BFLOAT16 input arrays, and output as float */
|
||||
float cblas_sbdot(OPENBLAS_CONST blasint n, OPENBLAS_CONST bfloat16 *x, OPENBLAS_CONST blasint incx, OPENBLAS_CONST bfloat16 *y, OPENBLAS_CONST blasint incy);
|
||||
void cblas_sbgemv(OPENBLAS_CONST enum CBLAS_ORDER order, OPENBLAS_CONST enum CBLAS_TRANSPOSE trans, OPENBLAS_CONST blasint m, OPENBLAS_CONST blasint n, OPENBLAS_CONST float alpha, OPENBLAS_CONST bfloat16 *a, OPENBLAS_CONST blasint lda, OPENBLAS_CONST bfloat16 *x, OPENBLAS_CONST blasint incx, OPENBLAS_CONST float beta, float *y, OPENBLAS_CONST blasint incy);
|
||||
|
||||
void cblas_bgemm(OPENBLAS_CONST enum CBLAS_ORDER Order, OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, OPENBLAS_CONST enum CBLAS_TRANSPOSE TransB, OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, OPENBLAS_CONST blasint K,
|
||||
OPENBLAS_CONST bfloat16 alpha, OPENBLAS_CONST bfloat16 *A, OPENBLAS_CONST blasint lda, OPENBLAS_CONST bfloat16 *B, OPENBLAS_CONST blasint ldb, OPENBLAS_CONST bfloat16 beta, bfloat16 *C, OPENBLAS_CONST blasint ldc);
|
||||
void cblas_sbgemm(OPENBLAS_CONST enum CBLAS_ORDER Order, OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, OPENBLAS_CONST enum CBLAS_TRANSPOSE TransB, OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, OPENBLAS_CONST blasint K,
|
||||
OPENBLAS_CONST float alpha, OPENBLAS_CONST bfloat16 *A, OPENBLAS_CONST blasint lda, OPENBLAS_CONST bfloat16 *B, OPENBLAS_CONST blasint ldb, OPENBLAS_CONST float beta, float *C, OPENBLAS_CONST blasint ldc);
|
||||
void cblas_sbgemm_batch(OPENBLAS_CONST enum CBLAS_ORDER Order, OPENBLAS_CONST enum CBLAS_TRANSPOSE * TransA_array, OPENBLAS_CONST enum CBLAS_TRANSPOSE * TransB_array, OPENBLAS_CONST blasint * M_array, OPENBLAS_CONST blasint * N_array, OPENBLAS_CONST blasint * K_array,
|
||||
OPENBLAS_CONST float * alpha_array, OPENBLAS_CONST bfloat16 ** A_array, OPENBLAS_CONST blasint * lda_array, OPENBLAS_CONST bfloat16 ** B_array, OPENBLAS_CONST blasint * ldb_array, OPENBLAS_CONST float * beta_array, float ** C_array, OPENBLAS_CONST blasint * ldc_array, OPENBLAS_CONST blasint group_count, OPENBLAS_CONST blasint * group_size);
|
||||
|
||||
/*** FLOAT16 extensions ***/
|
||||
void cblas_shgemm(OPENBLAS_CONST enum CBLAS_ORDER Order, OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, OPENBLAS_CONST enum CBLAS_TRANSPOSE TransB, OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, OPENBLAS_CONST blasint K,
|
||||
OPENBLAS_CONST float alpha, OPENBLAS_CONST hfloat16 *A, OPENBLAS_CONST blasint lda, OPENBLAS_CONST hfloat16 *B, OPENBLAS_CONST blasint ldb, OPENBLAS_CONST float beta, float *C, OPENBLAS_CONST blasint ldc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
+7
-1
@@ -94,7 +94,13 @@ if (DYNAMIC_ARCH)
|
||||
set(DYNAMIC_CORE PRESCOTT ${DYNAMIC_LIST})
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
|
||||
if (ZARCH)
|
||||
set(DYNAMIC_CORE Z13 Z14 ZARCH_GENERIC)
|
||||
set(DYN_Z13 1)
|
||||
set(DYN_Z14 1)
|
||||
endif ()
|
||||
|
||||
if (LOONGARCH64)
|
||||
set(DYNAMIC_CORE LA64_GENERIC LA264 LA464)
|
||||
endif ()
|
||||
|
||||
+71
-10
@@ -1,3 +1,30 @@
|
||||
###############################################################################
|
||||
# Copyright (c) 2025, The OpenBLAS Project
|
||||
# All rights reserved.
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name of the OpenBLAS project nor the names of
|
||||
# its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
###############################################################################
|
||||
##
|
||||
## Author: Hank Anderson <hank@statease.com>
|
||||
## Description: Ported from portion of OpenBLAS/Makefile.system
|
||||
@@ -59,6 +86,10 @@ if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "LS
|
||||
set(BINARY_DEFINED 1)
|
||||
endif ()
|
||||
|
||||
if (ZARCH)
|
||||
set (BINARY_DEFINED 1)
|
||||
endif ()
|
||||
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "AIX")
|
||||
set(BINARY_DEFINED 1)
|
||||
endif ()
|
||||
@@ -192,6 +223,24 @@ if (${CORE} STREQUAL A64FX)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (${CORE} STREQUAL NEOVERSEV2)
|
||||
if (NOT DYNAMIC_ARCH)
|
||||
if (${CMAKE_C_COMPILER_ID} STREQUAL "PGI" AND NOT NO_SVE)
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -Msve_intrinsics -march=armv8.5-a+sve+sve2+bf16 -mtune=neoverse-v2")
|
||||
elseif (${CMAKE_C_COMPILER_ID} STREQUAL "NVC" AND NOT NO_SVE)
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -tp=neoverse-v2")
|
||||
else ()
|
||||
if (${GCC_VERSION} VERSION_GREATER 13.0 OR ${GCC_VERSION} VERSION_EQUAL 13.0)
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -mcpu=neoverse-v2")
|
||||
elseif (${GCC_VERSION} VERSION_GREATER 10.4 OR ${GCC_VERSION} VERSION_EQUAL 10.4)
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv8.4-a+sve+bf16 -mtune=neoverse-v1")
|
||||
else ()
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv8.2-a+sve+bf16")
|
||||
endif()
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (${CORE} STREQUAL NEOVERSEN2)
|
||||
if (NOT DYNAMIC_ARCH)
|
||||
if (${CMAKE_C_COMPILER_ID} STREQUAL "PGI" AND NOT NO_SVE)
|
||||
@@ -199,10 +248,10 @@ if (${CORE} STREQUAL NEOVERSEN2)
|
||||
elseif (${CMAKE_C_COMPILER_ID} STREQUAL "NVC" AND NOT NO_SVE)
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -tp=neoverse-v2")
|
||||
else ()
|
||||
if (${GCC_VERSION} VERSION_GREATER 10.4 OR ${GCC_VERSION} VERSION_EQUAL 10.4)
|
||||
if (${GCC_VERSION} VERSION_GREATER 11.1 OR ${GCC_VERSION} VERSION_EQUAL 11.1)
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv8.5-a+sve+sve2+bf16 -mtune=neoverse-n2")
|
||||
else ()
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv8.2-a+sve")
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv8.2-a+sve+bf16")
|
||||
endif()
|
||||
endif ()
|
||||
endif ()
|
||||
@@ -211,14 +260,14 @@ endif ()
|
||||
if (${CORE} STREQUAL NEOVERSEV1)
|
||||
if (NOT DYNAMIC_ARCH)
|
||||
if (${CMAKE_C_COMPILER_ID} STREQUAL "PGI" AND NOT NO_SVE)
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -Msve_intrinsics -march=armv8.4-a+sve -mtune=neoverse-v1")
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -Msve_intrinsics -march=armv8.4-a+sve+bf16 -mtune=neoverse-v1")
|
||||
elseif (${CMAKE_C_COMPILER_ID} STREQUAL "NVC" AND NOT NO_SVE)
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -tp=neoverse-v1")
|
||||
else ()
|
||||
if (${GCC_VERSION} VERSION_GREATER 10.4 OR ${GCC_VERSION} VERSION_EQUAL 10.4)
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv8.4-a+sve -mtune=neoverse-v1")
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv8.4-a+sve+bf16 -mtune=neoverse-v1")
|
||||
else ()
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv8.2-a+sve")
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv8.2-a+sve+bf16")
|
||||
endif()
|
||||
endif()
|
||||
endif ()
|
||||
@@ -229,9 +278,21 @@ if (${CORE} STREQUAL NEOVERSEN1)
|
||||
if (${CMAKE_C_COMPILER_ID} STREQUAL "NVC" AND NOT NO_SVE)
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -tp=neoverse-n1")
|
||||
elseif (${GCC_VERSION} VERSION_GREATER 9.4 OR ${GCC_VERSION} VERSION_EQUAL 9.4)
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv8.2-a+sve -mtune=neoverse-n1")
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv8.2-a -mtune=neoverse-n1")
|
||||
else ()
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv8.2-a+sve")
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv8.2-a")
|
||||
endif()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (${CORE} STREQUAL AMPEREONE)
|
||||
if (NOT DYNAMIC_ARCH)
|
||||
if (${CMAKE_C_COMPILER_ID} STREQUAL "NVC")
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -tp=neoverse-n1")
|
||||
elseif (${GCC_VERSION} VERSION_GREATER 12.1)
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv8.6-a+crypto+crc+fp16+sha3+rng -mtune=ampereone")
|
||||
else ()
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv8.6-a+fp16")
|
||||
endif()
|
||||
endif ()
|
||||
endif ()
|
||||
@@ -260,13 +321,13 @@ endif ()
|
||||
|
||||
if (${CORE} STREQUAL CORTEXA510)
|
||||
if (NOT DYNAMIC_ARCH)
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv8-a+sve")
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv8.4-a+sve")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (${CORE} STREQUAL CORTEXA710)
|
||||
if (NOT DYNAMIC_ARCH)
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv8-a+sve")
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv8.4-a+sve")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
@@ -278,7 +339,7 @@ endif ()
|
||||
|
||||
if (${CORE} STREQUAL CORTEXX2)
|
||||
if (NOT DYNAMIC_ARCH)
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv8-a+sve")
|
||||
set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv8.4-a+sve")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
|
||||
@@ -1,3 +1,31 @@
|
||||
###############################################################################
|
||||
# Copyright (c) 2025, The OpenBLAS Project
|
||||
# All rights reserved.
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name of the OpenBLAS project nor the names of
|
||||
# its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
###############################################################################
|
||||
|
||||
# helper functions for the kernel CMakeLists.txt
|
||||
|
||||
function(SetFallback KERNEL SOURCE_PATH)
|
||||
@@ -82,6 +110,7 @@ macro(SetDefaultL1)
|
||||
SetFallback(SROTMKERNEL rotm.S)
|
||||
SetFallback(DROTMKERNEL rotm.S)
|
||||
SetFallback(QROTMKERNEL rotm.S)
|
||||
SetFallback(BSCALKERNEL ../generic/scal.c)
|
||||
SetFallback(SSCALKERNEL scal.S)
|
||||
SetFallback(DSCALKERNEL scal.S)
|
||||
SetFallback(CSCALKERNEL zscal.S)
|
||||
@@ -141,6 +170,8 @@ if (BUILD_BFLOAT16)
|
||||
SetFallback(SHSWAPKERNEL ../arm/swap.c)
|
||||
SetFallback(TOBF16KERNEL ../x86_64/tobf16.c)
|
||||
SetFallback(BF16TOKERNEL ../x86_64/bf16to.c)
|
||||
SetFallback(BGEMVNKERNEL ../generic/gemv_n.c)
|
||||
SetFallback(BGEMVTKERNEL ../generic/gemv_t.c)
|
||||
SetFallback(SBGEMVNKERNEL ../x86_64/sbgemv_n.c)
|
||||
SetFallback(SBGEMVTKERNEL ../x86_64/sbgemv_t.c)
|
||||
endif ()
|
||||
@@ -193,6 +224,8 @@ macro(SetDefaultL2)
|
||||
SetFallback(XHEMV_V_KERNEL ../generic/zhemv_k.c)
|
||||
SetFallback(XHEMV_M_KERNEL ../generic/zhemv_k.c)
|
||||
if (BUILD_BFLOAT16)
|
||||
SetFallback(BGEMVNKERNEL ../generic/gemv_n.c)
|
||||
SetFallback(BGEMVTKERNEL ../generic/gemv_t.c)
|
||||
SetFallback(SBGEMVNKERNEL ../x86_64/sbgemv_n.c)
|
||||
SetFallback(SBGEMVTKERNEL ../x86_64/sbgemv_t.c)
|
||||
SetFallback(SHGERKERNEL ../generic/ger.c)
|
||||
@@ -206,6 +239,16 @@ macro(SetDefaultL3)
|
||||
SetFallback(ZGEADD_KERNEL ../generic/zgeadd.c)
|
||||
if (BUILD_BFLOAT16)
|
||||
SetFallback(SHGEADD_KERNEL ../generic/geadd.c)
|
||||
SetFallback(BGEMMKERNEL ../generic/gemmkernel_2x2.c)
|
||||
SetFallback(BGEMM_BETA ../generic/gemm_beta.c)
|
||||
SetFallback(BGEMMINCOPY ../generic/gemm_ncopy_2.c)
|
||||
SetFallback(BGEMMITCOPY ../generic/gemm_tcopy_2.c)
|
||||
SetFallback(BGEMMONCOPY ../generic/gemm_ncopy_2.c)
|
||||
SetFallback(BGEMMOTCOPY ../generic/gemm_tcopy_2.c)
|
||||
SetFallback(BGEMMINCOPYOBJ bgemm_incopy.o)
|
||||
SetFallback(BGEMMITCOPYOBJ bgemm_itcopy.o)
|
||||
SetFallback(BGEMMONCOPYOBJ bgemm_oncopy.o)
|
||||
SetFallback(BGEMMOTCOPYOBJ bgemm_otcopy.o)
|
||||
SetFallback(SBGEMMKERNEL ../generic/gemmkernel_2x2.c)
|
||||
SetFallback(SBGEMM_BETA ../generic/gemm_beta.c)
|
||||
SetFallback(SBGEMMINCOPY ../generic/gemm_ncopy_2.c)
|
||||
|
||||
+4
-4
@@ -11,7 +11,7 @@ set(SCLAUX
|
||||
la_constants.f90
|
||||
sbdsdc.f
|
||||
sbdsqr.f sdisna.f slabad.f slacpy.f sladiv.f slae2.f slaebz.f
|
||||
slaed0.f slaed1.f slaed2.f slaed3.f slaed4.f slaed5.f slaed6.f
|
||||
slaed0.f slaed1.f slaed2.f slaed4.f slaed5.f slaed6.f
|
||||
slaed7.f slaed8.f slaed9.f slaeda.f slaev2.f slagtf.f
|
||||
slagts.f slamrg.f slanst.f
|
||||
slapy2.f slapy3.f slarnv.f
|
||||
@@ -31,7 +31,7 @@ set(DZLAUX
|
||||
dbdsdc.f
|
||||
dbdsvdx.f dstevx.f dstein.f
|
||||
dbdsqr.f ddisna.f dlabad.f dlacpy.f dladiv.f dlae2.f dlaebz.f
|
||||
dlaed0.f dlaed1.f dlaed2.f dlaed3.f dlaed4.f dlaed5.f dlaed6.f
|
||||
dlaed0.f dlaed1.f dlaed2.f dlaed4.f dlaed5.f dlaed6.f
|
||||
dlaed7.f dlaed8.f dlaed9.f dlaeda.f dlaev2.f dlagtf.f
|
||||
dlagts.f dlamrg.f dlanst.f
|
||||
dlapy2.f dlapy3.f dlarnv.f
|
||||
@@ -517,7 +517,7 @@ set(SCLAUX
|
||||
scombssq.c sbdsvdx.c sstevx.c sstein.c
|
||||
sbdsdc.c
|
||||
sbdsqr.c sdisna.c slabad.c slacpy.c sladiv.c slae2.c slaebz.c
|
||||
slaed0.c slaed1.c slaed2.c slaed3.c slaed4.c slaed5.c slaed6.c
|
||||
slaed0.c slaed1.c slaed2.c slaed4.c slaed5.c slaed6.c
|
||||
slaed7.c slaed8.c slaed9.c slaeda.c slaev2.c slagtf.c
|
||||
slagts.c slamrg.c slanst.c
|
||||
slapy2.c slapy3.c slarnv.c
|
||||
@@ -536,7 +536,7 @@ set(DZLAUX
|
||||
dbdsdc.c
|
||||
dbdsvdx.c dstevx.c dstein.c
|
||||
dbdsqr.c ddisna.c dlabad.c dlacpy.c dladiv.c dlae2.c dlaebz.c
|
||||
dlaed0.c dlaed1.c dlaed2.c dlaed3.c dlaed4.c dlaed5.c dlaed6.c
|
||||
dlaed0.c dlaed1.c dlaed2.c dlaed4.c dlaed5.c dlaed6.c
|
||||
dlaed7.c dlaed8.c dlaed9.c dlaeda.c dlaev2.c dlagtf.c
|
||||
dlagts.c dlamrg.c dlanst.c
|
||||
dlapy2.c dlapy3.c dlarnv.c
|
||||
|
||||
+131
-2
@@ -1,3 +1,31 @@
|
||||
###############################################################################
|
||||
# Copyright (c) 2025, The OpenBLAS Project
|
||||
# All rights reserved.
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name of the OpenBLAS project nor the names of
|
||||
# its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
###############################################################################
|
||||
|
||||
##
|
||||
## Author: Hank Anderson <hank@statease.com>
|
||||
## Description: Ported from OpenBLAS/Makefile.prebuild
|
||||
@@ -131,6 +159,8 @@ if (DEFINED CORE AND CMAKE_CROSSCOMPILING AND NOT (${HOST_OS} STREQUAL "WINDOWSS
|
||||
set(HAVE_SSE2 1)
|
||||
set(HAVE_SSE3 1)
|
||||
set(HAVE_SSSE3 1)
|
||||
set(BGEMM_UNROLL_M 8)
|
||||
set(BGEMM_UNROLL_N 4)
|
||||
set(SBGEMM_UNROLL_M 8)
|
||||
set(SBGEMM_UNROLL_N 4)
|
||||
set(SGEMM_UNROLL_M 8)
|
||||
@@ -1195,6 +1225,33 @@ endif ()
|
||||
set(ZGEMM_UNROLL_M 4)
|
||||
set(ZGEMM_UNROLL_N 4)
|
||||
set(SYMV_P 16)
|
||||
elseif ("${TCORE}" STREQUAL "AMPEREONE")
|
||||
file(APPEND ${TARGET_CONF_TEMP}
|
||||
"#define L1_CODE_SIZE\t16384\n"
|
||||
"#define L1_CODE_LINESIZE\t64\n"
|
||||
"#define L1_CODE_ASSOCIATIVE\t4\n"
|
||||
"#define L1_DATA_SIZE\t65536\n"
|
||||
"#define L1_DATA_LINESIZE\t64\n"
|
||||
"#define L1_DATA_ASSOCIATIVE\t4\n"
|
||||
"#define L2_SIZE\t2097152\n\n"
|
||||
"#define L2_LINESIZE\t64\n"
|
||||
"#define L2_ASSOCIATIVE\t8\n"
|
||||
"#define DTB_DEFAULT_ENTRIES\t64\n"
|
||||
"#define DTB_SIZE\t4096\n"
|
||||
"#define HAVE_VFPV4\n"
|
||||
"#define HAVE_VFPV3\n"
|
||||
"#define HAVE_VFP\n"
|
||||
"#define HAVE_NEON\n"
|
||||
"#define ARMV8\n")
|
||||
set(SGEMM_UNROLL_M 16)
|
||||
set(SGEMM_UNROLL_N 4)
|
||||
set(DGEMM_UNROLL_M 8)
|
||||
set(DGEMM_UNROLL_N 4)
|
||||
set(CGEMM_UNROLL_M 8)
|
||||
set(CGEMM_UNROLL_N 4)
|
||||
set(ZGEMM_UNROLL_M 4)
|
||||
set(ZGEMM_UNROLL_N 4)
|
||||
set(SYMV_P 16)
|
||||
elseif ("${TCORE}" STREQUAL "VORTEX")
|
||||
file(APPEND ${TARGET_CONF_TEMP}
|
||||
"#define ARMV8\n"
|
||||
@@ -1253,7 +1310,7 @@ endif ()
|
||||
file(APPEND ${TARGET_CONF_TEMP}
|
||||
"#define L1_DATA_SIZE\t32768\n"
|
||||
"#define L1_DATA_LINESIZE\t64\n"
|
||||
"#define L2_SIZE\t262144\n"
|
||||
"#define L2_SIZE\t1048576\n"
|
||||
"#define L2_LINESIZE\t64\n"
|
||||
"#define DTB_DEFAULT_ENTRIES\t64\n"
|
||||
"#define DTB_SIZE\t4096\n"
|
||||
@@ -1350,6 +1407,78 @@ endif ()
|
||||
set(ZGEMM_UNROLL_M 8)
|
||||
set(ZGEMM_UNROLL_N 2)
|
||||
set(SYMV_P 8)
|
||||
elseif ("${TCORE}" STREQUAL "C910V")
|
||||
file(APPEND ${TARGET_CONF_TEMP}
|
||||
"#define L1_DATA_SIZE 32768\n"
|
||||
"#define L1_DATA_LINESIZE 32\n"
|
||||
"#define L2_SIZE 1048576\n"
|
||||
"#define L2_LINESIZE 32 \n"
|
||||
"#define DTB_DEFAULT_ENTRIES 128\n"
|
||||
"#define DTB_SIZE 4096\n"
|
||||
"#define L2_ASSOCIATIVE 4\n")
|
||||
set(SGEMM_UNROLL_M 16)
|
||||
set(SGEMM_UNROLL_N 4)
|
||||
set(DGEMM_UNROLL_M 8)
|
||||
set(DGEMM_UNROLL_N 4)
|
||||
set(CGEMM_UNROLL_M 2)
|
||||
set(CGEMM_UNROLL_N 2)
|
||||
set(ZGEMM_UNROLL_M 2)
|
||||
set(ZGEMM_UNROLL_N 2)
|
||||
set(SYMV_P 16)
|
||||
elseif ("${TCORE}" STREQUAL "x280")
|
||||
file(APPEND ${TARGET_CONF_TEMP}
|
||||
"#define L1_DATA_SIZE 65536\n"
|
||||
"#define L1_LINESIZE 32 \n"
|
||||
"#define L2_SIZE 2097152\n"
|
||||
"#define L2_LINESIZE 32 \n"
|
||||
"#define DTB_DEFAULT_ENTRIES 128\n"
|
||||
"#define DTB_SIZE 4096\n"
|
||||
"#define L2_ASSOCIATIVE 4\n")
|
||||
set(SGEMM_UNROLL_M 16)
|
||||
set(SGEMM_UNROLL_N 8)
|
||||
set(DGEMM_UNROLL_M 16)
|
||||
set(DGEMM_UNROLL_N 8)
|
||||
set(CGEMM_UNROLL_M 8)
|
||||
set(CGEMM_UNROLL_N 4)
|
||||
set(ZGEMM_UNROLL_M 8)
|
||||
set(ZGEMM_UNROLL_N 4)
|
||||
set(SYMV_P 16)
|
||||
elseif ("${TCORE}" STREQUAL "RISCV64_ZVL128B")
|
||||
file(APPEND ${TARGET_CONF_TEMP}
|
||||
"#define L1_DATA_SIZE 32768\n"
|
||||
"#define L1_DATA_LINESIZE 32\n"
|
||||
"#define L2_SIZE 1048576\n"
|
||||
"#define L2_LINESIZE 32 \n"
|
||||
"#define DTB_DEFAULT_ENTRIES 128\n"
|
||||
"#define DTB_SIZE 4096\n"
|
||||
"#define L2_ASSOCIATIVE 4\n")
|
||||
set(SGEMM_UNROLL_M 8)
|
||||
set(SGEMM_UNROLL_N 8)
|
||||
set(DGEMM_UNROLL_M 8)
|
||||
set(DGEMM_UNROLL_N 4)
|
||||
set(CGEMM_UNROLL_M 8)
|
||||
set(CGEMM_UNROLL_N 4)
|
||||
set(ZGEMM_UNROLL_M 4)
|
||||
set(ZGEMM_UNROLL_N 4)
|
||||
set(SYMV_P 16)
|
||||
elseif ("${TCORE}" STREQUAL "RISCV64_ZVL256B")
|
||||
file(APPEND ${TARGET_CONF_TEMP}
|
||||
"#define L1_DATA_SIZE 65536\n"
|
||||
"#define L1_DATA_LINESIZE 32\n"
|
||||
"#define L2_SIZE 2097152\n"
|
||||
"#define L2_LINESIZE 32 \n"
|
||||
"#define DTB_DEFAULT_ENTRIES 128\n"
|
||||
"#define DTB_SIZE 4096\n"
|
||||
"#define L2_ASSOCIATIVE 4\n")
|
||||
set(SGEMM_UNROLL_M 16)
|
||||
set(SGEMM_UNROLL_N 8)
|
||||
set(DGEMM_UNROLL_M 8)
|
||||
set(DGEMM_UNROLL_N 8)
|
||||
set(CGEMM_UNROLL_M 8)
|
||||
set(CGEMM_UNROLL_N 8)
|
||||
set(ZGEMM_UNROLL_M 8)
|
||||
set(ZGEMM_UNROLL_N 4)
|
||||
set(SYMV_P 16)
|
||||
elseif ("${TCORE}" STREQUAL "GENERIC")
|
||||
file(APPEND ${TARGET_CONF_TEMP}
|
||||
"#define L1_DATA_SIZE 32768\n"
|
||||
@@ -1361,7 +1490,7 @@ endif ()
|
||||
"#define L2_ASSOCIATIVE 8\n")
|
||||
elseif ("${TCORE}" STREQUAL "RISCV64_GENERIC")
|
||||
file(APPEND ${TARGET_CONF_TEMP}
|
||||
"#define L1_DATA_SIZE 32768\n"
|
||||
"#define L1_DATA_SIZE 32768\n"
|
||||
"#define L1_DATA_LINESIZE 32\n"
|
||||
"#define L2_SIZE 1048576\n"
|
||||
"#define L2_LINESIZE 32 \n"
|
||||
|
||||
+76
-14
@@ -1,3 +1,30 @@
|
||||
###############################################################################
|
||||
# Copyright (c) 2025, The OpenBLAS Project
|
||||
# All rights reserved.
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name of the OpenBLAS project nor the names of
|
||||
# its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
###############################################################################
|
||||
##
|
||||
## Author: Hank Anderson <hank@statease.com>
|
||||
## Description: Ported from OpenBLAS/Makefile.system
|
||||
@@ -289,12 +316,19 @@ if (DEFINED TARGET)
|
||||
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -mcpu=power8 -mtune=power8 -mvsx -fno-fast-math")
|
||||
endif()
|
||||
|
||||
if (${TARGET} STREQUAL Z13)
|
||||
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -march=z13 -mzvector")
|
||||
endif()
|
||||
if (${TARGET} STREQUAL Z14)
|
||||
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -march=z14 -mzvector")
|
||||
endif()
|
||||
|
||||
if (${TARGET} STREQUAL NEOVERSEV1)
|
||||
if (${CMAKE_C_COMPILER_ID} STREQUAL "PGI" AND NOT NO_SVE)
|
||||
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -Msve_intrinsics -march=armv8.4-a+sve -mtune=neoverse-v1")
|
||||
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -Msve_intrinsics -march=armv8.4-a+sve+bf16 -mtune=neoverse-v1")
|
||||
else ()
|
||||
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER 10.4 OR CMAKE_C_COMPILER_VERSION VERSION_EQUAL 10.4)
|
||||
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -march=armv8.4-a+sve -mtune=neoverse-v1")
|
||||
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -march=armv8.4-a+sve+bf16 -mtune=neoverse-v1")
|
||||
else ()
|
||||
message(FATAL_ERROR "Compiler ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_VERSION} does not support Neoverse V1.")
|
||||
endif()
|
||||
@@ -311,6 +345,19 @@ if (${TARGET} STREQUAL NEOVERSEV1)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
if (${TARGET} STREQUAL NEOVERSEV2)
|
||||
if (${CMAKE_C_COMPILER_ID} STREQUAL "PGI" AND NOT NO_SVE)
|
||||
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -Msve-intrinsics -march=armv9-a+sve+sve2+bf16 -mtune=neoverse-v2")
|
||||
else ()
|
||||
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER 13.0 OR CMAKE_C_COMPILER_VERSION VERSION_EQUAL 13.0)
|
||||
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -mcpu=neoverse-v2")
|
||||
elseif (CMAKE_C_COMPILER_VERSION VERSION_GREATER 10.4 OR CMAKE_C_COMPILER_VERSION VERSION_EQUAL 10.4)
|
||||
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -march=armv8.4-a+sve+bf16 -mtune=neoverse-v1")
|
||||
else ()
|
||||
message(FATAL_ERROR "Compiler $${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_VERSION} does not support Neoverse V2.")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
if (${TARGET} STREQUAL ARMV8SVE)
|
||||
if (${CMAKE_C_COMPILER_ID} STREQUAL "PGI" AND NOT NO_SVE)
|
||||
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -Msve-intrinsics -march=armv8.2-a+sve")
|
||||
@@ -420,20 +467,32 @@ if (X86_64 OR ${CORE} STREQUAL POWER10 OR ARM64 OR LOONGARCH64)
|
||||
endif ()
|
||||
if (ARM64)
|
||||
set(GEMM_GEMV_FORWARD TRUE)
|
||||
set(SBGEMM_GEMV_FORWARD TRUE)
|
||||
set(BGEMM_GEMV_FORWARD TRUE)
|
||||
endif ()
|
||||
if (POWER)
|
||||
set(GEMM_GEMV_FORWARD TRUE)
|
||||
set(SBGEMM_GEMV_FORWARD TRUE)
|
||||
endif ()
|
||||
if (RISCV64)
|
||||
set(GEMM_GEMV_FORWARD TRUE)
|
||||
endif ()
|
||||
|
||||
if (GEMM_GEMV_FORWARD AND NOT ONLY_CBLAS)
|
||||
if (GEMM_GEMV_FORWARD)
|
||||
set(CCOMMON_OPT "${CCOMMON_OPT} -DGEMM_GEMV_FORWARD")
|
||||
endif ()
|
||||
if (GEMM_GEMV_FORWARD_BF16 AND NOT ONLY_CBLAS)
|
||||
set(CCOMMON_OPT "${CCOMMON_OPT} -DGEMM_GEMV_FORWARD_BF16")
|
||||
if (SBGEMM_GEMV_FORWARD)
|
||||
set(CCOMMON_OPT "${CCOMMON_OPT} -DSBGEMM_GEMV_FORWARD")
|
||||
endif ()
|
||||
if (BGEMM_GEMV_FORWARD)
|
||||
set(CCOMMON_OPT "${CCOMMON_OPT} -DBGEMM_GEMV_FORWARD")
|
||||
endif ()
|
||||
if (SMALL_MATRIX_OPT)
|
||||
set(CCOMMON_OPT "${CCOMMON_OPT} -DSMALL_MATRIX_OPT")
|
||||
endif ()
|
||||
|
||||
if (DYNAMIC_ARCH)
|
||||
if (X86 OR X86_64 OR ARM64 OR POWER OR RISCV64 OR LOONGARCH64)
|
||||
if (X86 OR X86_64 OR ARM64 OR POWER OR RISCV64 OR LOONGARCH64 OR ZARCH)
|
||||
set(CCOMMON_OPT "${CCOMMON_OPT} -DDYNAMIC_ARCH")
|
||||
if (DYNAMIC_OLDER)
|
||||
set(CCOMMON_OPT "${CCOMMON_OPT} -DDYNAMIC_OLDER")
|
||||
@@ -640,6 +699,9 @@ endif()
|
||||
if (BUILD_BFLOAT16)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_BFLOAT16")
|
||||
endif()
|
||||
if (BUILD_HFLOAT16)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_HFLOAT16")
|
||||
endif()
|
||||
if(NOT MSVC)
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${CCOMMON_OPT}")
|
||||
endif()
|
||||
@@ -647,14 +709,14 @@ endif()
|
||||
set(PFLAGS "${PFLAGS} ${CCOMMON_OPT} -I${TOPDIR} -DPROFILE ${COMMON_PROF}")
|
||||
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
|
||||
|
||||
if ("${F_COMPILER}" STREQUAL "FLANG")
|
||||
if (${CMAKE_Fortran_COMPILER_VERSION} VERSION_LESS_EQUAL 3)
|
||||
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -fno-unroll-loops")
|
||||
endif ()
|
||||
endif ()
|
||||
if (ARM64 AND CMAKE_Fortran_COMPILER_ID MATCHES "LLVMFlang.*" AND CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -O2")
|
||||
endif ()
|
||||
if ("${F_COMPILER}" STREQUAL "FLANG")
|
||||
if (${CMAKE_Fortran_COMPILER_VERSION} VERSION_LESS_EQUAL 3)
|
||||
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -fno-unroll-loops")
|
||||
endif ()
|
||||
endif ()
|
||||
if (ARM64 AND CMAKE_Fortran_COMPILER_ID MATCHES "LLVMFlang.*" AND CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -O2")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
|
||||
|
||||
@@ -50,6 +50,9 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "loongarch64.*")
|
||||
set(LOONGARCH64 1)
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "riscv64.*")
|
||||
set(RISCV64 1)
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "s390.*")
|
||||
set(ZARCH 1)
|
||||
set(BINARY 64)
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*" OR (CMAKE_SYSTEM_NAME MATCHES "Darwin" AND CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*"))
|
||||
if (NOT BINARY)
|
||||
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
||||
@@ -100,6 +103,8 @@ elseif(X86)
|
||||
set(ARCH "x86")
|
||||
elseif(POWER)
|
||||
set(ARCH "power")
|
||||
elseif(ZARCH)
|
||||
set(ARCH "zarch")
|
||||
elseif(MIPS32)
|
||||
set(ARCH "mips")
|
||||
elseif(MIPS64)
|
||||
|
||||
+29
-1
@@ -1,3 +1,31 @@
|
||||
###############################################################################
|
||||
# Copyright (c) 2025, The OpenBLAS Project
|
||||
# All rights reserved.
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name of the OpenBLAS project nor the names of
|
||||
# its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
###############################################################################
|
||||
|
||||
# Functions to help with the OpenBLAS build
|
||||
|
||||
# Reads string from getarch into CMake vars. Format of getarch vars is VARNAME=VALUE
|
||||
@@ -347,7 +375,7 @@ function(GenerateNamedObjects sources_in)
|
||||
if (NOT no_float_type)
|
||||
string(SUBSTRING ${float_type} 0 1 float_char)
|
||||
string(TOLOWER ${float_char} float_char)
|
||||
if (${float_type} STREQUAL "BFLOAT16")
|
||||
if (${float_type} STREQUAL "BFLOAT16" AND NOT "${defines_in}" MATCHES "BGEM")
|
||||
set (float_char "sb")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*********************************************************************/
|
||||
/* Copyright 2009, 2010 The University of Texas at Austin. */
|
||||
/* Copyright 2025 The OpenBLAS Project. */
|
||||
/* All rights reserved. */
|
||||
/* */
|
||||
/* Redistribution and use in source and binary forms, with or */
|
||||
@@ -266,6 +267,14 @@ typedef uint16_t bfloat16;
|
||||
#define BFLOAT16CONVERSION 1
|
||||
#endif
|
||||
|
||||
#ifdef BUILD_HFLOAT16
|
||||
#ifndef hfloat16
|
||||
typedef _Float16 hfloat16;
|
||||
#endif
|
||||
#else
|
||||
typedef uint16_t hfloat16;
|
||||
#endif
|
||||
|
||||
#ifdef USE64BITINT
|
||||
typedef BLASLONG blasint;
|
||||
#if defined(OS_WINDOWS) && defined(__64BIT__)
|
||||
@@ -309,10 +318,21 @@ typedef int blasint;
|
||||
#elif defined(BFLOAT16)
|
||||
#define IFLOAT bfloat16
|
||||
#define XFLOAT IFLOAT
|
||||
#define FLOAT float
|
||||
#ifdef BGEMM
|
||||
#define FLOAT bfloat16
|
||||
#else
|
||||
#define FLOAT float
|
||||
#endif
|
||||
#define SIZE 2
|
||||
#define BASE_SHIFT 1
|
||||
#define ZBASE_SHIFT 2
|
||||
#elif defined(HFLOAT16)
|
||||
#define IFLOAT hfloat16
|
||||
#define XFLOAT IFLOAT
|
||||
#define FLOAT float
|
||||
#define SIZE 2
|
||||
#define BASE_SHIFT 1
|
||||
#define ZBASE_SHIFT 2
|
||||
#else
|
||||
#define FLOAT float
|
||||
#define SIZE 4
|
||||
|
||||
+9
-1
@@ -114,7 +114,15 @@ static inline int blas_quickdivide(blasint x, blasint y){
|
||||
OPENBLAS_ARM_TYPE_FUNCTION \
|
||||
REALNAME:
|
||||
|
||||
#define EPILOGUE
|
||||
#if defined(__ELF__) && defined(__linux__)
|
||||
# define GNUSTACK .section .note.GNU-stack,"",%progbits
|
||||
#else
|
||||
# define GNUSTACK
|
||||
#endif
|
||||
|
||||
#define EPILOGUE \
|
||||
GNUSTACK
|
||||
|
||||
|
||||
#define PROFCODE
|
||||
|
||||
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2025, The OpenBLAS Project
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name of the OpenBLAS project nor the names of
|
||||
* its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
* *****************************************************************************/
|
||||
|
||||
#ifndef COMMON_B_H
|
||||
#define COMMON_B_H
|
||||
|
||||
#ifndef DYNAMIC_ARCH
|
||||
#define BGEMV_N_K bgemv_n
|
||||
#define BGEMV_T_K bgemv_t
|
||||
|
||||
#define BSCAL_K bscal_k
|
||||
|
||||
#define BGEMM_ONCOPY bgemm_oncopy
|
||||
#define BGEMM_OTCOPY bgemm_otcopy
|
||||
|
||||
#if BGEMM_DEFAULT_UNROLL_M == BGEMM_DEFAULT_UNROLL_N
|
||||
#define BGEMM_INCOPY bgemm_oncopy
|
||||
#define BGEMM_ITCOPY bgemm_otcopy
|
||||
#else
|
||||
#define BGEMM_INCOPY bgemm_incopy
|
||||
#define BGEMM_ITCOPY bgemm_itcopy
|
||||
#endif
|
||||
|
||||
#define BGEMM_BETA bgemm_beta
|
||||
#define BGEMM_KERNEL bgemm_kernel
|
||||
|
||||
#else
|
||||
#define BGEMV_N_K gotoblas->bgemv_n
|
||||
#define BGEMV_T_K gotoblas->bgemv_t
|
||||
|
||||
#define BSCAL_K gotoblas->bscal_k
|
||||
|
||||
#define BGEMM_ONCOPY gotoblas->bgemm_oncopy
|
||||
#define BGEMM_OTCOPY gotoblas->bgemm_otcopy
|
||||
#define BGEMM_INCOPY gotoblas->bgemm_incopy
|
||||
#define BGEMM_ITCOPY gotoblas->bgemm_itcopy
|
||||
#define BGEMM_BETA gotoblas->bgemm_beta
|
||||
#define BGEMM_KERNEL gotoblas->bgemm_kernel
|
||||
|
||||
#endif
|
||||
|
||||
#define BGEMM_NN bgemm_nn
|
||||
#define BGEMM_CN bgemm_tn
|
||||
#define BGEMM_TN bgemm_tn
|
||||
#define BGEMM_NC bgemm_nt
|
||||
#define BGEMM_NT bgemm_nt
|
||||
#define BGEMM_CC bgemm_tt
|
||||
#define BGEMM_CT bgemm_tt
|
||||
#define BGEMM_TC bgemm_tt
|
||||
#define BGEMM_TT bgemm_tt
|
||||
#define BGEMM_NR bgemm_nn
|
||||
#define BGEMM_TR bgemm_tn
|
||||
#define BGEMM_CR bgemm_tn
|
||||
#define BGEMM_RN bgemm_nn
|
||||
#define BGEMM_RT bgemm_nt
|
||||
#define BGEMM_RC bgemm_nt
|
||||
#define BGEMM_RR bgemm_nn
|
||||
|
||||
#define BGEMM_THREAD_NN bgemm_thread_nn
|
||||
#define BGEMM_THREAD_CN bgemm_thread_tn
|
||||
#define BGEMM_THREAD_TN bgemm_thread_tn
|
||||
#define BGEMM_THREAD_NC bgemm_thread_nt
|
||||
#define BGEMM_THREAD_NT bgemm_thread_nt
|
||||
#define BGEMM_THREAD_CC bgemm_thread_tt
|
||||
#define BGEMM_THREAD_CT bgemm_thread_tt
|
||||
#define BGEMM_THREAD_TC bgemm_thread_tt
|
||||
#define BGEMM_THREAD_TT bgemm_thread_tt
|
||||
#define BGEMM_THREAD_NR bgemm_thread_nn
|
||||
#define BGEMM_THREAD_TR bgemm_thread_tn
|
||||
#define BGEMM_THREAD_CR bgemm_thread_tn
|
||||
#define BGEMM_THREAD_RN bgemm_thread_nn
|
||||
#define BGEMM_THREAD_RT bgemm_thread_nt
|
||||
#define BGEMM_THREAD_RC bgemm_thread_nt
|
||||
#define BGEMM_THREAD_RR bgemm_thread_nn
|
||||
#endif
|
||||
@@ -1,5 +1,6 @@
|
||||
/*********************************************************************/
|
||||
/* Copyright 2009, 2010 The University of Texas at Austin. */
|
||||
/* Copyright 2025 The OpenBLAS Project. */
|
||||
/* All rights reserved. */
|
||||
/* */
|
||||
/* Redistribution and use in source and binary forms, with or */
|
||||
@@ -59,6 +60,7 @@ double BLASFUNC(dsdot) (blasint *, float *, blasint *, float *, blasint *);
|
||||
double BLASFUNC(ddot) (blasint *, double *, blasint *, double *, blasint *);
|
||||
xdouble BLASFUNC(qdot) (blasint *, xdouble *, blasint *, xdouble *, blasint *);
|
||||
|
||||
void BLASFUNC(bscal) (blasint *, bfloat16 *, bfloat16 *, blasint *);
|
||||
float BLASFUNC(sbdot) (blasint *, bfloat16 *, blasint *, bfloat16 *, blasint *);
|
||||
void BLASFUNC(sbstobf16) (blasint *, float *, blasint *, bfloat16 *, blasint *);
|
||||
void BLASFUNC(sbdtobf16) (blasint *, double *, blasint *, bfloat16 *, blasint *);
|
||||
@@ -255,6 +257,8 @@ void BLASFUNC(xgeru)(blasint *, blasint *, xdouble *, xdouble *, blasint *,
|
||||
void BLASFUNC(xgerc)(blasint *, blasint *, xdouble *, xdouble *, blasint *,
|
||||
xdouble *, blasint *, xdouble *, blasint *);
|
||||
|
||||
void BLASFUNC(bgemv)(char *, blasint *, blasint *, bfloat16 *, bfloat16 *, blasint *,
|
||||
bfloat16 *, blasint *, bfloat16 *, bfloat16 *, blasint *);
|
||||
void BLASFUNC(sbgemv)(char *, blasint *, blasint *, float *, bfloat16 *, blasint *,
|
||||
bfloat16 *, blasint *, float *, float *, blasint *);
|
||||
void BLASFUNC(sgemv)(char *, blasint *, blasint *, float *, float *, blasint *,
|
||||
@@ -481,6 +485,10 @@ void BLASFUNC(xhbmv)(char *, blasint *, blasint *, xdouble *, xdouble *, blasint
|
||||
|
||||
/* Level 3 routines */
|
||||
|
||||
void BLASFUNC(shgemm)(char *, char *, blasint *, blasint *, blasint *, float *,
|
||||
hfloat16 *, blasint *, hfloat16 *, blasint *, float *, float *, blasint *);
|
||||
void BLASFUNC(bgemm)(char *, char *, blasint *, blasint *, blasint *, bfloat16 *,
|
||||
bfloat16 *, blasint *, bfloat16 *, blasint *, bfloat16 *, bfloat16 *, blasint *);
|
||||
void BLASFUNC(sbgemm)(char *, char *, blasint *, blasint *, blasint *, float *,
|
||||
bfloat16 *, blasint *, bfloat16 *, blasint *, float *, float *, blasint *);
|
||||
void BLASFUNC(sgemm)(char *, char *, blasint *, blasint *, blasint *, float *,
|
||||
|
||||
@@ -439,4 +439,9 @@ blasint xtrtrs_LRN_parallel(blas_arg_t *, BLASLONG *, BLASLONG *, xdouble *, xdo
|
||||
blasint xtrtrs_LCU_parallel(blas_arg_t *, BLASLONG *, BLASLONG *, xdouble *, xdouble *, BLASLONG);
|
||||
blasint xtrtrs_LCN_parallel(blas_arg_t *, BLASLONG *, BLASLONG *, xdouble *, xdouble *, BLASLONG);
|
||||
|
||||
blasint slaed3_single(blasint *, blasint *, blasint *, float *, float *, blasint *, float *, float *, float *, blasint *, blasint *, float *, float *, blasint *);
|
||||
blasint dlaed3_single(blasint *, blasint *, blasint *, double *, double *, blasint *, double *, double *, double *, blasint *, blasint *, double *, double *, blasint *);
|
||||
blasint slaed3_parallel(blasint *, blasint *, blasint *, float *, float *, blasint *, float *, float *, float *, blasint *, blasint *, float *, float *, blasint *);
|
||||
blasint dlaed3_parallel(blasint *, blasint *, blasint *, double *, double *, blasint *, double *, double *, double *, blasint *, blasint *, double *, double *, blasint *);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*********************************************************************/
|
||||
/* Copyright 2025 The OpenBLAS Project. */
|
||||
/* Copyright 2009, 2010 The University of Texas at Austin. */
|
||||
/* All rights reserved. */
|
||||
/* */
|
||||
@@ -169,6 +170,9 @@ BLASLONG icmin_k(BLASLONG, float *, BLASLONG);
|
||||
BLASLONG izmin_k(BLASLONG, double *, BLASLONG);
|
||||
BLASLONG ixmin_k(BLASLONG, xdouble *, BLASLONG);
|
||||
|
||||
|
||||
int bscal_k(BLASLONG, BLASLONG, BLASLONG, bfloat16,
|
||||
bfloat16 *, BLASLONG, bfloat16 *, BLASLONG, bfloat16 *, BLASLONG);
|
||||
int sscal_k(BLASLONG, BLASLONG, BLASLONG, float,
|
||||
float *, BLASLONG, float *, BLASLONG, float *, BLASLONG);
|
||||
int dscal_k(BLASLONG, BLASLONG, BLASLONG, double,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*********************************************************************/
|
||||
/* Copyright 2025 The OpenBLAS Project */
|
||||
/* Copyright 2009, 2010 The University of Texas at Austin. */
|
||||
/* All rights reserved. */
|
||||
/* */
|
||||
@@ -44,6 +45,11 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
int bgemv_n(BLASLONG, BLASLONG, bfloat16, bfloat16 *, BLASLONG, bfloat16 *, BLASLONG, bfloat16, bfloat16 *, BLASLONG);
|
||||
int bgemv_t(BLASLONG, BLASLONG, bfloat16, bfloat16 *, BLASLONG, bfloat16 *, BLASLONG, bfloat16, bfloat16 *, BLASLONG);
|
||||
int bgemv_thread_n(BLASLONG, BLASLONG, bfloat16, bfloat16 *, BLASLONG, bfloat16 *, BLASLONG, bfloat16, bfloat16 *, BLASLONG, int);
|
||||
int bgemv_thread_t(BLASLONG, BLASLONG, bfloat16, bfloat16 *, BLASLONG, bfloat16 *, BLASLONG, bfloat16, bfloat16 *, BLASLONG, int);
|
||||
int sbgemv_n(BLASLONG, BLASLONG, float, bfloat16 *, BLASLONG, bfloat16 *, BLASLONG, float, float *, BLASLONG);
|
||||
int sbgemv_t(BLASLONG, BLASLONG, float, bfloat16 *, BLASLONG, bfloat16 *, BLASLONG, float, float *, BLASLONG);
|
||||
int sbgemv_thread_n(BLASLONG, BLASLONG, float, bfloat16 *, BLASLONG, bfloat16 *, BLASLONG, float, float *, BLASLONG, int);
|
||||
|
||||
+42
-1
@@ -52,9 +52,19 @@ void sgemm_direct(BLASLONG M, BLASLONG N, BLASLONG K,
|
||||
float * B, BLASLONG strideB,
|
||||
float * R, BLASLONG strideR);
|
||||
|
||||
void sgemm_direct_alpha_beta(BLASLONG M, BLASLONG N, BLASLONG K,
|
||||
float alpha,
|
||||
float * A, BLASLONG strideA,
|
||||
float * B, BLASLONG strideB,
|
||||
float beta,
|
||||
float * R, BLASLONG strideR);
|
||||
|
||||
int sgemm_direct_performant(BLASLONG M, BLASLONG N, BLASLONG K);
|
||||
|
||||
|
||||
int shgemm_beta(BLASLONG, BLASLONG, BLASLONG, float,
|
||||
hfloat16 *, BLASLONG, hfloat16 *, BLASLONG, float *, BLASLONG);
|
||||
int bgemm_beta(BLASLONG, BLASLONG, BLASLONG, bfloat16,
|
||||
bfloat16 *, BLASLONG, bfloat16 *, BLASLONG, bfloat16 *, BLASLONG);
|
||||
int sbgemm_beta(BLASLONG, BLASLONG, BLASLONG, float,
|
||||
bfloat16 *, BLASLONG, bfloat16 *, BLASLONG, float *, BLASLONG);
|
||||
int sgemm_beta(BLASLONG, BLASLONG, BLASLONG, float,
|
||||
@@ -78,6 +88,14 @@ int xgemm_beta(BLASLONG, BLASLONG, BLASLONG, xdouble *,
|
||||
xdouble *, BLASLONG, xdouble *, BLASLONG, xdouble *, BLASLONG);
|
||||
#endif
|
||||
|
||||
int shgemm_incopy(BLASLONG m, BLASLONG n, hfloat16 *a, BLASLONG lda, hfloat16 *b);
|
||||
int shgemm_itcopy(BLASLONG m, BLASLONG n, hfloat16 *a, BLASLONG lda, hfloat16 *b);
|
||||
int shgemm_oncopy(BLASLONG m, BLASLONG n, hfloat16 *a, BLASLONG lda, hfloat16 *b);
|
||||
int shgemm_otcopy(BLASLONG m, BLASLONG n, hfloat16 *a, BLASLONG lda, hfloat16 *b);
|
||||
int bgemm_incopy(BLASLONG m, BLASLONG n, bfloat16 *a, BLASLONG lda, bfloat16 *b);
|
||||
int bgemm_itcopy(BLASLONG m, BLASLONG n, bfloat16 *a, BLASLONG lda, bfloat16 *b);
|
||||
int bgemm_oncopy(BLASLONG m, BLASLONG n, bfloat16 *a, BLASLONG lda, bfloat16 *b);
|
||||
int bgemm_otcopy(BLASLONG m, BLASLONG n, bfloat16 *a, BLASLONG lda, bfloat16 *b);
|
||||
int sbgemm_incopy(BLASLONG m, BLASLONG n, bfloat16 *a, BLASLONG lda, bfloat16 *b);
|
||||
int sbgemm_itcopy(BLASLONG m, BLASLONG n, bfloat16 *a, BLASLONG lda, bfloat16 *b);
|
||||
int sbgemm_oncopy(BLASLONG m, BLASLONG n, bfloat16 *a, BLASLONG lda, bfloat16 *b);
|
||||
@@ -505,6 +523,8 @@ int xher2k_kernel_UC(BLASLONG m, BLASLONG n, BLASLONG k, xdouble alpha_r, xdoubl
|
||||
int xher2k_kernel_LN(BLASLONG m, BLASLONG n, BLASLONG k, xdouble alpha_r, xdouble alpha_i, xdouble *a, xdouble *b, xdouble *c, BLASLONG ldc, BLASLONG offset, int flag);
|
||||
int xher2k_kernel_LC(BLASLONG m, BLASLONG n, BLASLONG k, xdouble alpha_r, xdouble alpha_i, xdouble *a, xdouble *b, xdouble *c, BLASLONG ldc, BLASLONG offset, int flag);
|
||||
|
||||
int shgemm_kernel(BLASLONG, BLASLONG, BLASLONG, float, hfloat16 *, hfloat16 *, float *, BLASLONG);
|
||||
int bgemm_kernel(BLASLONG, BLASLONG, BLASLONG, bfloat16, bfloat16 *, bfloat16 *, bfloat16 *, BLASLONG);
|
||||
int sbgemm_kernel(BLASLONG, BLASLONG, BLASLONG, float, bfloat16 *, bfloat16 *, float *, BLASLONG);
|
||||
int sgemm_kernel(BLASLONG, BLASLONG, BLASLONG, float, float *, float *, float *, BLASLONG);
|
||||
int dgemm_kernel(BLASLONG, BLASLONG, BLASLONG, double, double *, double *, double *, BLASLONG);
|
||||
@@ -657,6 +677,16 @@ int cgemm3m_kernel(BLASLONG, BLASLONG, BLASLONG, float, float, float *, float
|
||||
int zgemm3m_kernel(BLASLONG, BLASLONG, BLASLONG, double, double, double *, double *, double *, BLASLONG);
|
||||
int xgemm3m_kernel(BLASLONG, BLASLONG, BLASLONG, xdouble, xdouble, xdouble *, xdouble *, xdouble *, BLASLONG);
|
||||
|
||||
int shgemm_nn(blas_arg_t *, BLASLONG *, BLASLONG *, hfloat16 *, hfloat16 *, BLASLONG);
|
||||
int shgemm_nt(blas_arg_t *, BLASLONG *, BLASLONG *, hfloat16 *, hfloat16 *, BLASLONG);
|
||||
int shgemm_tn(blas_arg_t *, BLASLONG *, BLASLONG *, hfloat16 *, hfloat16 *, BLASLONG);
|
||||
int shgemm_tt(blas_arg_t *, BLASLONG *, BLASLONG *, hfloat16 *, hfloat16 *, BLASLONG);
|
||||
|
||||
int bgemm_nn(blas_arg_t *, BLASLONG *, BLASLONG *, bfloat16 *, bfloat16 *, BLASLONG);
|
||||
int bgemm_nt(blas_arg_t *, BLASLONG *, BLASLONG *, bfloat16 *, bfloat16 *, BLASLONG);
|
||||
int bgemm_tn(blas_arg_t *, BLASLONG *, BLASLONG *, bfloat16 *, bfloat16 *, BLASLONG);
|
||||
int bgemm_tt(blas_arg_t *, BLASLONG *, BLASLONG *, bfloat16 *, bfloat16 *, BLASLONG);
|
||||
|
||||
int sbgemm_nn(blas_arg_t *, BLASLONG *, BLASLONG *, bfloat16 *, bfloat16 *, BLASLONG);
|
||||
int sbgemm_nt(blas_arg_t *, BLASLONG *, BLASLONG *, bfloat16 *, bfloat16 *, BLASLONG);
|
||||
int sbgemm_tn(blas_arg_t *, BLASLONG *, BLASLONG *, bfloat16 *, bfloat16 *, BLASLONG);
|
||||
@@ -754,6 +784,16 @@ int xgemm_cr(blas_arg_t *, BLASLONG *, BLASLONG *, xdouble *, xdouble *, BLASLON
|
||||
int xgemm_cc(blas_arg_t *, BLASLONG *, BLASLONG *, xdouble *, xdouble *, BLASLONG);
|
||||
#endif
|
||||
|
||||
int shgemm_thread_nn(blas_arg_t *, BLASLONG *, BLASLONG *, hfloat16 *, hfloat16 *, BLASLONG);
|
||||
int shgemm_thread_nt(blas_arg_t *, BLASLONG *, BLASLONG *, hfloat16 *, hfloat16 *, BLASLONG);
|
||||
int shgemm_thread_tn(blas_arg_t *, BLASLONG *, BLASLONG *, hfloat16 *, hfloat16 *, BLASLONG);
|
||||
int shgemm_thread_tt(blas_arg_t *, BLASLONG *, BLASLONG *, hfloat16 *, hfloat16 *, BLASLONG);
|
||||
|
||||
int bgemm_thread_nn(blas_arg_t *, BLASLONG *, BLASLONG *, bfloat16 *, bfloat16 *, BLASLONG);
|
||||
int bgemm_thread_nt(blas_arg_t *, BLASLONG *, BLASLONG *, bfloat16 *, bfloat16 *, BLASLONG);
|
||||
int bgemm_thread_tn(blas_arg_t *, BLASLONG *, BLASLONG *, bfloat16 *, bfloat16 *, BLASLONG);
|
||||
int bgemm_thread_tt(blas_arg_t *, BLASLONG *, BLASLONG *, bfloat16 *, bfloat16 *, BLASLONG);
|
||||
|
||||
int sbgemm_thread_nn(blas_arg_t *, BLASLONG *, BLASLONG *, bfloat16 *, bfloat16 *, BLASLONG);
|
||||
int sbgemm_thread_nt(blas_arg_t *, BLASLONG *, BLASLONG *, bfloat16 *, bfloat16 *, BLASLONG);
|
||||
int sbgemm_thread_tn(blas_arg_t *, BLASLONG *, BLASLONG *, bfloat16 *, bfloat16 *, BLASLONG);
|
||||
@@ -1944,6 +1984,7 @@ int dgemm_batch_thread(blas_arg_t * queue, BLASLONG nums);
|
||||
int cgemm_batch_thread(blas_arg_t * queue, BLASLONG nums);
|
||||
int zgemm_batch_thread(blas_arg_t * queue, BLASLONG nums);
|
||||
int sbgemm_batch_thread(blas_arg_t * queue, BLASLONG nums);
|
||||
// int shgemm_batch_thread(blas_arg_t * queue, BLASLONG nums);
|
||||
|
||||
#ifdef __CUDACC__
|
||||
}
|
||||
|
||||
+106
-5
@@ -1,5 +1,6 @@
|
||||
/*********************************************************************/
|
||||
/* Copyright 2009, 2010 The University of Texas at Austin. */
|
||||
/* Copyright 2025 The OpenBLAS Project. */
|
||||
/* All rights reserved. */
|
||||
/* */
|
||||
/* Redistribution and use in source and binary forms, with or */
|
||||
@@ -39,6 +40,8 @@
|
||||
#ifndef COMMON_MACRO
|
||||
#define COMMON_MACRO
|
||||
|
||||
#include "common_sh.h"
|
||||
#include "common_b.h"
|
||||
#include "common_sb.h"
|
||||
#include "common_s.h"
|
||||
#include "common_d.h"
|
||||
@@ -656,15 +659,108 @@
|
||||
#define GEMM_SMALL_KERNEL_B0_NT DGEMM_SMALL_KERNEL_B0_NT
|
||||
#define GEMM_SMALL_KERNEL_B0_TN DGEMM_SMALL_KERNEL_B0_TN
|
||||
#define GEMM_SMALL_KERNEL_B0_TT DGEMM_SMALL_KERNEL_B0_TT
|
||||
#elif defined(HFLOAT16)
|
||||
#define GEMM_BETA SHGEMM_BETA
|
||||
#define GEMM_KERNEL_N SHGEMM_KERNEL
|
||||
#define GEMM_KERNEL_L SHGEMM_KERNEL
|
||||
#define GEMM_KERNEL_R SHGEMM_KERNEL
|
||||
#define GEMM_KERNEL_B SHGEMM_KERNEL
|
||||
#define GEMM_NN SHGEMM_NN
|
||||
#define GEMM_CN SHGEMM_TN
|
||||
#define GEMM_TN SHGEMM_TN
|
||||
#define GEMM_NC SHGEMM_NT
|
||||
#define GEMM_NT SHGEMM_NT
|
||||
#define GEMM_CC SHGEMM_TT
|
||||
#define GEMM_CT SHGEMM_TT
|
||||
#define GEMM_TC SHGEMM_TT
|
||||
#define GEMM_TT SHGEMM_TT
|
||||
#define GEMM_NR SHGEMM_NN
|
||||
#define GEMM_TR SHGEMM_TN
|
||||
#define GEMM_CR SHGEMM_TN
|
||||
#define GEMM_RN SHGEMM_NN
|
||||
#define GEMM_RT SHGEMM_NT
|
||||
#define GEMM_RC SHGEMM_NT
|
||||
#define GEMM_RR SHGEMM_NN
|
||||
#define GEMM_ONCOPY SHGEMM_ONCOPY
|
||||
#define GEMM_OTCOPY SHGEMM_OTCOPY
|
||||
#define GEMM_INCOPY SHGEMM_INCOPY
|
||||
#define GEMM_ITCOPY SHGEMM_ITCOPY
|
||||
|
||||
#define GEMM_THREAD_NN SHGEMM_THREAD_NN
|
||||
#define GEMM_THREAD_CN SHGEMM_THREAD_TN
|
||||
#define GEMM_THREAD_TN SHGEMM_THREAD_TN
|
||||
#define GEMM_THREAD_NC SHGEMM_THREAD_NT
|
||||
#define GEMM_THREAD_NT SHGEMM_THREAD_NT
|
||||
#define GEMM_THREAD_CC SHGEMM_THREAD_TT
|
||||
#define GEMM_THREAD_CT SHGEMM_THREAD_TT
|
||||
#define GEMM_THREAD_TC SHGEMM_THREAD_TT
|
||||
#define GEMM_THREAD_TT SHGEMM_THREAD_TT
|
||||
#define GEMM_THREAD_NR SHGEMM_THREAD_NN
|
||||
#define GEMM_THREAD_TR SHGEMM_THREAD_TN
|
||||
#define GEMM_THREAD_CR SHGEMM_THREAD_TN
|
||||
#define GEMM_THREAD_RN SHGEMM_THREAD_NN
|
||||
#define GEMM_THREAD_RT SHGEMM_THREAD_NT
|
||||
#define GEMM_THREAD_RC SHGEMM_THREAD_NT
|
||||
#define GEMM_THREAD_RR SHGEMM_THREAD_NN
|
||||
|
||||
|
||||
#elif defined(BFLOAT16) && defined(BGEMM)
|
||||
#define SCAL_K BSCAL_K
|
||||
|
||||
#define GEMV_N BGEMV_N_K
|
||||
#define GEMV_T BGEMV_T_K
|
||||
|
||||
#define GEMM_BETA BGEMM_BETA
|
||||
#define GEMM_KERNEL_N BGEMM_KERNEL
|
||||
#define GEMM_KERNEL_L BGEMM_KERNEL
|
||||
#define GEMM_KERNEL_R BGEMM_KERNEL
|
||||
#define GEMM_KERNEL_B BGEMM_KERNEL
|
||||
|
||||
#define GEMM_NN BGEMM_NN
|
||||
#define GEMM_CN BGEMM_TN
|
||||
#define GEMM_TN BGEMM_TN
|
||||
#define GEMM_NC BGEMM_NT
|
||||
#define GEMM_NT BGEMM_NT
|
||||
#define GEMM_CC BGEMM_TT
|
||||
#define GEMM_CT BGEMM_TT
|
||||
#define GEMM_TC BGEMM_TT
|
||||
#define GEMM_TT BGEMM_TT
|
||||
#define GEMM_NR BGEMM_NN
|
||||
#define GEMM_TR BGEMM_TN
|
||||
#define GEMM_CR BGEMM_TN
|
||||
#define GEMM_RN BGEMM_NN
|
||||
#define GEMM_RT BGEMM_NT
|
||||
#define GEMM_RC BGEMM_NT
|
||||
#define GEMM_RR BGEMM_NN
|
||||
#define GEMM_ONCOPY BGEMM_ONCOPY
|
||||
#define GEMM_OTCOPY BGEMM_OTCOPY
|
||||
#define GEMM_INCOPY BGEMM_INCOPY
|
||||
#define GEMM_ITCOPY BGEMM_ITCOPY
|
||||
|
||||
#define GEMM_THREAD_NN BGEMM_THREAD_NN
|
||||
#define GEMM_THREAD_CN BGEMM_THREAD_TN
|
||||
#define GEMM_THREAD_TN BGEMM_THREAD_TN
|
||||
#define GEMM_THREAD_NC BGEMM_THREAD_NT
|
||||
#define GEMM_THREAD_NT BGEMM_THREAD_NT
|
||||
#define GEMM_THREAD_CC BGEMM_THREAD_TT
|
||||
#define GEMM_THREAD_CT BGEMM_THREAD_TT
|
||||
#define GEMM_THREAD_TC BGEMM_THREAD_TT
|
||||
#define GEMM_THREAD_TT BGEMM_THREAD_TT
|
||||
#define GEMM_THREAD_NR BGEMM_THREAD_NN
|
||||
#define GEMM_THREAD_TR BGEMM_THREAD_TN
|
||||
#define GEMM_THREAD_CR BGEMM_THREAD_TN
|
||||
#define GEMM_THREAD_RN BGEMM_THREAD_NN
|
||||
#define GEMM_THREAD_RT BGEMM_THREAD_NT
|
||||
#define GEMM_THREAD_RC BGEMM_THREAD_NT
|
||||
#define GEMM_THREAD_RR BGEMM_THREAD_NN
|
||||
|
||||
#elif defined(BFLOAT16)
|
||||
|
||||
#define D_TO_BF16_K SBDTOBF16_K
|
||||
#define D_BF16_TO_K DBF16TOD_K
|
||||
#define S_TO_BF16_K SBSTOBF16_K
|
||||
#define S_BF16_TO_K SBF16TOS_K
|
||||
#define SBGEMV_N SBGEMV_N_K
|
||||
#define SBGEMV_T SBGEMV_T_K
|
||||
#define GEMV_N SBGEMV_N_K
|
||||
#define GEMV_T SBGEMV_T_K
|
||||
|
||||
#define AMAX_K SAMAX_K
|
||||
#define AMIN_K SAMIN_K
|
||||
@@ -682,8 +778,6 @@
|
||||
#define AXPYC_K SAXPYC_K
|
||||
#define AXPBY_K SAXPBY_K
|
||||
#define SCAL_K SSCAL_K
|
||||
#define GEMV_N SGEMV_N
|
||||
#define GEMV_T SGEMV_T
|
||||
#define SYMV_U SSYMV_U
|
||||
#define SYMV_L SSYMV_L
|
||||
#define GERU_K SGERU_K
|
||||
@@ -2618,6 +2712,9 @@
|
||||
|| defined(ARCH_LOONGARCH64) || defined(ARCH_E2K) || defined(ARCH_ALPHA))
|
||||
extern BLASLONG gemm_offset_a;
|
||||
extern BLASLONG gemm_offset_b;
|
||||
extern BLASLONG bgemm_p;
|
||||
extern BLASLONG bgemm_q;
|
||||
extern BLASLONG bgemm_r;
|
||||
extern BLASLONG sbgemm_p;
|
||||
extern BLASLONG sbgemm_q;
|
||||
extern BLASLONG sbgemm_r;
|
||||
@@ -2990,6 +3087,8 @@ typedef struct {
|
||||
#define NEG_TCOPY DNEG_TCOPY
|
||||
#define LARF_L DLARF_L
|
||||
#define LARF_R DLARF_R
|
||||
#define LAED3_SINGLE dlaed3_single
|
||||
#define LAED3_PARALLEL dlaed3_parallel
|
||||
#else
|
||||
#define GETF2 SGETF2
|
||||
#define GETRF SGETRF
|
||||
@@ -3011,6 +3110,8 @@ typedef struct {
|
||||
#define NEG_TCOPY SNEG_TCOPY
|
||||
#define LARF_L SLARF_L
|
||||
#define LARF_R SLARF_R
|
||||
#define LAED3_SINGLE slaed3_single
|
||||
#define LAED3_PARALLEL slaed3_parallel
|
||||
#endif
|
||||
#else
|
||||
#ifdef XDOUBLE
|
||||
|
||||
+120
-23
@@ -1,6 +1,6 @@
|
||||
/*********************************************************************/
|
||||
/* Copyright 2009, 2010 The University of Texas at Austin. */
|
||||
/* Copyright 2023 The OpenBLAS Project. */
|
||||
/* Copyright 2023, 2025 The OpenBLAS Project. */
|
||||
/* All rights reserved. */
|
||||
/* */
|
||||
/* Redistribution and use in source and binary forms, with or */
|
||||
@@ -48,8 +48,27 @@ typedef struct {
|
||||
int dtb_entries;
|
||||
int switch_ratio;
|
||||
int offsetA, offsetB, align;
|
||||
#if BUILD_HFLOAT16 == 1
|
||||
int shgemm_p, shgemm_q, shgemm_r;
|
||||
int shgemm_unroll_m, shgemm_unroll_n, shgemm_unroll_mn;
|
||||
|
||||
int (*shgemm_kernel )(BLASLONG, BLASLONG, BLASLONG, float, hfloat16 *, hfloat16 *, float *, BLASLONG);
|
||||
int (*shgemm_beta )(BLASLONG, BLASLONG, BLASLONG, float, hfloat16 *, BLASLONG, hfloat16 *, BLASLONG, float *, BLASLONG);
|
||||
|
||||
int (*shgemm_incopy )(BLASLONG, BLASLONG, hfloat16 *, BLASLONG, hfloat16 *);
|
||||
int (*shgemm_itcopy )(BLASLONG, BLASLONG, hfloat16 *, BLASLONG, hfloat16 *);
|
||||
int (*shgemm_oncopy )(BLASLONG, BLASLONG, hfloat16 *, BLASLONG, hfloat16 *);
|
||||
int (*shgemm_otcopy )(BLASLONG, BLASLONG, hfloat16 *, BLASLONG, hfloat16 *);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if BUILD_BFLOAT16 == 1
|
||||
int bgemm_p, bgemm_q, bgemm_r;
|
||||
int bgemm_unroll_m, bgemm_unroll_n, bgemm_unroll_mn;
|
||||
int bgemm_align_k;
|
||||
|
||||
int sbgemm_p, sbgemm_q, sbgemm_r;
|
||||
int sbgemm_unroll_m, sbgemm_unroll_n, sbgemm_unroll_mn;
|
||||
int sbgemm_align_k;
|
||||
@@ -64,10 +83,10 @@ typedef struct {
|
||||
float (*sbamin_k) (BLASLONG, float *, BLASLONG);
|
||||
float (*sbmax_k) (BLASLONG, float *, BLASLONG);
|
||||
float (*sbmin_k) (BLASLONG, float *, BLASLONG);
|
||||
BLASLONG (*isbamax_k)(BLASLONG, float *, BLASLONG);
|
||||
BLASLONG (*isbamin_k)(BLASLONG, float *, BLASLONG);
|
||||
BLASLONG (*isbmax_k) (BLASLONG, float *, BLASLONG);
|
||||
BLASLONG (*isbmin_k) (BLASLONG, float *, BLASLONG);
|
||||
BLASLONG (*isbamax_k)(BLASLONG, float *, BLASLONG);
|
||||
BLASLONG (*isbamin_k)(BLASLONG, float *, BLASLONG);
|
||||
BLASLONG (*isbmax_k) (BLASLONG, float *, BLASLONG);
|
||||
BLASLONG (*isbmin_k) (BLASLONG, float *, BLASLONG);
|
||||
|
||||
float (*sbnrm2_k) (BLASLONG, float *, BLASLONG);
|
||||
float (*sbasum_k) (BLASLONG, float *, BLASLONG);
|
||||
@@ -79,10 +98,14 @@ BLASLONG (*isbmin_k) (BLASLONG, float *, BLASLONG);
|
||||
int (*sbrot_k) (BLASLONG, float *, BLASLONG, float *, BLASLONG, float, float);
|
||||
int (*sbrotm_k) (BLASLONG, float *, BLASLONG, float *, BLASLONG, float *);
|
||||
|
||||
int (*bscal_k) (BLASLONG, BLASLONG, BLASLONG, bfloat16, bfloat16 *, BLASLONG, bfloat16 *, BLASLONG, bfloat16 *, BLASLONG);
|
||||
int (*sbaxpy_k) (BLASLONG, BLASLONG, BLASLONG, float, float *, BLASLONG, float *, BLASLONG, float *, BLASLONG);
|
||||
int (*sbscal_k) (BLASLONG, BLASLONG, BLASLONG, float, float *, BLASLONG, float *, BLASLONG, float *, BLASLONG);
|
||||
int (*sbswap_k) (BLASLONG, BLASLONG, BLASLONG, float, float *, BLASLONG, float *, BLASLONG, float *, BLASLONG);
|
||||
|
||||
int (*bgemv_n) (BLASLONG, BLASLONG, bfloat16, bfloat16 *, BLASLONG, bfloat16 *, BLASLONG, bfloat16, bfloat16 *, BLASLONG);
|
||||
int (*bgemv_t) (BLASLONG, BLASLONG, bfloat16, bfloat16 *, BLASLONG, bfloat16 *, BLASLONG, bfloat16, bfloat16 *, BLASLONG);
|
||||
|
||||
int (*sbgemv_n) (BLASLONG, BLASLONG, float, bfloat16 *, BLASLONG, bfloat16 *, BLASLONG, float, float *, BLASLONG);
|
||||
int (*sbgemv_t) (BLASLONG, BLASLONG, float, bfloat16 *, BLASLONG, bfloat16 *, BLASLONG, float, float *, BLASLONG);
|
||||
int (*sbger_k) (BLASLONG, BLASLONG, BLASLONG, float, float *, BLASLONG, float *, BLASLONG, float *, BLASLONG, float *);
|
||||
@@ -90,6 +113,14 @@ BLASLONG (*isbmin_k) (BLASLONG, float *, BLASLONG);
|
||||
int (*sbsymv_L) (BLASLONG, BLASLONG, float, float *, BLASLONG, float *, BLASLONG, float *, BLASLONG, float *);
|
||||
int (*sbsymv_U) (BLASLONG, BLASLONG, float, float *, BLASLONG, float *, BLASLONG, float *, BLASLONG, float *);
|
||||
|
||||
int (*bgemm_kernel )(BLASLONG, BLASLONG, BLASLONG, bfloat16, bfloat16 *, bfloat16 *, bfloat16 *, BLASLONG);
|
||||
int (*bgemm_beta )(BLASLONG, BLASLONG, BLASLONG, bfloat16, bfloat16 *, BLASLONG, bfloat16 *, BLASLONG, bfloat16 *, BLASLONG);
|
||||
|
||||
int (*bgemm_incopy )(BLASLONG, BLASLONG, bfloat16 *, BLASLONG, bfloat16 *);
|
||||
int (*bgemm_itcopy )(BLASLONG, BLASLONG, bfloat16 *, BLASLONG, bfloat16 *);
|
||||
int (*bgemm_oncopy )(BLASLONG, BLASLONG, bfloat16 *, BLASLONG, bfloat16 *);
|
||||
int (*bgemm_otcopy )(BLASLONG, BLASLONG, bfloat16 *, BLASLONG, bfloat16 *);
|
||||
|
||||
int (*sbgemm_kernel )(BLASLONG, BLASLONG, BLASLONG, float, bfloat16 *, bfloat16 *, float *, BLASLONG);
|
||||
int (*sbgemm_beta )(BLASLONG, BLASLONG, BLASLONG, float, bfloat16 *, BLASLONG, bfloat16 *, BLASLONG, float *, BLASLONG);
|
||||
|
||||
@@ -180,12 +211,12 @@ BLASLONG (*isbmin_k) (BLASLONG, float *, BLASLONG);
|
||||
#endif
|
||||
|
||||
#if (BUILD_SINGLE==1) || (BUILD_DOUBLE ==1) || (BUILD_COMPLEX==1)
|
||||
BLASLONG (*isamax_k)(BLASLONG, float *, BLASLONG);
|
||||
BLASLONG (*isamax_k)(BLASLONG, float *, BLASLONG);
|
||||
#endif
|
||||
#if (BUILD_SINGLE==1) || (BUILD_COMPLEX==1)
|
||||
BLASLONG (*isamin_k)(BLASLONG, float *, BLASLONG);
|
||||
BLASLONG (*ismax_k) (BLASLONG, float *, BLASLONG);
|
||||
BLASLONG (*ismin_k) (BLASLONG, float *, BLASLONG);
|
||||
BLASLONG (*isamin_k)(BLASLONG, float *, BLASLONG);
|
||||
BLASLONG (*ismax_k) (BLASLONG, float *, BLASLONG);
|
||||
BLASLONG (*ismin_k) (BLASLONG, float *, BLASLONG);
|
||||
float (*snrm2_k) (BLASLONG, float *, BLASLONG);
|
||||
float (*sasum_k) (BLASLONG, float *, BLASLONG);
|
||||
#endif
|
||||
@@ -225,6 +256,7 @@ BLASLONG (*ismin_k) (BLASLONG, float *, BLASLONG);
|
||||
#endif
|
||||
#ifdef ARCH_ARM64
|
||||
void (*sgemm_direct) (BLASLONG, BLASLONG, BLASLONG, float *, BLASLONG , float *, BLASLONG , float * , BLASLONG);
|
||||
void (*sgemm_direct_alpha_beta) (BLASLONG, BLASLONG, BLASLONG, float, float *, BLASLONG, float *, BLASLONG, float, float * , BLASLONG);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -316,10 +348,10 @@ BLASLONG (*ismin_k) (BLASLONG, float *, BLASLONG);
|
||||
double (*damin_k) (BLASLONG, double *, BLASLONG);
|
||||
double (*dmax_k) (BLASLONG, double *, BLASLONG);
|
||||
double (*dmin_k) (BLASLONG, double *, BLASLONG);
|
||||
BLASLONG (*idamax_k)(BLASLONG, double *, BLASLONG);
|
||||
BLASLONG (*idamin_k)(BLASLONG, double *, BLASLONG);
|
||||
BLASLONG (*idmax_k) (BLASLONG, double *, BLASLONG);
|
||||
BLASLONG (*idmin_k) (BLASLONG, double *, BLASLONG);
|
||||
BLASLONG (*idamax_k)(BLASLONG, double *, BLASLONG);
|
||||
BLASLONG (*idamin_k)(BLASLONG, double *, BLASLONG);
|
||||
BLASLONG (*idmax_k) (BLASLONG, double *, BLASLONG);
|
||||
BLASLONG (*idmin_k) (BLASLONG, double *, BLASLONG);
|
||||
|
||||
double (*dnrm2_k) (BLASLONG, double *, BLASLONG);
|
||||
double (*dasum_k) (BLASLONG, double *, BLASLONG);
|
||||
@@ -435,10 +467,10 @@ BLASLONG (*idmin_k) (BLASLONG, double *, BLASLONG);
|
||||
xdouble (*qamin_k) (BLASLONG, xdouble *, BLASLONG);
|
||||
xdouble (*qmax_k) (BLASLONG, xdouble *, BLASLONG);
|
||||
xdouble (*qmin_k) (BLASLONG, xdouble *, BLASLONG);
|
||||
BLASLONG (*iqamax_k)(BLASLONG, xdouble *, BLASLONG);
|
||||
BLASLONG (*iqamin_k)(BLASLONG, xdouble *, BLASLONG);
|
||||
BLASLONG (*iqmax_k) (BLASLONG, xdouble *, BLASLONG);
|
||||
BLASLONG (*iqmin_k) (BLASLONG, xdouble *, BLASLONG);
|
||||
BLASLONG (*iqamax_k)(BLASLONG, xdouble *, BLASLONG);
|
||||
BLASLONG (*iqamin_k)(BLASLONG, xdouble *, BLASLONG);
|
||||
BLASLONG (*iqmax_k) (BLASLONG, xdouble *, BLASLONG);
|
||||
BLASLONG (*iqmin_k) (BLASLONG, xdouble *, BLASLONG);
|
||||
|
||||
xdouble (*qnrm2_k) (BLASLONG, xdouble *, BLASLONG);
|
||||
xdouble (*qasum_k) (BLASLONG, xdouble *, BLASLONG);
|
||||
@@ -528,8 +560,8 @@ BLASLONG (*iqmin_k) (BLASLONG, xdouble *, BLASLONG);
|
||||
float (*camax_k) (BLASLONG, float *, BLASLONG);
|
||||
float (*camin_k) (BLASLONG, float *, BLASLONG);
|
||||
|
||||
BLASLONG (*icamax_k)(BLASLONG, float *, BLASLONG);
|
||||
BLASLONG (*icamin_k)(BLASLONG, float *, BLASLONG);
|
||||
BLASLONG (*icamax_k)(BLASLONG, float *, BLASLONG);
|
||||
BLASLONG (*icamin_k)(BLASLONG, float *, BLASLONG);
|
||||
|
||||
float (*cnrm2_k) (BLASLONG, float *, BLASLONG);
|
||||
float (*casum_k) (BLASLONG, float *, BLASLONG);
|
||||
@@ -739,8 +771,8 @@ BLASLONG (*icamin_k)(BLASLONG, float *, BLASLONG);
|
||||
|
||||
double (*zamax_k) (BLASLONG, double *, BLASLONG);
|
||||
double (*zamin_k) (BLASLONG, double *, BLASLONG);
|
||||
BLASLONG (*izamax_k)(BLASLONG, double *, BLASLONG);
|
||||
BLASLONG (*izamin_k)(BLASLONG, double *, BLASLONG);
|
||||
BLASLONG (*izamax_k)(BLASLONG, double *, BLASLONG);
|
||||
BLASLONG (*izamin_k)(BLASLONG, double *, BLASLONG);
|
||||
|
||||
double (*znrm2_k) (BLASLONG, double *, BLASLONG);
|
||||
double (*zasum_k) (BLASLONG, double *, BLASLONG);
|
||||
@@ -950,8 +982,8 @@ BLASLONG (*izamin_k)(BLASLONG, double *, BLASLONG);
|
||||
|
||||
xdouble (*xamax_k) (BLASLONG, xdouble *, BLASLONG);
|
||||
xdouble (*xamin_k) (BLASLONG, xdouble *, BLASLONG);
|
||||
BLASLONG (*ixamax_k)(BLASLONG, xdouble *, BLASLONG);
|
||||
BLASLONG (*ixamin_k)(BLASLONG, xdouble *, BLASLONG);
|
||||
BLASLONG (*ixamax_k)(BLASLONG, xdouble *, BLASLONG);
|
||||
BLASLONG (*ixamin_k)(BLASLONG, xdouble *, BLASLONG);
|
||||
|
||||
xdouble (*xnrm2_k) (BLASLONG, xdouble *, BLASLONG);
|
||||
xdouble (*xasum_k) (BLASLONG, xdouble *, BLASLONG);
|
||||
@@ -1229,7 +1261,23 @@ extern gotoblas_t *gotoblas;
|
||||
|
||||
#define HAVE_EX_L2 gotoblas -> exclusive_cache
|
||||
|
||||
#if (BUILD_HFLOAT16==1)
|
||||
#define SHGEMM_P gotoblas -> shgemm_p
|
||||
#define SHGEMM_Q gotoblas -> shgemm_q
|
||||
#define SHGEMM_R gotoblas -> shgemm_r
|
||||
#define SHGEMM_UNROLL_M gotoblas -> shgemm_unroll_m
|
||||
#define SHGEMM_UNROLL_N gotoblas -> shgemm_unroll_n
|
||||
#define SHGEMM_UNROLL_MN gotoblas -> shgemm_unroll_mn
|
||||
#endif
|
||||
|
||||
#if (BUILD_BFLOAT16==1)
|
||||
#define BGEMM_P gotoblas -> bgemm_p
|
||||
#define BGEMM_Q gotoblas -> bgemm_q
|
||||
#define BGEMM_R gotoblas -> bgemm_r
|
||||
#define BGEMM_UNROLL_M gotoblas -> bgemm_unroll_m
|
||||
#define BGEMM_UNROLL_N gotoblas -> bgemm_unroll_n
|
||||
#define BGEMM_UNROLL_MN gotoblas -> bgemm_unroll_mn
|
||||
|
||||
#define SBGEMM_P gotoblas -> sbgemm_p
|
||||
#define SBGEMM_Q gotoblas -> sbgemm_q
|
||||
#define SBGEMM_R gotoblas -> sbgemm_r
|
||||
@@ -1357,7 +1405,31 @@ extern gotoblas_t *gotoblas;
|
||||
#define HAVE_EX_L2 0
|
||||
#endif
|
||||
|
||||
#if (BUILD_HFLOAT16 == 1)
|
||||
#define SHGEMM_P SHGEMM_DEFAULT_P
|
||||
#define SHGEMM_Q SHGEMM_DEFAULT_Q
|
||||
#define SHGEMM_R SHGEMM_DEFAULT_R
|
||||
#define SHGEMM_UNROLL_M SHGEMM_DEFAULT_UNROLL_M
|
||||
#define SHGEMM_UNROLL_N SHGEMM_DEFAULT_UNROLL_N
|
||||
#ifdef SHGEMM_DEFAULT_UNROLL_MN
|
||||
#define SHGEMM_UNROLL_MN SHGEMM_DEFAULT_UNROLL_MN
|
||||
#else
|
||||
#define SHGEMM_UNROLL_MN MAX((SHGEMM_UNROLL_M), (SHGEMM_UNROLL_N))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (BUILD_BFLOAT16 == 1)
|
||||
#define BGEMM_P BGEMM_DEFAULT_P
|
||||
#define BGEMM_Q BGEMM_DEFAULT_Q
|
||||
#define BGEMM_R BGEMM_DEFAULT_R
|
||||
#define BGEMM_UNROLL_M BGEMM_DEFAULT_UNROLL_M
|
||||
#define BGEMM_UNROLL_N BGEMM_DEFAULT_UNROLL_N
|
||||
#ifdef BGEMM_DEFAULT_UNROLL_MN
|
||||
#define BGEMM_UNROLL_MN BGEMM_DEFAULT_UNROLL_MN
|
||||
#else
|
||||
#define BGEMM_UNROLL_MN MAX((BGEMM_UNROLL_M), (BGEMM_UNROLL_N))
|
||||
#endif
|
||||
|
||||
#define SBGEMM_P SBGEMM_DEFAULT_P
|
||||
#define SBGEMM_Q SBGEMM_DEFAULT_Q
|
||||
#define SBGEMM_R SBGEMM_DEFAULT_R
|
||||
@@ -1478,6 +1550,7 @@ extern gotoblas_t *gotoblas;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef COMPLEX
|
||||
@@ -1505,6 +1578,30 @@ extern gotoblas_t *gotoblas;
|
||||
#define GEMM_DEFAULT_R DGEMM_DEFAULT_R
|
||||
#define GEMM_DEFAULT_UNROLL_M DGEMM_DEFAULT_UNROLL_M
|
||||
#define GEMM_DEFAULT_UNROLL_N DGEMM_DEFAULT_UNROLL_N
|
||||
#elif defined(HFLOAT16)
|
||||
#define GEMM_P SHGEMM_P
|
||||
#define GEMM_Q SHGEMM_Q
|
||||
#define GEMM_R SHGEMM_R
|
||||
#define GEMM_UNROLL_M SHGEMM_UNROLL_M
|
||||
#define GEMM_UNROLL_N SHGEMM_UNROLL_N
|
||||
#define GEMM_UNROLL_MN SHGEMM_UNROLL_MN
|
||||
#define GEMM_DEFAULT_P SHGEMM_DEFAULT_P
|
||||
#define GEMM_DEFAULT_Q SHGEMM_DEFAULT_Q
|
||||
#define GEMM_DEFAULT_R SHGEMM_DEFAULT_R
|
||||
#define GEMM_DEFAULT_UNROLL_M SHGEMM_DEFAULT_UNROLL_M
|
||||
#define GEMM_DEFAULT_UNROLL_N SHGEMM_DEFAULT_UNROLL_N
|
||||
#elif defined(BFLOAT16) && defined(BGEMM)
|
||||
#define GEMM_P BGEMM_P
|
||||
#define GEMM_Q BGEMM_Q
|
||||
#define GEMM_R BGEMM_R
|
||||
#define GEMM_UNROLL_M BGEMM_UNROLL_M
|
||||
#define GEMM_UNROLL_N BGEMM_UNROLL_N
|
||||
#define GEMM_UNROLL_MN BGEMM_UNROLL_MN
|
||||
#define GEMM_DEFAULT_P BGEMM_DEFAULT_P
|
||||
#define GEMM_DEFAULT_Q BGEMM_DEFAULT_Q
|
||||
#define GEMM_DEFAULT_R BGEMM_DEFAULT_R
|
||||
#define GEMM_DEFAULT_UNROLL_M BGEMM_DEFAULT_UNROLL_M
|
||||
#define GEMM_DEFAULT_UNROLL_N BGEMM_DEFAULT_UNROLL_N
|
||||
#elif defined(BFLOAT16)
|
||||
#define GEMM_P SBGEMM_P
|
||||
#define GEMM_Q SBGEMM_Q
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
|
||||
#define SGEMM_DIRECT_PERFORMANT sgemm_direct_performant
|
||||
#define SGEMM_DIRECT sgemm_direct
|
||||
#define SGEMM_DIRECT_ALPHA_BETA sgemm_direct_alpha_beta
|
||||
|
||||
#define SGEMM_ONCOPY sgemm_oncopy
|
||||
#define SGEMM_OTCOPY sgemm_otcopy
|
||||
@@ -218,6 +219,7 @@
|
||||
#elif ARCH_ARM64
|
||||
#define SGEMM_DIRECT_PERFORMANT sgemm_direct_performant
|
||||
#define SGEMM_DIRECT gotoblas -> sgemm_direct
|
||||
#define SGEMM_DIRECT_ALPHA_BETA gotoblas -> sgemm_direct_alpha_beta
|
||||
#endif
|
||||
|
||||
#define SGEMM_ONCOPY gotoblas -> sgemm_oncopy
|
||||
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
#ifndef COMMON_SH_H
|
||||
#define COMMON_SH_H
|
||||
|
||||
#ifndef DYNAMIC_ARCH
|
||||
|
||||
#define SHGEMM_ONCOPY shgemm_oncopy
|
||||
#define SHGEMM_OTCOPY shgemm_otcopy
|
||||
|
||||
#if SGEMM_DEFAULT_UNROLL_M == SGEMM_DEFAULT_UNROLL_N
|
||||
#define SHGEMM_INCOPY shgemm_oncopy
|
||||
#define SHGEMM_ITCOPY shgemm_otcopy
|
||||
#else
|
||||
#define SHGEMM_INCOPY shgemm_incopy
|
||||
#define SHGEMM_ITCOPY shgemm_itcopy
|
||||
#endif
|
||||
|
||||
#define SHGEMM_BETA shgemm_beta
|
||||
#define SHGEMM_KERNEL shgemm_kernel
|
||||
|
||||
|
||||
#else // #DYNAMIC_ARCH
|
||||
|
||||
#define SHGEMM_ONCOPY gotoblas -> shgemm_oncopy
|
||||
#define SHGEMM_OTCOPY gotoblas -> shgemm_otcopy
|
||||
#if SGEMM_DEFAULT_UNROLL_M == SGEMM_DEFAULT_UNROLL_N
|
||||
#define SHGEMM_INCOPY gotoblas -> shgemm_oncopy
|
||||
#define SHGEMM_ITCOPY gotoblas -> shgemm_otcopy
|
||||
#else
|
||||
#define SHGEMM_INCOPY gotoblas -> shgemm_incopy
|
||||
#define SHGEMM_ITCOPY gotoblas -> shgemm_itcopy
|
||||
#endif
|
||||
|
||||
#define SHGEMM_BETA gotoblas -> shgemm_beta
|
||||
#define SHGEMM_KERNEL gotoblas -> shgemm_kernel
|
||||
#endif // #DYNAMIC_ARCH
|
||||
|
||||
#define SHGEMM_NN shgemm_nn
|
||||
#define SHGEMM_CN shgemm_tn
|
||||
#define SHGEMM_TN shgemm_tn
|
||||
#define SHGEMM_NC shgemm_nt
|
||||
#define SHGEMM_NT shgemm_nt
|
||||
#define SHGEMM_CC shgemm_tt
|
||||
#define SHGEMM_CT shgemm_tt
|
||||
#define SHGEMM_TC shgemm_tt
|
||||
#define SHGEMM_TT shgemm_tt
|
||||
#define SHGEMM_NR shgemm_nn
|
||||
#define SHGEMM_TR shgemm_tn
|
||||
#define SHGEMM_CR shgemm_tn
|
||||
#define SHGEMM_RN shgemm_nn
|
||||
#define SHGEMM_RT shgemm_nt
|
||||
#define SHGEMM_RC shgemm_nt
|
||||
#define SHGEMM_RR shgemm_nn
|
||||
|
||||
#define SHGEMM_THREAD_NN shgemm_thread_nn
|
||||
#define SHGEMM_THREAD_CN shgemm_thread_tn
|
||||
#define SHGEMM_THREAD_TN shgemm_thread_tn
|
||||
#define SHGEMM_THREAD_NC shgemm_thread_nt
|
||||
#define SHGEMM_THREAD_NT shgemm_thread_nt
|
||||
#define SHGEMM_THREAD_CC shgemm_thread_tt
|
||||
#define SHGEMM_THREAD_CT shgemm_thread_tt
|
||||
#define SHGEMM_THREAD_TC shgemm_thread_tt
|
||||
#define SHGEMM_THREAD_TT shgemm_thread_tt
|
||||
#define SHGEMM_THREAD_NR shgemm_thread_nn
|
||||
#define SHGEMM_THREAD_TR shgemm_thread_tn
|
||||
#define SHGEMM_THREAD_CR shgemm_thread_tn
|
||||
#define SHGEMM_THREAD_RN shgemm_thread_nn
|
||||
#define SHGEMM_THREAD_RT shgemm_thread_nt
|
||||
#define SHGEMM_THREAD_RC shgemm_thread_nt
|
||||
#define SHGEMM_THREAD_RR shgemm_thread_nn
|
||||
|
||||
|
||||
#endif // #COMMON_SH_H
|
||||
@@ -66,5 +66,9 @@ _cpuid:
|
||||
|
||||
#endif
|
||||
#if defined(__ELF__) && defined(__linux__)
|
||||
#if defined(__arm__)
|
||||
.section .note.GNU-stack,"",%progbits
|
||||
#else
|
||||
.section .note.GNU-stack,"",@progbits
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+27
-4
@@ -79,6 +79,7 @@ size_t length64=sizeof(value64);
|
||||
#define CPU_TSV110 9
|
||||
// Ampere
|
||||
#define CPU_EMAG8180 10
|
||||
#define CPU_AMPERE1 25
|
||||
// Apple
|
||||
#define CPU_VORTEX 13
|
||||
// Fujitsu
|
||||
@@ -111,7 +112,8 @@ static char *cpuname[] = {
|
||||
"CORTEXA710",
|
||||
"FT2000",
|
||||
"CORTEXA76",
|
||||
"NEOVERSEV2"
|
||||
"NEOVERSEV2",
|
||||
"AMPERE1"
|
||||
};
|
||||
|
||||
static char *cpuname_lower[] = {
|
||||
@@ -139,7 +141,9 @@ static char *cpuname_lower[] = {
|
||||
"cortexa710",
|
||||
"ft2000",
|
||||
"cortexa76",
|
||||
"neoversev2"
|
||||
"neoversev2",
|
||||
"ampere1",
|
||||
"ampere1a"
|
||||
};
|
||||
|
||||
static int cpulowperf=0;
|
||||
@@ -276,11 +280,11 @@ int detect(void)
|
||||
fclose(infile);
|
||||
}
|
||||
}
|
||||
sprintf(cpuimpl,"0x%2x",implementer);
|
||||
sprintf(cpuimpl,"0x%02x",implementer);
|
||||
cpu_implementer=strdup(cpuimpl);
|
||||
}
|
||||
qsort(cpucores,1024,sizeof(int),cpusort);
|
||||
sprintf(cpupart,"0x%3x",cpucores[0]);
|
||||
sprintf(cpupart,"0x%03x",cpucores[0]);
|
||||
cpu_part=strdup(cpupart);
|
||||
if(cpu_part != NULL && cpu_implementer != NULL) {
|
||||
// Arm
|
||||
@@ -334,6 +338,10 @@ int detect(void)
|
||||
// Ampere
|
||||
else if (strstr(cpu_implementer, "0x50") && strstr(cpu_part, "0x000"))
|
||||
return CPU_EMAG8180;
|
||||
else if (strstr(cpu_implementer, "0xc0")) {
|
||||
if (strstr(cpu_part, "0xac3") || strstr(cpu_part, "0xac4"))
|
||||
return CPU_AMPERE1;
|
||||
}
|
||||
// Fujitsu
|
||||
else if (strstr(cpu_implementer, "0x46") && strstr(cpu_part, "0x001"))
|
||||
return CPU_A64FX;
|
||||
@@ -684,6 +692,21 @@ void get_cpuconfig(void)
|
||||
printf("#define DTB_SIZE 4096\n");
|
||||
break;
|
||||
|
||||
case CPU_AMPERE1:
|
||||
printf("#define %s\n", cpuname[d]);
|
||||
printf("#define L1_CODE_SIZE 16384\n");
|
||||
printf("#define L1_CODE_LINESIZE 64\n");
|
||||
printf("#define L1_CODE_ASSOCIATIVE 4\n");
|
||||
printf("#define L1_DATA_SIZE 65536\n");
|
||||
printf("#define L1_DATA_LINESIZE 64\n");
|
||||
printf("#define L1_DATA_ASSOCIATIVE 4\n");
|
||||
printf("#define L2_SIZE 2097152\n");
|
||||
printf("#define L2_LINESIZE 64\n");
|
||||
printf("#define L2_ASSOCIATIVE 8\n");
|
||||
printf("#define DTB_DEFAULT_ENTRIES 64\n");
|
||||
printf("#define DTB_SIZE 4096\n");
|
||||
break;
|
||||
|
||||
case CPU_THUNDERX3T110:
|
||||
printf("#define THUNDERX3T110 \n");
|
||||
printf("#define L1_CODE_SIZE 65536 \n");
|
||||
|
||||
@@ -131,6 +131,7 @@ int detect(void){
|
||||
if (!strncasecmp(p, "POWER8", 6)) return CPUTYPE_POWER8;
|
||||
if (!strncasecmp(p, "POWER9", 6)) return CPUTYPE_POWER9;
|
||||
if (!strncasecmp(p, "POWER10", 7)) return CPUTYPE_POWER10;
|
||||
if (!strncasecmp(p, "POWER11", 7)) return CPUTYPE_POWER10;
|
||||
if (!strncasecmp(p, "Cell", 4)) return CPUTYPE_CELL;
|
||||
if (!strncasecmp(p, "7447", 4)) return CPUTYPE_PPCG4;
|
||||
|
||||
@@ -171,6 +172,9 @@ int detect(void){
|
||||
int id;
|
||||
__asm __volatile("mfpvr %0" : "=r"(id));
|
||||
switch ( id >> 16 ) {
|
||||
case 0x82: // POWER11
|
||||
return CPUTYPE_POWER10;
|
||||
break;
|
||||
case 0x80: // POWER10
|
||||
return CPUTYPE_POWER10;
|
||||
break;
|
||||
|
||||
+3
-1
@@ -1567,6 +1567,7 @@ int get_cpuname(void){
|
||||
case 10:
|
||||
case 15:
|
||||
case 14: // Alder Lake N
|
||||
case 13: // Lunar Lake
|
||||
if(support_avx2())
|
||||
return CPUTYPE_HASWELL;
|
||||
if(support_avx())
|
||||
@@ -2412,7 +2413,8 @@ int get_coretype(void){
|
||||
case 7: // Raptor Lake
|
||||
case 10:
|
||||
case 15:
|
||||
case 14: // Alder Lake N
|
||||
case 14: // Alder Lake N
|
||||
case 13: // Lunar Lake
|
||||
#ifndef NO_AVX2
|
||||
if(support_avx2())
|
||||
return CORE_HASWELL;
|
||||
|
||||
@@ -6,7 +6,7 @@ enable_language(Fortran)
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DADD${BU} -DCBLAS")
|
||||
if (BINARY32 AND CMAKE_C_PLATFORM_ID MATCHES "MinGW" AND CMAKE_Fortran_COMPILER_VERSION VERSION_EQUAL 14.2)
|
||||
if (BINARY32 AND CMAKE_C_PLATFORM_ID MATCHES "MinGW" AND CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER 14.1)
|
||||
list(REMOVE_ITEM ${CMAKE_Fortran_FLAGS} -O3 -O2 -O1 -Os)
|
||||
set (CMAKE_Fortran_FLAGS_RELEASE "" CACHE STRING "" FORCE)
|
||||
endif()
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 156 KiB |
+4
-4
@@ -91,7 +91,7 @@ like Intel Haswell. There once was an effort to build an OpenCL implementation t
|
||||
|
||||
We obtained a performance comparable with Intel MKL that actually outperformed Intel MKL in some cases.
|
||||
Here is the result of the DGEMM subroutine's performance on Intel Core i5-2500K Windows 7 SP1 64-bit:
|
||||

|
||||

|
||||
|
||||
<hr noshade="noshade">
|
||||
|
||||
@@ -220,8 +220,8 @@ lead to compiler error messages about an "ABI change" when compiling AVX512 code
|
||||
### <a name="ppcxl"></a>Building OpenBLAS on POWER fails with IBM XL
|
||||
|
||||
Trying to compile OpenBLAS with IBM XL ends with error messages about unknown register names
|
||||
like "vs32". Working around these by using known alternate names for the vector registers only leads to another assembler error about unsupported constraints. This is a known deficiency in the IBM compiler at least up to and including 16.1.0 (and in the POWER version of clang, from which it is derived) - use gcc instead. (See issues #1078
|
||||
and #1699 for related discussions)
|
||||
like "vs32". Working around these by using known alternate names for the vector registers only leads to another assembler error about unsupported constraints. This is a known deficiency in the IBM compiler at least up to and including 16.1.0 (and in the POWER version of clang, from which it is derived) - use gcc instead. (See issues [#1078](https://github.com/OpenMathLib/OpenBLAS/issues/1078)
|
||||
and [#1699](https://github.com/OpenMathLib/OpenBLAS/issues/1699) for related discussions)
|
||||
|
||||
### <a name="debianlts"></a>Replacing system BLAS/updating APT OpenBLAS in Mint/Ubuntu/Debian
|
||||
|
||||
@@ -268,7 +268,7 @@ path (usually either /usr/local/include, /opt/OpenBLAS/include or whatever you s
|
||||
|
||||
This is due to different interpretations of the (informal) standard for passing characters as arguments between C and FORTRAN functions. As the method for storing text differs in the two languages, when C calls Fortran the text length is passed as an "invisible" additional parameter.
|
||||
Historically, this has not been required when the text is just a single character, so older code like the Reference-LAPACK bundled with OpenBLAS
|
||||
does not do it. Recently gcc's checking has changed to require it, but there is no consensus yet if and how the existing LAPACK (and many other codebases) should adapt. (And for actual compilation, gcc has mostly backtracked and provided compatibility options - hence the default build settings in the OpenBLAS Makefiles add -fno-optimize-sibling-calls to the gfortran options to prevent miscompilation with "affected" versions. See ticket 2154 in the issue tracker for more details and links)
|
||||
does not do it. Recently gcc's checking has changed to require it, but there is no consensus yet if and how the existing LAPACK (and many other codebases) should adapt. (And for actual compilation, gcc has mostly backtracked and provided compatibility options - hence the default build settings in the OpenBLAS Makefiles add -fno-optimize-sibling-calls to the gfortran options to prevent miscompilation with "affected" versions. See ticket [#2154](https://github.com/OpenMathLib/OpenBLAS/issues/2154) in the issue tracker for more details and links)
|
||||
<hr noshade="noshade">
|
||||
|
||||
### <a name="newcpu"></a>Build fails with lots of errors about undefined ?GEMM_UNROLL_M
|
||||
|
||||
+10
-2
@@ -623,14 +623,22 @@ Note: using `TARGET=CORTEXA57` in place of `ARMV8` will pick up better
|
||||
optimized routines. Implementations for the `CORTEXA57` target are compatible
|
||||
with all other `ARMV8` targets.
|
||||
|
||||
Note: for NDK 23b, something as simple as:
|
||||
Note: for NDK 23b and later, something as simple as:
|
||||
```bash
|
||||
export PATH=/opt/android-ndk-r23b/toolchains/llvm/prebuilt/linux-x86_64/bin/:$PATH
|
||||
make HOSTCC=gcc CC=/opt/android-ndk-r23b/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android31-clang ONLY_CBLAS=1 TARGET=ARMV8
|
||||
make HOSTCC=gcc CC=/opt/android-ndk-r23b/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android31-clang ONLY_CBLAS=1 TARGET=ARMV8 RANLIB=echo
|
||||
```
|
||||
appears to be sufficient on Linux. On OSX, setting AR to the ar provided in the
|
||||
"bin" path of the NDK (probably `llvm-ar`) is also necessary.
|
||||
|
||||
If you prefer building with CMake, running
|
||||
```bash
|
||||
cmake -DANDROID_ABI=arm64-v8a -DTARGET=ARMV8 -DCMAKE_TOOLCHAIN_FILE=/opt/android-ndk-r27/build/cmake/android.toolchain.cmake -DNOFORTRAN=1 -DANDROID_PLATFORM=android-23 ..
|
||||
cmake --build .
|
||||
```
|
||||
in your build directory should work (be sure to adjust the toolchain_file argument according to where you installed the NDK, and the ANDROID_PLATFORM
|
||||
according to the minimum version of Android you want to support. (If you leave out the ANDROID_PLATFORM parameter, the build will fail with an error
|
||||
message about a missing declaration or missing header file complex.h)
|
||||
|
||||
??? note "Alternative build script for 3 architectures"
|
||||
|
||||
|
||||
@@ -1,3 +1,31 @@
|
||||
###############################################################################
|
||||
# Copyright (c) 2025 The OpenBLAS Project
|
||||
# All rights reserved.
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name of the OpenBLAS project nor the names of
|
||||
# its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
###############################################################################
|
||||
|
||||
TOPDIR = ../..
|
||||
include ../../Makefile.system
|
||||
|
||||
@@ -423,6 +451,9 @@ XBLASOBJS += \
|
||||
xtbmv_thread_CLU.$(SUFFIX) xtbmv_thread_CLN.$(SUFFIX)
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16),1)
|
||||
BBLASOBJS += \
|
||||
bgemv_thread_n$(TSUFFIX).$(SUFFIX) \
|
||||
bgemv_thread_t$(TSUFFIX).$(SUFFIX)
|
||||
SBBLASOBJS += \
|
||||
sbgemv_thread_n$(TSUFFIX).$(SUFFIX) \
|
||||
sbgemv_thread_t$(TSUFFIX).$(SUFFIX)
|
||||
@@ -3707,6 +3738,10 @@ xtrsv_CUN.$(SUFFIX) xtrsv_CUN.$(PSUFFIX) : ztrsv_L.c ../../param.h
|
||||
$(CC) -c $(CFLAGS) -DXDOUBLE -DCOMPLEX -DTRANSA=4 -UUNIT $< -o $(@F)
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16),1)
|
||||
bgemv_thread_n.$(SUFFIX) bgemv_thread_n.$(PSUFFIX) : sbgemv_thread.c ../../common.h
|
||||
$(CC) -c $(CFLAGS) -DBGEMM -UCOMPLEX -UDOUBLE -UTRANSA -UCONJ -UXCONJ $< -o $(@F)
|
||||
bgemv_thread_t.$(SUFFIX) bgemv_thread_t.$(PSUFFIX) : sbgemv_thread.c ../../common.h
|
||||
$(CC) -c $(CFLAGS) -DBGEMM -UCOMPLEX -UDOUBLE -DTRANSA -UCONJ -UXCONJ $< -o $(@F)
|
||||
sbgemv_thread_n.$(SUFFIX) sbgemv_thread_n.$(PSUFFIX) : sbgemv_thread.c ../../common.h
|
||||
$(CC) -c $(CFLAGS) -UCOMPLEX -UDOUBLE -UTRANSA -UCONJ -UXCONJ $< -o $(@F)
|
||||
sbgemv_thread_t.$(SUFFIX) sbgemv_thread_t.$(PSUFFIX) : sbgemv_thread.c ../../common.h
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*********************************************************************/
|
||||
/* Copyright 2025 The OpenBLAS Project. */
|
||||
/* Copyright 2009, 2010 The University of Texas at Austin. */
|
||||
/* All rights reserved. */
|
||||
/* */
|
||||
@@ -41,21 +42,21 @@
|
||||
#include "common.h"
|
||||
|
||||
#ifndef TRANSA
|
||||
#define SBGEMV SBGEMV_N
|
||||
#define GEMV GEMV_N
|
||||
#else
|
||||
#define SBGEMV SBGEMV_T
|
||||
#define GEMV GEMV_T
|
||||
#endif
|
||||
|
||||
static int sbgemv_kernel(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *dummy1, FLOAT *dummy2, BLASLONG dummy3){
|
||||
|
||||
bfloat16 *a, *x;
|
||||
float *y;
|
||||
IFLOAT *a, *x;
|
||||
FLOAT *y;
|
||||
BLASLONG lda, incx, incy;
|
||||
BLASLONG m_from, m_to, n_from, n_to;
|
||||
|
||||
a = (bfloat16 *)args->a;
|
||||
x = (bfloat16 *)args->b;
|
||||
y = (float *)args->c;
|
||||
a = (IFLOAT *)args->a;
|
||||
x = (IFLOAT *)args->b;
|
||||
y = (FLOAT *)args->c;
|
||||
|
||||
lda = args->lda;
|
||||
incx = args->ldb;
|
||||
@@ -77,12 +78,12 @@ static int sbgemv_kernel(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n,
|
||||
y += n_from * incy;
|
||||
#endif
|
||||
|
||||
SBGEMV(m_to - m_from, n_to - n_from, *((FLOAT *)(args->alpha)), a, lda, x, incx, *((FLOAT *)(args->beta)), y, incy);
|
||||
GEMV(m_to - m_from, n_to - n_from, *((FLOAT *)(args->alpha)), a, lda, x, incx, *((FLOAT *)(args->beta)), y, incy);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CNAME(BLASLONG m, BLASLONG n, float alpha, bfloat16 *a, BLASLONG lda, bfloat16 *x, BLASLONG incx, float beta, float *y, BLASLONG incy, int threads)
|
||||
int CNAME(BLASLONG m, BLASLONG n, FLOAT alpha, IFLOAT *a, BLASLONG lda, IFLOAT *x, BLASLONG incx, FLOAT beta, FLOAT *y, BLASLONG incy, int threads)
|
||||
{
|
||||
blas_arg_t args;
|
||||
blas_queue_t queue[MAX_CPU_NUMBER];
|
||||
|
||||
@@ -14,10 +14,17 @@ foreach (GEMM_DEFINE ${GEMM_DEFINES})
|
||||
endif ()
|
||||
if (BUILD_BFLOAT16)
|
||||
GenerateNamedObjects("gemm.c" "${GEMM_DEFINE}" "gemm_${GEMM_DEFINE_LC}" 0 "" "" false "BFLOAT16")
|
||||
GenerateNamedObjects("gemm.c" "${GEMM_DEFINE};BGEMM" "gemm_${GEMM_DEFINE_LC}" 0 "" "" false "BFLOAT16")
|
||||
if (USE_THREAD AND NOT USE_SIMPLE_THREADED_LEVEL3)
|
||||
GenerateNamedObjects("gemm.c" "${GEMM_DEFINE};THREADED_LEVEL3" "gemm_thread_${GEMM_DEFINE_LC}" 0 "" "" false "BFLOAT16")
|
||||
endif ()
|
||||
endif ()
|
||||
if (BUILD_HFLOAT16)
|
||||
GenerateNamedObjects("gemm.c" "${GEMM_DEFINE}" "gemm_${GEMM_DEFINE_LC}" 0 "" "" false "HFLOAT16")
|
||||
if (USE_THREAD AND NOT USE_SIMPLE_THREADED_LEVEL3)
|
||||
GenerateNamedObjects("gemm.c" "${GEMM_DEFINE};THREADED_LEVEL3" "gemm_thread_${GEMM_DEFINE_LC}" 0 "" "" false "HFLOAT16")
|
||||
endif ()
|
||||
endif ()
|
||||
endforeach ()
|
||||
|
||||
if ( BUILD_COMPLEX16 AND NOT BUILD_DOUBLE)
|
||||
|
||||
+126
-16
@@ -1,3 +1,32 @@
|
||||
###############################################################################
|
||||
# Copyright (c) 2025, The OpenBLAS Project
|
||||
# All rights reserved.
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name of the OpenBLAS project nor the names of
|
||||
# its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
###############################################################################
|
||||
|
||||
TOPDIR = ../..
|
||||
include ../../Makefile.system
|
||||
|
||||
@@ -20,9 +49,14 @@ USE_GEMM3M = 1
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16),1)
|
||||
BBLASOBJS += bgemm_nn.$(SUFFIX) bgemm_nt.$(SUFFIX) bgemm_tn.$(SUFFIX) bgemm_tt.$(SUFFIX)
|
||||
SBBLASOBJS += sbgemm_nn.$(SUFFIX) sbgemm_nt.$(SUFFIX) sbgemm_tn.$(SUFFIX) sbgemm_tt.$(SUFFIX)
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_HFLOAT16),1)
|
||||
SHBLASOBJS += shgemm_nn.$(SUFFIX) shgemm_nt.$(SUFFIX) shgemm_tn.$(SUFFIX) shgemm_tt.$(SUFFIX)
|
||||
endif
|
||||
|
||||
SBLASOBJS += \
|
||||
sgemm_nn.$(SUFFIX) sgemm_nt.$(SUFFIX) sgemm_tn.$(SUFFIX) sgemm_tt.$(SUFFIX) \
|
||||
strmm_LNUU.$(SUFFIX) strmm_LNUN.$(SUFFIX) strmm_LNLU.$(SUFFIX) strmm_LNLN.$(SUFFIX) \
|
||||
@@ -208,8 +242,12 @@ COMMONOBJS += syrk_thread.$(SUFFIX)
|
||||
|
||||
ifneq ($(USE_SIMPLE_THREADED_LEVEL3), 1)
|
||||
ifeq ($(BUILD_BFLOAT16),1)
|
||||
BBLASOBJS += bgemm_thread_nn.$(SUFFIX) bgemm_thread_nt.$(SUFFIX) bgemm_thread_tn.$(SUFFIX) bgemm_thread_tt.$(SUFFIX)
|
||||
SBBLASOBJS += sbgemm_thread_nn.$(SUFFIX) sbgemm_thread_nt.$(SUFFIX) sbgemm_thread_tn.$(SUFFIX) sbgemm_thread_tt.$(SUFFIX)
|
||||
endif
|
||||
ifeq ($(BUILD_HFLOAT16),1)
|
||||
SHBLASOBJS += shgemm_thread_nn.$(SUFFIX) shgemm_thread_nt.$(SUFFIX) shgemm_thread_tn.$(SUFFIX) shgemm_thread_tt.$(SUFFIX)
|
||||
endif
|
||||
SBLASOBJS += sgemm_thread_nn.$(SUFFIX) sgemm_thread_nt.$(SUFFIX) sgemm_thread_tn.$(SUFFIX) sgemm_thread_tt.$(SUFFIX)
|
||||
DBLASOBJS += dgemm_thread_nn.$(SUFFIX) dgemm_thread_nt.$(SUFFIX) dgemm_thread_tn.$(SUFFIX) dgemm_thread_tt.$(SUFFIX)
|
||||
QBLASOBJS += qgemm_thread_nn.$(SUFFIX) qgemm_thread_nt.$(SUFFIX) qgemm_thread_tn.$(SUFFIX) qgemm_thread_tt.$(SUFFIX)
|
||||
@@ -343,17 +381,41 @@ endif
|
||||
|
||||
all ::
|
||||
|
||||
bgemm_nn.$(SUFFIX) : gemm.c level3.c ../../param.h
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DBFLOAT16 -DBGEMM -UDOUBLE -UCOMPLEX -DNN $< -o $(@F)
|
||||
|
||||
bgemm_nt.$(SUFFIX) : gemm.c level3.c ../../param.h
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DBFLOAT16 -DBGEMM -UDOUBLE -UCOMPLEX -DNT $< -o $(@F)
|
||||
|
||||
bgemm_tn.$(SUFFIX) : gemm.c level3.c ../../param.h
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DBFLOAT16 -DBGEMM -UDOUBLE -UCOMPLEX -DTN $< -o $(@F)
|
||||
|
||||
bgemm_tt.$(SUFFIX) : gemm.c level3.c ../../param.h
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DBFLOAT16 -DBGEMM -UDOUBLE -UCOMPLEX -DTT $< -o $(@F)
|
||||
|
||||
sbgemm_nn.$(SUFFIX) : gemm.c level3.c ../../param.h
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DHALF -UDOUBLE -UCOMPLEX -DNN $< -o $(@F)
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DBFLOAT16 -UDOUBLE -UCOMPLEX -DNN $< -o $(@F)
|
||||
|
||||
sbgemm_nt.$(SUFFIX) : gemm.c level3.c ../../param.h
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DHALF -UDOUBLE -UCOMPLEX -DNT $< -o $(@F)
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DBFLOAT16 -UDOUBLE -UCOMPLEX -DNT $< -o $(@F)
|
||||
|
||||
sbgemm_tn.$(SUFFIX) : gemm.c level3.c ../../param.h
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DHALF -UDOUBLE -UCOMPLEX -DTN $< -o $(@F)
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DBFLOAT16 -UDOUBLE -UCOMPLEX -DTN $< -o $(@F)
|
||||
|
||||
sbgemm_tt.$(SUFFIX) : gemm.c level3.c ../../param.h
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DHALF -UDOUBLE -UCOMPLEX -DTT $< -o $(@F)
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DBFLOAT16 -UDOUBLE -UCOMPLEX -DTT $< -o $(@F)
|
||||
|
||||
shgemm_nn.$(SUFFIX) : gemm.c level3.c ../../param.h
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX -DNN $< -o $(@F)
|
||||
|
||||
shgemm_nt.$(SUFFIX) : gemm.c level3.c ../../param.h
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX -DNT $< -o $(@F)
|
||||
|
||||
shgemm_tn.$(SUFFIX) : gemm.c level3.c ../../param.h
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX -DTN $< -o $(@F)
|
||||
|
||||
shgemm_tt.$(SUFFIX) : gemm.c level3.c ../../param.h
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX -DTT $< -o $(@F)
|
||||
|
||||
sgemm_nn.$(SUFFIX) : gemm.c level3.c ../../param.h
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -UDOUBLE -UCOMPLEX -DNN $< -o $(@F)
|
||||
@@ -550,17 +612,41 @@ gemm_thread_variable.$(SUFFIX) : gemm_thread_variable.c ../../common.h
|
||||
beta_thread.$(SUFFIX) : beta_thread.c ../../common.h
|
||||
$(CC) -c $(CFLAGS) $< -o $(@F)
|
||||
|
||||
bgemm_thread_nn.$(SUFFIX) : gemm.c level3_thread.c ../../param.h
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -DBFLOAT16 -DBGEMM -UDOUBLE -UCOMPLEX -DNN $< -o $(@F)
|
||||
|
||||
bgemm_thread_nt.$(SUFFIX) : gemm.c level3_thread.c ../../param.h
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -DBFLOAT16 -DBGEMM -UDOUBLE -UCOMPLEX -DNT $< -o $(@F)
|
||||
|
||||
bgemm_thread_tn.$(SUFFIX) : gemm.c level3_thread.c ../../param.h
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -DBFLOAT16 -DBGEMM -UDOUBLE -UCOMPLEX -DTN $< -o $(@F)
|
||||
|
||||
bgemm_thread_tt.$(SUFFIX) : gemm.c level3_thread.c ../../param.h
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -DBFLOAT16 -DBGEMM -UDOUBLE -UCOMPLEX -DTT $< -o $(@F)
|
||||
|
||||
sbgemm_thread_nn.$(SUFFIX) : gemm.c level3_thread.c ../../param.h
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -DHALF -UDOUBLE -UCOMPLEX -DNN $< -o $(@F)
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -DBFLOAT16 -UDOUBLE -UCOMPLEX -DNN $< -o $(@F)
|
||||
|
||||
sbgemm_thread_nt.$(SUFFIX) : gemm.c level3_thread.c ../../param.h
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -DHALF -UDOUBLE -UCOMPLEX -DNT $< -o $(@F)
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -DBFLOAT16 -UDOUBLE -UCOMPLEX -DNT $< -o $(@F)
|
||||
|
||||
sbgemm_thread_tn.$(SUFFIX) : gemm.c level3_thread.c ../../param.h
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -DHALF -UDOUBLE -UCOMPLEX -DTN $< -o $(@F)
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -DBFLOAT16 -UDOUBLE -UCOMPLEX -DTN $< -o $(@F)
|
||||
|
||||
sbgemm_thread_tt.$(SUFFIX) : gemm.c level3_thread.c ../../param.h
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -DHALF -UDOUBLE -UCOMPLEX -DTT $< -o $(@F)
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -DBFLOAT16 -UDOUBLE -UCOMPLEX -DTT $< -o $(@F)
|
||||
|
||||
shgemm_thread_nn.$(SUFFIX) : gemm.c level3_thread.c ../../param.h
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -DHFLOAT16 -UDOUBLE -UCOMPLEX -DNN $< -o $(@F)
|
||||
|
||||
shgemm_thread_nt.$(SUFFIX) : gemm.c level3_thread.c ../../param.h
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -DHFLOAT16 -UDOUBLE -UCOMPLEX -DNT $< -o $(@F)
|
||||
|
||||
shgemm_thread_tn.$(SUFFIX) : gemm.c level3_thread.c ../../param.h
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -DHFLOAT16 -UDOUBLE -UCOMPLEX -DTN $< -o $(@F)
|
||||
|
||||
shgemm_thread_tt.$(SUFFIX) : gemm.c level3_thread.c ../../param.h
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -DHFLOAT16 -UDOUBLE -UCOMPLEX -DTT $< -o $(@F)
|
||||
|
||||
sgemm_thread_nn.$(SUFFIX) : gemm.c level3_thread.c ../../param.h
|
||||
$(CC) $(CFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -UDOUBLE -UCOMPLEX -DNN $< -o $(@F)
|
||||
@@ -2736,16 +2822,28 @@ xtrsm_RCLN.$(SUFFIX) : trsm_R.c
|
||||
$(CC) -c $(CFLAGS) -DCOMPLEX -DXDOUBLE -DTRANSA -UUPPER -UUNIT -DCONJ $< -o $(@F)
|
||||
|
||||
sbgemm_nn.$(PSUFFIX) : gemm.c level3.c ../../param.h
|
||||
$(CC) $(PFLAGS) $(BLOCKS) -c -DHALF -UDOUBLE -UCOMPLEX -DNN $< -o $(@F)
|
||||
$(CC) $(PFLAGS) $(BLOCKS) -c -DBFLOAT16 -UDOUBLE -UCOMPLEX -DNN $< -o $(@F)
|
||||
|
||||
sbgemm_nt.$(PSUFFIX) : gemm.c level3.c ../../param.h
|
||||
$(CC) $(PFLAGS) $(BLOCKS) -c -DHALF -UDOUBLE -UCOMPLEX -DNT $< -o $(@F)
|
||||
$(CC) $(PFLAGS) $(BLOCKS) -c -DBFLOAT16 -UDOUBLE -UCOMPLEX -DNT $< -o $(@F)
|
||||
|
||||
sbgemm_tn.$(PSUFFIX) : gemm.c level3.c ../../param.h
|
||||
$(CC) $(PFLAGS) $(BLOCKS) -c -DHALF -UDOUBLE -UCOMPLEX -DTN $< -o $(@F)
|
||||
$(CC) $(PFLAGS) $(BLOCKS) -c -DBFLOAT16 -UDOUBLE -UCOMPLEX -DTN $< -o $(@F)
|
||||
|
||||
sbgemm_tt.$(PSUFFIX) : gemm.c level3.c ../../param.h
|
||||
$(CC) $(PFLAGS) $(BLOCKS) -c -DHALF -UDOUBLE -UCOMPLEX -DTT $< -o $(@F)
|
||||
$(CC) $(PFLAGS) $(BLOCKS) -c -DBFLOAT16 -UDOUBLE -UCOMPLEX -DTT $< -o $(@F)
|
||||
|
||||
shgemm_nn.$(PSUFFIX) : gemm.c level3.c ../../param.h
|
||||
$(CC) $(PFLAGS) $(BLOCKS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX -DNN $< -o $(@F)
|
||||
|
||||
shgemm_nt.$(PSUFFIX) : gemm.c level3.c ../../param.h
|
||||
$(CC) $(PFLAGS) $(BLOCKS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX -DNT $< -o $(@F)
|
||||
|
||||
shgemm_tn.$(PSUFFIX) : gemm.c level3.c ../../param.h
|
||||
$(CC) $(PFLAGS) $(BLOCKS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX -DTN $< -o $(@F)
|
||||
|
||||
shgemm_tt.$(PSUFFIX) : gemm.c level3.c ../../param.h
|
||||
$(CC) $(PFLAGS) $(BLOCKS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX -DTT $< -o $(@F)
|
||||
|
||||
sgemm_nn.$(PSUFFIX) : gemm.c level3.c ../../param.h
|
||||
$(CC) $(PFLAGS) $(BLOCKS) -c -UDOUBLE -UCOMPLEX -DNN $< -o $(@F)
|
||||
@@ -2959,16 +3057,28 @@ zgemm_batch_thread.$(SUFFIX) : gemm_batch_thread.c ../../common.h
|
||||
|
||||
|
||||
sbgemm_thread_nn.$(PSUFFIX) : gemm.c level3_thread.c ../../param.h
|
||||
$(CC) $(PFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -DHALF -UDOUBLE -UCOMPLEX -DNN $< -o $(@F)
|
||||
$(CC) $(PFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -DBFLOAT16 -UDOUBLE -UCOMPLEX -DNN $< -o $(@F)
|
||||
|
||||
sbgemm_thread_nt.$(PSUFFIX) : gemm.c level3_thread.c ../../param.h
|
||||
$(CC) $(PFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -DHALF -UDOUBLE -UCOMPLEX -DNT $< -o $(@F)
|
||||
$(CC) $(PFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -DBFLOAT16 -UDOUBLE -UCOMPLEX -DNT $< -o $(@F)
|
||||
|
||||
sbgemm_thread_tn.$(PSUFFIX) : gemm.c level3_thread.c ../../param.h
|
||||
$(CC) $(PFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -DHALF -UDOUBLE -UCOMPLEX -DTN $< -o $(@F)
|
||||
$(CC) $(PFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -DBFLOAT16 -UDOUBLE -UCOMPLEX -DTN $< -o $(@F)
|
||||
|
||||
sbgemm_thread_tt.$(PSUFFIX) : gemm.c level3_thread.c ../../param.h
|
||||
$(CC) $(PFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -DHALF -UDOUBLE -UCOMPLEX -DTT $< -o $(@F)
|
||||
$(CC) $(PFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -DBFLOAT16 -UDOUBLE -UCOMPLEX -DTT $< -o $(@F)
|
||||
|
||||
shgemm_thread_nn.$(PSUFFIX) : gemm.c level3_thread.c ../../param.h
|
||||
$(CC) $(PFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -DHFLOAT16 -UDOUBLE -UCOMPLEX -DNN $< -o $(@F)
|
||||
|
||||
shgemm_thread_nt.$(PSUFFIX) : gemm.c level3_thread.c ../../param.h
|
||||
$(CC) $(PFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -DHFLOAT16 -UDOUBLE -UCOMPLEX -DNT $< -o $(@F)
|
||||
|
||||
shgemm_thread_tn.$(PSUFFIX) : gemm.c level3_thread.c ../../param.h
|
||||
$(CC) $(PFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -DHFLOAT16 -UDOUBLE -UCOMPLEX -DTN $< -o $(@F)
|
||||
|
||||
shgemm_thread_tt.$(PSUFFIX) : gemm.c level3_thread.c ../../param.h
|
||||
$(CC) $(PFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -DHFLOAT16 -UDOUBLE -UCOMPLEX -DTT $< -o $(@F)
|
||||
|
||||
sgemm_thread_nn.$(PSUFFIX) : gemm.c level3_thread.c ../../param.h
|
||||
$(CC) $(PFLAGS) $(BLOCKS) -c -DTHREADED_LEVEL3 -UDOUBLE -UCOMPLEX -DNN $< -o $(@F)
|
||||
|
||||
@@ -59,6 +59,14 @@
|
||||
#define GEMM_Q 128
|
||||
#endif
|
||||
|
||||
#ifdef GEMM_DIVIDE_RATE
|
||||
#define DIVIDE_RATE GEMM_DIVIDE_RATE
|
||||
#endif
|
||||
|
||||
#ifdef GEMM_DIVIDE_LIMIT
|
||||
#define DIVIDE_LIMIT GEMM_DIVIDE_LIMIT
|
||||
#endif
|
||||
|
||||
#ifdef THREADED_LEVEL3
|
||||
#include "level3_thread.c"
|
||||
#else
|
||||
|
||||
+19
-6
@@ -1,5 +1,6 @@
|
||||
/*********************************************************************/
|
||||
/* Copyright 2009, 2010 The University of Texas at Austin. */
|
||||
/* Copyright 2025 The OpenBLAS Project. */
|
||||
/* All rights reserved. */
|
||||
/* */
|
||||
/* Redistribution and use in source and binary forms, with or */
|
||||
@@ -169,6 +170,22 @@
|
||||
#define STOP_RPCC(COUNTER)
|
||||
#endif
|
||||
|
||||
#if defined(BUILD_BFLOAT16)
|
||||
#if defined(DYNAMIC_ARCH)
|
||||
#if defined(BGEMM)
|
||||
#define BFLOAT16_ALIGN_K gotoblas->bgemm_align_k
|
||||
#else
|
||||
#define BFLOAT16_ALIGN_K gotoblas->sbgemm_align_k
|
||||
#endif
|
||||
#else
|
||||
#if defined(BGEMM)
|
||||
#define BFLOAT16_ALIGN_K BGEMM_ALIGN_K
|
||||
#else
|
||||
#define BFLOAT16_ALIGN_K SBGEMM_ALIGN_K
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
int CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n,
|
||||
XFLOAT *sa, XFLOAT *sb, BLASLONG dummy){
|
||||
BLASLONG k, lda, ldb, ldc;
|
||||
@@ -305,12 +322,8 @@ int CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n,
|
||||
}
|
||||
|
||||
BLASLONG pad_min_l = min_l;
|
||||
#if defined(HALF)
|
||||
#if defined(DYNAMIC_ARCH)
|
||||
pad_min_l = (min_l + gotoblas->sbgemm_align_k - 1) & ~(gotoblas->sbgemm_align_k-1);
|
||||
#else
|
||||
pad_min_l = (min_l + SBGEMM_ALIGN_K - 1) & ~(SBGEMM_ALIGN_K - 1);;
|
||||
#endif
|
||||
#if defined(BFLOAT16)
|
||||
pad_min_l = (min_l + BFLOAT16_ALIGN_K - 1) & ~(BFLOAT16_ALIGN_K - 1);
|
||||
#endif
|
||||
|
||||
/* First, we have to move data A to L2 cache */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*********************************************************************/
|
||||
/* Copyright 2009, 2010 The University of Texas at Austin. */
|
||||
/* Copyright 2023 The OpenBLAS Project. */
|
||||
/* Copyright 2023, 2025 The OpenBLAS Project. */
|
||||
/* All rights reserved. */
|
||||
/* */
|
||||
/* Redistribution and use in source and binary forms, with or */
|
||||
@@ -216,6 +216,22 @@ typedef struct {
|
||||
#define STOP_RPCC(COUNTER)
|
||||
#endif
|
||||
|
||||
#if defined(BUILD_BFLOAT16)
|
||||
#if defined(DYNAMIC_ARCH)
|
||||
#if defined(BGEMM)
|
||||
#define BFLOAT16_ALIGN_K gotoblas->bgemm_align_k
|
||||
#else
|
||||
#define BFLOAT16_ALIGN_K gotoblas->sbgemm_align_k
|
||||
#endif
|
||||
#else
|
||||
#if defined(BGEMM)
|
||||
#define BFLOAT16_ALIGN_K BGEMM_ALIGN_K
|
||||
#else
|
||||
#define BFLOAT16_ALIGN_K SBGEMM_ALIGN_K
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static int inner_thread(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, IFLOAT *sa, IFLOAT *sb, BLASLONG mypos){
|
||||
|
||||
IFLOAT *buffer[DIVIDE_RATE];
|
||||
@@ -230,6 +246,7 @@ static int inner_thread(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n,
|
||||
|
||||
BLASLONG nthreads_m;
|
||||
BLASLONG mypos_m, mypos_n;
|
||||
BLASLONG divide_rate = DIVIDE_RATE;
|
||||
|
||||
BLASLONG is, js, ls, bufferside, jjs;
|
||||
BLASLONG min_i, min_l, div_n, min_jj;
|
||||
@@ -264,6 +281,11 @@ static int inner_thread(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n,
|
||||
alpha = (FLOAT *)args -> alpha;
|
||||
beta = (FLOAT *)args -> beta;
|
||||
|
||||
/* Disable divide_rate when N of all threads are less than to DIVIDE_LIMIT */
|
||||
#ifdef DIVIDE_LIMIT
|
||||
if (N < DIVIDE_LIMIT) divide_rate = 1;
|
||||
#endif
|
||||
|
||||
/* Initialize 2D CPU distribution */
|
||||
nthreads_m = args -> nthreads;
|
||||
if (range_m) {
|
||||
@@ -305,9 +327,9 @@ static int inner_thread(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n,
|
||||
) return 0;
|
||||
|
||||
/* Initialize workspace for local region of B */
|
||||
div_n = (n_to - n_from + DIVIDE_RATE - 1) / DIVIDE_RATE;
|
||||
div_n = (n_to - n_from + divide_rate - 1) / divide_rate;
|
||||
buffer[0] = sb;
|
||||
for (i = 1; i < DIVIDE_RATE; i++) {
|
||||
for (i = 1; i < divide_rate; i++) {
|
||||
buffer[i] = buffer[i - 1] + GEMM_Q * ((div_n + GEMM_UNROLL_N - 1)/GEMM_UNROLL_N) * GEMM_UNROLL_N * COMPSIZE;
|
||||
}
|
||||
|
||||
@@ -324,12 +346,8 @@ static int inner_thread(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n,
|
||||
|
||||
BLASLONG pad_min_l = min_l;
|
||||
|
||||
#if defined(HALF)
|
||||
#if defined(DYNAMIC_ARCH)
|
||||
pad_min_l = (min_l + gotoblas->sbgemm_align_k - 1) & ~(gotoblas->sbgemm_align_k-1);
|
||||
#else
|
||||
pad_min_l = (min_l + SBGEMM_ALIGN_K - 1) & ~(SBGEMM_ALIGN_K - 1);;
|
||||
#endif
|
||||
#if defined(BFLOAT16)
|
||||
pad_min_l = (min_l + BFLOAT16_ALIGN_K - 1) & ~(BFLOAT16_ALIGN_K - 1);
|
||||
#endif
|
||||
|
||||
/* Determine step size in m
|
||||
@@ -353,7 +371,7 @@ static int inner_thread(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n,
|
||||
STOP_RPCC(copy_A);
|
||||
|
||||
/* Copy local region of B into workspace and apply kernel */
|
||||
div_n = (n_to - n_from + DIVIDE_RATE - 1) / DIVIDE_RATE;
|
||||
div_n = (n_to - n_from + divide_rate - 1) / divide_rate;
|
||||
for (js = n_from, bufferside = 0; js < n_to; js += div_n, bufferside ++) {
|
||||
|
||||
/* Make sure if no one is using workspace */
|
||||
@@ -422,7 +440,7 @@ static int inner_thread(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n,
|
||||
if (current >= (mypos_n + 1) * nthreads_m) current = mypos_n * nthreads_m;
|
||||
|
||||
/* Split other region of B into parts */
|
||||
div_n = (range_n[current + 1] - range_n[current] + DIVIDE_RATE - 1) / DIVIDE_RATE;
|
||||
div_n = (range_n[current + 1] - range_n[current] + divide_rate - 1) / divide_rate;
|
||||
for (js = range_n[current], bufferside = 0; js < range_n[current + 1]; js += div_n, bufferside ++) {
|
||||
if (current != mypos) {
|
||||
|
||||
@@ -473,7 +491,7 @@ static int inner_thread(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n,
|
||||
do {
|
||||
|
||||
/* Split region of B into parts and apply kernel */
|
||||
div_n = (range_n[current + 1] - range_n[current] + DIVIDE_RATE - 1) / DIVIDE_RATE;
|
||||
div_n = (range_n[current + 1] - range_n[current] + divide_rate - 1) / divide_rate;
|
||||
for (js = range_n[current], bufferside = 0; js < range_n[current + 1]; js += div_n, bufferside ++) {
|
||||
|
||||
/* Apply kernel with local region of A and part of region of B */
|
||||
@@ -508,7 +526,7 @@ static int inner_thread(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n,
|
||||
/* Wait until all other threads are done with local region of B */
|
||||
START_RPCC();
|
||||
for (i = 0; i < args -> nthreads; i++) {
|
||||
for (js = 0; js < DIVIDE_RATE; js++) {
|
||||
for (js = 0; js < divide_rate; js++) {
|
||||
while (job[mypos].working[i][CACHE_LINE_SIZE * js] ) {YIELDING;};
|
||||
}
|
||||
}
|
||||
@@ -851,9 +869,20 @@ int CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, IFLOAT *sa, IF
|
||||
/* Objective function come from sum of partitions in m and n. */
|
||||
/* (n / nthreads_n) + (m / nthreads_m) */
|
||||
/* = (n * nthreads_m + m * nthreads_n) / (nthreads_n * nthreads_m) */
|
||||
while (nthreads_m % 2 == 0 && n * nthreads_m + m * nthreads_n > n * (nthreads_m / 2) + m * (nthreads_n * 2)) {
|
||||
nthreads_m /= 2;
|
||||
nthreads_n *= 2;
|
||||
BLASLONG cost = 0, div = 0;
|
||||
BLASLONG i;
|
||||
for (i = 1; i <= sqrt(nthreads_m); i++) {
|
||||
if (nthreads_m % i) continue;
|
||||
BLASLONG j = nthreads_m / i;
|
||||
BLASLONG cost_i = n * j + m * nthreads_n * i;
|
||||
BLASLONG cost_j = n * i + m * nthreads_n * j;
|
||||
if (cost == 0 ||
|
||||
cost_i < cost) {cost = cost_i; div = i;}
|
||||
if (cost_j < cost) {cost = cost_j; div = j;}
|
||||
}
|
||||
if (div > 1) {
|
||||
nthreads_m /= div;
|
||||
nthreads_n *= div;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,8 @@ if (DYNAMIC_ARCH)
|
||||
list(APPEND COMMON_SOURCES dynamic_arm64.c)
|
||||
elseif (POWER)
|
||||
list(APPEND COMMON_SOURCES dynamic_power.c)
|
||||
elseif (ZARCH)
|
||||
list(APPEND COMMON_SOURCES dynamic_zarch.c)
|
||||
elseif (RISCV64)
|
||||
list(APPEND COMMON_SOURCES dynamic_riscv64.c detect_riscv64.c)
|
||||
elseif (LOONGARCH64)
|
||||
|
||||
@@ -119,11 +119,11 @@ static void * blas_thread_buffer[MAX_CPU_NUMBER];
|
||||
|
||||
/* Local Variables */
|
||||
#if defined(USE_PTHREAD_LOCK)
|
||||
static pthread_mutex_t server_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
volatile static pthread_mutex_t server_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
#elif defined(USE_PTHREAD_SPINLOCK)
|
||||
static pthread_spinlock_t server_lock = 0;
|
||||
volatile static pthread_spinlock_t server_lock = 0;
|
||||
#else
|
||||
static unsigned long server_lock = 0;
|
||||
volatile static unsigned long server_lock = 0;
|
||||
#endif
|
||||
|
||||
#define THREAD_STATUS_SLEEP 2
|
||||
|
||||
@@ -63,12 +63,12 @@ uint64_t detect_riscv64_rvv100(void)
|
||||
* RVV 1.0 and we return 0.
|
||||
*/
|
||||
|
||||
asm volatile("vsetvli x0, x0, e8, m1, ta, ma\n\t"
|
||||
asm volatile("vsetvli t0, x0, e8, m1, ta, ma\n\t"
|
||||
"csrr %0, vtype\n\t"
|
||||
"slt %0, x0, %0\n"
|
||||
: "=r" (rvv10_supported)
|
||||
:
|
||||
:);
|
||||
:"t0", "vtype");
|
||||
|
||||
return rvv10_supported;
|
||||
}
|
||||
|
||||
@@ -440,13 +440,21 @@ static gotoblas_t *get_coretype(void) {
|
||||
return &gotoblas_TSV110;
|
||||
}
|
||||
break;
|
||||
case 0x50: // Ampere
|
||||
case 0x50: // Ampere/AppliedMicro
|
||||
switch (part)
|
||||
{
|
||||
case 0x000: // Skylark/EMAG8180
|
||||
return &gotoblas_EMAG8180;
|
||||
}
|
||||
break;
|
||||
case 0xc0: // Ampere
|
||||
switch(part)
|
||||
{
|
||||
case 0xac3:
|
||||
case 0xac4:
|
||||
return &gotoblas_NEOVERSEN1;
|
||||
}
|
||||
break;
|
||||
case 0x51: // Qualcomm
|
||||
switch (part)
|
||||
{
|
||||
|
||||
@@ -69,7 +69,10 @@ static int cpuid(void)
|
||||
else if (arch == POWER_9) return CPU_POWER9;
|
||||
#endif
|
||||
#ifdef POWER_10
|
||||
else if (arch >= POWER_10) return CPU_POWER10;
|
||||
else if (arch == POWER_10) return CPU_POWER10;
|
||||
#endif
|
||||
#ifdef POWER_11
|
||||
else if (arch >= POWER_11) return CPU_POWER10;
|
||||
#endif
|
||||
return CPU_UNKNOWN;
|
||||
}
|
||||
@@ -173,6 +176,13 @@ static struct {
|
||||
.cpu_type = CPU_POWER10,
|
||||
},
|
||||
|
||||
{ /* Power11 */
|
||||
.pvr_mask = 0xffff0000,
|
||||
.pvr_value = 0x00820000,
|
||||
.cpu_name = "POWER11 (raw)",
|
||||
.cpu_type = CPU_POWER10,
|
||||
},
|
||||
|
||||
{ /* End of table, pvr_mask and pvr_value must be zero */
|
||||
.pvr_mask = 0x0,
|
||||
.pvr_value = 0x0,
|
||||
|
||||
@@ -97,6 +97,8 @@ struct riscv_hwprobe {
|
||||
|
||||
#define RISCV_HWPROBE_KEY_IMA_EXT_0 4
|
||||
#define RISCV_HWPROBE_IMA_V (1 << 2)
|
||||
#define RISCV_HWPROBE_EXT_ZFH (1 << 27)
|
||||
#define RISCV_HWPROBE_EXT_ZVFH (1 << 30)
|
||||
|
||||
#ifndef NR_riscv_hwprobe
|
||||
#ifndef NR_arch_specific_syscall
|
||||
@@ -147,6 +149,7 @@ char* gotoblas_corename(void) {
|
||||
}
|
||||
|
||||
static gotoblas_t* get_coretype(void) {
|
||||
uint64_t vector_mask;
|
||||
unsigned vlenb = 0;
|
||||
|
||||
#if !defined(OS_LINUX)
|
||||
@@ -165,14 +168,25 @@ static gotoblas_t* get_coretype(void) {
|
||||
};
|
||||
int ret = syscall(NR_riscv_hwprobe, pairs, 1, 0, NULL, 0);
|
||||
if (ret == 0) {
|
||||
if (!(pairs[0].value & RISCV_HWPROBE_IMA_V))
|
||||
#if defined(BUILD_HFLOAT16)
|
||||
vector_mask = (RISCV_HWPROBE_IMA_V | RISCV_HWPROBE_EXT_ZFH | RISCV_HWPROBE_EXT_ZVFH);
|
||||
#else
|
||||
vector_mask = RISCV_HWPROBE_IMA_V;
|
||||
#endif
|
||||
if ((pairs[0].value & vector_mask) != vector_mask)
|
||||
return NULL;
|
||||
} else {
|
||||
#if defined(BUILD_HFLOAT16)
|
||||
snprintf(coremsg, sizeof(coremsg), "Cpu support for Zfh+Zvfh extensions required due to BUILD_HFLOAT16=1\n");
|
||||
openblas_warning(1, coremsg);
|
||||
return NULL;
|
||||
#else
|
||||
if (!(getauxval(AT_HWCAP) & DETECT_RISCV64_HWCAP_ISA_V))
|
||||
return NULL;
|
||||
|
||||
if (!detect_riscv64_rvv100())
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -391,7 +391,15 @@ static void numa_mapping(void) {
|
||||
core = 0;
|
||||
for (cpu = 0; cpu < common -> num_procs; cpu ++) {
|
||||
bitmask_idx = CPUELT(cpu);
|
||||
/*
|
||||
* When common->avail[i] = 0x5555555555555555UL (indicating that adjacent logical cores share a physical core),
|
||||
* using it as a mask may overlap with the local_cpu_map function's role, leading to only half of the real physical cores being detected.
|
||||
*/
|
||||
#ifdef ARCH_LOONGARCH64
|
||||
if (common -> node_info[node][bitmask_idx]) {
|
||||
#else
|
||||
if (common -> node_info[node][bitmask_idx] & common -> avail[bitmask_idx] & CPUMASK(cpu)) {
|
||||
#endif
|
||||
common -> cpu_info[count] = WRITE_CORE(core) | WRITE_NODE(node) | WRITE_CPU(cpu);
|
||||
count ++;
|
||||
core ++;
|
||||
@@ -930,8 +938,12 @@ void gotoblas_affinity_init(void) {
|
||||
|
||||
if (common -> num_nodes > 1) numa_mapping();
|
||||
|
||||
#ifdef ARCH_LOONGARCH64
|
||||
common -> final_num_procs = common -> num_procs;
|
||||
#else
|
||||
common -> final_num_procs = 0;
|
||||
for(i = 0; i < common -> avail_count; i++) common -> final_num_procs += rcount(common -> avail[i]) + 1; //Make the max cpu number.
|
||||
#endif
|
||||
|
||||
for (cpu = 0; cpu < common -> final_num_procs; cpu ++) common -> cpu_use[cpu] = 0;
|
||||
|
||||
|
||||
+11
-2
@@ -2922,6 +2922,7 @@ void *blas_memory_alloc(int procpos){
|
||||
blas_unlock(&memory[position].lock);
|
||||
#endif
|
||||
if (!memory[position].addr) {
|
||||
int failcount = 0;
|
||||
do {
|
||||
#ifdef DEBUG
|
||||
printf("Allocation Start : %lx\n", base_address);
|
||||
@@ -2973,8 +2974,16 @@ void *blas_memory_alloc(int procpos){
|
||||
#ifdef DEBUG
|
||||
printf(" Success -> %08lx\n", map_address);
|
||||
#endif
|
||||
if (((BLASLONG) map_address) == -1) base_address = 0UL;
|
||||
|
||||
if (((BLASLONG) map_address) == -1) {
|
||||
base_address = 0UL;
|
||||
failcount++;
|
||||
if (failcount >10) {
|
||||
fprintf(stderr, "OpenBLAS error: Memory allocation still failed after 10 retries, giving up.\n");
|
||||
exit(1);
|
||||
}
|
||||
} else {
|
||||
failcount = 0;
|
||||
}
|
||||
if (base_address) base_address += BUFFER_SIZE + FIXED_PAGESIZE;
|
||||
|
||||
} while ((BLASLONG)map_address == -1);
|
||||
|
||||
@@ -67,6 +67,16 @@ BLASLONG sbgemm_p = DEFAULT_GEMM_P;
|
||||
#else
|
||||
BLASLONG sbgemm_p = SBGEMM_P;
|
||||
#endif
|
||||
#if SHGEMM_P == shgemm_p
|
||||
BLASLONG shgemm_p = DEFAULT_GEMM_P;
|
||||
#else
|
||||
BLASLONG shgemm_p = SHGEMM_P;
|
||||
#endif
|
||||
#if BGEMM_P == bgemm_p
|
||||
BLASLONG bgemm_p = DEFAULT_GEMM_P;
|
||||
#else
|
||||
BLASLONG bgemm_p = BGEMM_P;
|
||||
#endif
|
||||
#if SGEMM_P == sgemm_p
|
||||
BLASLONG sgemm_p = DEFAULT_GEMM_P;
|
||||
#else
|
||||
@@ -93,6 +103,16 @@ BLASLONG sbgemm_q = DEFAULT_GEMM_Q;
|
||||
#else
|
||||
BLASLONG sbgemm_q = SBGEMM_Q;
|
||||
#endif
|
||||
#if SHGEMM_Q == shgemm_q
|
||||
BLASLONG shgemm_q = DEFAULT_GEMM_Q;
|
||||
#else
|
||||
BLASLONG shgemm_q = SHGEMM_Q;
|
||||
#endif
|
||||
#if BGEMM_Q == bgemm_q
|
||||
BLASLONG bgemm_q = DEFAULT_GEMM_Q;
|
||||
#else
|
||||
BLASLONG bgemm_q = BGEMM_Q;
|
||||
#endif
|
||||
#if SGEMM_Q == sgemm_q
|
||||
BLASLONG sgemm_q = DEFAULT_GEMM_Q;
|
||||
#else
|
||||
@@ -119,6 +139,16 @@ BLASLONG sbgemm_r = DEFAULT_GEMM_R;
|
||||
#else
|
||||
BLASLONG sbgemm_r = SBGEMM_R;
|
||||
#endif
|
||||
#if SHGEMM_R == shgemm_r
|
||||
BLASLONG shgemm_r = DEFAULT_GEMM_R;
|
||||
#else
|
||||
BLASLONG shgemm_r = SHGEMM_R;
|
||||
#endif
|
||||
#if BGEMM_R == bgemm_r
|
||||
BLASLONG bgemm_r = DEFAULT_GEMM_R;
|
||||
#else
|
||||
BLASLONG bgemm_r = BGEMM_R;
|
||||
#endif
|
||||
#if SGEMM_R == sgemm_r
|
||||
BLASLONG sgemm_r = DEFAULT_GEMM_R;
|
||||
#else
|
||||
@@ -526,6 +556,10 @@ void blas_set_parameter(void){
|
||||
|
||||
#ifdef BUILD_BFLOAT16
|
||||
sbgemm_r = (((BUFFER_SIZE - ((SBGEMM_P * SBGEMM_Q * 4 + GEMM_OFFSET_A + GEMM_ALIGN) & ~GEMM_ALIGN)) / (SBGEMM_Q * 4)) - 15) & ~15;
|
||||
bgemm_r = (((BUFFER_SIZE - ((BGEMM_P * BGEMM_Q * 4 + GEMM_OFFSET_A + GEMM_ALIGN) & ~GEMM_ALIGN)) / (BGEMM_Q * 4)) - 15) & ~15;
|
||||
#endif
|
||||
#ifdef BUILD_HFLOAT16
|
||||
shgemm_r = (((BUFFER_SIZE - ((SHGEMM_P * SHGEMM_Q * 4 + GEMM_OFFSET_A + GEMM_ALIGN) & ~GEMM_ALIGN)) / (SHGEMM_Q * 4)) - 15) & ~15;
|
||||
#endif
|
||||
sgemm_r = (((BUFFER_SIZE - ((SGEMM_P * SGEMM_Q * 4 + GEMM_OFFSET_A + GEMM_ALIGN) & ~GEMM_ALIGN)) / (SGEMM_Q * 4)) - 15) & ~15;
|
||||
dgemm_r = (((BUFFER_SIZE - ((DGEMM_P * DGEMM_Q * 8 + GEMM_OFFSET_A + GEMM_ALIGN) & ~GEMM_ALIGN)) / (DGEMM_Q * 8)) - 15) & ~15;
|
||||
@@ -619,6 +653,7 @@ void blas_set_parameter(void){
|
||||
size = BITMASK(cpuid3, 16, 0xff);
|
||||
|
||||
sbgemm_p = 192 * (size + 1);
|
||||
shgemm_p = 192 * (size + 1);
|
||||
sgemm_p = 192 * (size + 1);
|
||||
dgemm_p = 96 * (size + 1);
|
||||
cgemm_p = 96 * (size + 1);
|
||||
@@ -634,6 +669,10 @@ void blas_set_parameter(void){
|
||||
|
||||
#ifdef BUILD_BFLOAT16
|
||||
sbgemm_r = (((BUFFER_SIZE - ((SBGEMM_P * SBGEMM_Q * 4 + GEMM_OFFSET_A + GEMM_ALIGN) & ~GEMM_ALIGN)) / (SBGEMM_Q * 4)) - 15) & ~15;
|
||||
bgemm_r = (((BUFFER_SIZE - ((BGEMM_P * BGEMM_Q * 4 + GEMM_OFFSET_A + GEMM_ALIGN) & ~GEMM_ALIGN)) / (BGEMM_Q * 4)) - 15) & ~15;
|
||||
#endif
|
||||
#ifdef BUILD_HFLOAT16
|
||||
shgemm_r = (((BUFFER_SIZE - ((SHGEMM_P * SHGEMM_Q * 4 + GEMM_OFFSET_A + GEMM_ALIGN) & ~GEMM_ALIGN)) / (SHGEMM_Q * 4)) - 15) & ~15;
|
||||
#endif
|
||||
sgemm_r = (((BUFFER_SIZE - ((SGEMM_P * SGEMM_Q * 4 + GEMM_OFFSET_A + GEMM_ALIGN) & ~GEMM_ALIGN)) / (SGEMM_Q * 4)) - 15) & ~15;
|
||||
dgemm_r = (((BUFFER_SIZE - ((DGEMM_P * DGEMM_Q * 8 + GEMM_OFFSET_A + GEMM_ALIGN) & ~GEMM_ALIGN)) / (DGEMM_Q * 8)) - 15) & ~15;
|
||||
|
||||
+10
-7
@@ -39,6 +39,9 @@ endif
|
||||
ifndef BUILD_BFLOAT16
|
||||
BUILD_BFLOAT16 = 0
|
||||
endif
|
||||
ifndef BUILD_HFLOAT16
|
||||
BUILD_HFLOAT16 = 0
|
||||
endif
|
||||
ifndef BUILD_SINGLE
|
||||
BUILD_SINGLE = 0
|
||||
endif
|
||||
@@ -130,10 +133,10 @@ dll : ../$(LIBDLLNAME)
|
||||
-Wl,--whole-archive ../$(LIBNAME) -Wl,--no-whole-archive $(FEXTRALIB) $(EXTRALIB)
|
||||
|
||||
$(LIBPREFIX).def : $(GENSYM)
|
||||
./$(GENSYM) win2k $(ARCH) dummy $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) "$(SYMBOLPREFIX)" "$(SYMBOLSUFFIX)" $(BUILD_LAPACK_DEPRECATED) $(BUILD_BFLOAT16) $(BUILD_SINGLE) $(BUILD_DOUBLE) $(BUILD_COMPLEX) $(BUILD_COMPLEX16) > $(@F)
|
||||
./$(GENSYM) win2k $(ARCH) dummy $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) "$(SYMBOLPREFIX)" "$(SYMBOLSUFFIX)" $(BUILD_LAPACK_DEPRECATED) $(BUILD_BFLOAT16) $(BUILD_HFLOAT16) $(BUILD_SINGLE) $(BUILD_DOUBLE) $(BUILD_COMPLEX) $(BUILD_COMPLEX16) > $(@F)
|
||||
|
||||
libgoto_hpl.def : $(GENSYM)
|
||||
./$(GENSYM) win2khpl $(ARCH) dummy $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) "$(SYMBOLPREFIX)" "$(SYMBOLSUFFIX)" $(BUILD_LAPACK_DEPRECATED) $(BUILD_BFLOAT16) $(BUILD_SINGLE) $(BUILD_DOUBLE) $(BUILD_COMPLEX) $(BUILD_COMPLEX16) > $(@F)
|
||||
./$(GENSYM) win2khpl $(ARCH) dummy $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) "$(SYMBOLPREFIX)" "$(SYMBOLSUFFIX)" $(BUILD_LAPACK_DEPRECATED) $(BUILD_BFLOAT16) $(BUILD_HFLOAT16) $(BUILD_SINGLE) $(BUILD_DOUBLE) $(BUILD_COMPLEX) $(BUILD_COMPLEX16) > $(@F)
|
||||
|
||||
ifeq ($(OSNAME), Darwin)
|
||||
ifeq ($(FIXED_LIBNAME),1)
|
||||
@@ -298,23 +301,23 @@ static : ../$(LIBNAME)
|
||||
rm -f goto.$(SUFFIX)
|
||||
|
||||
osx.def : $(GENSYM) ../Makefile.system ../getarch.c
|
||||
./$(GENSYM) osx $(ARCH) "$(BU)" $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) "$(SYMBOLPREFIX)" "$(SYMBOLSUFFIX)" $(BUILD_LAPACK_DEPRECATED) $(BUILD_BFLOAT16) $(BUILD_SINGLE) $(BUILD_DOUBLE) $(BUILD_COMPLEX) $(BUILD_COMPLEX16) > $(@F)
|
||||
./$(GENSYM) osx $(ARCH) "$(BU)" $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) "$(SYMBOLPREFIX)" "$(SYMBOLSUFFIX)" $(BUILD_LAPACK_DEPRECATED) $(BUILD_BFLOAT16) $(BUILD_HFLOAT16) $(BUILD_SINGLE) $(BUILD_DOUBLE) $(BUILD_COMPLEX) $(BUILD_COMPLEX16) > $(@F)
|
||||
|
||||
aix.def : $(GENSYM) ../Makefile.system ../getarch.c
|
||||
./$(GENSYM) aix $(ARCH) "$(BU)" $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) "$(SYMBOLPREFIX)" "$(SYMBOLSUFFIX)" $(BUILD_LAPACK_DEPRECATED) $(BUILD_BFLOAT16) $(BUILD_SINGLE) $(BUILD_DOUBLE) $(BUILD_COMPLEX) $(BUILD_COMPLEX16) > $(@F)
|
||||
./$(GENSYM) aix $(ARCH) "$(BU)" $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) "$(SYMBOLPREFIX)" "$(SYMBOLSUFFIX)" $(BUILD_LAPACK_DEPRECATED) $(BUILD_BFLOAT16) $(BUILD_HFLOAT16) $(BUILD_SINGLE) $(BUILD_DOUBLE) $(BUILD_COMPLEX) $(BUILD_COMPLEX16) > $(@F)
|
||||
|
||||
objcopy.def : $(GENSYM) ../Makefile.system ../getarch.c
|
||||
./$(GENSYM) objcopy $(ARCH) "$(BU)" $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) "$(SYMBOLPREFIX)" "$(SYMBOLSUFFIX)" $(BUILD_LAPACK_DEPRECATED) $(BUILD_BFLOAT16) $(BUILD_SINGLE) $(BUILD_DOUBLE) $(BUILD_COMPLEX) $(BUILD_COMPLEX16) > $(@F)
|
||||
./$(GENSYM) objcopy $(ARCH) "$(BU)" $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) "$(SYMBOLPREFIX)" "$(SYMBOLSUFFIX)" $(BUILD_LAPACK_DEPRECATED) $(BUILD_BFLOAT16) $(BUILD_HFLOAT16) $(BUILD_SINGLE) $(BUILD_DOUBLE) $(BUILD_COMPLEX) $(BUILD_COMPLEX16) > $(@F)
|
||||
|
||||
objconv.def : $(GENSYM) ../Makefile.system ../getarch.c
|
||||
./$(GENSYM) objconv $(ARCH) "$(BU)" $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) "$(SYMBOLPREFIX)" "$(SYMBOLSUFFIX)" $(BUILD_LAPACK_DEPRECATED) $(BUILD_BFLOAT16) $(BUILD_SINGLE) $(BUILD_DOUBLE) $(BUILD_COMPLEX) $(BUILD_COMPLEX16) > $(@F)
|
||||
./$(GENSYM) objconv $(ARCH) "$(BU)" $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) "$(SYMBOLPREFIX)" "$(SYMBOLSUFFIX)" $(BUILD_LAPACK_DEPRECATED) $(BUILD_BFLOAT16) $(BUILD_HFLOAT16) $(BUILD_SINGLE) $(BUILD_DOUBLE) $(BUILD_COMPLEX) $(BUILD_COMPLEX16) > $(@F)
|
||||
|
||||
test : linktest.c
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) -lm && echo OK.
|
||||
rm -f linktest
|
||||
|
||||
linktest.c : $(GENSYM) ../Makefile.system ../getarch.c
|
||||
./$(GENSYM) linktest $(ARCH) "$(BU)" $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) "$(SYMBOLPREFIX)" "$(SYMBOLSUFFIX)" $(BUILD_LAPACK_DEPRECATED) $(BUILD_BFLOAT16) $(BUILD_SINGLE) $(BUILD_DOUBLE) $(BUILD_COMPLEX) $(BUILD_COMPLEX16) > linktest.c
|
||||
./$(GENSYM) linktest $(ARCH) "$(BU)" $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) "$(SYMBOLPREFIX)" "$(SYMBOLSUFFIX)" $(BUILD_LAPACK_DEPRECATED) $(BUILD_BFLOAT16) $(BUILD_HFLOAT16) $(BUILD_SINGLE) $(BUILD_DOUBLE) $(BUILD_COMPLEX) $(BUILD_COMPLEX16) > linktest.c
|
||||
|
||||
clean ::
|
||||
@rm -f *.def *.dylib __.SYMDEF* *.renamed
|
||||
|
||||
+45
-8
@@ -1,5 +1,33 @@
|
||||
#!/bin/sh
|
||||
|
||||
###############################################################################
|
||||
# Copyright (c) 2025, The OpenBLAS Project
|
||||
# All rights reserved.
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name of the OpenBLAS project nor the names of
|
||||
# its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
###############################################################################
|
||||
|
||||
# Changelog
|
||||
# 2017/09/03 staticfloat
|
||||
# Added zsymv and csymv into @lapackobjs2 so they are properly renamed
|
||||
@@ -51,7 +79,8 @@ blasobjsz="
|
||||
zgeadd dzsum zgemmt zgemmtr"
|
||||
|
||||
blasobjs="lsame xerbla"
|
||||
bfblasobjs="sbgemm sbgemmt sbgemmtr sbgemv sbdot sbstobf16 sbdtobf16 sbf16tos dbf16tod"
|
||||
bfblasobjs="bgemm bgemv sbgemm sbgemmt sbgemmtr sbgemv sbdot sbstobf16 sbdtobf16 sbf16tos dbf16tod"
|
||||
hfblasobjs="shgemm"
|
||||
cblasobjsc="
|
||||
cblas_caxpy cblas_ccopy cblas_cdotc cblas_cdotu cblas_cgbmv cblas_cgemm cblas_cgemv
|
||||
cblas_cgerc cblas_cgeru cblas_chbmv cblas_chemm cblas_chemv cblas_cher2 cblas_cher2k
|
||||
@@ -100,6 +129,7 @@ cblasobjsz="
|
||||
cblasobjs="cblas_xerbla"
|
||||
|
||||
bfcblasobjs="cblas_sbgemm cblas_sbgemv cblas_sbdot cblas_sbstobf16 cblas_sbdtobf16 cblas_sbf16tos cblas_dbf16tod cblas_sbgemm_batch"
|
||||
hfcblasobjs="cblas_shgemm"
|
||||
|
||||
exblasobjs="
|
||||
qamax qamin qasum qaxpy qcabs1 qcopy qdot qgbmv qgemm
|
||||
@@ -3814,6 +3844,8 @@ shift
|
||||
p16=$9
|
||||
shift
|
||||
p17=$9
|
||||
shift
|
||||
p18=$9
|
||||
|
||||
if [ $p13 -eq 1 ]; then
|
||||
blasobjs="$blasobjs $bfblasobjs"
|
||||
@@ -3821,6 +3853,11 @@ if [ $p13 -eq 1 ]; then
|
||||
fi
|
||||
|
||||
if [ $p14 -eq 1 ]; then
|
||||
blasobjs="$blasobjs $hfblasobjs"
|
||||
cblasobjs="$cblasobjs $hfcblasobjs"
|
||||
fi
|
||||
|
||||
if [ $p15 -eq 1 ]; then
|
||||
blasobjs="$blasobjs $blasobjss"
|
||||
cblasobjs="$cblasobjs $cblasobjss"
|
||||
lapackobjs="$lapackobjs $lapackobjss"
|
||||
@@ -3833,11 +3870,11 @@ if [ $p14 -eq 1 ]; then
|
||||
lapackeobjs="$lapackeobjs $lapackeobjss"
|
||||
fi
|
||||
|
||||
if [ $p15 -eq 1 ]; then
|
||||
if [ $p16 -eq 1 ]; then
|
||||
blasobjs="$blasobjs $blasobjsd"
|
||||
cblasobjs="$cblasobjs $cblasobjsd"
|
||||
lapackobjs="$lapackobjs $lapackobjsd"
|
||||
if [ $p14 -eq 0 ]; then
|
||||
if [ $p15 -eq 0 ]; then
|
||||
lapackobjs2="$lapackobjs2 $lapackobjs2ds"
|
||||
fi
|
||||
lapackobjs2="$lapackobjs2 $lapackobjs2d $lapackobjs2dz"
|
||||
@@ -3847,14 +3884,14 @@ if [ $p15 -eq 1 ]; then
|
||||
lapackeobjs="$lapackeobjs $lapackeobjsd"
|
||||
fi
|
||||
|
||||
if [ $p16 -eq 1 ]; then
|
||||
if [ $p17 -eq 1 ]; then
|
||||
blasobjs="$blasobjs $blasobjsc"
|
||||
cblasobjs="$cblasobjs $cblasobjsc"
|
||||
gemm3mobjs="$gemm3mobjs $gemm3mobjsc"
|
||||
cblasgemm3mobjs="$cblasgemm3mobjs $cblasgemm3mobjsc"
|
||||
lapackobjs="$lapackobjs $lapackobjsc"
|
||||
lapackobjs2="$lapackobjs2 $lapackobjs2c $lapackobjs2zc"
|
||||
if [ $p14 -eq 0 ]; then
|
||||
if [ $p15 -eq 0 ]; then
|
||||
lapackobjs2="$lapackobjs2 $lapackobjs2sc"
|
||||
fi
|
||||
lapack_deprecated_objs="$lapack_deprecated_objs $lapack_deprecated_objsc"
|
||||
@@ -3863,17 +3900,17 @@ if [ $p16 -eq 1 ]; then
|
||||
lapackeobjs="$lapackeobjs $lapackeobjsc"
|
||||
fi
|
||||
|
||||
if [ $p17 -eq 1 ]; then
|
||||
if [ $p18 -eq 1 ]; then
|
||||
blasobjs="$blasobjs $blasobjsz"
|
||||
cblasobjs="$cblasobjs $cblasobjsz"
|
||||
gemm3mobjs="$gemm3mobjs $gemm3mobjsz"
|
||||
cblasgemm3mobjs="$cblasgemm3mobjs $cblasgemm3mobjsz"
|
||||
lapackobjs="$lapackobjs $lapackobjsz"
|
||||
lapackobjs2="$lapackobjs2 $lapackobjs2z"
|
||||
if [ $p16 -eq 0 ]; then
|
||||
if [ $p17 -eq 0 ]; then
|
||||
lapackobjs2="$lapackobjs2 $lapackobjs2zc"
|
||||
fi
|
||||
if [ $p15 -eq 0 ]; then
|
||||
if [ $p16 -eq 0 ]; then
|
||||
lapackobjs2="$lapackobjs2 $lapackobjs2dz"
|
||||
fi
|
||||
lapack_deprecated_objs="$lapack_deprecated_objs $lapack_deprecated_objsz"
|
||||
|
||||
+42
-9
@@ -1,5 +1,33 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
###############################################################################
|
||||
# Copyright (c) 2025, The OpenBLAS Project
|
||||
# All rights reserved.
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name of the OpenBLAS project nor the names of
|
||||
# its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
###############################################################################
|
||||
|
||||
# Changelog
|
||||
# 2017/09/03 staticfloat
|
||||
# Added zsymv and csymv into @lapackobjs2 so they are properly renamed
|
||||
@@ -51,7 +79,8 @@
|
||||
zgeadd, dzsum, zgemmt,zgemmtr);
|
||||
|
||||
@blasobjs = (lsame, xerbla);
|
||||
@bfblasobjs = (sbgemm, sbgemmt, sbgemmtr, sbgemv, sbdot, sbstobf16, sbdtobf16, sbf16tos, dbf16tod);
|
||||
@bfblasobjs = (bgemm, bgemv, sbgemm, sbgemmt, sbgemmtr, sbgemv, sbdot, sbstobf16, sbdtobf16, sbf16tos, dbf16tod);
|
||||
@hfblasobjs = (shgemm);
|
||||
@cblasobjsc = (
|
||||
cblas_caxpy, cblas_ccopy, cblas_cdotc, cblas_cdotu, cblas_cgbmv, cblas_cgemm, cblas_cgemv,
|
||||
cblas_cgerc, cblas_cgeru, cblas_chbmv, cblas_chemm, cblas_chemv, cblas_cher2, cblas_cher2k,
|
||||
@@ -97,7 +126,7 @@
|
||||
@cblasobjs = ( cblas_xerbla );
|
||||
|
||||
@bfcblasobjs = (cblas_sbgemm, cblas_sbgemmt, cblas_sbgemmtr, cblas_sbgemv, cblas_sbdot, cblas_sbstobf16, cblas_sbdtobf16, cblas_sbf16tos, cblas_dbf16tod, cblas_sbgemm_batch);
|
||||
|
||||
@hfcblasobjs = (cblas_shgemm);
|
||||
@exblasobjs = (
|
||||
qamax,qamin,qasum,qaxpy,qcabs1,qcopy,qdot,qgbmv,qgemm,
|
||||
qgemv,qger,qmax,qmin,
|
||||
@@ -3777,6 +3806,10 @@ if ($ARGV[12] == 1) {
|
||||
@cblasobjs = (@cblasobjs, @bfcblasobjs);
|
||||
}
|
||||
if ($ARGV[13] == 1) {
|
||||
@blasobjs = (@blasobjs, @hfblasobjs);
|
||||
@cblasobjs = (@cblasobjs, @hfcblasobjs);
|
||||
}
|
||||
if ($ARGV[14] == 1) {
|
||||
@blasobjs = (@blasobjs, @blasobjss);
|
||||
@cblasobjs = (@cblasobjs, @cblasobjss);
|
||||
@lapackobjs = (@lapackobjs, @lapackobjss);
|
||||
@@ -3788,11 +3821,11 @@ if ($ARGV[13] == 1) {
|
||||
@lapack_embeded_underscore_objs = (@lapack_embeded_underscore_objs, @lapack_embeded_underscore_objs_s);
|
||||
@lapackeobjs = (@lapackeobjs, @lapackeobjss);
|
||||
}
|
||||
if ($ARGV[14] == 1) {
|
||||
if ($ARGV[15] == 1) {
|
||||
@blasobjs = (@blasobjs, @blasobjsd);
|
||||
@cblasobjs = (@cblasobjs, @cblasobjsd);
|
||||
@lapackobjs = (@lapackobjs, @lapackobjsd);
|
||||
if ($ARGV[13] == 0) {
|
||||
if ($ARGV[14] == 0) {
|
||||
@lapackobjs2 = (@lapackobjs2, @lapackobjs2ds);
|
||||
}
|
||||
@lapackobjs2 = (@lapackobjs2, @lapackobjs2d, @lapackobjs2dz);
|
||||
@@ -3801,14 +3834,14 @@ if ($ARGV[14] == 1) {
|
||||
@lapack_embeded_underscore_objs = (@lapack_embeded_underscore_objs, @lapack_embeded_underscore_objs_d);
|
||||
@lapackeobjs = (@lapackeobjs, @lapackeobjsd);
|
||||
}
|
||||
if ($ARGV[15] == 1) {
|
||||
if ($ARGV[16] == 1) {
|
||||
@blasobjs = (@blasobjs, @blasobjsc);
|
||||
@cblasobjs = (@cblasobjs, @cblasobjsc);
|
||||
@gemm3mobjs = (@gemm3mobjs, @gemm3mobjsc);
|
||||
@cblasgemm3mobjs = (@cblasgemm3mobjs, @cblasgemm3mobjsc);
|
||||
@lapackobjs = (@lapackobjs, @lapackobjsc);
|
||||
@lapackobjs2 = (@lapackobjs2, @lapackobjs2c, @lapackobjs2zc);
|
||||
if ($ARGV[13] == 0) {
|
||||
if ($ARGV[14] == 0) {
|
||||
@lapackobjs2 = (@lapackobjs2, @lapackobjs2sc);
|
||||
}
|
||||
@lapack_deprecated_objs = (@lapack_deprecated_objs, @lapack_deprecated_objsc);
|
||||
@@ -3816,17 +3849,17 @@ if ($ARGV[15] == 1) {
|
||||
@lapack_embeded_underscore_objs = (@lapack_embeded_underscore_objs, @lapack_embeded_underscore_objs_c);
|
||||
@lapackeobjs = (@lapackeobjs, @lapackeobjsc);
|
||||
}
|
||||
if ($ARGV[16] == 1) {
|
||||
if ($ARGV[17] == 1) {
|
||||
@blasobjs = (@blasobjs, @blasobjsz);
|
||||
@cblasobjs = (@cblasobjs, @cblasobjsz);
|
||||
@gemm3mobjs = (@gemm3mobjs, @gemm3mobjsz);
|
||||
@cblasgemm3mobjs = (@cblasgemm3mobjs, @cblasgemm3mobjsz);
|
||||
@lapackobjs = (@lapackobjs, @lapackobjsz);
|
||||
@lapackobjs2 = (@lapackobjs2, @lapackobjs2z);
|
||||
if ($ARGV[15] == 0) {
|
||||
if ($ARGV[16] == 0) {
|
||||
@lapackobjs2 = (@lapackobjs2, @lapackobjs2zc);
|
||||
}
|
||||
if ($ARGV[14] == 0) {
|
||||
if ($ARGV[15] == 0) {
|
||||
@lapackobjs2 = (@lapackobjs2, @lapackobjs2dz);
|
||||
}
|
||||
@lapack_deprecated_objs = (@lapack_deprecated_objs, @lapack_deprecated_objsz);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2011-2014, The OpenBLAS Project
|
||||
Copyright (c) 2011-2014, 2025 The OpenBLAS Project
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -158,6 +158,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
/* #define FORCE_CSKY */
|
||||
/* #define FORCE_CK860FV */
|
||||
/* #define FORCE_GENERIC */
|
||||
/* #define FORCE_AMPERE1 */
|
||||
|
||||
#ifdef FORCE_P2
|
||||
#define FORCE
|
||||
@@ -835,7 +836,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#define CORENAME "POWER9"
|
||||
#endif
|
||||
|
||||
#if defined(FORCE_POWER10)
|
||||
#if defined(FORCE_POWER10) || (FORCE_POWER11)
|
||||
#define FORCE
|
||||
#define ARCHITECTURE "POWER"
|
||||
#define SUBARCHITECTURE "POWER10"
|
||||
@@ -1475,7 +1476,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
"-DL2_SIZE=1048576 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=16 " \
|
||||
"-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
|
||||
"-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DHAVE_SVE -DARMV8 " \
|
||||
"-march=armv8.4-a+sve -mtune=neoverse-v1"
|
||||
"-march=armv8.4-a+sve+bf16 -mtune=neoverse-v1"
|
||||
#define LIBNAME "neoversev1"
|
||||
#define CORENAME "NEOVERSEV1"
|
||||
#endif
|
||||
@@ -1497,6 +1498,22 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#define CORENAME "NEOVERSEN2"
|
||||
#endif
|
||||
|
||||
#ifdef FORCE_NEOVERSEV2
|
||||
#define FORCE
|
||||
#define ARCHITECTURE "ARM64"
|
||||
#define SUBARCHITECTURE "NEOVERSEV2"
|
||||
#define SUBDIRNAME "arm64"
|
||||
#define ARCHCONFIG "-DNEOVERSEV2 " \
|
||||
"-DL1_CODE_SIZE=65536 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=4 " \
|
||||
"-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=4 " \
|
||||
"-DL2_SIZE=1048576 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=16 " \
|
||||
"-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
|
||||
"-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DHAVE_SVE -DARMV8 " \
|
||||
"-mcpu=neoverse-v2"
|
||||
#define LIBNAME "neoversev2"
|
||||
#define CORENAME "NEOVERSEV2"
|
||||
#endif
|
||||
|
||||
#ifdef FORCE_CORTEXA55
|
||||
#define FORCE
|
||||
#define ARCHITECTURE "ARM64"
|
||||
@@ -1590,6 +1607,22 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#define CORENAME "EMAG8180"
|
||||
#endif
|
||||
|
||||
#ifdef FORCE_AMPERE1
|
||||
#define FORCE
|
||||
#define ARCHITECTURE "ARM64"
|
||||
#define SUBARCHITECTURE "AMPERE1"
|
||||
#define SUBDIRNAME "arm64"
|
||||
#define ARCHCONFIG "-DAMPERE1 " \
|
||||
"-DL1_CODE_SIZE=16384 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=4 " \
|
||||
"-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=4 " \
|
||||
"-DL2_SIZE=2097152 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=16 " \
|
||||
"-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
|
||||
"-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8 " \
|
||||
"-march=armv8.6-a+crypto+crc+fp16+sha3+rng"
|
||||
#define LIBNAME "ampere1"
|
||||
#define CORENAME "AMPERE1"
|
||||
#endif
|
||||
|
||||
#ifdef FORCE_THUNDERX3T110
|
||||
#define ARMV8
|
||||
#define FORCE
|
||||
@@ -1820,7 +1853,6 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#define CORENAME "CK860FV"
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef FORCE
|
||||
|
||||
#ifdef USER_TARGET
|
||||
|
||||
@@ -1,3 +1,31 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2025, The OpenBLAS Project
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name of the OpenBLAS project nor the names of
|
||||
* its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
* *****************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#ifndef BUILD_KERNEL
|
||||
#include "config.h"
|
||||
@@ -17,8 +45,14 @@ typedef unsigned long BLASULONG;
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
if ( (argc <= 1) || ((argc >= 2) && (*argv[1] == '0'))) {
|
||||
printf("BGEMM_UNROLL_M=%d\n", BGEMM_DEFAULT_UNROLL_M);
|
||||
printf("BGEMM_UNROLL_N=%d\n", BGEMM_DEFAULT_UNROLL_N);
|
||||
printf("BGEMM_UNROLL_M=%d\n", BGEMM_DEFAULT_UNROLL_M);
|
||||
printf("BGEMM_UNROLL_N=%d\n", BGEMM_DEFAULT_UNROLL_N);
|
||||
printf("SBGEMM_UNROLL_M=%d\n", SBGEMM_DEFAULT_UNROLL_M);
|
||||
printf("SBGEMM_UNROLL_N=%d\n", SBGEMM_DEFAULT_UNROLL_N);
|
||||
printf("SHGEMM_UNROLL_M=%d\n", SHGEMM_DEFAULT_UNROLL_M);
|
||||
printf("SHGEMM_UNROLL_N=%d\n", SHGEMM_DEFAULT_UNROLL_N);
|
||||
printf("SGEMM_UNROLL_M=%d\n", SGEMM_DEFAULT_UNROLL_M);
|
||||
printf("SGEMM_UNROLL_N=%d\n", SGEMM_DEFAULT_UNROLL_N);
|
||||
printf("DGEMM_UNROLL_M=%d\n", DGEMM_DEFAULT_UNROLL_M);
|
||||
|
||||
+46
-15
@@ -1,3 +1,30 @@
|
||||
###############################################################################
|
||||
# Copyright (c) 2025, The OpenBLAS Project
|
||||
# All rights reserved.
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name of the OpenBLAS project nor the names of
|
||||
# its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
###############################################################################
|
||||
|
||||
include_directories(${PROJECT_SOURCE_DIR})
|
||||
include_directories(${PROJECT_BINARY_DIR})
|
||||
@@ -97,10 +124,8 @@ foreach (CBLAS_FLAG ${CBLAS_FLAGS})
|
||||
#sdsdot, dsdot
|
||||
if (BUILD_SINGLE OR BUILD_DOUBLE)
|
||||
GenerateNamedObjects("sdsdot.c" "" "sdsdot" ${CBLAS_FLAG} "" "" true "SINGLE")
|
||||
if(CBLAS_FLAG EQUAL 1)
|
||||
GenerateNamedObjects("gemm_batch.c" "" "gemm_batch" ${CBLAS_FLAG} "" "" false)
|
||||
endif ()
|
||||
endif ()
|
||||
GenerateNamedObjects("gemm_batch.c" "" "gemm_batch" ${CBLAS_FLAG} "" "" false)
|
||||
endif ()
|
||||
if (BUILD_DOUBLE)
|
||||
GenerateNamedObjects("dsdot.c" "" "dsdot" ${CBLAS_FLAG} "" "" true "SINGLE")
|
||||
endif ()
|
||||
@@ -123,18 +148,22 @@ endif ()
|
||||
GenerateNamedObjects("imax.c" "USE_MIN" "i*min" ${CBLAS_FLAG})
|
||||
|
||||
if (BUILD_BFLOAT16)
|
||||
GenerateNamedObjects("scal.c" "BGEMM" "bscal" ${CBLAS_FLAG} "" "" true "BFLOAT16")
|
||||
GenerateNamedObjects("bf16dot.c" "" "sbdot" ${CBLAS_FLAG} "" "" true "BFLOAT16")
|
||||
GenerateNamedObjects("gemm.c" "BGEMM" "bgemm" ${CBLAS_FLAG} "" "" true "BFLOAT16")
|
||||
GenerateNamedObjects("gemm.c" "" "sbgemm" ${CBLAS_FLAG} "" "" true "BFLOAT16")
|
||||
GenerateNamedObjects("gemmt.c" "" "sbgemmt" ${CBLAS_FLAG} "" "" true "BFLOAT16")
|
||||
GenerateNamedObjects("gemmt.c" "RNAME" "sbgemmtr" ${CBLAS_FLAG} "" "" true "BFLOAT16")
|
||||
GenerateNamedObjects("sbgemmt.c" "" "sbgemmt" ${CBLAS_FLAG} "" "" true "BFLOAT16")
|
||||
GenerateNamedObjects("sbgemmt.c" "RNAME" "sbgemmtr" ${CBLAS_FLAG} "" "" true "BFLOAT16")
|
||||
GenerateNamedObjects("sbgemv.c" "BGEMM" "bgemv" ${CBLAS_FLAG} "" "" true "BFLOAT16")
|
||||
GenerateNamedObjects("sbgemv.c" "" "sbgemv" ${CBLAS_FLAG} "" "" true "BFLOAT16")
|
||||
GenerateNamedObjects("tobf16.c" "SINGLE_PREC" "sbstobf16" ${CBLAS_FLAG} "" "" true "BFLOAT16")
|
||||
GenerateNamedObjects("tobf16.c" "DOUBLE_PREC" "sbdtobf16" ${CBLAS_FLAG} "" "" true "BFLOAT16")
|
||||
GenerateNamedObjects("bf16to.c" "SINGLE_PREC" "sbf16tos" ${CBLAS_FLAG} "" "" true "BFLOAT16")
|
||||
GenerateNamedObjects("bf16to.c" "DOUBLE_PREC" "dbf16tod" ${CBLAS_FLAG} "" "" true "BFLOAT16")
|
||||
if(CBLAS_FLAG EQUAL 1)
|
||||
GenerateNamedObjects("gemm_batch.c" "" "sbgemm_batch" ${CBLAS_FLAG} "" "" true "BFLOAT16")
|
||||
endif ()
|
||||
if (BUILD_HFLOAT16)
|
||||
GenerateNamedObjects("gemm.c" "" "shgemm" ${CBLAS_FLAG} "" "" true "HFLOAT16")
|
||||
endif ()
|
||||
|
||||
# complex-specific sources
|
||||
@@ -164,9 +193,7 @@ foreach (float_type ${FLOAT_TYPES})
|
||||
GenerateNamedObjects("max.c" "USE_ABS" "scamax" ${CBLAS_FLAG} "" "" true "COMPLEX")
|
||||
GenerateNamedObjects("asum.c" "" "scasum" ${CBLAS_FLAG} "" "" true "COMPLEX")
|
||||
GenerateNamedObjects("sum.c" "" "scsum" ${CBLAS_FLAG} "" "" true "COMPLEX")
|
||||
if(CBLAS_FLAG EQUAL 1)
|
||||
GenerateNamedObjects("gemm_batch.c" "" "cgemm_batch" ${CBLAS_FLAG} "" "" true "COMPLEX")
|
||||
endif ()
|
||||
GenerateNamedObjects("gemm_batch.c" "" "cgemm_batch" ${CBLAS_FLAG} "" "" true "COMPLEX")
|
||||
endif ()
|
||||
if (${float_type} STREQUAL "ZCOMPLEX")
|
||||
GenerateNamedObjects("zscal.c" "SSCAL" "dscal" ${CBLAS_FLAG} "" "" false "ZCOMPLEX")
|
||||
@@ -176,9 +203,7 @@ foreach (float_type ${FLOAT_TYPES})
|
||||
GenerateNamedObjects("max.c" "USE_ABS" "dzamax" ${CBLAS_FLAG} "" "" true "ZCOMPLEX")
|
||||
GenerateNamedObjects("asum.c" "" "dzasum" ${CBLAS_FLAG} "" "" true "ZCOMPLEX")
|
||||
GenerateNamedObjects("sum.c" "" "dzsum" ${CBLAS_FLAG} "" "" true "ZCOMPLEX")
|
||||
if(CBLAS_FLAG EQUAL 1)
|
||||
GenerateNamedObjects("gemm_batch.c" "" "zgemm_batch" ${CBLAS_FLAG} "" "" true "ZCOMPLEX")
|
||||
endif ()
|
||||
GenerateNamedObjects("gemm_batch.c" "" "zgemm_batch" ${CBLAS_FLAG} "" "" true "ZCOMPLEX")
|
||||
endif ()
|
||||
endforeach ()
|
||||
|
||||
@@ -218,6 +243,7 @@ if (NOT NO_LAPACK)
|
||||
GenerateNamedObjects("lapack/lauu2.c" "" "" 0 "" "" 0 3)
|
||||
GenerateNamedObjects("lapack/trti2.c" "" "" 0 "" "" 0 3)
|
||||
endif()
|
||||
GenerateNamedObjects("lapack/laed3.c" "" "" 0 "" "" 0 1)
|
||||
endif ()
|
||||
|
||||
if ( BUILD_COMPLEX AND NOT BUILD_SINGLE)
|
||||
@@ -228,7 +254,7 @@ if ( BUILD_COMPLEX AND NOT BUILD_SINGLE)
|
||||
GenerateNamedObjects("nrm2.c" "" "nrm2" 0 "" "" false "SINGLE")
|
||||
GenerateNamedObjects("gemv.c" "" "gemv" 0 "" "" false "SINGLE")
|
||||
GenerateNamedObjects("gemm.c" "" "gemm" 0 "" "" false "SINGLE")
|
||||
GenerateNamedObjects("gemm_batch.c" "" "gemm_batch" 1 "" "" false "SINGLE")
|
||||
GenerateNamedObjects("gemm_batch.c" "" "gemm_batch" 0 "" "" false "SINGLE")
|
||||
GenerateNamedObjects("asum.c" "" "asum" 0 "" "" false "SINGLE")
|
||||
GenerateNamedObjects("swap.c" "" "swap" 0 "" "" false "SINGLE")
|
||||
GenerateNamedObjects("axpy.c" "" "axpy" 0 "" "" false "SINGLE")
|
||||
@@ -242,13 +268,18 @@ if ( BUILD_COMPLEX16 AND NOT BUILD_DOUBLE)
|
||||
GenerateNamedObjects("nrm2.c" "" "nrm2" 0 "" "" false "DOUBLE")
|
||||
GenerateNamedObjects("gemv.c" "" "gemv" 0 "" "" false "DOUBLE")
|
||||
GenerateNamedObjects("gemm.c" "" "gemm" 0 "" "" false "DOUBLE")
|
||||
GenerateNamedObjects("gemm_batch.c" "" "gemm_batch" 1 "" "" false "DOUBLE")
|
||||
GenerateNamedObjects("gemm_batch.c" "" "gemm_batch" 0 "" "" false "DOUBLE")
|
||||
GenerateNamedObjects("asum.c" "" "asum" 0 "" "" false "DOUBLE")
|
||||
GenerateNamedObjects("swap.c" "" "swap" 0 "" "" false "DOUBLE")
|
||||
GenerateNamedObjects("axpy.c" "" "axpy" 0 "" "" false "DOUBLE")
|
||||
GenerateNamedObjects("imax.c" "USE_ABS" "i*amax" 0 "" "" false "DOUBLE")
|
||||
endif ()
|
||||
|
||||
if ( BUILD_BFLOAT16 AND NO_FBLAS )
|
||||
GenerateNamedObjects("tobf16.c" "SINGLE_PREC" "sbstobf16" 0 "" "" true "BFLOAT16")
|
||||
GenerateNamedObjects("bf16to.c" "SINGLE_PREC" "sbf16tos" 0 "" "" true "BFLOAT16")
|
||||
endif()
|
||||
|
||||
add_library(interface OBJECT ${OPENBLAS_SRC})
|
||||
|
||||
if (USE_OPENMP)
|
||||
|
||||
+110
-12
@@ -1,3 +1,31 @@
|
||||
###############################################################################
|
||||
# Copyright (c) 2025, The OpenBLAS Project
|
||||
# All rights reserved.
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name of the OpenBLAS project nor the names of
|
||||
# its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
###############################################################################
|
||||
|
||||
TOPDIR = ..
|
||||
include $(TOPDIR)/Makefile.system
|
||||
|
||||
@@ -44,15 +72,23 @@ SBLAS3OBJS = \
|
||||
sgemm.$(SUFFIX) ssymm.$(SUFFIX) strmm.$(SUFFIX) \
|
||||
strsm.$(SUFFIX) ssyrk.$(SUFFIX) ssyr2k.$(SUFFIX) \
|
||||
somatcopy.$(SUFFIX) simatcopy.$(SUFFIX)\
|
||||
sgeadd.$(SUFFIX) sgemmt.$(SUFFIX) sgemmtr.$(SUFFIX)
|
||||
sgeadd.$(SUFFIX) sgemmt.$(SUFFIX) sgemmtr.$(SUFFIX) \
|
||||
sgemm_batch.$(SUFFIX)
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16),1)
|
||||
BBLAS3OBJS = bgemm.$(SUFFIX)
|
||||
BBLAS2OBJS = bgemv.$(SUFFIX)
|
||||
BBLAS1OBJS = bscal.$(SUFFIX)
|
||||
SBBLAS1OBJS = sbdot.$(SUFFIX)
|
||||
SBBLAS2OBJS = sbgemv.$(SUFFIX)
|
||||
SBBLAS3OBJS = sbgemm.$(SUFFIX) sbgemmt.$(SUFFIX) sbgemmtr.$(SUFFIX)
|
||||
SBBLAS3OBJS = sbgemm.$(SUFFIX) sbgemmt.$(SUFFIX) sbgemmtr.$(SUFFIX) sbgemm_batch.$(SUFFIX)
|
||||
SBEXTOBJS = sbstobf16.$(SUFFIX) sbdtobf16.$(SUFFIX) sbf16tos.$(SUFFIX) dbf16tod.$(SUFFIX)
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_HFLOAT16),1)
|
||||
SHBLAS3OBJS = shgemm.$(SUFFIX)
|
||||
endif
|
||||
|
||||
DBLAS1OBJS = \
|
||||
daxpy.$(SUFFIX) dswap.$(SUFFIX) \
|
||||
dcopy.$(SUFFIX) dscal.$(SUFFIX) \
|
||||
@@ -76,7 +112,8 @@ DBLAS3OBJS = \
|
||||
dgemm.$(SUFFIX) dsymm.$(SUFFIX) dtrmm.$(SUFFIX) \
|
||||
dtrsm.$(SUFFIX) dsyrk.$(SUFFIX) dsyr2k.$(SUFFIX) \
|
||||
domatcopy.$(SUFFIX) dimatcopy.$(SUFFIX)\
|
||||
dgeadd.$(SUFFIX) dgemmt.$(SUFFIX) dgemmtr.$(SUFFIX)
|
||||
dgeadd.$(SUFFIX) dgemmt.$(SUFFIX) dgemmtr.$(SUFFIX) \
|
||||
dgemm_batch.$(SUFFIX)
|
||||
|
||||
CBLAS1OBJS = \
|
||||
caxpy.$(SUFFIX) caxpyc.$(SUFFIX) cswap.$(SUFFIX) \
|
||||
@@ -105,7 +142,8 @@ CBLAS3OBJS = \
|
||||
ctrsm.$(SUFFIX) csyrk.$(SUFFIX) csyr2k.$(SUFFIX) \
|
||||
chemm.$(SUFFIX) cherk.$(SUFFIX) cher2k.$(SUFFIX) \
|
||||
comatcopy.$(SUFFIX) cimatcopy.$(SUFFIX)\
|
||||
cgeadd.$(SUFFIX) cgemmt.$(SUFFIX) cgemmtr.$(SUFFIX)
|
||||
cgeadd.$(SUFFIX) cgemmt.$(SUFFIX) cgemmtr.$(SUFFIX) \
|
||||
cgemm_batch.$(SUFFIX)
|
||||
|
||||
ZBLAS1OBJS = \
|
||||
zaxpy.$(SUFFIX) zaxpyc.$(SUFFIX) zswap.$(SUFFIX) \
|
||||
@@ -134,7 +172,8 @@ ZBLAS3OBJS = \
|
||||
ztrsm.$(SUFFIX) zsyrk.$(SUFFIX) zsyr2k.$(SUFFIX) \
|
||||
zhemm.$(SUFFIX) zherk.$(SUFFIX) zher2k.$(SUFFIX) \
|
||||
zomatcopy.$(SUFFIX) zimatcopy.$(SUFFIX)\
|
||||
zgeadd.$(SUFFIX) zgemmt.$(SUFFIX) zgemmtr.$(SUFFIX)
|
||||
zgeadd.$(SUFFIX) zgemmt.$(SUFFIX) zgemmtr.$(SUFFIX) \
|
||||
zgemm_batch.$(SUFFIX)
|
||||
|
||||
ifeq ($(SUPPORT_GEMM3M), 1)
|
||||
|
||||
@@ -285,10 +324,20 @@ CSBLAS3OBJS = \
|
||||
cblas_sgeadd.$(SUFFIX) cblas_sgemmt.$(SUFFIX) cblas_sgemmtr.$(SUFFIX) cblas_sgemm_batch.$(SUFFIX)
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16),1)
|
||||
CBBLAS3OBJS = cblas_bgemm.$(SUFFIX)
|
||||
CBBLAS2OBJS = cblas_bgemv.$(SUFFIX)
|
||||
CBBLAS1OBJS = cblas_bscal.$(SUFFIX)
|
||||
CSBBLAS1OBJS = cblas_sbdot.$(SUFFIX)
|
||||
CSBBLAS2OBJS = cblas_sbgemv.$(SUFFIX)
|
||||
CSBBLAS3OBJS = cblas_sbgemm.$(SUFFIX) cblas_sbgemmt.$(SUFFIX) cblas_sbgemmtr.$(SUFFIX) cblas_sbgemm_batch.$(SUFFIX)
|
||||
CSBEXTOBJS = cblas_sbstobf16.$(SUFFIX) cblas_sbdtobf16.$(SUFFIX) cblas_sbf16tos.$(SUFFIX) cblas_dbf16tod.$(SUFFIX)
|
||||
ifeq ($(ONLY_CBLAS),1)
|
||||
CSBEXTOBJS += sbstobf16.$(SUFFIX) sbdtobf16.$(SUFFIX) sbf16tos.$(SUFFIX) dbf16tod.$(SUFFIX)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_HFLOAT16),1)
|
||||
CSHBLAS3OBJS = cblas_shgemm.$(SUFFIX)
|
||||
endif
|
||||
|
||||
CDBLAS1OBJS = \
|
||||
@@ -385,9 +434,13 @@ override CFLAGS += -I.
|
||||
SBLAS1OBJS += $(CSBLAS1OBJS)
|
||||
SBLAS2OBJS += $(CSBLAS2OBJS)
|
||||
SBLAS3OBJS += $(CSBLAS3OBJS)
|
||||
BBLAS3OBJS += $(CBBLAS3OBJS)
|
||||
BBLAS2OBJS += $(CBBLAS2OBJS)
|
||||
BBLAS1OBJS += $(CBBLAS1OBJS)
|
||||
SBBLAS1OBJS += $(CSBBLAS1OBJS)
|
||||
SBBLAS2OBJS += $(CSBBLAS2OBJS)
|
||||
SBBLAS3OBJS += $(CSBBLAS3OBJS)
|
||||
SHBLAS3OBJS += $(CSHBLAS3OBJS)
|
||||
DBLAS1OBJS += $(CDBLAS1OBJS)
|
||||
DBLAS2OBJS += $(CDBLAS2OBJS)
|
||||
DBLAS3OBJS += $(CDBLAS3OBJS)
|
||||
@@ -403,8 +456,10 @@ SBEXTOBJS += $(CSBEXTOBJS)
|
||||
CBAUXOBJS += $(CXERBLAOBJ)
|
||||
endif
|
||||
|
||||
BBLASOBJS = $(BBLAS3OBJS) $(BBLAS2OBJS) $(BBLAS1OBJS)
|
||||
SBLASOBJS = $(SBLAS1OBJS) $(SBLAS2OBJS) $(SBLAS3OBJS)
|
||||
SBBLASOBJS = $(SBBLAS1OBJS) $(SBBLAS2OBJS) $(SBBLAS3OBJS)
|
||||
SHBLASOBJS = $(SHBLAS3OBJS)
|
||||
DBLASOBJS = $(DBLAS1OBJS) $(DBLAS2OBJS) $(DBLAS3OBJS)
|
||||
QBLASOBJS = $(QBLAS1OBJS) $(QBLAS2OBJS) $(QBLAS3OBJS)
|
||||
CBLASOBJS = $(CBLAS1OBJS) $(CBLAS2OBJS) $(CBLAS3OBJS)
|
||||
@@ -419,8 +474,8 @@ XBLASOBJS = $(XBLAS1OBJS) $(XBLAS2OBJS) $(XBLAS3OBJS)
|
||||
SLAPACKOBJS = \
|
||||
sgetrf.$(SUFFIX) sgetrs.$(SUFFIX) spotrf.$(SUFFIX) sgetf2.$(SUFFIX) \
|
||||
spotf2.$(SUFFIX) slaswp.$(SUFFIX) sgesv.$(SUFFIX) slauu2.$(SUFFIX) \
|
||||
slauum.$(SUFFIX) strti2.$(SUFFIX) strtri.$(SUFFIX) strtrs.$(SUFFIX)
|
||||
|
||||
slauum.$(SUFFIX) strti2.$(SUFFIX) strtri.$(SUFFIX) strtrs.$(SUFFIX) \
|
||||
slaed3.$(SUFFIX)
|
||||
|
||||
#DLAPACKOBJS = \
|
||||
# dgetrf.$(SUFFIX) dgetrs.$(SUFFIX) dpotrf.$(SUFFIX) dgetf2.$(SUFFIX) \
|
||||
@@ -430,8 +485,8 @@ SLAPACKOBJS = \
|
||||
DLAPACKOBJS = \
|
||||
dgetrf.$(SUFFIX) dgetrs.$(SUFFIX) dpotrf.$(SUFFIX) dgetf2.$(SUFFIX) \
|
||||
dpotf2.$(SUFFIX) dlaswp.$(SUFFIX) dgesv.$(SUFFIX) dlauu2.$(SUFFIX) \
|
||||
dlauum.$(SUFFIX) dtrti2.$(SUFFIX) dtrtri.$(SUFFIX) dtrtrs.$(SUFFIX)
|
||||
|
||||
dlauum.$(SUFFIX) dtrti2.$(SUFFIX) dtrtri.$(SUFFIX) dtrtrs.$(SUFFIX) \
|
||||
dlaed3.$(SUFFIX)
|
||||
|
||||
QLAPACKOBJS = \
|
||||
qgetf2.$(SUFFIX) qgetrf.$(SUFFIX) qlauu2.$(SUFFIX) qlauum.$(SUFFIX) \
|
||||
@@ -512,7 +567,7 @@ ifneq ($(BUILD_COMPLEX16),1)
|
||||
ZBLASOBJS=
|
||||
endif
|
||||
|
||||
FUNCOBJS = $(SBEXTOBJS) $(CXERBLAOBJS) $(SBBLASOBJS) $(SBLASOBJS) $(DBLASOBJS) $(CBLASOBJS) $(ZBLASOBJS)
|
||||
FUNCOBJS = $(SBEXTOBJS) $(CXERBLAOBJS) $(BBLASOBJS) $(SBBLASOBJS) $(SBLASOBJS) $(DBLASOBJS) $(CBLASOBJS) $(ZBLASOBJS) $(SHBLASOBJS)
|
||||
|
||||
ifeq ($(EXPRECISION), 1)
|
||||
FUNCOBJS += $(QBLASOBJS) $(XBLASOBJS)
|
||||
@@ -547,10 +602,10 @@ clean ::
|
||||
level1 : $(SBEXTOBJS) $(SBBLAS1OBJS) $(SBLAS1OBJS) $(DBLAS1OBJS) $(QBLAS1OBJS) $(CBLAS1OBJS) $(ZBLAS1OBJS) $(XBLAS1OBJS)
|
||||
$(AR) $(ARFLAGS) -ru $(TOPDIR)/$(LIBNAME) $^
|
||||
|
||||
level2 : $(SBBLAS2OBJS) $(SBLAS2OBJS) $(DBLAS2OBJS) $(QBLAS2OBJS) $(CBLAS2OBJS) $(ZBLAS2OBJS) $(XBLAS2OBJS)
|
||||
level2 : $(SBBLAS2OBJS) $(BBLAS2OBJS) $(SBLAS2OBJS) $(DBLAS2OBJS) $(QBLAS2OBJS) $(CBLAS2OBJS) $(ZBLAS2OBJS) $(XBLAS2OBJS)
|
||||
$(AR) $(ARFLAGS) -ru $(TOPDIR)/$(LIBNAME) $^
|
||||
|
||||
level3 : $(SBBLAS3OBJS) $(SBLAS3OBJS) $(DBLAS3OBJS) $(QBLAS3OBJS) $(CBLAS3OBJS) $(ZBLAS3OBJS) $(XBLAS3OBJS)
|
||||
level3 : $(SBBLAS3OBJS) $(BBLAS3OBJ) $(SBLAS3OBJS) $(DBLAS3OBJS) $(QBLAS3OBJS) $(CBLAS3OBJS) $(ZBLAS3OBJS) $(XBLAS3OBJS) $(SHBLAS3OBJS)
|
||||
$(AR) $(ARFLAGS) -ru $(TOPDIR)/$(LIBNAME) $^
|
||||
|
||||
aux : $(CBAUXOBJS)
|
||||
@@ -782,6 +837,8 @@ dsdot.$(SUFFIX) dsdot.$(PSUFFIX) : dsdot.c
|
||||
$(CC) $(CFLAGS) -c $< -o $(@F)
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16),1)
|
||||
bscal.$(SUFFIX) bscal.$(PSUFFIX) : scal.c
|
||||
$(CC) $(CFLAGS) -DBGEMM -c $< -o $(@F)
|
||||
sbdot.$(SUFFIX) sbdot.$(PSUFFIX) : bf16dot.c
|
||||
$(CC) $(CFLAGS) -c $< -o $(@F)
|
||||
sbstobf16.$(SUFFIX) sbstobf16.$(PSUFFIX) : tobf16.c
|
||||
@@ -939,6 +996,8 @@ xgerc.$(SUFFIX) xgerc.$(PSUFFIX) : zger.c
|
||||
$(CC) -c $(CFLAGS) -DCONJ $< -o $(@F)
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16),1)
|
||||
bgemv.$(SUFFIX) bgemv.$(PSUFFIX) : sbgemv.c
|
||||
$(CC) $(CFLAGS) -DBGEMM -c $< -o $(@F)
|
||||
sbgemv.$(SUFFIX) sbgemv.$(PSUFFIX) : sbgemv.c
|
||||
$(CC) $(CFLAGS) -c $< -o $(@F)
|
||||
endif
|
||||
@@ -1301,6 +1360,8 @@ xhpr2.$(SUFFIX) xhpr2.$(PSUFFIX) : zhpr2.c
|
||||
$(CC) -c $(CFLAGS) $< -o $(@F)
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16),1)
|
||||
bgemm.$(SUFFIX) bgemm.$(PSUFFIX) : gemm.c ../param.h
|
||||
$(CC) -c $(CFLAGS) $< -o $(@F)
|
||||
sbgemm.$(SUFFIX) sbgemm.$(PSUFFIX) : gemm.c ../param.h
|
||||
$(CC) -c $(CFLAGS) $< -o $(@F)
|
||||
sbgemmt.$(SUFFIX) sbgemmt.$(PSUFFIX) : sbgemmt.c ../param.h
|
||||
@@ -1309,6 +1370,11 @@ sbgemmtr.$(SUFFIX) sbgemmtr.$(PSUFFIX) : sbgemmt.c ../param.h
|
||||
$(CC) -c $(CFLAGS) -DRNAME $< -o $(@F)
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_HFLOAT16),1)
|
||||
shgemm.$(SUFFIX) shgemm.$(PSUFFIX) : gemm.c ../param.h
|
||||
$(CC) -c $(CFLAGS) $< -o $(@F)
|
||||
endif
|
||||
|
||||
sgemm.$(SUFFIX) sgemm.$(PSUFFIX) : gemm.c ../param.h
|
||||
$(CC) -c $(CFLAGS) $< -o $(@F)
|
||||
|
||||
@@ -1604,6 +1670,8 @@ cblas_dsdot.$(SUFFIX) cblas_dsdot.$(PSUFFIX) : dsdot.c
|
||||
$(CC) $(CFLAGS) -DCBLAS -c $< -o $(@F)
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16),1)
|
||||
cblas_bscal.$(SUFFIX) cblas_bscal.$(PSUFFIX) : scal.c
|
||||
$(CC) $(CFLAGS) -DCBLAS -c $< -o $(@F)
|
||||
cblas_sbdot.$(SUFFIX) cblas_sbdot.$(PSUFFIX) : bf16dot.c
|
||||
$(CC) $(CFLAGS) -DCBLAS -c $< -o $(@F)
|
||||
cblas_sbstobf16.$(SUFFIX) cblas_sbstobf16.$(PSUFFIX) : tobf16.c
|
||||
@@ -1758,6 +1826,8 @@ cblas_zdrot.$(SUFFIX) cblas_zdrot.$(PSUFFIX) : zrot.c
|
||||
$(CC) $(CFLAGS) -DCBLAS -c $< -o $(@F)
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16),1)
|
||||
cblas_bgemv.$(SUFFIX) cblas_bgemv.$(PSUFFIX) : sbgemv.c
|
||||
$(CC) -DCBLAS -DBGEMM -c $(CFLAGS) $< -o $(@F)
|
||||
cblas_sbgemv.$(SUFFIX) cblas_sbgemv.$(PSUFFIX) : sbgemv.c
|
||||
$(CC) -DCBLAS -c $(CFLAGS) $< -o $(@F)
|
||||
endif
|
||||
@@ -1964,10 +2034,17 @@ cblas_sgemm.$(SUFFIX) cblas_sgemm.$(PSUFFIX) : gemm.c ../param.h
|
||||
$(CC) -DCBLAS -c $(CFLAGS) $< -o $(@F)
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16),1)
|
||||
cblas_bgemm.$(SUFFIX) cblas_bgemm.$(PSUFFIX) : gemm.c ../param.h
|
||||
$(CC) -DCBLAS -DBGEMM -c $(CFLAGS) $< -o $(@F)
|
||||
cblas_sbgemm.$(SUFFIX) cblas_sbgemm.$(PSUFFIX) : gemm.c ../param.h
|
||||
$(CC) -DCBLAS -c $(CFLAGS) $< -o $(@F)
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_HFLOAT16),1)
|
||||
cblas_shgemm.$(SUFFIX) cblas_shgemm.$(PSUFFIX) : gemm.c ../param.h
|
||||
$(CC) -DCBLAS -c $(CFLAGS) $< -o $(@F)
|
||||
endif
|
||||
|
||||
cblas_dgemm.$(SUFFIX) cblas_dgemm.$(PSUFFIX) : gemm.c ../param.h
|
||||
$(CC) -DCBLAS -c $(CFLAGS) $< -o $(@F)
|
||||
|
||||
@@ -2345,6 +2422,11 @@ zlarf.$(SUFFIX) zlarf.$(PSUFFIX) : larf.c
|
||||
xlarf.$(SUFFIX) xlarf.$(PSUFFIX) : larf.c
|
||||
$(CC) -c $(CFLAGS) $< -o $(@F)
|
||||
|
||||
slaed3.$(SUFFIX) slaed3.$(PSUFFIX) : lapack/laed3.c
|
||||
$(CC) -c $(CFLAGS) $< -o $(@F)
|
||||
|
||||
dlaed3.$(SUFFIX) dlaed3.$(PSUFFIX) : lapack/laed3.c
|
||||
$(CC) -c $(CFLAGS) $< -o $(@F)
|
||||
|
||||
############# BLAS EXTENSIONS #####################################
|
||||
|
||||
@@ -2461,3 +2543,19 @@ cblas_cgemm_batch.$(SUFFIX) cblas_cgemm_batch.$(PSUFFIX) : gemm_batch.c ../param
|
||||
|
||||
cblas_zgemm_batch.$(SUFFIX) cblas_zgemm_batch.$(PSUFFIX) : gemm_batch.c ../param.h
|
||||
$(CC) -c $(CFLAGS) -DCBLAS $< -o $(@F)
|
||||
|
||||
sbgemm_batch.$(SUFFIX) sbgemm_batch.$(PSUFFIX) : gemm_batch.c ../param.h
|
||||
$(CC) -c $(CFLAGS) -UCBLAS $< -o $(@F)
|
||||
|
||||
sgemm_batch.$(SUFFIX) sgemm_batch.$(PSUFFIX) : gemm_batch.c ../param.h
|
||||
$(CC) -c $(CFLAGS) -UCBLAS $< -o $(@F)
|
||||
|
||||
dgemm_batch.$(SUFFIX) dgemm_batch.$(PSUFFIX) : gemm_batch.c ../param.h
|
||||
$(CC) -c $(CFLAGS) -UCBLAS $< -o $(@F)
|
||||
|
||||
cgemm_batch.$(SUFFIX) cgemm_batch.$(PSUFFIX) : gemm_batch.c ../param.h
|
||||
$(CC) -c $(CFLAGS) -UCBLAS $< -o $(@F)
|
||||
|
||||
zgemm_batch.$(SUFFIX) zgemm_batch.$(PSUFFIX) : gemm_batch.c ../param.h
|
||||
$(CC) -c $(CFLAGS) -UCBLAS $< -o $(@F)
|
||||
|
||||
|
||||
+24
-11
@@ -54,8 +54,15 @@
|
||||
#define ERROR_NAME "DGEMM "
|
||||
#define GEMV BLASFUNC(dgemv)
|
||||
#elif defined(BFLOAT16)
|
||||
#ifdef BGEMM
|
||||
#define ERROR_NAME "BGEMM "
|
||||
#define GEMV BLASFUNC(bgemv)
|
||||
#else
|
||||
#define ERROR_NAME "SBGEMM "
|
||||
#define GEMV BLASFUNC(sbgemv)
|
||||
#endif
|
||||
#elif defined(HFLOAT16)
|
||||
#define ERROR_NAME "SHGEMM "
|
||||
#else
|
||||
#define ERROR_NAME "SGEMM "
|
||||
#define GEMV BLASFUNC(sgemv)
|
||||
@@ -111,7 +118,7 @@ static int (*gemm[])(blas_arg_t *, BLASLONG *, BLASLONG *, IFLOAT *, IFLOAT *, B
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined(SMALL_MATRIX_OPT) && !defined(GEMM3M) && !defined(XDOUBLE)
|
||||
#if defined(SMALL_MATRIX_OPT) && !defined(GEMM3M) && !defined(XDOUBLE) && !defined(HFLOAT16) && !defined(BGEMM)
|
||||
#define USE_SMALL_MATRIX_OPT 1
|
||||
#else
|
||||
#define USE_SMALL_MATRIX_OPT 0
|
||||
@@ -219,11 +226,11 @@ static inline int get_gemm_optimal_nthreads_neoversev2(double MNK, int ncpu) {
|
||||
|
||||
static inline int get_gemm_optimal_nthreads(double MNK) {
|
||||
int ncpu = num_cpu_avail(3);
|
||||
#if defined(NEOVERSEV1) && !defined(COMPLEX) && !defined(DOUBLE) && !defined(BFLOAT16)
|
||||
#if defined(NEOVERSEV1) && !defined(COMPLEX) && !defined(DOUBLE) && !defined(BFLOAT16) && !defined(HFLOAT16)
|
||||
return get_gemm_optimal_nthreads_neoversev1(MNK, ncpu);
|
||||
#elif defined(NEOVERSEV2) && !defined(COMPLEX) && !defined(DOUBLE) && !defined(BFLOAT16)
|
||||
#elif defined(NEOVERSEV2) && !defined(COMPLEX) && !defined(DOUBLE) && !defined(BFLOAT16) && !defined(HFLOAT16)
|
||||
return get_gemm_optimal_nthreads_neoversev2(MNK, ncpu);
|
||||
#elif defined(DYNAMIC_ARCH) && !defined(COMPLEX) && !defined(DOUBLE) && !defined(BFLOAT16)
|
||||
#elif defined(DYNAMIC_ARCH) && !defined(COMPLEX) && !defined(DOUBLE) && !defined(BFLOAT16) && !defined(HFLOAT16)
|
||||
if (strcmp(gotoblas_corename(), "neoversev1") == 0) {
|
||||
return get_gemm_optimal_nthreads_neoversev1(MNK, ncpu);
|
||||
}
|
||||
@@ -417,21 +424,27 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_TRANSPOSE TransA, enum CBLAS_TRANS
|
||||
|
||||
PRINT_DEBUG_CNAME;
|
||||
|
||||
#if !defined(COMPLEX) && !defined(DOUBLE) && !defined(BFLOAT16) && defined(USE_SGEMM_KERNEL_DIRECT)
|
||||
#if defined(DYNAMIC_ARCH) && defined(ARCH_x86)
|
||||
if (support_avx512() )
|
||||
#if !defined(COMPLEX) && !defined(DOUBLE) && !defined(BFLOAT16) && !defined(HFLOAT16)
|
||||
#if defined(ARCH_x86) && (defined(USE_SGEMM_KERNEL_DIRECT)||defined(DYNAMIC_ARCH))
|
||||
#if defined(DYNAMIC_ARCH)
|
||||
if (support_avx512() )
|
||||
#endif
|
||||
if (beta == 0 && alpha == 1.0 && order == CblasRowMajor && TransA == CblasNoTrans && TransB == CblasNoTrans && SGEMM_DIRECT_PERFORMANT(m,n,k)) {
|
||||
SGEMM_DIRECT(m, n, k, a, lda, b, ldb, c, ldc);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#if defined(DYNAMIC_ARCH) && defined(ARCH_ARM64)
|
||||
if (support_sme1()){
|
||||
#if defined(ARCH_ARM64) && (defined(USE_SGEMM_KERNEL_DIRECT)||defined(DYNAMIC_ARCH))
|
||||
#if defined(DYNAMIC_ARCH)
|
||||
if (support_sme1())
|
||||
#endif
|
||||
if (beta == 0 && alpha == 1.0 && order == CblasRowMajor && TransA == CblasNoTrans && TransB == CblasNoTrans) {
|
||||
SGEMM_DIRECT(m, n, k, a, lda, b, ldb, c, ldc);
|
||||
return;
|
||||
}else if (order == CblasRowMajor && TransA == CblasNoTrans && TransB == CblasNoTrans) {
|
||||
SGEMM_DIRECT_ALPHA_BETA(m, n, k, alpha, a, lda, b, ldb, beta, c, ldc);
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -574,7 +587,7 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_TRANSPOSE TransA, enum CBLAS_TRANS
|
||||
args.m, args.n, args.k, args.lda, args.ldb, args.ldc);
|
||||
#endif
|
||||
|
||||
#if defined(GEMM_GEMV_FORWARD) && !defined(GEMM3M) && !defined(COMPLEX) && (!defined(BFLOAT16) || defined(GEMM_GEMV_FORWARD_BF16))
|
||||
#if defined(GEMM_GEMV_FORWARD) && !defined(GEMM3M) && !defined(COMPLEX) && !defined(HFLOAT16) && (!defined(BFLOAT16) || (!defined(BGEMM) && defined(SBGEMM_GEMV_FORWARD)) || (defined(BGEMM) && defined(BGEMM_GEMV_FORWARD)))
|
||||
#if defined(ARCH_ARM64)
|
||||
// The gemv kernels in arm64/{gemv_n.S,gemv_n_sve.c,gemv_t.S,gemv_t_sve.c}
|
||||
// perform poorly in certain circumstances. We use the following boolean
|
||||
|
||||
+50
-5
@@ -114,6 +114,17 @@ static size_t zgemm_small_kernel_b0[] = {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CBLAS
|
||||
void NAME(char *transa_array, char *transb_array,
|
||||
blasint * m_array, blasint * n_array, blasint * k_array,
|
||||
FLOAT * alpha_array,
|
||||
IFLOAT ** a_array, blasint * lda_array,
|
||||
IFLOAT ** b_array, blasint * ldb_array,
|
||||
FLOAT * beta_array,
|
||||
FLOAT ** c_array, blasint * ldc_array, blasint * gcount, blasint * group_size) {
|
||||
blasint group_count = *gcount;
|
||||
#else
|
||||
|
||||
void CNAME(enum CBLAS_ORDER order, enum CBLAS_TRANSPOSE * transa_array, enum CBLAS_TRANSPOSE * transb_array,
|
||||
blasint * m_array, blasint * n_array, blasint * k_array,
|
||||
#ifndef COMPLEX
|
||||
@@ -134,8 +145,11 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_TRANSPOSE * transa_array, enum CB
|
||||
FLOAT ** a_array=(FLOAT**)va_array;
|
||||
FLOAT ** b_array=(FLOAT**)vb_array;
|
||||
FLOAT ** c_array=(FLOAT**)vc_array;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
BLASLONG group_m, group_n, group_k;
|
||||
BLASLONG group_lda, group_ldb, group_ldc;
|
||||
|
||||
blas_arg_t * args_array=NULL;
|
||||
|
||||
int mode=0, group_mode=0;
|
||||
@@ -148,8 +162,6 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_TRANSPOSE * transa_array, enum CB
|
||||
blasint info;
|
||||
|
||||
void * group_alpha, * group_beta;
|
||||
BLASLONG group_m, group_n, group_k;
|
||||
BLASLONG group_lda, group_ldb, group_ldc;
|
||||
void * group_routine=NULL;
|
||||
#ifdef SMALL_MATRIX_OPT
|
||||
void * group_small_matrix_opt_routine=NULL;
|
||||
@@ -201,7 +213,8 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_TRANSPOSE * transa_array, enum CB
|
||||
group_transa = -1;
|
||||
group_transb = -1;
|
||||
info = 0;
|
||||
|
||||
|
||||
#if defined(CBLAS)
|
||||
if (order == CblasColMajor) {
|
||||
group_m = m_array[i];
|
||||
group_n = n_array[i];
|
||||
@@ -254,7 +267,7 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_TRANSPOSE * transa_array, enum CB
|
||||
group_lda = ldb_array[i];
|
||||
group_ldb = lda_array[i];
|
||||
group_ldc = ldc_array[i];
|
||||
|
||||
|
||||
if (transb_array[i] == CblasNoTrans) group_transa = 0;
|
||||
if (transb_array[i] == CblasTrans) group_transa = 1;
|
||||
#ifndef COMPLEX
|
||||
@@ -273,6 +286,32 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_TRANSPOSE * transa_array, enum CB
|
||||
if (transa_array[i] == CblasConjNoTrans) group_transb = 2;
|
||||
if (transa_array[i] == CblasConjTrans) group_transb = 3;
|
||||
#endif
|
||||
|
||||
#else
|
||||
group_m = m_array[i];
|
||||
group_n = n_array[i];
|
||||
group_k = k_array[i];
|
||||
|
||||
group_lda = lda_array[i];
|
||||
group_ldb = ldb_array[i];
|
||||
group_ldc = ldc_array[i];
|
||||
|
||||
if (transb_array[i] == 'N') group_transa = 0;
|
||||
if (transb_array[i] == 'T') group_transa = 1;
|
||||
#ifndef COMPLEX
|
||||
if (transb_array[i] == 'C') group_transa = 1;
|
||||
#else
|
||||
if (transb_array[i] == 'C') group_transa = 3;
|
||||
#endif
|
||||
if (transa_array[i] == 'N') group_transb = 0;
|
||||
if (transa_array[i] == 'T') group_transb = 1;
|
||||
#ifndef COMPLEX
|
||||
if (transa_array[i] == 'C') group_transb = 1;
|
||||
#else
|
||||
if (transa_array[i] == 'C') group_transb = 3;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
group_nrowa = group_m;
|
||||
if (group_transa & 1) group_nrowa = group_k;
|
||||
group_nrowb = group_k;
|
||||
@@ -288,7 +327,9 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_TRANSPOSE * transa_array, enum CB
|
||||
if (group_m < 0) info = 3;
|
||||
if (group_transb < 0) info = 2;
|
||||
if (group_transa < 0) info = 1;
|
||||
#if defined(CBLAS)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (info >= 0) {
|
||||
BLASFUNC(xerbla)(ERROR_NAME, &info, sizeof(ERROR_NAME));
|
||||
@@ -344,13 +385,17 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_TRANSPOSE * transa_array, enum CB
|
||||
args_array[count].alpha=group_alpha;
|
||||
args_array[count].beta=group_beta;
|
||||
|
||||
#if defined(CBLAS)
|
||||
if (order == CblasColMajor) {
|
||||
args_array[count].a=(a_array[matrix_idx+j]);
|
||||
args_array[count].b=(b_array[matrix_idx+j]);
|
||||
}else if(order == CblasRowMajor){
|
||||
#endif
|
||||
args_array[count].a=(b_array[matrix_idx+j]);
|
||||
args_array[count].b=(a_array[matrix_idx+j]);
|
||||
#if defined(CBLAS)
|
||||
}
|
||||
#endif
|
||||
|
||||
args_array[count].c=(c_array[matrix_idx+j]);
|
||||
|
||||
|
||||
+3
-1
@@ -180,8 +180,10 @@ void CNAME(enum CBLAS_ORDER order,
|
||||
|
||||
#ifdef SMPTEST
|
||||
// Threshold chosen so that speed-up is > 1 on a Xeon E5-2630
|
||||
if(1L * m * n > 2048L * GEMM_MULTITHREAD_THRESHOLD)
|
||||
if(1L * m * n > 20480L * GEMM_MULTITHREAD_THRESHOLD)
|
||||
nthreads = num_cpu_avail(2);
|
||||
else if(1L * m * n > 2048L * GEMM_MULTITHREAD_THRESHOLD)
|
||||
nthreads = MIN(3,num_cpu_avail(2));
|
||||
else
|
||||
nthreads = 1;
|
||||
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
/***************************************************************************
|
||||
Copyright (c) 2025, The OpenBLAS Project
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. Neither the name of the OpenBLAS project nor the names of
|
||||
its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written
|
||||
permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "common.h"
|
||||
|
||||
#if defined(DOUBLE)
|
||||
#define ERROR_NAME "DLAED3"
|
||||
#else
|
||||
#define ERROR_NAME "SLAED3"
|
||||
#endif
|
||||
|
||||
/* ===================================================================== */
|
||||
int NAME(blasint *k, blasint *n, blasint *n1, FLOAT *d,
|
||||
FLOAT *q, blasint *ldq, FLOAT *rho, FLOAT *dlamda,
|
||||
FLOAT *q2, blasint *indx, blasint *ctot, FLOAT *w,
|
||||
FLOAT *s, blasint *Info)
|
||||
{
|
||||
blasint kval, nval, qdim, info;
|
||||
|
||||
qdim = *ldq;
|
||||
kval = *k;
|
||||
nval = *n;
|
||||
|
||||
/* Test the input parameters. */
|
||||
info = 0;
|
||||
if (kval < 0) {
|
||||
info = 1;
|
||||
} else if (nval < kval) {
|
||||
info = 2;
|
||||
} else if (qdim < nval || qdim < 1) {
|
||||
info = 6;
|
||||
}
|
||||
if (info) {
|
||||
BLASFUNC(xerbla)(ERROR_NAME, &info, sizeof(ERROR_NAME) - 1);
|
||||
*Info = - info;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Quick return if possible */
|
||||
|
||||
*Info = 0;
|
||||
if (kval == 0) return 0;
|
||||
|
||||
#ifdef SMP
|
||||
int nthreads = num_cpu_avail(4);
|
||||
|
||||
if (nthreads == 1) {
|
||||
#endif
|
||||
LAED3_SINGLE(k, n, n1, d, q, ldq, rho, dlamda, q2, indx, ctot, w, s, Info);
|
||||
#ifdef SMP
|
||||
} else {
|
||||
LAED3_PARALLEL(k, n, n1, d, q, ldq, rho, dlamda, q2, indx, ctot, w, s, Info);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -127,10 +127,10 @@ int NAME(char *UPLO, char *DIAG, blasint *N, FLOAT *a, blasint *ldA, blasint *In
|
||||
#endif
|
||||
|
||||
#ifdef SMP
|
||||
if (args.n <= 150)
|
||||
args.nthreads = 1;
|
||||
else
|
||||
args.nthreads = num_cpu_avail(4);
|
||||
if (args.n <= 150)
|
||||
args.nthreads = 1;
|
||||
else
|
||||
args.nthreads = num_cpu_avail(4);
|
||||
|
||||
if (args.nthreads == 1) {
|
||||
#endif
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*********************************************************************/
|
||||
/* Copyright 2024, The OpenBLAS Project. */
|
||||
/* Copyright 2024-2025 The OpenBLAS Project. */
|
||||
/* All rights reserved. */
|
||||
/* */
|
||||
/* Redistribution and use in source and binary forms, with or */
|
||||
@@ -305,7 +305,7 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo,
|
||||
#endif
|
||||
int (*gemv[]) (BLASLONG, BLASLONG, FLOAT, IFLOAT *, BLASLONG,
|
||||
IFLOAT *, BLASLONG, FLOAT, FLOAT *, BLASLONG) = {
|
||||
SBGEMV_N, SBGEMV_T,};
|
||||
GEMV_N, GEMV_T,};
|
||||
|
||||
|
||||
if (m == 0)
|
||||
|
||||
+32
-14
@@ -1,4 +1,5 @@
|
||||
/*********************************************************************/
|
||||
/* Copyright 2025 The OpenBLAS Project. */
|
||||
/* Copyright 2009, 2010 The University of Texas at Austin. */
|
||||
/* All rights reserved. */
|
||||
/* */
|
||||
@@ -43,17 +44,25 @@
|
||||
#include "functable.h"
|
||||
#endif
|
||||
|
||||
#ifdef BGEMM
|
||||
#define GEMV_THREAD_N bgemv_thread_n
|
||||
#define GEMV_THREAD_T bgemv_thread_t
|
||||
#define ERROR_NAME "BGEMV "
|
||||
#else
|
||||
#define GEMV_THREAD_N sbgemv_thread_n
|
||||
#define GEMV_THREAD_T sbgemv_thread_t
|
||||
#define ERROR_NAME "SBGEMV "
|
||||
#endif
|
||||
|
||||
#ifdef SMP
|
||||
static int (*sbgemv_thread[])(BLASLONG, BLASLONG, float, bfloat16 *, BLASLONG, bfloat16 * , BLASLONG, float, float *, BLASLONG, int) = {
|
||||
sbgemv_thread_n, sbgemv_thread_t,
|
||||
static int (*gemv_thread[])(BLASLONG, BLASLONG, FLOAT, IFLOAT *, BLASLONG, IFLOAT * , BLASLONG, FLOAT, FLOAT *, BLASLONG, int) = {
|
||||
GEMV_THREAD_N, GEMV_THREAD_T,
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifndef CBLAS
|
||||
|
||||
void NAME(char *TRANS, blasint *M, blasint *N, float *ALPHA, bfloat16 *a, blasint *LDA, bfloat16 *x, blasint *INCX, float *BETA, float *y, blasint *INCY)
|
||||
void NAME(char *TRANS, blasint *M, blasint *N, FLOAT *ALPHA, IFLOAT *a, blasint *LDA, IFLOAT *x, blasint *INCX, FLOAT *BETA, FLOAT *y, blasint *INCY)
|
||||
{
|
||||
char trans = *TRANS;
|
||||
blasint m = *M;
|
||||
@@ -61,14 +70,14 @@ void NAME(char *TRANS, blasint *M, blasint *N, float *ALPHA, bfloat16 *a, blasin
|
||||
blasint lda = *LDA;
|
||||
blasint incx = *INCX;
|
||||
blasint incy = *INCY;
|
||||
float alpha = *ALPHA;
|
||||
float beta = *BETA;
|
||||
FLOAT alpha = *ALPHA;
|
||||
FLOAT beta = *BETA;
|
||||
#ifdef SMP
|
||||
int nthreads;
|
||||
#endif
|
||||
|
||||
int (*sbgemv[])(BLASLONG, BLASLONG, float, bfloat16 *, BLASLONG, bfloat16 * , BLASLONG, float, float *, BLASLONG) = {
|
||||
SBGEMV_N, SBGEMV_T,
|
||||
int (*gemv[])(BLASLONG, BLASLONG, FLOAT, IFLOAT *, BLASLONG, IFLOAT * , BLASLONG, FLOAT, FLOAT *, BLASLONG) = {
|
||||
GEMV_N, GEMV_T,
|
||||
};
|
||||
|
||||
blasint info;
|
||||
@@ -104,7 +113,7 @@ void NAME(char *TRANS, blasint *M, blasint *N, float *ALPHA, bfloat16 *a, blasin
|
||||
|
||||
#else
|
||||
|
||||
void CNAME(enum CBLAS_ORDER order, enum CBLAS_TRANSPOSE TransA, blasint m, blasint n, float alpha, bfloat16 *a, blasint lda, bfloat16 *x, blasint incx, float beta, float *y, blasint incy)
|
||||
void CNAME(enum CBLAS_ORDER order, enum CBLAS_TRANSPOSE TransA, blasint m, blasint n, FLOAT alpha, IFLOAT *a, blasint lda, IFLOAT *x, blasint incx, FLOAT beta, FLOAT *y, blasint incy)
|
||||
{
|
||||
blasint lenx, leny;
|
||||
int trans;
|
||||
@@ -113,8 +122,8 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_TRANSPOSE TransA, blasint m, blasi
|
||||
int nthreads;
|
||||
#endif
|
||||
|
||||
int (*sbgemv[])(BLASLONG, BLASLONG, float, bfloat16 *, BLASLONG, bfloat16 * , BLASLONG, float, float *, BLASLONG) = {
|
||||
SBGEMV_N, SBGEMV_T,
|
||||
int (*gemv[])(BLASLONG, BLASLONG, FLOAT, IFLOAT *, BLASLONG, IFLOAT * , BLASLONG, FLOAT, FLOAT *, BLASLONG) = {
|
||||
GEMV_N, GEMV_T,
|
||||
};
|
||||
|
||||
PRINT_DEBUG_CNAME;
|
||||
@@ -166,8 +175,17 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_TRANSPOSE TransA, blasint m, blasi
|
||||
leny = m;
|
||||
}
|
||||
|
||||
if (alpha == ZERO) {
|
||||
if (beta != ONE) SCAL_K(leny, 0, 0, beta, y, blasabs(incy), NULL, 0, NULL, 0);
|
||||
#ifdef BGEMM
|
||||
float alpha_float, beta_float;
|
||||
SBF16TOS_K(1, &alpha, 1, &alpha_float, 1);
|
||||
SBF16TOS_K(1, &beta, 1, &beta_float, 1);
|
||||
#else
|
||||
float alpha_float = alpha;
|
||||
float beta_float = beta;
|
||||
#endif
|
||||
|
||||
if (alpha_float == ZERO) {
|
||||
if (beta_float != ONE) SCAL_K(leny, 0, 0, beta, y, blasabs(incy), NULL, 0, NULL, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -185,10 +203,10 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_TRANSPOSE TransA, blasint m, blasi
|
||||
|
||||
if (nthreads == 1) {
|
||||
#endif
|
||||
(sbgemv[(int)trans])(m, n, alpha, a, lda, x, incx, beta, y, incy);
|
||||
(gemv[(int)trans])(m, n, alpha, a, lda, x, incx, beta, y, incy);
|
||||
#ifdef SMP
|
||||
} else {
|
||||
(sbgemv_thread[(int)trans])(m, n, alpha, a, lda, x, incx, beta, y, incy, nthreads);
|
||||
(gemv_thread[(int)trans])(m, n, alpha, a, lda, x, incx, beta, y, incy, nthreads);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
+9
-1
@@ -1,4 +1,5 @@
|
||||
/*********************************************************************/
|
||||
/* Copyright 2025 The OpenBLAS Project. */
|
||||
/* Copyright 2009, 2010 The University of Texas at Austin. */
|
||||
/* All rights reserved. */
|
||||
/* */
|
||||
@@ -68,7 +69,14 @@ void CNAME(blasint n, FLOAT alpha, FLOAT *x, blasint incx){
|
||||
|
||||
if (incx <= 0 || n <= 0) return;
|
||||
|
||||
if (alpha == ONE) return;
|
||||
#ifdef BGEMM
|
||||
float alpha_float;
|
||||
SBF16TOS_K(1, &alpha, 1, &alpha_float, 1);
|
||||
#else
|
||||
float alpha_float = alpha;
|
||||
#endif
|
||||
|
||||
if (alpha_float == ONE) return;
|
||||
|
||||
IDEBUG_START;
|
||||
|
||||
|
||||
+4
-1
@@ -219,7 +219,10 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo,
|
||||
|
||||
#ifdef SMP
|
||||
nthreads = num_cpu_avail(2);
|
||||
|
||||
|
||||
if (n < 50 ) nthreads = 1;
|
||||
if (nthreads > 2 && n < 500) nthreads = 2;
|
||||
|
||||
if (nthreads == 1) {
|
||||
#endif
|
||||
|
||||
|
||||
+2
-2
@@ -98,7 +98,7 @@ void CNAME(blasint n, FLOAT alpha_r, void *vx, blasint incx){
|
||||
if (nthreads == 1) {
|
||||
#endif
|
||||
|
||||
SCAL_K(n, 0, 0, alpha[0], alpha[1], x, incx, NULL, 0, NULL, 0);
|
||||
SCAL_K(n, 0, 0, alpha[0], alpha[1], x, incx, NULL, 0, NULL, 1);
|
||||
|
||||
#ifdef SMP
|
||||
} else {
|
||||
@@ -108,7 +108,7 @@ void CNAME(blasint n, FLOAT alpha_r, void *vx, blasint incx){
|
||||
mode = BLAS_SINGLE | BLAS_COMPLEX;
|
||||
#endif
|
||||
|
||||
blas_level1_thread(mode, n, 0, 0, alpha, x, incx, NULL, 0, NULL, 0, (int (*)(void))SCAL_K, nthreads);
|
||||
blas_level1_thread(mode, n, 0, 0, alpha, x, incx, NULL, 0, NULL, 1, (int (*)(void))SCAL_K, nthreads);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
+2
-2
@@ -116,12 +116,12 @@ void NAME(char *UPLO, blasint *N, FLOAT *ALPHA,
|
||||
|
||||
#else
|
||||
|
||||
void CNAME(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, int n, FLOAT alpha, FLOAT *x, int incx, FLOAT *a, int lda) {
|
||||
void CNAME(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, int n, void* valpha, FLOAT *x, int incx, FLOAT *a, int lda) {
|
||||
|
||||
FLOAT *buffer;
|
||||
int uplo;
|
||||
blasint info;
|
||||
FLOAT * ALPHA = α
|
||||
FLOAT * ALPHA = (FLOAT*)valpha;
|
||||
FLOAT alpha_r = ALPHA[0];
|
||||
FLOAT alpha_i = ALPHA[1];
|
||||
#ifdef SMP
|
||||
|
||||
@@ -1,3 +1,30 @@
|
||||
###############################################################################
|
||||
# Copyright (c) 2025, The OpenBLAS Project
|
||||
# All rights reserved.
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name of the OpenBLAS project nor the names of
|
||||
# its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
###############################################################################
|
||||
|
||||
include_directories(${PROJECT_SOURCE_DIR})
|
||||
|
||||
@@ -94,6 +121,7 @@ function (build_core TARGET_CORE KDIR TSUFFIX KERNEL_DEFINITIONS)
|
||||
|
||||
# sbdot
|
||||
if (BUILD_BFLOAT16)
|
||||
GenerateNamedObjects("${KERNELDIR}/${BSCALKERNEL}" "BGEMM" "scal_k" false "" "" false "BFLOAT16")
|
||||
GenerateNamedObjects("${KERNELDIR}/${SBDOTKERNEL}" "SBDOT" "dot_k" false "" "" false "BFLOAT16")
|
||||
GenerateNamedObjects("${KERNELDIR}/${BF16TOKERNEL}" "SINGLE" "f16tos_k" false "" "" false "BFLOAT16")
|
||||
GenerateNamedObjects("${KERNELDIR}/${BF16TOKERNEL}" "DOUBLE" "bf16tod_k" false "" "" false "DOUBLE")
|
||||
@@ -195,6 +223,8 @@ function (build_core TARGET_CORE KDIR TSUFFIX KERNEL_DEFINITIONS)
|
||||
GenerateNamedObjects("${KERNELDIR}/${SGEMVTKERNEL}" "TRANS" "gemv_t" false "" "" false "SINGLE")
|
||||
endif ()
|
||||
if (BUILD_BFLOAT16)
|
||||
GenerateNamedObjects("${KERNELDIR}/${BGEMVNKERNEL}" "BGEMM" "gemv_n" false "" "" false "BFLOAT16")
|
||||
GenerateNamedObjects("${KERNELDIR}/${BGEMVTKERNEL}" "BGEMM" "gemv_t" false "" "" false "BFLOAT16")
|
||||
GenerateNamedObjects("${KERNELDIR}/${SBGEMVNKERNEL}" "" "gemv_n" false "" "" false "BFLOAT16")
|
||||
GenerateNamedObjects("${KERNELDIR}/${SBGEMVTKERNEL}" "" "gemv_t" false "" "" false "BFLOAT16")
|
||||
endif ()
|
||||
@@ -211,6 +241,9 @@ function (build_core TARGET_CORE KDIR TSUFFIX KERNEL_DEFINITIONS)
|
||||
if (X86_64 OR ARM64)
|
||||
set(USE_DIRECT_SGEMM true)
|
||||
endif()
|
||||
if (UC_TARGET_CORE MATCHES ARMV9SME)
|
||||
set (HAVE_SME true)
|
||||
endif ()
|
||||
|
||||
if (USE_DIRECT_SGEMM)
|
||||
# if (NOT DEFINED SGEMMDIRECTKERNEL)
|
||||
@@ -222,9 +255,11 @@ function (build_core TARGET_CORE KDIR TSUFFIX KERNEL_DEFINITIONS)
|
||||
GenerateNamedObjects("${KERNELDIR}/${SGEMMDIRECTPERFORMANT}" "" "gemm_direct_performant" false "" "" false SINGLE)
|
||||
elseif (ARM64)
|
||||
set (SGEMMDIRECTKERNEL sgemm_direct_arm64_sme1.c)
|
||||
set (SGEMMDIRECTKERNEL_ALPHA_BETA sgemm_direct_alpha_beta_arm64_sme1.c)
|
||||
set (SGEMMDIRECTSMEKERNEL sgemm_direct_sme1.S)
|
||||
set (SGEMMDIRECTPREKERNEL sgemm_direct_sme1_preprocess.S)
|
||||
GenerateNamedObjects("${KERNELDIR}/${SGEMMDIRECTKERNEL}" "" "gemm_direct" false "" "" false SINGLE)
|
||||
GenerateNamedObjects("${KERNELDIR}/${SGEMMDIRECTKERNEL_ALPHA_BETA}" "" "gemm_direct_alpha_beta" false "" "" false SINGLE)
|
||||
if (HAVE_SME)
|
||||
GenerateNamedObjects("${KERNELDIR}/${SGEMMDIRECTSMEKERNEL}" "" "gemm_direct_sme1" false "" "" false SINGLE)
|
||||
GenerateNamedObjects("${KERNELDIR}/${SGEMMDIRECTPREKERNEL}" "" "gemm_direct_sme1_preprocess" false "" "" false SINGLE)
|
||||
@@ -336,6 +371,20 @@ function (build_core TARGET_CORE KDIR TSUFFIX KERNEL_DEFINITIONS)
|
||||
endif ()
|
||||
|
||||
if (BUILD_BFLOAT16)
|
||||
if (BGEMMINCOPY)
|
||||
GenerateNamedObjects("${KERNELDIR}/${BGEMMINCOPY}" "BGEMM" "${BGEMMINCOPYOBJ}" false "" "" true "BFLOAT16")
|
||||
endif ()
|
||||
if (BGEMMITCOPY)
|
||||
GenerateNamedObjects("${KERNELDIR}/${BGEMMITCOPY}" "BGEMM" "${BGEMMITCOPYOBJ}" false "" "" true "BFLOAT16")
|
||||
endif ()
|
||||
if (BGEMMONCOPY)
|
||||
GenerateNamedObjects("${KERNELDIR}/${BGEMMONCOPY}" "BGEMM" "${BGEMMONCOPYOBJ}" false "" "" true "BFLOAT16")
|
||||
endif ()
|
||||
if (BGEMMOTCOPY)
|
||||
GenerateNamedObjects("${KERNELDIR}/${BGEMMOTCOPY}" "BGEMM" "${BGEMMOTCOPYOBJ}" false "" "" true "BFLOAT16")
|
||||
endif ()
|
||||
GenerateNamedObjects("${KERNELDIR}/${BGEMMKERNEL}" "BGEMM" "gemm_kernel" false "" "" false "BFLOAT16")
|
||||
GenerateNamedObjects("${KERNELDIR}/${BGEMM_BETA}" "BGEMM" "gemm_beta" false "" "" false "BFLOAT16")
|
||||
if (SBGEMMINCOPY)
|
||||
GenerateNamedObjects("${KERNELDIR}/${SBGEMMINCOPY}" "" "${SBGEMMINCOPYOBJ}" false "" "" true "BFLOAT16")
|
||||
endif ()
|
||||
@@ -351,6 +400,22 @@ function (build_core TARGET_CORE KDIR TSUFFIX KERNEL_DEFINITIONS)
|
||||
GenerateNamedObjects("${KERNELDIR}/${SBGEMMKERNEL}" "" "gemm_kernel" false "" "" false "BFLOAT16")
|
||||
GenerateNamedObjects("${KERNELDIR}/${SBGEMM_BETA}" "" "gemm_beta" false "" "" false "BFLOAT16")
|
||||
endif ()
|
||||
if (BUILD_HFLOAT16)
|
||||
if (SHGEMMINCOPY)
|
||||
GenerateNamedObjects("${KERNELDIR}/${SHGEMMINCOPY}" "" "${SHGEMMINCOPYOBJ}" false "" "" true "HFLOAT16")
|
||||
endif ()
|
||||
if (SHGEMMITCOPY)
|
||||
GenerateNamedObjects("${KERNELDIR}/${SHGEMMITCOPY}" "" "${SHGEMMITCOPYOBJ}" false "" "" true "HFLOAT16")
|
||||
endif ()
|
||||
if (SHGEMMONCOPY)
|
||||
GenerateNamedObjects("${KERNELDIR}/${SHGEMMONCOPY}" "" "${SHGEMMONCOPYOBJ}" false "" "" true "HFLOAT16")
|
||||
endif ()
|
||||
if (SHGEMMOTCOPY)
|
||||
GenerateNamedObjects("${KERNELDIR}/${SHGEMMOTCOPY}" "" "${SHGEMMOTCOPYOBJ}" false "" "" true "HFLOAT16")
|
||||
endif ()
|
||||
GenerateNamedObjects("${KERNELDIR}/${SHGEMMKERNEL}" "" "gemm_kernel" false "" "" false "HFLOAT16")
|
||||
GenerateNamedObjects("${KERNELDIR}/${SHGEMM_BETA}" "" "gemm_beta" false "" "" false "HFLOAT16")
|
||||
endif ()
|
||||
foreach (float_type ${FLOAT_TYPES})
|
||||
string(SUBSTRING ${float_type} 0 1 float_char)
|
||||
if (${float_char}GEMMINCOPY)
|
||||
@@ -769,6 +834,45 @@ endif ()
|
||||
GenerateNamedObjects("${KERNELDIR}/${SBGEMM_SMALL_K_B0_TN}" "B0" "gemm_small_kernel_b0_tn" false "" "" false "BFLOAT16")
|
||||
GenerateNamedObjects("${KERNELDIR}/${SBGEMM_SMALL_K_B0_TT}" "B0" "gemm_small_kernel_b0_tt" false "" "" false "BFLOAT16")
|
||||
endif ()
|
||||
|
||||
if (BUILD_HFLOAT16)
|
||||
if (NOT DEFINED SHGEMM_SMALL_M_PERMIT)
|
||||
set(SHGEMM_SMALL_M_PERMIT ../generic/gemm_small_matrix_permit.c)
|
||||
endif ()
|
||||
if (NOT DEFINED SHGEMM_SMALL_K_NN)
|
||||
set(SHGEMM_SMALL_K_NN ../generic/gemm_small_matrix_kernel_nn.c)
|
||||
endif ()
|
||||
if (NOT DEFINED SHGEMM_SMALL_K_NT)
|
||||
set(SHGEMM_SMALL_K_NT ../generic/gemm_small_matrix_kernel_nt.c)
|
||||
endif ()
|
||||
if (NOT DEFINED SHGEMM_SMALL_K_TN)
|
||||
set(SHGEMM_SMALL_K_TN ../generic/gemm_small_matrix_kernel_tn.c)
|
||||
endif ()
|
||||
if (NOT DEFINED SHGEMM_SMALL_K_TT)
|
||||
set(SHGEMM_SMALL_K_TT ../generic/gemm_small_matrix_kernel_tt.c)
|
||||
endif ()
|
||||
if (NOT DEFINED SHGEMM_SMALL_K_B0_NN)
|
||||
set(SHGEMM_SMALL_K_B0_NN ../generic/gemm_small_matrix_kernel_nn.c)
|
||||
endif ()
|
||||
if (NOT DEFINED SHGEMM_SMALL_K_B0_NT)
|
||||
set(SHGEMM_SMALL_K_B0_NT ../generic/gemm_small_matrix_kernel_nt.c)
|
||||
endif ()
|
||||
if (NOT DEFINED SHGEMM_SMALL_K_B0_TN)
|
||||
set(SHGEMM_SMALL_K_B0_TN ../generic/gemm_small_matrix_kernel_tn.c)
|
||||
endif ()
|
||||
if (NOT DEFINED SHGEMM_SMALL_K_B0_TT)
|
||||
set(SHGEMM_SMALL_K_B0_TT ../generic/gemm_small_matrix_kernel_tt.c)
|
||||
endif ()
|
||||
GenerateNamedObjects("${KERNELDIR}/${SHGEMM_SMALL_M_PERMIT}" "" "gemm_small_matrix_permit" false "" "" false "HFLOAT16")
|
||||
GenerateNamedObjects("${KERNELDIR}/${SHGEMM_SMALL_K_NN}" "" "gemm_small_kernel_nn" false "" "" false "HFLOAT16")
|
||||
GenerateNamedObjects("${KERNELDIR}/${SHGEMM_SMALL_K_NT}" "" "gemm_small_kernel_nt" false "" "" false "HFLOAT16")
|
||||
GenerateNamedObjects("${KERNELDIR}/${SHGEMM_SMALL_K_TN}" "" "gemm_small_kernel_tn" false "" "" false "HFLOAT16")
|
||||
GenerateNamedObjects("${KERNELDIR}/${SHGEMM_SMALL_K_TT}" "" "gemm_small_kernel_tt" false "" "" false "HFLOAT16")
|
||||
GenerateNamedObjects("${KERNELDIR}/${SHGEMM_SMALL_K_B0_NN}" "B0" "gemm_small_kernel_b0_nn" false "" "" false "HFLOAT16")
|
||||
GenerateNamedObjects("${KERNELDIR}/${SHGEMM_SMALL_K_B0_NT}" "B0" "gemm_small_kernel_b0_nt" false "" "" false "HFLOAT16")
|
||||
GenerateNamedObjects("${KERNELDIR}/${SHGEMM_SMALL_K_B0_TN}" "B0" "gemm_small_kernel_b0_tn" false "" "" false "HFLOAT16")
|
||||
GenerateNamedObjects("${KERNELDIR}/${SHGEMM_SMALL_K_B0_TT}" "B0" "gemm_small_kernel_b0_tt" false "" "" false "HFLOAT16")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (NOT DEFINED ${float_char}OMATCOPY_CN)
|
||||
|
||||
@@ -1,3 +1,31 @@
|
||||
###############################################################################
|
||||
# Copyright (c) 2025 The OpenBLAS Project
|
||||
# All rights reserved.
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name of the OpenBLAS project nor the names of
|
||||
# its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
###############################################################################
|
||||
|
||||
FMAFLAG=
|
||||
ifndef OLDGCC
|
||||
ifdef HAVE_FMA3
|
||||
@@ -271,6 +299,10 @@ XDOTKERNEL = zdot.S
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16),1)
|
||||
ifndef BSCALKERNEL
|
||||
BSCALKERNEL = ../generic/scal.c
|
||||
endif
|
||||
|
||||
ifndef SBDOTKERNEL
|
||||
SBDOTKERNEL = ../x86_64/sbdot.c
|
||||
endif
|
||||
@@ -551,6 +583,8 @@ XBLASOBJS += \
|
||||
xscal_k$(TSUFFIX).$(SUFFIX) xswap_k$(TSUFFIX).$(SUFFIX) xsum_k$(TSUFFIX).$(SUFFIX)
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16),1)
|
||||
BBLASOBJS += \
|
||||
bscal_k$(TSUFFIX).$(SUFFIX)
|
||||
SBBLASOBJS += \
|
||||
sbdot_k$(TSUFFIX).$(SUFFIX)
|
||||
SBEXTOBJS += \
|
||||
@@ -778,6 +812,8 @@ $(KDIR)qdot_k$(TSUFFIX).$(SUFFIX) $(KDIR)qdot_k$(TPSUFFIX).$(PSUFFIX) : $(KERNEL
|
||||
$(CC) -c $(CFLAGS) -UCOMPLEX -DXDOUBLE $< -o $@
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16),1)
|
||||
$(KDIR)bscal_k$(TSUFFIX).$(SUFFIX) $(KDIR)bscal_k$(TPSUFFIX).$(PSUFFIX) : $(KERNELDIR)/$(BSCALKERNEL)
|
||||
$(CC) -c $(CFLAGS) -UCOMPLEX -UDOUBLE $< -o $@
|
||||
$(KDIR)sbdot_k$(TSUFFIX).$(SUFFIX) $(KDIR)sbdot_k$(TPSUFFIX).$(PSUFFIX) : $(KERNELDIR)/$(SBDOTKERNEL)
|
||||
$(CC) -c $(CFLAGS) -UCOMPLEX $< -o $@
|
||||
$(KDIR)sbstobf16_k$(TSUFFIX).$(SUFFIX) : $(KERNELDIR)/$(TOBF16KERNEL)
|
||||
|
||||
@@ -1,3 +1,31 @@
|
||||
###############################################################################
|
||||
# Copyright (c) 2025 The OpenBLAS Project
|
||||
# All rights reserved.
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name of the OpenBLAS project nor the names of
|
||||
# its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
###############################################################################
|
||||
|
||||
FMAFLAG=
|
||||
ifndef OLDGCC
|
||||
ifdef HAVE_FMA3
|
||||
@@ -56,6 +84,14 @@ XGEMVTKERNEL = zgemv_t.S
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16),1)
|
||||
ifndef BGEMVNKERNEL
|
||||
BGEMVNKERNEL = ../generic/gemv_n.c
|
||||
endif
|
||||
|
||||
ifndef BGEMVTKERNEL
|
||||
BGEMVTKERNEL = ../generic/gemv_t.c
|
||||
endif
|
||||
|
||||
ifndef SBGEMVNKERNEL
|
||||
SBGEMVNKERNEL = ../x86_64/sbgemv_n.c
|
||||
endif
|
||||
@@ -255,6 +291,9 @@ XBLASOBJS += \
|
||||
xgeru_k$(TSUFFIX).$(SUFFIX) xgerc_k$(TSUFFIX).$(SUFFIX) xgerv_k$(TSUFFIX).$(SUFFIX) xgerd_k$(TSUFFIX).$(SUFFIX)
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16),1)
|
||||
BBLASOBJS += \
|
||||
bgemv_n$(TSUFFIX).$(SUFFIX) \
|
||||
bgemv_t$(TSUFFIX).$(SUFFIX)
|
||||
SBBLASOBJS += \
|
||||
sbgemv_n$(TSUFFIX).$(SUFFIX) \
|
||||
sbgemv_t$(TSUFFIX).$(SUFFIX)
|
||||
@@ -513,5 +552,9 @@ $(KDIR)sbgemv_n$(TSUFFIX).$(SUFFIX) $(KDIR)sbgemv_n$(TPSUFFIX).$(PSUFFIX) : $(KE
|
||||
$(CC) -c $(CFLAGS) -UCOMPLEX $< -o $@
|
||||
$(KDIR)sbgemv_t$(TSUFFIX).$(SUFFIX) $(KDIR)sbgemv_t$(TPSUFFIX).$(PSUFFIX) : $(KERNELDIR)/$(SBGEMVTKERNEL)
|
||||
$(CC) -c $(CFLAGS) -UCOMPLEX $< -o $@
|
||||
$(KDIR)bgemv_n$(TSUFFIX).$(SUFFIX) $(KDIR)bgemv_n$(TPSUFFIX).$(PSUFFIX) : $(KERNELDIR)/$(BGEMVNKERNEL)
|
||||
$(CC) -c $(CFLAGS) -DBGEMM -UCOMPLEX $< -o $@
|
||||
$(KDIR)bgemv_t$(TSUFFIX).$(SUFFIX) $(KDIR)bgemv_t$(TPSUFFIX).$(PSUFFIX) : $(KERNELDIR)/$(BGEMVTKERNEL)
|
||||
$(CC) -c $(CFLAGS) -DBGEMM -UCOMPLEX $< -o $@
|
||||
endif
|
||||
|
||||
|
||||
+255
-4
@@ -1,3 +1,30 @@
|
||||
###############################################################################
|
||||
# Copyright (c) 2025, The OpenBLAS Project
|
||||
# All rights reserved.
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name of the OpenBLAS project nor the names of
|
||||
# its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
###############################################################################
|
||||
USE_GEMM3M = 0
|
||||
OS := $(shell uname)
|
||||
|
||||
@@ -105,11 +132,29 @@ ifeq ($(TARGET_CORE), ARMV9SME)
|
||||
HAVE_SME = 1
|
||||
endif
|
||||
SGEMMDIRECTKERNEL = sgemm_direct_arm64_sme1.c
|
||||
SGEMMDIRECTKERNEL_ALPHA_BETA = sgemm_direct_alpha_beta_arm64_sme1.c
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16), 1)
|
||||
ifndef BGEMMKERNEL
|
||||
BGEMM_BETA = ../generic/gemm_beta.c
|
||||
BGEMMKERNEL = ../generic/gemmkernel_2x2.c
|
||||
BGEMMINCOPY = ../generic/gemm_ncopy_2.c
|
||||
BGEMMITCOPY = ../generic/gemm_tcopy_2.c
|
||||
BGEMMONCOPY = ../generic/gemm_ncopy_2.c
|
||||
BGEMMOTCOPY = ../generic/gemm_tcopy_2.c
|
||||
BGEMMINCOPYOBJ = bgemm_incopy$(TSUFFIX).$(SUFFIX)
|
||||
BGEMMITCOPYOBJ = bgemm_itcopy$(TSUFFIX).$(SUFFIX)
|
||||
BGEMMONCOPYOBJ = bgemm_oncopy$(TSUFFIX).$(SUFFIX)
|
||||
BGEMMOTCOPYOBJ = bgemm_otcopy$(TSUFFIX).$(SUFFIX)
|
||||
endif
|
||||
BKERNELOBJS += \
|
||||
bgemm_kernel$(TSUFFIX).$(SUFFIX) \
|
||||
$(BGEMMINCOPYOBJ) $(BGEMMITCOPYOBJ) \
|
||||
$(BGEMMONCOPYOBJ) $(BGEMMOTCOPYOBJ)
|
||||
|
||||
ifndef SBGEMMKERNEL
|
||||
SBGEMM_BETA = ../generic/gemm_beta.c
|
||||
SBGEMMKERNEL = ../generic/gemmkernel_2x2.c
|
||||
@@ -129,6 +174,26 @@ SBKERNELOBJS += \
|
||||
$(SBGEMMONCOPYOBJ) $(SBGEMMOTCOPYOBJ)
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_HFLOAT16), 1)
|
||||
ifndef SHGEMMKERNEL
|
||||
SHGEMM_BETA = ../generic/gemm_beta.c
|
||||
SHGEMMKERNEL = ../generic/gemmkernel_2x2.c
|
||||
SHGEMMONCOPY = ../generic/gemm_ncopy_2.c
|
||||
SHGEMMOTCOPY = ../generic/gemm_tcopy_2.c
|
||||
SHGEMMONCOPYOBJ = shgemm_oncopy$(TSUFFIX).$(SUFFIX)
|
||||
SHGEMMOTCOPYOBJ = shgemm_otcopy$(TSUFFIX).$(SUFFIX)
|
||||
SHGEMMINCOPY = ../generic/gemm_ncopy_2.c
|
||||
SHGEMMITCOPY = ../generic/gemm_tcopy_2.c
|
||||
SHGEMMINCOPYOBJ = shgemm_incopy$(TSUFFIX).$(SUFFIX)
|
||||
SHGEMMITCOPYOBJ = shgemm_itcopy$(TSUFFIX).$(SUFFIX)
|
||||
endif
|
||||
|
||||
SHKERNELOBJS += \
|
||||
shgemm_kernel$(TSUFFIX).$(SUFFIX) \
|
||||
$(SHGEMMINCOPYOBJ) $(SHGEMMITCOPYOBJ) \
|
||||
$(SHGEMMONCOPYOBJ) $(SHGEMMOTCOPYOBJ)
|
||||
endif
|
||||
|
||||
ifneq "$(or $(BUILD_SINGLE),$(BUILD_DOUBLE),$(BUILD_COMPLEX))" ""
|
||||
SKERNELOBJS += \
|
||||
sgemm_kernel$(TSUFFIX).$(SUFFIX) \
|
||||
@@ -144,7 +209,8 @@ SKERNELOBJS += \
|
||||
endif
|
||||
ifeq ($(ARCH), arm64)
|
||||
SKERNELOBJS += \
|
||||
sgemm_direct$(TSUFFIX).$(SUFFIX)
|
||||
sgemm_direct$(TSUFFIX).$(SUFFIX) \
|
||||
sgemm_direct_alpha_beta$(TSUFFIX).$(SUFFIX)
|
||||
ifdef HAVE_SME
|
||||
SKERNELOBJS += \
|
||||
sgemm_direct_sme1$(TSUFFIX).$(SUFFIX) \
|
||||
@@ -190,8 +256,12 @@ XKERNELOBJS += \
|
||||
$(XGEMMONCOPYOBJ) $(XGEMMOTCOPYOBJ)
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16),1)
|
||||
BBLASOBJS += $(BKERNELOBJS)
|
||||
SBBLASOBJS += $(SBKERNELOBJS)
|
||||
endif
|
||||
ifeq ($(BUILD_HFLOAT16),1)
|
||||
SHBLASOBJS += $(SHKERNELOBJS)
|
||||
endif
|
||||
SBLASOBJS += $(SKERNELOBJS)
|
||||
DBLASOBJS += $(DKERNELOBJS)
|
||||
QBLASOBJS += $(QKERNELOBJS)
|
||||
@@ -200,8 +270,12 @@ ZBLASOBJS += $(ZKERNELOBJS)
|
||||
XBLASOBJS += $(XKERNELOBJS)
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16),1)
|
||||
BBLASOBJS += bgemm_beta$(TSUFFIX).$(SUFFIX)
|
||||
SBBLASOBJS += sbgemm_beta$(TSUFFIX).$(SUFFIX)
|
||||
endif
|
||||
ifeq ($(BUILD_HFLOAT16),1)
|
||||
SHBLASOBJS += shgemm_beta$(TSUFFIX).$(SUFFIX)
|
||||
endif
|
||||
|
||||
ifneq "$(or $(BUILD_SINGLE),$(BUILD_DOUBLE),$(BUILD_COMPLEX))" ""
|
||||
SBLASOBJS += \
|
||||
@@ -493,6 +567,15 @@ SBBLASOBJS += \
|
||||
sbgemm_small_kernel_b0_tn$(TSUFFIX).$(SUFFIX) sbgemm_small_kernel_b0_tt$(TSUFFIX).$(SUFFIX)
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_HFLOAT16),1)
|
||||
SHBLASOBJS += \
|
||||
shgemm_small_matrix_permit$(TSUFFIX).$(SUFFIX) \
|
||||
shgemm_small_kernel_nn$(TSUFFIX).$(SUFFIX) shgemm_small_kernel_nt$(TSUFFIX).$(SUFFIX) \
|
||||
shgemm_small_kernel_tn$(TSUFFIX).$(SUFFIX) shgemm_small_kernel_tt$(TSUFFIX).$(SUFFIX) \
|
||||
shgemm_small_kernel_b0_nn$(TSUFFIX).$(SUFFIX) shgemm_small_kernel_b0_nt$(TSUFFIX).$(SUFFIX) \
|
||||
shgemm_small_kernel_b0_tn$(TSUFFIX).$(SUFFIX) shgemm_small_kernel_b0_tt$(TSUFFIX).$(SUFFIX)
|
||||
endif
|
||||
|
||||
SBLASOBJS += \
|
||||
sgemm_small_matrix_permit$(TSUFFIX).$(SUFFIX) \
|
||||
sgemm_small_kernel_nn$(TSUFFIX).$(SUFFIX) sgemm_small_kernel_nt$(TSUFFIX).$(SUFFIX) \
|
||||
@@ -593,12 +676,23 @@ ZBLASOBJS += \
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16), 1)
|
||||
BGEMMINCOPYOBJ_P = $(BGEMMINCOPYOBJ:.$(SUFFIX)=.$(PSUFFIX))
|
||||
BGEMMITCOPYOBJ_P = $(BGEMMITCOPYOBJ:.$(SUFFIX)=.$(PSUFFIX))
|
||||
BGEMMONCOPYOBJ_P = $(BGEMMONCOPYOBJ:.$(SUFFIX)=.$(PSUFFIX))
|
||||
BGEMMOTCOPYOBJ_P = $(BGEMMOTCOPYOBJ:.$(SUFFIX)=.$(PSUFFIX))
|
||||
SBGEMMINCOPYOBJ_P = $(SBGEMMINCOPYOBJ:.$(SUFFIX)=.$(PSUFFIX))
|
||||
SBGEMMITCOPYOBJ_P = $(SBGEMMITCOPYOBJ:.$(SUFFIX)=.$(PSUFFIX))
|
||||
SBGEMMONCOPYOBJ_P = $(SBGEMMONCOPYOBJ:.$(SUFFIX)=.$(PSUFFIX))
|
||||
SBGEMMOTCOPYOBJ_P = $(SBGEMMOTCOPYOBJ:.$(SUFFIX)=.$(PSUFFIX))
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_HFLOAT16), 1)
|
||||
SHGEMMINCOPYOBJ_P = $(SHGEMMINCOPYOBJ:.$(SUFFIX)=.$(PSUFFIX))
|
||||
SHGEMMITCOPYOBJ_P = $(SHGEMMITCOPYOBJ:.$(SUFFIX)=.$(PSUFFIX))
|
||||
SHGEMMONCOPYOBJ_P = $(SHGEMMONCOPYOBJ:.$(SUFFIX)=.$(PSUFFIX))
|
||||
SHGEMMOTCOPYOBJ_P = $(SHGEMMOTCOPYOBJ:.$(SUFFIX)=.$(PSUFFIX))
|
||||
endif
|
||||
|
||||
SGEMMINCOPYOBJ_P = $(SGEMMINCOPYOBJ:.$(SUFFIX)=.$(PSUFFIX))
|
||||
SGEMMITCOPYOBJ_P = $(SGEMMITCOPYOBJ:.$(SUFFIX)=.$(PSUFFIX))
|
||||
SGEMMONCOPYOBJ_P = $(SGEMMONCOPYOBJ:.$(SUFFIX)=.$(PSUFFIX))
|
||||
@@ -625,10 +719,17 @@ XGEMMONCOPYOBJ_P = $(XGEMMONCOPYOBJ:.$(SUFFIX)=.$(PSUFFIX))
|
||||
XGEMMOTCOPYOBJ_P = $(XGEMMOTCOPYOBJ:.$(SUFFIX)=.$(PSUFFIX))
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16),1)
|
||||
$(KDIR)bgemm_beta$(TSUFFIX).$(SUFFIX) : $(KERNELDIR)/$(BGEMM_BETA)
|
||||
$(CC) $(CFLAGS) -c -DBFLOAT16 -DBGEMM -UDOUBLE -UCOMPLEX $< -o $@
|
||||
$(KDIR)sbgemm_beta$(TSUFFIX).$(SUFFIX) : $(KERNELDIR)/$(SBGEMM_BETA)
|
||||
$(CC) $(CFLAGS) -c -DBFLOAT16 -UDOUBLE -UCOMPLEX $< -o $@
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_HFLOAT16),1)
|
||||
$(KDIR)shgemm_beta$(TSUFFIX).$(SUFFIX) : $(KERNELDIR)/$(SHGEMM_BETA)
|
||||
$(CC) $(CFLAGS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX $< -o $@
|
||||
endif
|
||||
|
||||
$(KDIR)sgemm_beta$(TSUFFIX).$(SUFFIX) : $(KERNELDIR)/$(SGEMM_BETA)
|
||||
$(CC) $(CFLAGS) -c -UDOUBLE -UCOMPLEX $< -o $@
|
||||
|
||||
@@ -651,9 +752,22 @@ ifeq ($(ARCH), E2K)
|
||||
USE_TRMM = 1
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16), 1)
|
||||
|
||||
$(KDIR)$(BGEMMONCOPYOBJ) : $(KERNELDIR)/$(BGEMMONCOPY)
|
||||
$(CC) $(CFLAGS) -c -DBFLOAT16 -DBGEMM -UDOUBLE -UCOMPLEX $< -o $@
|
||||
|
||||
$(KDIR)$(BGEMMOTCOPYOBJ) : $(KERNELDIR)/$(BGEMMOTCOPY)
|
||||
$(CC) $(CFLAGS) -c -DBFLOAT16 -DBGEMM -UDOUBLE -UCOMPLEX $< -o $@
|
||||
|
||||
ifneq ($(BGEMM_UNROLL_M), $(BGEMM_UNROLL_N))
|
||||
$(KDIR)$(BGEMMINCOPYOBJ) : $(KERNELDIR)/$(BGEMMINCOPY)
|
||||
$(CC) $(CFLAGS) -c -DBFLOAT16 -DBGEMM -UDOUBLE -UCOMPLEX $< -o $@
|
||||
|
||||
$(KDIR)$(BGEMMITCOPYOBJ) : $(KERNELDIR)/$(BGEMMITCOPY)
|
||||
$(CC) $(CFLAGS) -c -DBFLOAT16 -DBGEMM -UDOUBLE -UCOMPLEX $< -o $@
|
||||
endif
|
||||
|
||||
$(KDIR)$(SBGEMMONCOPYOBJ) : $(KERNELDIR)/$(SBGEMMONCOPY)
|
||||
$(CC) $(CFLAGS) -c -DBFLOAT16 -UDOUBLE -UCOMPLEX $< -o $@
|
||||
|
||||
@@ -671,6 +785,25 @@ $(KDIR)$(SBGEMMITCOPYOBJ) : $(KERNELDIR)/$(SBGEMMITCOPY)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_HFLOAT16), 1)
|
||||
|
||||
$(KDIR)$(SHGEMMONCOPYOBJ) : $(KERNELDIR)/$(SHGEMMONCOPY)
|
||||
$(CC) $(CFLAGS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX $< -o $@
|
||||
|
||||
$(KDIR)$(SHGEMMOTCOPYOBJ) : $(KERNELDIR)/$(SHGEMMOTCOPY)
|
||||
$(CC) $(CFLAGS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX $< -o $@
|
||||
|
||||
#ifneq ($(SHGEMM_UNROLL_M), $(SHGEMM_UNROLL_N))
|
||||
|
||||
$(KDIR)$(SHGEMMINCOPYOBJ) : $(KERNELDIR)/$(SHGEMMINCOPY)
|
||||
$(CC) $(CFLAGS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX $< -o $@
|
||||
|
||||
$(KDIR)$(SHGEMMITCOPYOBJ) : $(KERNELDIR)/$(SHGEMMITCOPY)
|
||||
$(CC) $(CFLAGS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX $< -o $@
|
||||
|
||||
#endif
|
||||
endif
|
||||
|
||||
$(KDIR)$(SGEMMONCOPYOBJ) : $(KERNELDIR)/$(SGEMMONCOPY)
|
||||
$(CC) $(CFLAGS) -c -UDOUBLE -UCOMPLEX $< -o $@
|
||||
|
||||
@@ -838,6 +971,8 @@ endif
|
||||
ifeq ($(ARCH), arm64)
|
||||
$(KDIR)sgemm_direct$(TSUFFIX).$(SUFFIX) : $(KERNELDIR)/$(SGEMMDIRECTKERNEL)
|
||||
$(CC) $(CFLAGS) -c -UDOUBLE -UCOMPLEX $< -o $@
|
||||
$(KDIR)sgemm_direct_alpha_beta$(TSUFFIX).$(SUFFIX) : $(KERNELDIR)/$(SGEMMDIRECTKERNEL_ALPHA_BETA)
|
||||
$(CC) $(CFLAGS) -c -UDOUBLE -UCOMPLEX $< -o $@
|
||||
ifdef HAVE_SME
|
||||
$(KDIR)sgemm_direct_sme1$(TSUFFIX).$(SUFFIX) :
|
||||
$(CC) $(CFLAGS) -c $(KERNELDIR)/sgemm_direct_sme1.S -UDOUBLE -UCOMPLEX -o $@
|
||||
@@ -848,11 +983,18 @@ endif
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16), 1)
|
||||
|
||||
$(KDIR)bgemm_kernel$(TSUFFIX).$(SUFFIX) : $(KERNELDIR)/$(BGEMMKERNEL)
|
||||
$(CC) $(CFLAGS) -c -DBFLOAT16 -DBGEMM -UDOUBLE -UCOMPLEX $< -o $@
|
||||
$(KDIR)sbgemm_kernel$(TSUFFIX).$(SUFFIX) : $(KERNELDIR)/$(SBGEMMKERNEL) $(SBGEMMDEPEND)
|
||||
$(CC) $(CFLAGS) -c -DBFLOAT16 -UDOUBLE -UCOMPLEX $< -o $@
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_HFLOAT16), 1)
|
||||
|
||||
$(KDIR)shgemm_kernel$(TSUFFIX).$(SUFFIX) : $(KERNELDIR)/$(SHGEMMKERNEL) $(SHGEMMDEPEND)
|
||||
$(CC) $(CFLAGS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX $< -o $@
|
||||
endif
|
||||
|
||||
$(KDIR)dgemm_kernel$(TSUFFIX).$(SUFFIX) : $(KERNELDIR)/$(DGEMMKERNEL) $(DGEMMDEPEND)
|
||||
ifeq ($(OS), AIX)
|
||||
$(CC) $(CFLAGS) -S -DDOUBLE -UCOMPLEX $< -o - > dgemm_kernel$(TSUFFIX).s
|
||||
@@ -2836,10 +2978,17 @@ $(KDIR)sgemm_beta$(TSUFFIX).$(PSUFFIX) : $(KERNELDIR)/$(SGEMM_BETA)
|
||||
$(CC) $(PFLAGS) -c -UDOUBLE -UCOMPLEX $< -o $@
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16),1)
|
||||
$(KDIR)bgemm_beta$(TSUFFIX).$(PSUFFIX) : $(KERNELDIR)/$(BGEMM_BETA)
|
||||
$(CC) $(PFLAGS) -c -DBFLOAT16 -DBGEMM -UDOUBLE -UCOMPLEX $< -o $@
|
||||
$(KDIR)sbgemm_beta$(TSUFFIX).$(PSUFFIX) : $(KERNELDIR)/$(SBGEMM_BETA)
|
||||
$(CC) $(PFLAGS) -c -DBFLOAT16 -UDOUBLE -UCOMPLEX $< -o $@
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_HFLOAT16),1)
|
||||
$(KDIR)shgemm_beta$(TSUFFIX).$(PSUFFIX) : $(KERNELDIR)/$(SHGEMM_BETA)
|
||||
$(CC) $(PFLAGS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX $< -o $@
|
||||
endif
|
||||
|
||||
$(KDIR)dgemm_beta$(TSUFFIX).$(PSUFFIX) : $(KERNELDIR)/$(DGEMM_BETA)
|
||||
$(CC) $(PFLAGS) -c -DDOUBLE -UCOMPLEX $< -o $@
|
||||
|
||||
@@ -2857,6 +3006,20 @@ $(KDIR)xgemm_beta$(TSUFFIX).$(PSUFFIX) : $(KERNELDIR)/$(XGEMM_BETA)
|
||||
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16), 1)
|
||||
$(BGEMMONCOPYOBJ_P) : $(KERNELDIR)/$(BGEMMONCOPY)
|
||||
$(CC) $(PFLAGS) -c -DBFLOAT16 -DBGEMM -UDOUBLE -UCOMPLEX $< -o $@
|
||||
|
||||
$(BGEMMOTCOPYOBJ_P) : $(KERNELDIR)/$(BGEMMOTCOPY)
|
||||
$(CC) $(PFLAGS) -c -DBFLOAT16 -DBGEMM -UDOUBLE -UCOMPLEX $< -o $@
|
||||
|
||||
ifneq ($(BGEMM_UNROLL_M), $(BGEMM_UNROLL_N))
|
||||
$(BGEMMINCOPYOBJ_P) : $(KERNELDIR)/$(BGEMMINCOPY)
|
||||
$(CC) $(PFLAGS) -c -DBFLOAT16 -DBGEMM -UDOUBLE -UCOMPLEX $< -o $@
|
||||
|
||||
$(BGEMMITCOPYOBJ_P) : $(KERNELDIR)/$(BGEMMITCOPY)
|
||||
$(CC) $(PFLAGS) -c -DBFLOAT16 -DBGEMM -UDOUBLE -UCOMPLEX $< -o $@
|
||||
endif
|
||||
|
||||
$(SBGEMMONCOPYOBJ_P) : $(KERNELDIR)/$(SBGEMMONCOPY)
|
||||
$(CC) $(PFLAGS) -c -DBFLOAT16 -UDOUBLE -UCOMPLEX $< -o $@
|
||||
|
||||
@@ -2869,10 +3032,26 @@ $(SBGEMMINCOPYOBJ_P) : $(KERNELDIR)/$(SBGEMMINCOPY)
|
||||
|
||||
$(SBGEMMITCOPYOBJ_P) : $(KERNELDIR)/$(SBGEMMITCOPY)
|
||||
$(CC) $(PFLAGS) -c -DBFLOAT16 -UDOUBLE -UCOMPLEX $< -o $@
|
||||
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_HFLOAT16), 1)
|
||||
$(SHGEMMONCOPYOBJ_P) : $(KERNELDIR)/$(SHGEMMONCOPY)
|
||||
$(CC) $(PFLAGS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX $< -o $@
|
||||
|
||||
$(SHGEMMOTCOPYOBJ_P) : $(KERNELDIR)/$(SHGEMMOTCOPY)
|
||||
$(CC) $(PFLAGS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX $< -o $@
|
||||
|
||||
#ifneq ($(SHGEMM_UNROLL_M), $(SHGEMM_UNROLL_N))
|
||||
$(SHGEMMINCOPYOBJ_P) : $(KERNELDIR)/$(SHGEMMINCOPY)
|
||||
$(CC) $(PFLAGS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX $< -o $@
|
||||
|
||||
$(SHGEMMITCOPYOBJ_P) : $(KERNELDIR)/$(SHGEMMITCOPY)
|
||||
$(CC) $(PFLAGS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX $< -o $@
|
||||
|
||||
#endif
|
||||
endif
|
||||
|
||||
$(SGEMMONCOPYOBJ_P) : $(KERNELDIR)/$(SGEMMONCOPY)
|
||||
$(CC) $(PFLAGS) -c -UDOUBLE -UCOMPLEX $< -o $@
|
||||
|
||||
@@ -2979,10 +3158,17 @@ endif
|
||||
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16), 1)
|
||||
$(KDIR)bgemm_kernel$(TSUFFIX).$(PSUFFIX) : $(KERNELDIR)/$(BGEMMKERNEL) $(BGEMMDEPEND)
|
||||
$(CC) $(PFLAGS) -c -DBFLOAT16 -DBGEMM -UDOUBLE -UCOMPLEX $< -o $@
|
||||
$(KDIR)sbgemm_kernel$(TSUFFIX).$(PSUFFIX) : $(KERNELDIR)/$(SBGEMMKERNEL) $(SBGEMMDEPEND)
|
||||
$(CC) $(PFLAGS) -c -DBFLOAT16 -UDOUBLE -UCOMPLEX $< -o $@
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_HFLOAT16), 1)
|
||||
$(KDIR)shgemm_kernel$(TSUFFIX).$(PSUFFIX) : $(KERNELDIR)/$(SHGEMMKERNEL) $(SHGEMMDEPEND)
|
||||
$(CC) $(PFLAGS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX $< -o $@
|
||||
endif
|
||||
|
||||
$(KDIR)sgemm_kernel$(TSUFFIX).$(PSUFFIX) : $(KERNELDIR)/$(SGEMMKERNEL) $(SGEMMDEPEND)
|
||||
$(CC) $(PFLAGS) -c -UDOUBLE -UCOMPLEX $< -o $@
|
||||
|
||||
@@ -4843,6 +5029,71 @@ $(KDIR)sbgemm_small_kernel_b0_tt$(TSUFFIX).$(SUFFIX) : $(KERNELDIR)/$(SBGEMM_SMA
|
||||
$(CC) $(CFLAGS) -c -DBFLOAT16 -UDOUBLE -UCOMPLEX -DB0 $< -o $@
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_HFLOAT16), 1)
|
||||
ifndef SHGEMM_SMALL_M_PERMIT
|
||||
SHGEMM_SMALL_M_PERMIT = ../generic/gemm_small_matrix_permit.c
|
||||
endif
|
||||
|
||||
ifndef SHGEMM_SMALL_K_NN
|
||||
SHGEMM_SMALL_K_NN = ../generic/gemm_small_matrix_kernel_nn.c
|
||||
endif
|
||||
|
||||
ifndef SHGEMM_SMALL_K_NT
|
||||
SHGEMM_SMALL_K_NT = ../generic/gemm_small_matrix_kernel_nt.c
|
||||
endif
|
||||
|
||||
ifndef SHGEMM_SMALL_K_TN
|
||||
SHGEMM_SMALL_K_TN = ../generic/gemm_small_matrix_kernel_tn.c
|
||||
endif
|
||||
|
||||
ifndef SHGEMM_SMALL_K_TT
|
||||
SHGEMM_SMALL_K_TT = ../generic/gemm_small_matrix_kernel_tt.c
|
||||
endif
|
||||
|
||||
$(KDIR)shgemm_small_matrix_permit$(TSUFFIX).$(SUFFIX) : $(KERNELDIR)/$(SHGEMM_SMALL_M_PERMIT)
|
||||
$(CC) $(CFLAGS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX $< -o $@
|
||||
|
||||
$(KDIR)shgemm_small_kernel_nn$(TSUFFIX).$(SUFFIX) : $(KERNELDIR)/$(SHGEMM_SMALL_K_NN)
|
||||
$(CC) $(CFLAGS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX $< -o $@
|
||||
|
||||
$(KDIR)shgemm_small_kernel_nt$(TSUFFIX).$(SUFFIX) : $(KERNELDIR)/$(SHGEMM_SMALL_K_NT)
|
||||
$(CC) $(CFLAGS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX $< -o $@
|
||||
|
||||
$(KDIR)shgemm_small_kernel_tn$(TSUFFIX).$(SUFFIX) : $(KERNELDIR)/$(SHGEMM_SMALL_K_TN)
|
||||
$(CC) $(CFLAGS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX $< -o $@
|
||||
|
||||
$(KDIR)shgemm_small_kernel_tt$(TSUFFIX).$(SUFFIX) : $(KERNELDIR)/$(SHGEMM_SMALL_K_TT)
|
||||
$(CC) $(CFLAGS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX $< -o $@
|
||||
|
||||
ifndef SHGEMM_SMALL_K_B0_NN
|
||||
SHGEMM_SMALL_K_B0_NN = ../generic/gemm_small_matrix_kernel_nn.c
|
||||
endif
|
||||
|
||||
ifndef SHGEMM_SMALL_K_B0_NT
|
||||
SHGEMM_SMALL_K_B0_NT = ../generic/gemm_small_matrix_kernel_nt.c
|
||||
endif
|
||||
|
||||
ifndef SHGEMM_SMALL_K_B0_TN
|
||||
SHGEMM_SMALL_K_B0_TN = ../generic/gemm_small_matrix_kernel_tn.c
|
||||
endif
|
||||
|
||||
ifndef SHGEMM_SMALL_K_B0_TT
|
||||
SHGEMM_SMALL_K_B0_TT = ../generic/gemm_small_matrix_kernel_tt.c
|
||||
endif
|
||||
|
||||
$(KDIR)shgemm_small_kernel_b0_nn$(TSUFFIX).$(SUFFIX) : $(KERNELDIR)/$(SHGEMM_SMALL_K_B0_NN)
|
||||
$(CC) $(CFLAGS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX -DB0 $< -o $@
|
||||
|
||||
$(KDIR)shgemm_small_kernel_b0_nt$(TSUFFIX).$(SUFFIX) : $(KERNELDIR)/$(SHGEMM_SMALL_K_B0_NT)
|
||||
$(CC) $(CFLAGS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX -DB0 $< -o $@
|
||||
|
||||
$(KDIR)shgemm_small_kernel_b0_tn$(TSUFFIX).$(SUFFIX) : $(KERNELDIR)/$(SHGEMM_SMALL_K_B0_TN)
|
||||
$(CC) $(CFLAGS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX -DB0 $< -o $@
|
||||
|
||||
$(KDIR)shgemm_small_kernel_b0_tt$(TSUFFIX).$(SUFFIX) : $(KERNELDIR)/$(SHGEMM_SMALL_K_B0_TT)
|
||||
$(CC) $(CFLAGS) -c -DHFLOAT16 -UDOUBLE -UCOMPLEX -DB0 $< -o $@
|
||||
endif
|
||||
|
||||
ifndef CGEMM_SMALL_M_PERMIT
|
||||
CGEMM_SMALL_M_PERMIT = ../generic/zgemm_small_matrix_permit.c
|
||||
endif
|
||||
|
||||
+40
-49
@@ -27,65 +27,56 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
/**************************************************************************************
|
||||
* 2013/09/14 Saar
|
||||
* BLASTEST float : OK
|
||||
* BLASTEST double : OK
|
||||
* CTEST : OK
|
||||
* TEST : OK
|
||||
* BLASTEST float : OK
|
||||
* BLASTEST double : OK
|
||||
* CTEST : OK
|
||||
* TEST : OK
|
||||
*
|
||||
**************************************************************************************/
|
||||
|
||||
#include "common.h"
|
||||
|
||||
// The c/zscal_k function is called not only by cblas_c/zscal but also by other upper-level interfaces.
|
||||
// In certain cases, the expected return values for cblas_s/zscal differ from those of other upper-level interfaces.
|
||||
// To handle this, we use the dummy2 parameter to differentiate between them.
|
||||
int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r,FLOAT da_i, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y, FLOAT *dummy, BLASLONG dummy2)
|
||||
{
|
||||
BLASLONG i=0;
|
||||
BLASLONG inc_x2;
|
||||
BLASLONG ip = 0;
|
||||
FLOAT temp;
|
||||
BLASLONG i = 0;
|
||||
BLASLONG inc_x2;
|
||||
BLASLONG ip = 0;
|
||||
FLOAT temp;
|
||||
|
||||
if ( (n <= 0) || (inc_x <= 0))
|
||||
return(0);
|
||||
if ((n <= 0) || (inc_x <= 0))
|
||||
return(0);
|
||||
|
||||
inc_x2 = 2 * inc_x;
|
||||
if (dummy2 == 0) {
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
if (da_r == 0.0 && da_i == 0.0)
|
||||
{
|
||||
x[ip] = 0.0;
|
||||
x[ip+1] = 0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
temp = da_r * x[ip] - da_i * x[ip+1];
|
||||
x[ip+1] = da_r * x[ip+1] + da_i * x[ip] ;
|
||||
x[ip] = temp;
|
||||
}
|
||||
|
||||
inc_x2 = 2 * inc_x;
|
||||
for ( i=0; i<n; i++ )
|
||||
{
|
||||
if ( da_r == 0.0 )
|
||||
{
|
||||
if ( da_i == 0.0 )
|
||||
{
|
||||
temp = 0.0;
|
||||
x[ip+1] = 0.0 ;
|
||||
}
|
||||
else
|
||||
{
|
||||
temp = - da_i * x[ip+1] ;
|
||||
if (isnan(x[ip]) || isinf(x[ip])) temp = NAN;
|
||||
if (!isinf(x[ip+1]))
|
||||
x[ip+1] = da_i * x[ip] ;
|
||||
else x[ip+1] = NAN;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( da_i == 0.0 )
|
||||
{
|
||||
temp = da_r * x[ip] ;
|
||||
x[ip+1] = da_r * x[ip+1];
|
||||
}
|
||||
else
|
||||
{
|
||||
temp = da_r * x[ip] - da_i * x[ip+1] ;
|
||||
x[ip+1] = da_r * x[ip+1] + da_i * x[ip] ;
|
||||
}
|
||||
}
|
||||
x[ip] = temp;
|
||||
ip += inc_x2;
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
temp = da_r * x[ip] - da_i * x[ip+1];
|
||||
x[ip+1] = da_r * x[ip+1] + da_i * x[ip] ;
|
||||
|
||||
ip += inc_x2;
|
||||
}
|
||||
|
||||
return(0);
|
||||
x[ip] = temp;
|
||||
ip += inc_x2;
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,3 +4,9 @@ SGEMVNKERNEL = gemv_n_sve_v4x3.c
|
||||
DGEMVNKERNEL = gemv_n_sve_v4x3.c
|
||||
SGEMVTKERNEL = gemv_t_sve_v4x3.c
|
||||
DGEMVTKERNEL = gemv_t_sve_v4x3.c
|
||||
|
||||
DDOTKERNEL = dot_sve_v8.c
|
||||
SDOTKERNEL = dot_sve_v8.c
|
||||
|
||||
SAXPYKERNEL = axpy_sve.c
|
||||
DAXPYKERNEL = axpy_sve.c
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
include $(KERNELDIR)/KERNEL.NEOVERSEN1
|
||||
@@ -188,6 +188,20 @@ ZGEMMOTCOPY = ../generic/zgemm_tcopy_$(ZGEMM_UNROLL_N).c
|
||||
ZGEMMONCOPYOBJ = zgemm_oncopy$(TSUFFIX).$(SUFFIX)
|
||||
ZGEMMOTCOPYOBJ = zgemm_otcopy$(TSUFFIX).$(SUFFIX)
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16), 1)
|
||||
BGEMM_BETA = sbgemm_beta_neoversen2.c
|
||||
BGEMMKERNEL = sbgemm_kernel_$(BGEMM_UNROLL_M)x$(BGEMM_UNROLL_N)_neoversen2.c
|
||||
BGEMMINCOPY = sbgemm_ncopy_$(BGEMM_UNROLL_M)_neoversen2.c
|
||||
BGEMMITCOPY = sbgemm_tcopy_$(BGEMM_UNROLL_M)_neoversen2.c
|
||||
BGEMMONCOPY = sbgemm_ncopy_$(BGEMM_UNROLL_N)_neoversen2.c
|
||||
BGEMMOTCOPY = sbgemm_tcopy_$(BGEMM_UNROLL_N)_neoversen2.c
|
||||
BGEMMINCOPYOBJ = bgemm_incopy$(TSUFFIX).$(SUFFIX)
|
||||
BGEMMITCOPYOBJ = bgemm_itcopy$(TSUFFIX).$(SUFFIX)
|
||||
BGEMMONCOPYOBJ = bgemm_oncopy$(TSUFFIX).$(SUFFIX)
|
||||
BGEMMOTCOPYOBJ = bgemm_otcopy$(TSUFFIX).$(SUFFIX)
|
||||
BGEMVTKERNEL = sbgemv_t_bfdot.c
|
||||
BGEMVNKERNEL = bgemv_n_sve_v3x4.c
|
||||
|
||||
SBGEMM_BETA = sbgemm_beta_neoversen2.c
|
||||
SBGEMMKERNEL = sbgemm_kernel_$(SBGEMM_UNROLL_M)x$(SBGEMM_UNROLL_N)_neoversen2.c
|
||||
SBGEMMINCOPY = sbgemm_ncopy_$(SBGEMM_UNROLL_M)_neoversen2.c
|
||||
@@ -199,4 +213,5 @@ SBGEMMITCOPYOBJ = sbgemm_itcopy$(TSUFFIX).$(SUFFIX)
|
||||
SBGEMMONCOPYOBJ = sbgemm_oncopy$(TSUFFIX).$(SUFFIX)
|
||||
SBGEMMOTCOPYOBJ = sbgemm_otcopy$(TSUFFIX).$(SUFFIX)
|
||||
SBGEMVTKERNEL = sbgemv_t_bfdot.c
|
||||
SBGEMVNKERNEL = sbgemv_n_neon.c
|
||||
SBGEMVNKERNEL = sbgemv_n_neon.c
|
||||
endif
|
||||
|
||||
@@ -1,24 +1,72 @@
|
||||
###############################################################################
|
||||
# Copyright (c) 2025, The OpenBLAS Project
|
||||
# All rights reserved.
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name of the OpenBLAS project nor the names of
|
||||
# its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
###############################################################################
|
||||
|
||||
include $(KERNELDIR)/KERNEL.ARMV8SVE
|
||||
|
||||
SGEMVNKERNEL = gemv_n_sve_v1x3.c
|
||||
DGEMVNKERNEL = gemv_n_sve_v1x3.c
|
||||
SGEMVTKERNEL = gemv_t_sve_v1x3.c
|
||||
DGEMVTKERNEL = gemv_t_sve_v1x3.c
|
||||
|
||||
SAXPYKERNEL = axpy_sve.c
|
||||
DAXPYKERNEL = axpy_sve.c
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16), 1)
|
||||
BGEMM_BETA = bgemm_beta_neon.c
|
||||
BGEMMKERNEL = bgemm_kernel_2vlx4_neoversev1.c
|
||||
ifneq ($(BGEMM_UNROLL_M), $(BGEMM_UNROLL_N))
|
||||
BGEMMINCOPY = bgemm_ncopy_2vl_neoversev1.c
|
||||
BGEMMITCOPY = bgemm_tcopy_2vl_neoversev1.c
|
||||
BGEMMINCOPYOBJ = bgemm_incopy$(TSUFFIX).$(SUFFIX)
|
||||
BGEMMITCOPYOBJ = bgemm_itcopy$(TSUFFIX).$(SUFFIX)
|
||||
endif
|
||||
BGEMMONCOPY = bgemm_ncopy_4_neoversev1.c
|
||||
BGEMMOTCOPY = bgemm_tcopy_4_neoversev1.c
|
||||
BGEMMONCOPYOBJ = bgemm_oncopy$(TSUFFIX).$(SUFFIX)
|
||||
BGEMMOTCOPYOBJ = bgemm_otcopy$(TSUFFIX).$(SUFFIX)
|
||||
|
||||
BGEMVTKERNEL = sbgemv_t_bfdot.c
|
||||
BGEMVNKERNEL = bgemv_n_sve_v3x4.c
|
||||
|
||||
SBGEMM_BETA = sbgemm_beta_neoversev1.c
|
||||
SBGEMMKERNEL = sbgemm_kernel_$(SBGEMM_UNROLL_M)x$(SBGEMM_UNROLL_N)_neoversev1.c
|
||||
SBGEMMKERNEL = bgemm_kernel_2vlx4_neoversev1.c
|
||||
ifneq ($(SBGEMM_UNROLL_M), $(SBGEMM_UNROLL_N))
|
||||
SBGEMMINCOPY = sbgemm_ncopy_$(SBGEMM_UNROLL_M)_neoversev1.c
|
||||
SBGEMMITCOPY = sbgemm_tcopy_$(SBGEMM_UNROLL_M)_neoversev1.c
|
||||
SBGEMMINCOPY = bgemm_ncopy_2vl_neoversev1.c
|
||||
SBGEMMITCOPY = bgemm_tcopy_2vl_neoversev1.c
|
||||
SBGEMMINCOPYOBJ = sbgemm_incopy$(TSUFFIX).$(SUFFIX)
|
||||
SBGEMMITCOPYOBJ = sbgemm_itcopy$(TSUFFIX).$(SUFFIX)
|
||||
endif
|
||||
SBGEMMONCOPY = sbgemm_ncopy_$(SBGEMM_UNROLL_N)_neoversev1.c
|
||||
SBGEMMOTCOPY = sbgemm_tcopy_$(SBGEMM_UNROLL_N)_neoversev1.c
|
||||
SBGEMMONCOPY = bgemm_ncopy_4_neoversev1.c
|
||||
SBGEMMOTCOPY = bgemm_tcopy_4_neoversev1.c
|
||||
SBGEMMONCOPYOBJ = sbgemm_oncopy$(TSUFFIX).$(SUFFIX)
|
||||
SBGEMMOTCOPYOBJ = sbgemm_otcopy$(TSUFFIX).$(SUFFIX)
|
||||
|
||||
SBGEMVNKERNEL = sbgemv_n_neon.c
|
||||
SBGEMVTKERNEL = sbgemv_t_bfdot.c
|
||||
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -1,6 +1 @@
|
||||
include $(KERNELDIR)/KERNEL.ARMV8SVE
|
||||
|
||||
ifeq ($(BUILD_BFLOAT16), 1)
|
||||
SBGEMVTKERNEL = sbgemv_t_bfdot.c
|
||||
SBGEMVNKERNEL = sbgemv_n_neon.c
|
||||
endif
|
||||
include $(KERNELDIR)/KERNEL.NEOVERSEN2
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
/***************************************************************************
|
||||
Copyright (c) 2025, The OpenBLAS Project
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. Neither the name of the OpenBLAS project nor the names of
|
||||
its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written
|
||||
permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include <arm_sve.h>
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#ifdef DOUBLE
|
||||
#define SV_TYPE svfloat64_t
|
||||
#define SV_COUNT svcntd
|
||||
#define SV_DUP svdup_f64
|
||||
#define SV_WHILE svwhilelt_b64_s64
|
||||
#define SV_TRUE svptrue_b64
|
||||
#else
|
||||
#define SV_TYPE svfloat32_t
|
||||
#define SV_COUNT svcntw
|
||||
#define SV_DUP svdup_f32
|
||||
#define SV_WHILE svwhilelt_b32_s64
|
||||
#define SV_TRUE svptrue_b32
|
||||
#endif
|
||||
|
||||
int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y, FLOAT *dummy, BLASLONG dummy2) {
|
||||
BLASLONG i = 0;
|
||||
BLASLONG ix = 0, iy = 0;
|
||||
BLASLONG sve_size = SV_COUNT();
|
||||
|
||||
if (n < 0) return (0);
|
||||
if (da == 0.0) return (0);
|
||||
|
||||
if (inc_x == 1 && inc_y == 1) {
|
||||
SV_TYPE da_vec = SV_DUP(da);
|
||||
for (i = 0; i + sve_size - 1 < n; i += sve_size) {
|
||||
SV_TYPE x_vec = svld1(SV_TRUE(), &x[i]);
|
||||
SV_TYPE y_vec = svld1(SV_TRUE(), &y[i]);
|
||||
y_vec = svmla_x(SV_TRUE(), y_vec, da_vec, x_vec);
|
||||
svst1(SV_TRUE(), &y[i], y_vec);
|
||||
}
|
||||
|
||||
if (i < n) {
|
||||
svbool_t pg = SV_WHILE(i, n);
|
||||
SV_TYPE x_vec = svld1(pg, &x[i]);
|
||||
SV_TYPE y_vec = svld1(pg, &y[i]);
|
||||
y_vec = svmla_x(pg, y_vec, da_vec, x_vec);
|
||||
svst1(pg, &y[i], y_vec);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
while (i < n) {
|
||||
y[iy] += da * x[ix];
|
||||
ix += inc_x;
|
||||
iy += inc_y;
|
||||
i++;
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2025, The OpenBLAS Project
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name of the OpenBLAS project nor the names of
|
||||
* its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
* *****************************************************************************/
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#include <arm_neon.h>
|
||||
|
||||
int CNAME(BLASLONG m, BLASLONG n, BLASLONG dummy1, FLOAT beta_in, IFLOAT *dummy2,
|
||||
BLASLONG dummy3, IFLOAT *dummy4, BLASLONG dummy5, FLOAT *c,
|
||||
BLASLONG ldc) {
|
||||
BLASLONG i, j;
|
||||
BLASLONG chunk, remain;
|
||||
|
||||
bfloat16_t *ptr_c, *ptr_c0;
|
||||
|
||||
bfloat16x8_t x0, z0;
|
||||
float32x4_t y0, y1;
|
||||
|
||||
float x;
|
||||
bfloat16_t z;
|
||||
|
||||
bfloat16_t zero_bf16 = vcvth_bf16_f32(0.0f);
|
||||
bfloat16x8_t zeros = vdupq_n_bf16(zero_bf16);
|
||||
|
||||
bfloat16_t beta_bf16;
|
||||
memcpy(&beta_bf16, &beta_in, sizeof(bfloat16_t));
|
||||
float beta = vcvtah_f32_bf16(beta_bf16);
|
||||
float32x4_t beta_neon = vdupq_n_f32(beta);
|
||||
|
||||
ptr_c = (bfloat16_t *)c;
|
||||
|
||||
chunk = m >> 3;
|
||||
remain = m & 7;
|
||||
|
||||
if (beta == 0.0f){
|
||||
for (j = 0; j < n; j ++){
|
||||
ptr_c0 = ptr_c;
|
||||
ptr_c += ldc;
|
||||
|
||||
for (i = 0; i < chunk; i ++){
|
||||
vst1q_bf16(ptr_c0, zeros);
|
||||
ptr_c0 += 8;
|
||||
}
|
||||
|
||||
for (i = 0; i < remain; i ++){
|
||||
ptr_c0[0] = zero_bf16;
|
||||
ptr_c0 ++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (j = 0; j < n; j ++){
|
||||
ptr_c0 = ptr_c;
|
||||
ptr_c += ldc;
|
||||
|
||||
for (i = 0; i < chunk; i ++){
|
||||
x0 = vld1q_bf16(ptr_c0);
|
||||
|
||||
y0 = vcvtq_low_f32_bf16(x0);
|
||||
y1 = vcvtq_high_f32_bf16(x0);
|
||||
|
||||
y0 = vmulq_f32(y0, beta_neon);
|
||||
y1 = vmulq_f32(y1, beta_neon);
|
||||
|
||||
z0 = vcvtq_low_bf16_f32(y0);
|
||||
z0 = vcvtq_high_bf16_f32(z0, y1);
|
||||
|
||||
vst1q_bf16(ptr_c0, z0);
|
||||
|
||||
ptr_c0 += 8;
|
||||
}
|
||||
|
||||
for (i = 0; i < remain; i ++){
|
||||
x = vcvtah_f32_bf16(ptr_c0[0]);
|
||||
z = vcvth_bf16_f32(x * beta);
|
||||
|
||||
ptr_c0[0] = z;
|
||||
ptr_c0 ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user