Compare commits

...
79 Commits
Author SHA1 Message Date
Martin Kroeker c59578f314 fix conditionals
apple m / build (cmake, gfortran, 0, 0) (push) Canceled after 0s
apple m / build (cmake, gfortran, 0, 1) (push) Canceled after 0s
apple m / build (cmake, gfortran, 1, 0) (push) Canceled after 0s
apple m / build (cmake, gfortran, 1, 1) (push) Canceled after 0s
apple m / build (make, gfortran, 0, 0) (push) Canceled after 0s
apple m / build (make, gfortran, 0, 1) (push) Canceled after 0s
apple m / build (make, gfortran, 1, 0) (push) Canceled after 0s
apple m / build (make, gfortran, 1, 1) (push) Canceled after 0s
c910v qemu test / TEST (riscv64-linux-gnu, NO_SHARED=1 TARGET=C910V, C910V, riscv64-unknown-linux-gnu) (push) Canceled after 0s
c910v qemu test / TEST (riscv64-linux-gnu, NO_SHARED=1 TARGET=RISCV64_GENERIC, RISCV64_GENERIC, riscv64-linux-gnu) (push) Canceled after 0s
Run codspeed benchmarks / benchmarks (make, gfortran, ubuntu-22.04, 3.12) (push) Canceled after 0s
continuous build / build (cmake, clang, flang, ubuntu-latest) (push) Canceled after 0s
continuous build / build (cmake, clang, gfortran, macos-latest) (push) Canceled after 0s
continuous build / build (cmake, clang, gfortran, ubuntu-24.04-arm) (push) Canceled after 0s
continuous build / build (cmake, clang, gfortran, ubuntu-latest) (push) Canceled after 0s
continuous build / build (cmake, clang-21, flang, ubuntu-latest) (push) Canceled after 0s
continuous build / build (cmake, clang-21, gfortran, ubuntu-24.04-arm) (push) Canceled after 0s
continuous build / build (cmake, clang-21, gfortran, ubuntu-latest) (push) Canceled after 0s
continuous build / build (cmake, gcc, flang, ubuntu-latest) (push) Canceled after 0s
continuous build / build (cmake, gcc, gfortran, ubuntu-24.04-arm) (push) Canceled after 0s
continuous build / build (cmake, gcc, gfortran, ubuntu-latest) (push) Canceled after 0s
continuous build / build (make, clang, flang, ubuntu-latest) (push) Canceled after 0s
continuous build / build (make, clang, gfortran, macos-latest) (push) Canceled after 0s
continuous build / build (make, clang, gfortran, ubuntu-24.04-arm) (push) Canceled after 0s
continuous build / build (make, clang, gfortran, ubuntu-latest) (push) Canceled after 0s
continuous build / build (make, clang-21, flang, ubuntu-latest) (push) Canceled after 0s
continuous build / build (make, clang-21, gfortran, ubuntu-24.04-arm) (push) Canceled after 0s
continuous build / build (make, clang-21, gfortran, ubuntu-latest) (push) Canceled after 0s
continuous build / build (make, gcc, flang, ubuntu-latest) (push) Canceled after 0s
continuous build / build (make, gcc, gfortran, ubuntu-24.04-arm) (push) Canceled after 0s
continuous build / build (make, gcc, gfortran, ubuntu-latest) (push) Canceled after 0s
continuous build / msys2 (None, fc, int32, UCRT64, mingw-w64-ucrt-x86_64) (push) Canceled after 0s
continuous build / msys2 (Release, fc, int32, CLANG64, mingw-w64-clang-x86_64) (push) Canceled after 0s
continuous build / msys2 (Release, fc, int32, MINGW32, mingw-w64-i686) (push) Canceled after 0s
continuous build / msys2 (Release, fc, int32, UCRT64, mingw-w64-ucrt-x86_64) (push) Canceled after 0s
continuous build / msys2 (Release, fc, int64, -DBINARY=64 -DINTERFACE64=1, CLANG64, mingw-w64-clang-x86_64) (push) Canceled after 0s
continuous build / msys2 (Release, fc, int64, -DBINARY=64 -DINTERFACE64=1, UCRT64, mingw-w64-ucrt-x86_64) (push) Canceled after 0s
continuous build / cross_build (DYNAMIC_ARCH=1 TARGET=GENERIC, mips64el, mips64el-linux-gnuabi64) (push) Canceled after 0s
continuous build / cross_build (TARGET=EV4, alpha, alpha-linux-gnu) (push) Canceled after 0s
continuous build / cross_build (TARGET=MIPS1004K, mipsel, mipsel-linux-gnu) (push) Canceled after 0s
continuous build / cross_build (TARGET=RISCV64_GENERIC, riscv64, riscv64-linux-gnu) (push) Canceled after 0s
continuous build / neoverse_build (push) Canceled after 0s
harmonyos / build (push) Canceled after 0s
loongarch64 qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=GENERIC, DYNAMIC_ARCH, loongarch64-linux-gnu) (push) Canceled after 0s
loongarch64 qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA264, LA264, loongarch64-linux-gnu) (push) Canceled after 0s
loongarch64 qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA464, LA464, loongarch64-linux-gnu) (push) Canceled after 0s
loongarch64 qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA64_GENERIC, LA64_GENERIC, loongarch64-linux-gnu) (push) Canceled after 0s
loongarch64 qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSON2K1000, LOONGSON2K1000, loongarch64-linux-gnu) (push) Canceled after 0s
loongarch64 qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSON3R5, LOONGSON3R5, loongarch64-linux-gnu) (push) Canceled after 0s
loongarch64 qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSONGENERIC, LOONGSONGENERIC, loongarch64-linux-gnu) (push) Canceled after 0s
loongarch64 clang qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=GENERIC, DYNAMIC_ARCH) (push) Canceled after 0s
loongarch64 clang qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA264, LA264) (push) Canceled after 0s
loongarch64 clang qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA464, LA464) (push) Canceled after 0s
loongarch64 clang qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA64_GENERIC, LA64_GENERIC) (push) Canceled after 0s
loongarch64 clang qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSON2K1000, LOONGSON2K1000) (push) Canceled after 0s
loongarch64 clang qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSON3R5, LOONGSON3R5) (push) Canceled after 0s
loongarch64 clang qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSONGENERIC, LOONGSONGENERIC) (push) Canceled after 0s
mips64 qemu test / TEST (NO_SHARED=1 TARGET=I6400, I6400, mipsisa64r6el-linux-gnuabi64) (push) Canceled after 0s
mips64 qemu test / TEST (NO_SHARED=1 TARGET=I6500, I6500, mipsisa64r6el-linux-gnuabi64) (push) Canceled after 0s
mips64 qemu test / TEST (NO_SHARED=1 TARGET=MIPS64_GENERIC, MIPS64_GENERIC, mips64el-linux-gnuabi64) (push) Canceled after 0s
mips64 qemu test / TEST (NO_SHARED=1 TARGET=P6600, P6600, mipsisa64r6el-linux-gnuabi64) (push) Canceled after 0s
mips64 qemu test / TEST (NO_SHARED=1 TARGET=SICORTEX, SICORTEX, mips64el-linux-gnuabi64) (push) Canceled after 0s
riscv64 zvl256b qemu test / TEST (TARGET=RISCV64_GENERIC BINARY=64 ARCH=riscv64 DYNAMIC_ARCH=1, rv64,g=true,c=true,v=true,vext_spec=v1.0,vlen=256,elen=64, DYNAMIC_ARCH=1) (push) Canceled after 0s
riscv64 zvl256b qemu test / TEST (TARGET=RISCV64_ZVL128B BINARY=64 ARCH=riscv64, rv64,g=true,c=true,v=true,vext_spec=v1.0,vlen=128,elen=64, RISCV64_ZVL128B) (push) Canceled after 0s
riscv64 zvl256b qemu test / TEST (TARGET=RISCV64_ZVL256B BINARY=64 ARCH=riscv64 BUILD_BFLOAT16=1 BUILD_HFLOAT16=1, rv64,g=true,c=true,v=true,vext_spec=v1.0,vlen=256,elen=64,zfh=true,zvfh=true,zvfbfwma=true, RISCV64_ZVL256B) (push) Canceled after 0s
2026-04-14 21:32:36 +02:00
Martin Kroeker d9786d387c fix missing eol 2026-04-14 10:56:04 +02:00
Martin Kroeker b9da7dbd24 Quote the respective SUMM file on failure in BLAS2/3 tests 2026-04-12 23:17:36 +02:00
Martin Kroeker 94e053ac10 Work around miscompilation of the AVX512 ?GEMM kernels by Windows LLVM 2026-04-11 19:27:31 +02:00
Martin Kroeker 646d0c9fee Merge pull request #5751 from chenx97/mips-dedup-c-impl
Remove redundant C implemetations from MIPS directories
2026-04-09 23:51:37 +02:00
Martin Kroeker 2c80f8c974 Merge pull request #5755 from martin-frbg/fixup5702
Fix partial merge of changes from PR #5702 (applying Reference-LAPACK PR 1203)
2026-04-09 16:35:13 +02:00
Martin Kroeker 0ea23484c6 Use ROUNDUP_LWORK and remove redundant conversions (Reference-LAPACK PR1203) 2026-04-09 14:54:55 +02:00
Martin Kroeker 1aea1d6237 Merge pull request #5753 from foxtran/fix/1203
Fix DROUNDUP_LWORK: patch was not fully copied
2026-04-09 14:08:23 +02:00
Henry Chen 6a5d2142f4 Fix dsdot precision for arm/dot.c 2026-04-09 18:11:47 +08:00
Igor S. Gerasimov f9f8e94a14 Fix DROUNDUP_LWORK: patch was not fully copied 2026-04-09 02:23:58 +02:00
Martin Kroeker 9a0f76a0a1 Merge pull request #5746 from chenx97/mips-fix-implicit-declaration
MIPS: fix implicit declarations found in the cpuinfo detector
2026-04-08 15:32:20 +02:00
Martin Kroeker 75a99605af Merge pull request #5744 from nakatamaho/fix/slamc3
lapack/laed3: fix MinGW build by matching LAMC3 prototype
2026-04-08 12:18:22 +02:00
Martin Kroeker 9d9fcc1881 Merge pull request #5752 from martin-frbg/fixup5748
Fix missing endif in openblas_config.h
2026-04-08 12:17:35 +02:00
Martin Kroeker e926bb0523 fix missing endif 2026-04-08 10:38:56 +02:00
Henry Chen e875a9cdd0 Remove redundant C implemetations from MIPS directories 2026-04-08 13:59:10 +08:00
Martin Kroeker fb45e7da89 CirrusCI: Fix ranlib confusion between xcode and AndroidNDK (#5749)
* Use ar and ranlib from Android NDK rather than xcode
2026-04-08 00:34:18 +02:00
Martin Kroeker e41cb1ad7a Merge pull request #5748 from martin-frbg/issue5747
Check that _Float16 is available before using it in openblas_config.h
2026-04-07 22:52:20 +02:00
Martin Kroeker dc32a8a90f Try to find out if _Float16 is available on the target before using it 2026-04-07 18:31:40 +02:00
Henry Chen a04ea2b2c4 MIPS: fix implicit declarations found in the cpuinfo detector 2026-04-07 15:59:50 +08:00
NAKATA Maho f272216ae3 lapack/laed3: fix MinGW build for slaed3
common_interface.h declares slamc3 as returning FLOATRET when
NEED_F2CCONV is enabled, but laed3_single.c and laed3_parallel.c
redeclared LAMC3 as returning FLOAT. This causes conflicting-type
errors in MinGW builds.

Use FLOATRET for the local LAMC3 prototype so it matches the shared
declaration. Also undefine the Windows max macro before the local
max definition in laed3_parallel.c to avoid macro redefinition
warnings.
2026-04-06 13:13:21 +09:00
Martin Kroeker 9b3cc7835b Merge pull request #5741 from martin-frbg/issue5696
Add note on using an x86 OpenBLAS in Windows on Arm via Prism
2026-04-02 11:38:16 +02:00
Martin Kroeker bef5f1c6e2 Merge pull request #5740 from martin-frbg/issue5739
Fix out-of-bounds access in the converted C version of the CBLAS tests
2026-04-02 11:37:57 +02:00
Martin Kroeker 3bbd755ba7 Add note on using an x86 OpenBLAS in Windows on Arm via Prism 2026-04-02 10:36:33 +02:00
Martin Kroeker 47be0d8a52 Fix access beyond array size 2026-04-02 10:14:09 +02:00
Martin Kroeker 93515c2f7a Merge pull request #5736 from martin-frbg/lapack1221
Follow-up on ?GESVDQ updates from PR1146 (Reference-LAPACK PR 1221)
2026-04-01 22:47:39 +02:00
Martin Kroeker 7dde52d5d2 Follow-up on ?GESVDQ updates from PR 1146 (Reference-LAPACK PR 1221) 2026-04-01 16:27:56 +02:00
Martin Kroeker c6e4d17819 Follow-up on ?GESVDQ updates from PR 1146 (Reference-LAPACK PR 1221) 2026-04-01 15:34:02 +02:00
Martin Kroeker b9ba9be508 Follow-up on ?GESVDQ updates from PR1146 (Reference-LAPACK PR 1221) 2026-04-01 15:19:41 +02:00
Martin Kroeker d27e98c97a Merge pull request #5734 from martin-frbg/lapack774
Fix workspace size in ?TGSEN (Reference-LAPACK PR 774)
2026-04-01 08:52:37 +02:00
Martin Kroeker 429d23f420 Merge pull request #5730 from martin-frbg/lapack1206
Fix overwriting of LDSWORK in ?TRSYL3 (Reference-LAPACK PR 1206)
2026-03-31 23:58:04 +02:00
Martin Kroeker 3f2338ba85 Merge pull request #5732 from martin-frbg/lapack1209
Remove unused parameter in  DORBDB3/ZUNBDB3 (Reference-LAPACK PR 1209)
2026-03-31 23:57:36 +02:00
Martin Kroeker 62dcdca823 Merge pull request #5733 from martin-frbg/lapack1211
Re-enable testing of the ?BB/?GG driver routines (Reference-LAPACK PR 1211)
2026-03-31 23:57:08 +02:00
Martin Kroeker eaeaf95e23 Merge pull request #5731 from martin-frbg/lapack1207
Fix crossover of INFO variables in some EIG tests (Reference-LAPACK PR 1207)
2026-03-31 23:56:47 +02:00
Martin Kroeker f1f36c02b9 Merge pull request #5729 from martin-frbg/lapack1195
Fix truncation of large workspace values in ZHE routines (Reference-LAPACK PR 1195)
2026-03-31 21:36:54 +02:00
Martin Kroeker 9816062aaf Merge pull request #5727 from martin-frbg/lapack1187
Fix DGGES test seed to avoid bad matrix (Reference-LAPACK PR 1187)
2026-03-31 21:36:35 +02:00
Martin Kroeker 664f17655c Merge pull request #5726 from martin-frbg/lapack1149
Fix display of version number in LAPACK tests (Reference-LAPACK PR 1149)
2026-03-31 21:36:17 +02:00
Martin Kroeker aec6170a8b Merge pull request #5725 from martin-frbg/lapack1146
Fix support for jobu/v in LAPACKE_?GESVDQ_WORK (Reference-LAPACK PR 1146)
2026-03-31 19:21:10 +02:00
Martin Kroeker 66cc9f043d Merge pull request #5724 from martin-frbg/lapack1136
Add NaN checks for input matrix A in ?GEEV (Reference-LAPACK PR 1136)
2026-03-31 16:16:25 +02:00
Martin Kroeker cc74393520 Fix workspace size (Reference-LAPACK PR 774) 2026-03-31 14:06:00 +02:00
Martin Kroeker 4bbb9fefc0 Fix workspace size (Reference-LAPACK PR 774) 2026-03-31 14:02:02 +02:00
Martin Kroeker e48625414f Merge pull request #5723 from martin-frbg/lapack1094
Change WORK dimension in deprecated ?GELQS/?GEQRS (Reference-LAPACK PR 1094)
2026-03-31 12:16:09 +02:00
Martin Kroeker 844939a9fb Enable testing of the driver routines (Reference-LAPACK PR 1211) 2026-03-31 11:53:42 +02:00
Martin Kroeker f085c70784 Remove unused parameter (Reference-LAPACK PR 1209) 2026-03-31 11:47:24 +02:00
Martin Kroeker 391cbf8584 Pass IINFO instead of INFO to ??PGVX (Reference-LAPACK PR 1207) 2026-03-31 11:39:45 +02:00
Martin Kroeker 6e89813300 Fix spurious overwriting of caller variable LDSWORK (Reference-LAPACK PR 1206) 2026-03-31 11:31:38 +02:00
Martin Kroeker 37e189c85d Fix truncation of large workspace values (Reference-LAPACK PR 1195) 2026-03-31 10:59:07 +02:00
Martin Kroeker 6dad37ff8d Merge pull request #5722 from martin-frbg/lapack1023
Change loop order in ?GETC2 (Reference-LAPACK PR 1023)
2026-03-31 09:43:49 +02:00
Martin Kroeker 004cf0d3d0 Fix seed to avoid FMA-sensitive ill-conditioned matrix (Reference-LAPACK PR 1187) 2026-03-31 00:02:26 +02:00
Martin Kroeker 1243314201 Fix display of minor version number (Reference-LAPACK PR 1149) 2026-03-30 23:48:43 +02:00
Martin Kroeker edad2a8b2f Fix display of minor version number (Reference-LAPACK PR 1149) 2026-03-30 23:47:31 +02:00
Martin Kroeker 55d7dd89ae Fix support for jobu and jobv (Reference-LAPACK PR 1146) 2026-03-30 23:36:42 +02:00
Martin Kroeker e19e140619 Add NaN checks for input matrix A (Reference-LAPACK PR 1136) 2026-03-30 23:06:12 +02:00
Martin Kroeker a03cd30185 Change WORK(LWORK) to WORK(*) (Reference-LAPACK PR 1094) 2026-03-30 21:36:05 +02:00
Martin Kroeker 904f9d60b0 Merge pull request #5721 from martin-frbg/lapack1020
Implement ?LARF1F and ?ORM2R (Reference-LAPACK PRs 1019/1020/1196)
2026-03-30 21:25:56 +02:00
Martin Kroeker ff5dc3ebc1 Change loop ordering to improve performance (Reference-LAPACK PR 1023) 2026-03-30 20:24:31 +02:00
Martin Kroeker a5d0f89ea4 Add C replacements for ?LARF1F/?LARF1L 2026-03-30 19:41:54 +02:00
Martin Kroeker af63f2a1aa Add C replacements for ?LARF1F/?LARF1L 2026-03-30 19:40:14 +02:00
Martin Kroeker 4342764c23 Implement ?LARF1F and ?ORM2R (Reference-LAPACK PRs 1019/1020/1196) 2026-03-30 19:15:29 +02:00
Martin Kroeker d9bb8f369f Implement ?LARF1F and ?ORM2R (Reference-LAPACK PRs 1019/1020/1196) 2026-03-30 18:45:36 +02:00
Martin Kroeker f5f789fc52 Implement ?LARF1F and ?ORM2R (Reference-LAPACK PRs 1019/1020/1196) 2026-03-30 18:41:59 +02:00
Martin Kroeker 605b1287e3 Add ?LARF1F and ?LARF1L (Reference-LAPACK PRs 1019/1020) 2026-03-30 18:34:28 +02:00
Martin Kroeker d26960a21e Merge pull request #5719 from martin-frbg/issue5713
ARM64 DYNAMIC_ARCH: add CortexA75/76  and restore VORTEX for DYNAMIC_LIST
2026-03-30 07:19:53 +02:00
Martin Kroeker 16211b7170 Add CortexA75/76 via CortexA73 and restore VORTEX for use with DYNAMIC_LIST 2026-03-29 22:10:44 +02:00
Martin Kroeker 0f9f6e4be5 Merge pull request #5710 from martin-frbg/issue5708
Work around miscompilation of the ARM64 non-SVE DDOT kernel
2026-03-27 22:09:08 +01:00
Martin Kroeker 3ebfc0ef65 Merge pull request #5718 from martin-frbg/issue5625
Fix CMake DYNAMIC_ARCH builds under Windows on Arm
2026-03-27 16:51:58 +01:00
Martin Kroeker 0315003d1f Do not build SME targets in DYNAMIC_ARCH under Windows 2026-03-27 13:42:41 +01:00
Martin Kroeker 75511cb67c POSIX strncasecmp is strnicmp in Windows on Arm 2026-03-27 13:40:39 +01:00
Martin Kroeker b8dbc4a1fc Merge pull request #5716 from yuanjia111/develop
[ARM64] Add optimized fp16 shgemm kernels for Neoverse N2
2026-03-27 13:36:25 +01:00
yuanjia e6eba9fa21 Add optimized FP16 shgemm for for NEOVERSEN2 target 2026-03-27 17:55:06 +08:00
Martin Kroeker 2671786e61 Merge pull request #5715 from martin-frbg/issue5714
typedef the unsupported fp16 as bfloat16 on Loongarch64 too
2026-03-27 10:19:44 +01:00
Martin Kroeker 3c188e4c12 Merge pull request #5712 from murste01/develop
Fix incorrect cast from BF16 to FP32 in SBGEMM
2026-03-27 07:50:00 +01:00
Martin Kroeker 7086a1b075 typedef the unsupported fp16 as bfloat16 on Loongarch64 too 2026-03-26 23:00:04 +01:00
Murray Steele f6d4fe703b Fix incorrect cast from BF16 to FP32 in SBGEMM
This change fixes a regression in SBGEMM where C is assumed to be BF16,
and so unconditionally casts the output to FP32 resulting in incorrect
outputs when beta=1.
2026-03-26 12:10:52 +00:00
Martin Kroeker 1f1fcd4927 Merge pull request #5709 from iv-m/loongarch64-fix-typo
c_check: loongarch64: Fix typo
2026-03-24 23:10:52 +01:00
Martin Kroeker e3ce4623c2 Use volatile attribute for SDOT only, to avoid creating new miscompilations 2026-03-24 23:08:02 +01:00
Ivan A. Melnikov 86971646ed c_check: loongarch64: Fix typo
Fixes: 42c7a27e6b
2026-03-24 21:25:46 +04:00
Martin Kroeker b8697b3448 Update version to 0.3.32.dev 2026-03-24 00:02:13 +01:00
Martin Kroeker d511552e64 Update version to 0.3.32.dev 2026-03-24 00:01:33 +01:00
Martin Kroeker 821242ed9d Merge pull request #5706 from OpenMathLib/release-0.3.0
Merge back from release branch to copy 0.3.32 tag
2026-03-24 00:00:52 +01:00
278 changed files with 11352 additions and 6257 deletions
+4 -2
View File
@@ -89,14 +89,16 @@ task:
type: text/plain
macos_instance:
image: ghcr.io/cirruslabs/macos-sonoma-xcode:latest
image: ghcr.io/cirruslabs/macos-tahoe-xcode:latest
task:
name: AppleM1/LLVM armv7-androidndk xbuild
compile_script:
- brew install --cask android-ndk
- export ANDROID_NDK_HOME="/opt/homebrew/share/android-ndk"
- export CC=/opt/homebrew/share/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi23-clang
- make TARGET=ARMV7 ARM_SOFTFP_ABI=1 NUM_THREADS=32 HOSTCC=clang NOFORTRAN=1 RANLIB="ls -l"
- export AR=/opt/homebrew/share/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ar
- export RANLIB=/opt/homebrew/share/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ranlib
- make TARGET=ARMV7 ARM_SOFTFP_ABI=1 NUM_THREADS=32 HOSTCC=clang NOFORTRAN=1
always:
config_artifacts:
path: "*conf*"
+1 -1
View File
@@ -9,7 +9,7 @@ project(OpenBLAS C ASM)
set(OpenBLAS_MAJOR_VERSION 0)
set(OpenBLAS_MINOR_VERSION 3)
set(OpenBLAS_PATCH_VERSION 32)
set(OpenBLAS_PATCH_VERSION 32.dev)
set(OpenBLAS_VERSION "${OpenBLAS_MAJOR_VERSION}.${OpenBLAS_MINOR_VERSION}.${OpenBLAS_PATCH_VERSION}")
+1 -1
View File
@@ -3,7 +3,7 @@
#
# This library's version
VERSION = 0.3.32
VERSION = 0.3.32.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
+1 -1
View File
@@ -131,7 +131,7 @@ case "$architecture" in
defined=1
;;
arm|arm64) defined=1 ;;
zarch|e2k|alpha|ia64|riscv64|loonarch64|wasm)
zarch|e2k|alpha|ia64|riscv64|loongarch64|wasm)
defined=1
BINARY=64
;;
+2
View File
@@ -48,9 +48,11 @@ if (DYNAMIC_ARCH)
if (${CMAKE_C_COMPILER_VERSION} VERSION_GREATER_EQUAL 11) # SVE ACLE supported in LLVM >= 11
set(DYNAMIC_CORE ${DYNAMIC_CORE} NEOVERSEV1 NEOVERSEN2 ARMV8SVE A64FX)
endif ()
if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
if (${CMAKE_C_COMPILER_VERSION} VERSION_GREATER_EQUAL 19 OR (${CMAKE_C_COMPILER_ID} MATCHES AppleClang AND ${CMAKE_C_COMPILER_VERSION} VERSION_GREATER_EQUAL 17) ) # SME ACLE supported in LLVM >= 19 and AppleClang >= 17
set(DYNAMIC_CORE ${DYNAMIC_CORE} ARMV9SME VORTEXM4)
endif()
endif()
endif ()
if (DYNAMIC_LIST)
set(DYNAMIC_CORE ARMV8 ${DYNAMIC_LIST})
+8 -6
View File
@@ -71,7 +71,7 @@ set(SLASRC
slaqr0.f slaqr1.f slaqr2.f slaqr3.f slaqr4.f slaqr5.f
slaqtr.f slar1v.f slar2v.f ilaslr.f ilaslc.f
slarf.f slarfb.f slarfb_gett.f slarfg.f slarfgp.f slarft.f slarfx.f slarfy.f slargv.f
slarrv.f slartv.f
slarf1f.f slarf1l.f slarrv.f slartv.f
slarz.f slarzb.f slarzt.f slasy2.f
slasyf.f slasyf_rook.f slasyf_rk.f slasyf_aa.f
slatbs.f slatdf.f slatps.f slatrd.f slatrs.f slatrz.f
@@ -178,6 +178,7 @@ set(CLASRC
claqz0.f claqz1.f claqz2.f claqz3.f
claqsp.f claqsy.f clar1v.f clar2v.f ilaclr.f ilaclc.f
clarf.f clarfb.f clarfb_gett.f clarfg.f clarfgp.f clarft.f
clarf1f.f clarf1l.f
clarfx.f clarfy.f clargv.f clarnv.f clarrv.f clartg.f90 clartv.f
clarz.f clarzb.f clarzt.f clascl.f claset.f clasr.f classq.f90
clasyf.f clasyf_rook.f clasyf_rk.f clasyf_aa.f
@@ -262,7 +263,7 @@ set(DLASRC
dlaqr0.f dlaqr1.f dlaqr2.f dlaqr3.f dlaqr4.f dlaqr5.f
dlaqtr.f dlar1v.f dlar2v.f iladlr.f iladlc.f
dlarf.f dlarfb.f dlarfb_gett.f dlarfg.f dlarfgp.f dlarft.f dlarfx.f dlarfy.f
dlargv.f dlarrv.f dlartv.f
dlarf1f.f dlarf1l.f dlargv.f dlarrv.f dlartv.f
dlarz.f dlarzb.f dlarzt.f dlasy2.f
dlasyf.f dlasyf_rook.f dlasyf_rk.f dlasyf_aa.f
dlatbs.f dlatdf.f dlatps.f dlatrd.f dlatrs.f dlatrz.f
@@ -371,7 +372,7 @@ set(ZLASRC
zlaqr0.f zlaqr1.f zlaqr2.f zlaqr3.f zlaqr4.f zlaqr5.f
zlaqsp.f zlaqsy.f zlar1v.f zlar2v.f ilazlr.f ilazlc.f
zlarcm.f zlarf.f zlarfb.f zlarfb_gett.f
zlarfg.f zlarfgp.f zlarft.f
zlarfg.f zlarfgp.f zlarft.f zlarf1f.f zlarf1l.f
zlarfx.f zlarfy.f zlargv.f zlarnv.f zlarrv.f zlartg.f90 zlartv.f
zlarz.f zlarzb.f zlarzt.f zlascl.f zlaset.f zlasr.f
zlassq.f90 zlasyf.f zlasyf_rook.f zlasyf_rk.f zlasyf_aa.f
@@ -575,7 +576,7 @@ set(SLASRC
slaqr0.c slaqr1.c slaqr2.c slaqr3.c slaqr4.c slaqr5.c
slaqtr.c slar1v.c slar2v.c ilaslr.c ilaslc.c
slarf.c slarfb.c slarfb_gett.c slarfg.c slarfgp.c slarft.c slarfx.c slarfy.c slargv.c
slarrv.c slartv.c
slarf1f.c slarf1l.c slarrv.c slartv.c
slarz.c slarzb.c slarzt.c slasy2.c
slasyf.c slasyf_rook.c slasyf_rk.c slasyf_aa.c
slatbs.c slatdf.c slatps.c slatrd.c slatrs.c slatrz.c
@@ -681,6 +682,7 @@ set(CLASRC
claqr0.c claqr1.c claqr2.c claqr3.c claqr4.c claqr5.c
claqsp.c claqsy.c clar1v.c clar2v.c ilaclr.c ilaclc.c
clarf.c clarfb.c clarfb_gett.c clarfg.c clarfgp.c clarft.c
clarf1f.c clarf1l.c
clarfx.c clarfy.c clargv.c clarnv.c clarrv.c clartg.c clartv.c
clarz.c clarzb.c clarzt.c clascl.c claset.c clasr.c classq.c
clasyf.c clasyf_rook.c clasyf_rk.c clasyf_aa.c
@@ -764,7 +766,7 @@ set(DLASRC
dlaqr0.c dlaqr1.c dlaqr2.c dlaqr3.c dlaqr4.c dlaqr5.c
dlaqtr.c dlar1v.c dlar2v.c iladlr.c iladlc.c
dlarf.c dlarfb.c dlarfb_gett.c dlarfg.c dlarfgp.c dlarft.c dlarfx.c dlarfy.c
dlargv.c dlarrv.c dlartv.c
dlarf1f.c dlarf1l.c dlargv.c dlarrv.c dlartv.c
dlarz.c dlarzb.c dlarzt.c dlasy2.c
dlasyf.c dlasyf_rook.c dlasyf_rk.c dlasyf_aa.c
dlatbs.c dlatdf.c dlatps.c dlatrd.c dlatrs.c dlatrz.c
@@ -871,7 +873,7 @@ set(ZLASRC
zlaqhb.c zlaqhe.c zlaqhp.c zlaqp2.c zlaqp2rk.c zlaqp3rk.c zlaqps.c zlaqsb.c
zlaqr0.c zlaqr1.c zlaqr2.c zlaqr3.c zlaqr4.c zlaqr5.c
zlaqsp.c zlaqsy.c zlar1v.c zlar2v.c ilazlr.c ilazlc.c
zlarcm.c zlarf.c zlarfb.c zlarfb_gett.c
zlarcm.c zlarf.c zlarfb.c zlarfb_gett.c zlarf1f.c zlarf1l.c
zlarfg.c zlarfgp.c zlarft.c
zlarfx.c zlarfy.c zlargv.c zlarnv.c zlarrv.c zlartg.c zlartv.c
zlarz.c zlarzb.c zlarzt.c zlascl.c zlaset.c zlasr.c
+40 -41
View File
@@ -1,5 +1,5 @@
/*****************************************************************************
Copyright (c) 2011-2014, The OpenBLAS Project
Copyright (c) 2011-2026, The OpenBLAS Project
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -13,9 +13,9 @@ met:
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
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"
@@ -109,7 +109,7 @@ int detect(void){
return CPU_1004K;
} else if (strstr(p, " 24K")) {
return CPU_24K;
} else
} else
return CPU_UNKNOWN;
}
#endif
@@ -136,6 +136,40 @@ void get_subdirname(void){
printf("mips");
}
int get_feature(char *search) {
#ifdef __linux
FILE *infile;
char buffer[2048], *p, *t;
p = (char *)NULL;
infile = fopen("/proc/cpuinfo", "r");
while (fgets(buffer, sizeof(buffer), infile)) {
if (!strncmp("Features", buffer, 8) ||
!strncmp("ASEs implemented", buffer, 16)) {
p = strchr(buffer, ':') + 2;
break;
}
}
fclose(infile);
if (p == NULL)
return 0;
t = strtok(p, " ");
while (t = strtok(NULL, " ")) {
if (strstr(t, search)) {
return (1);
}
}
#endif
return (0);
}
void get_cpuconfig(void){
if(detect()==CPU_P5600){
printf("#define P5600\n");
@@ -165,7 +199,7 @@ void get_cpuconfig(void){
}else{
printf("#define UNKNOWN\n");
}
#ifndef NO_MSA
#ifndef NO_MSA
if (get_feature("msa")) printf("#define HAVE_MSA\n");
#endif
}
@@ -181,38 +215,3 @@ void get_libname(void){
printf("mips\n");
}
}
int get_feature(char *search)
{
#ifdef __linux
FILE *infile;
char buffer[2048], *p,*t;
p = (char *) NULL ;
infile = fopen("/proc/cpuinfo", "r");
while (fgets(buffer, sizeof(buffer), infile))
{
if (!strncmp("Features", buffer, 8) || !strncmp("ASEs implemented", buffer, 16))
{
p = strchr(buffer, ':') + 2;
break;
}
}
fclose(infile);
if( p == NULL ) return 0;
t = strtok(p," ");
while( t = strtok(NULL," "))
{
if (strstr(t, search)) { return(1); }
}
#endif
return(0);
}
+39 -40
View File
@@ -1,5 +1,5 @@
/*****************************************************************************
Copyright (c) 2011-2014, The OpenBLAS Project
Copyright (c) 2011-2026, The OpenBLAS Project
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -13,9 +13,9 @@ met:
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
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"
@@ -145,13 +145,47 @@ void get_subarchitecture(void){
printf("SICORTEX");
}else{
printf("MIPS64_GENERIC");
}
}
}
void get_subdirname(void){
printf("mips64");
}
int get_feature(char *search) {
#ifdef __linux
FILE *infile;
char buffer[2048], *p, *t;
p = (char *)NULL;
infile = fopen("/proc/cpuinfo", "r");
while (fgets(buffer, sizeof(buffer), infile)) {
if (!strncmp("Features", buffer, 8) ||
!strncmp("ASEs implemented", buffer, 16)) {
p = strchr(buffer, ':') + 2;
break;
}
}
fclose(infile);
if (p == NULL)
return 0;
t = strtok(p, " ");
while (t = strtok(NULL, " ")) {
if (strstr(t, search)) {
return (1);
}
}
#endif
return (0);
}
void get_cpuconfig(void){
if(detect()==CPU_LOONGSON3R3) {
printf("#define LOONGSON3R3\n");
@@ -228,38 +262,3 @@ void get_libname(void){
printf("mips64_generic\n");
}
}
int get_feature(char *search)
{
#ifdef __linux
FILE *infile;
char buffer[2048], *p,*t;
p = (char *) NULL ;
infile = fopen("/proc/cpuinfo", "r");
while (fgets(buffer, sizeof(buffer), infile))
{
if (!strncmp("Features", buffer, 8) || !strncmp("ASEs implemented", buffer, 16))
{
p = strchr(buffer, ':') + 2;
break;
}
}
fclose(infile);
if( p == NULL ) return 0;
t = strtok(p," ");
while( t = strtok(NULL," "))
{
if (strstr(t, search)) { return(1); }
}
#endif
return(0);
}
+1 -1
View File
@@ -509,7 +509,7 @@ L30:
if (i__1 < 2) {
goto L60;
}
for (i__ = 1; i__ <= 9; ++i__) {
for (i__ = 1; i__ <= 6; ++i__) {
if (s_cmp(snamet, snames[i__ - 1] , (ftnlen)12, (ftnlen)12) ==
0) {
goto L50;
+4
View File
@@ -443,6 +443,10 @@ To then use the built OpenBLAS shared library in Visual Studio:
### Windows on Arm
If you want to use a regular x64 Windows build of OpenBLAS with x64 software in the Prism emulator, be sure to use the latest version of Prism, and to check the box
to "Disable floating point optimization" in the Emulation settings. (Right-click on the executable to open "Properties", then on the "Compatibility" tab click on
"Change emulation settings").
A fully functional native OpenBLAS for WoA that can be built as both a static and dynamic library using LLVM toolchain and Visual Studio 2022. Before starting to build, make sure that you have installed Visual Studio 2022 on your ARM device, including the "Desktop Development with C++" component (that contains the cmake tool).
(Note that you can use the free "Visual Studio 2022 Community Edition" for this task. In principle it would be possible to build with VisualStudio alone, but using
the LLVM toolchain enables native compilation of the Fortran sources of LAPACK and of all the optimized assembly files, which VisualStudio cannot handle on its own)
+19 -7
View File
@@ -129,10 +129,16 @@ extern gotoblas_t gotoblas_ARMV9SME;
#else
#define gotoblas_ARMV9SME gotoblas_ARMV8
#endif
#ifdef DYN_VORTEX
extern gotoblas_t gotoblas_VORTEX;
#elif defined(DYN_NEOVERSEN1)
#define gotoblas_VORTEX gotoblas_NEOVERSEN1
#else
#define gotoblas_VORTEX gotoblas_ARMV8
#endif
#ifdef DYN_VORTEXM4
extern gotoblas_t gotoblas_VORTEXM4;
#else
#error "dont have vortexm4"
#define gotoblas_VORTEXM4 gotoblas_ARMV8
#endif
#ifdef DYN_CORTEXA55
@@ -145,7 +151,7 @@ extern gotoblas_t gotoblas_A64FX;
#else
#define gotoblas_A64FX gotoblas_ARMV8
#endif
#else
#else //not a user-specified dynamic_list
extern gotoblas_t gotoblas_CORTEXA53;
#define gotoblas_CORTEXA55 gotoblas_CORTEXA53
extern gotoblas_t gotoblas_CORTEXA57;
@@ -157,6 +163,7 @@ extern gotoblas_t gotoblas_THUNDERX2T99;
extern gotoblas_t gotoblas_TSV110;
extern gotoblas_t gotoblas_EMAG8180;
extern gotoblas_t gotoblas_NEOVERSEN1;
#define gotoblas_VORTEX gotoblas_NEOVERSEN1
#ifndef NO_SVE
extern gotoblas_t gotoblas_NEOVERSEV1;
extern gotoblas_t gotoblas_NEOVERSEN2;
@@ -192,7 +199,7 @@ extern void openblas_warning(int verbose, const char * msg);
#define FALLBACK_VERBOSE 1
#define NEOVERSEN1_FALLBACK "OpenBLAS : Your OS does not support SVE instructions. OpenBLAS is using Neoverse N1 kernels as a fallback, which may give poorer performance.\n"
#define NUM_CORETYPES 20
#define NUM_CORETYPES 21
/*
* In case asm/hwcap.h is outdated on the build system, make sure
@@ -232,6 +239,7 @@ static char *corename[] = {
"armv8sve",
"a64fx",
"armv9sme",
"vortex",
"vortexm4",
"unknown"
};
@@ -256,7 +264,8 @@ char *gotoblas_corename(void) {
if (gotoblas == &gotoblas_ARMV8SVE) return corename[16];
if (gotoblas == &gotoblas_A64FX) return corename[17];
if (gotoblas == &gotoblas_ARMV9SME) return corename[18];
if (gotoblas == &gotoblas_VORTEXM4) return corename[19];
if (gotoblas == &gotoblas_VORTEX) return corename[19];
if (gotoblas == &gotoblas_VORTEXM4) return corename[20];
return corename[NUM_CORETYPES];
}
@@ -295,7 +304,8 @@ static gotoblas_t *force_coretype(char *coretype) {
case 16: return (&gotoblas_ARMV8SVE);
case 17: return (&gotoblas_A64FX);
case 18: return (&gotoblas_ARMV9SME);
case 19: return (&gotoblas_VORTEXM4);
case 19: return (&gotoblas_VORTEX);
case 20: return (&gotoblas_VORTEXM4);
}
snprintf(message, 128, "Core not found: %s\n", coretype);
openblas_warning(1, message);
@@ -312,7 +322,7 @@ static gotoblas_t *get_coretype(void) {
return &gotoblas_VORTEXM4;
}
#endif
return &gotoblas_NEOVERSEN1;
return &gotoblas_VORTEX;
#endif
#if (!defined OS_LINUX && !defined OS_ANDROID)
@@ -397,6 +407,8 @@ static gotoblas_t *get_coretype(void) {
case 0xd08: // Cortex A72
return &gotoblas_CORTEXA72;
case 0xd09: // Cortex A73
case 0xd0a: // Cortex A75
case 0xd0b: // Cortex A76
return &gotoblas_CORTEXA73;
case 0xd0c: // Neoverse N1
return &gotoblas_NEOVERSEN1;
@@ -486,7 +498,7 @@ static gotoblas_t *get_coretype(void) {
break;
case 0x61: // Apple
if (support_sme1()) return &gotoblas_VORTEXM4;
return &gotoblas_NEOVERSEN1;
return &gotoblas_VORTEX;
break;
default:
snprintf(coremsg, 128, "Unknown CPU model - implementer %x part %x\n",implementer,part);
+6 -3
View File
@@ -1,5 +1,5 @@
/***************************************************************************
Copyright (c) 2013, The OpenBLAS Project
Copyright (c) 2013-2026, 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
@@ -50,8 +50,11 @@ FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y)
while(i < n)
{
dot += y[iy] * x[ix] ;
#if defined(DSDOT)
dot += (double)y[iy] * (double)x[ix] ;
#else
dot += y[iy] * x[ix];
#endif
ix += inc_x ;
iy += inc_y ;
i++ ;
+19
View File
@@ -204,6 +204,25 @@ BGEMMOTCOPYOBJ = bgemm_otcopy$(TSUFFIX).$(SUFFIX)
BGEMVTKERNEL = sbgemv_t_bfdot.c
BGEMVNKERNEL = bgemv_n_sve_v3x4.c
ifeq ($(BUILD_HFLOAT16), 1)
SHGEMMKERNEL = shgemm_kernel_$(SHGEMM_UNROLL_M)x$(SHGEMM_UNROLL_N)_neoversen2.c
SHGEMMINCOPY = shgemm_ncopy_$(SHGEMM_UNROLL_M)_neoversen2.c
SHGEMMITCOPY = shgemm_tcopy_$(SHGEMM_UNROLL_M)_neoversen2.c
ifneq ($(SHGEMM_UNROLL_M), $(SHGEMM_UNROLL_N))
SHGEMMINCOPY = ../generic/gemm_ncopy_$(SHGEMM_UNROLL_M).c
SHGEMMITCOPY = ../generic/gemm_tcopy_$(SHGEMM_UNROLL_M).c
endif
SHGEMMONCOPY = shgemm_ncopy_$(SHGEMM_UNROLL_N)_neoversen2.c
SHGEMMOTCOPY = shgemm_tcopy_$(SHGEMM_UNROLL_N)_neoversen2.c
SHGEMMINCOPYOBJ = shgemm_incopy$(TSUFFIX).$(SUFFIX)
SHGEMMITCOPYOBJ = shgemm_itcopy$(TSUFFIX).$(SUFFIX)
SHGEMMONCOPYOBJ = shgemm_oncopy$(TSUFFIX).$(SUFFIX)
SHGEMMOTCOPYOBJ = shgemm_otcopy$(TSUFFIX).$(SUFFIX)
ifndef SHGEMM_BETA
SHGEMM_BETA = sbgemm_beta_neoversen2.c
endif
endif
SBGEMM_BETA = sbgemm_beta_neoversen2.c
SBGEMMKERNEL = sbgemm_kernel_$(SBGEMM_UNROLL_M)x$(SBGEMM_UNROLL_N)_neoversen2.c
ifneq ($(SBGEMM_UNROLL_M), $(SBGEMM_UNROLL_N))
+4 -1
View File
@@ -262,7 +262,10 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
static RETURN_TYPE dot_kernel_asimd(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y)
{
volatile RETURN_TYPE dot = 0.0;
#ifndef DOUBLE
volatile
#endif
RETURN_TYPE dot = 0.0;
BLASLONG j = 0;
__asm__ __volatile__ (
+887
View File
@@ -0,0 +1,887 @@
/***************************************************************************
* Copyright (c) 2026 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 <arm_neon.h>
#include "common.h"
static inline void kernel_8x8(BLASLONG K, const float16_t *A, const float16_t *B, FLOAT *C, BLASLONG ldc, FLOAT alpha) {
float32x4_t c0_low = vdupq_n_f32(0.0f);
float32x4_t c0_high = vdupq_n_f32(0.0f);
float32x4_t c1_low = vdupq_n_f32(0.0f);
float32x4_t c1_high = vdupq_n_f32(0.0f);
float32x4_t c2_low = vdupq_n_f32(0.0f);
float32x4_t c2_high = vdupq_n_f32(0.0f);
float32x4_t c3_low = vdupq_n_f32(0.0f);
float32x4_t c3_high = vdupq_n_f32(0.0f);
float32x4_t c4_low = vdupq_n_f32(0.0f);
float32x4_t c4_high = vdupq_n_f32(0.0f);
float32x4_t c5_low = vdupq_n_f32(0.0f);
float32x4_t c5_high = vdupq_n_f32(0.0f);
float32x4_t c6_low = vdupq_n_f32(0.0f);
float32x4_t c6_high = vdupq_n_f32(0.0f);
float32x4_t c7_low = vdupq_n_f32(0.0f);
float32x4_t c7_high = vdupq_n_f32(0.0f);
for (BLASLONG k = 0; k < K; ++k) {
float16x8_t a_f16 = vld1q_f16(A);
float32x4_t a_low = vcvt_f32_f16(vget_low_f16(a_f16));
float32x4_t a_high = vcvt_f32_f16(vget_high_f16(a_f16));
float16x8_t b_f16 = vld1q_f16(B);
float32x4_t b_low = vcvt_f32_f16(vget_low_f16(b_f16));
float32x4_t b_high = vcvt_f32_f16(vget_high_f16(b_f16));
float32_t b0_lane0 = vgetq_lane_f32(b_low, 0);
c0_low = vfmaq_n_f32(c0_low, a_low, b0_lane0);
c0_high = vfmaq_n_f32(c0_high, a_high, b0_lane0);
float32_t b0_lane1 = vgetq_lane_f32(b_low, 1);
c1_low = vfmaq_n_f32(c1_low, a_low, b0_lane1);
c1_high = vfmaq_n_f32(c1_high, a_high, b0_lane1);
float32_t b0_lane2 = vgetq_lane_f32(b_low, 2);
c2_low = vfmaq_n_f32(c2_low, a_low, b0_lane2);
c2_high = vfmaq_n_f32(c2_high, a_high, b0_lane2);
float32_t b0_lane3 = vgetq_lane_f32(b_low, 3);
c3_low = vfmaq_n_f32(c3_low, a_low, b0_lane3);
c3_high = vfmaq_n_f32(c3_high, a_high, b0_lane3);
float32_t b1_lane0 = vgetq_lane_f32(b_high, 0);
c4_low = vfmaq_n_f32(c4_low, a_low, b1_lane0);
c4_high = vfmaq_n_f32(c4_high, a_high, b1_lane0);
float32_t b1_lane1 = vgetq_lane_f32(b_high, 1);
c5_low = vfmaq_n_f32(c5_low, a_low, b1_lane1);
c5_high = vfmaq_n_f32(c5_high, a_high, b1_lane1);
float32_t b1_lane2 = vgetq_lane_f32(b_high, 2);
c6_low = vfmaq_n_f32(c6_low, a_low, b1_lane2);
c6_high = vfmaq_n_f32(c6_high, a_high, b1_lane2);
float32_t b1_lane3 = vgetq_lane_f32(b_high, 3);
c7_low = vfmaq_n_f32(c7_low, a_low, b1_lane3);
c7_high = vfmaq_n_f32(c7_high, a_high, b1_lane3);
A += 8;
B += 8;
}
FLOAT *col_0 = C + 0 * ldc;
FLOAT *col_1 = C + 1 * ldc;
FLOAT *col_2 = C + 2 * ldc;
FLOAT *col_3 = C + 3 * ldc;
FLOAT *col_4 = C + 4 * ldc;
FLOAT *col_5 = C + 5 * ldc;
FLOAT *col_6 = C + 6 * ldc;
FLOAT *col_7 = C + 7 * ldc;
float32x4_t t0_l = vld1q_f32(col_0);
float32x4_t t0_h = vld1q_f32(col_0 + 4);
t0_l = vaddq_f32(t0_l, vmulq_n_f32(c0_low, alpha));
t0_h = vaddq_f32(t0_h, vmulq_n_f32(c0_high, alpha));
vst1q_f32(col_0, t0_l);
vst1q_f32(col_0 + 4, t0_h);
float32x4_t t1_l = vld1q_f32(col_1);
float32x4_t t1_h = vld1q_f32(col_1 + 4);
t1_l = vaddq_f32(t1_l, vmulq_n_f32(c1_low, alpha));
t1_h = vaddq_f32(t1_h, vmulq_n_f32(c1_high, alpha));
vst1q_f32(col_1, t1_l);
vst1q_f32(col_1 + 4, t1_h);
float32x4_t t2_l = vld1q_f32(col_2);
float32x4_t t2_h = vld1q_f32(col_2 + 4);
t2_l = vaddq_f32(t2_l, vmulq_n_f32(c2_low, alpha));
t2_h = vaddq_f32(t2_h, vmulq_n_f32(c2_high, alpha));
vst1q_f32(col_2, t2_l);
vst1q_f32(col_2 + 4, t2_h);
float32x4_t t3_l = vld1q_f32(col_3);
float32x4_t t3_h = vld1q_f32(col_3 + 4);
t3_l = vaddq_f32(t3_l, vmulq_n_f32(c3_low, alpha));
t3_h = vaddq_f32(t3_h, vmulq_n_f32(c3_high, alpha));
vst1q_f32(col_3, t3_l);
vst1q_f32(col_3 + 4, t3_h);
float32x4_t t4_l = vld1q_f32(col_4);
float32x4_t t4_h = vld1q_f32(col_4 + 4);
t4_l = vaddq_f32(t4_l, vmulq_n_f32(c4_low, alpha));
t4_h = vaddq_f32(t4_h, vmulq_n_f32(c4_high, alpha));
vst1q_f32(col_4, t4_l);
vst1q_f32(col_4 + 4, t4_h);
float32x4_t t5_l = vld1q_f32(col_5);
float32x4_t t5_h = vld1q_f32(col_5 + 4);
t5_l = vaddq_f32(t5_l, vmulq_n_f32(c5_low, alpha));
t5_h = vaddq_f32(t5_h, vmulq_n_f32(c5_high, alpha));
vst1q_f32(col_5, t5_l);
vst1q_f32(col_5 + 4, t5_h);
float32x4_t t6_l = vld1q_f32(col_6);
float32x4_t t6_h = vld1q_f32(col_6 + 4);
t6_l = vaddq_f32(t6_l, vmulq_n_f32(c6_low, alpha));
t6_h = vaddq_f32(t6_h, vmulq_n_f32(c6_high, alpha));
vst1q_f32(col_6, t6_l);
vst1q_f32(col_6 + 4, t6_h);
float32x4_t t7_l = vld1q_f32(col_7);
float32x4_t t7_h = vld1q_f32(col_7 + 4);
t7_l = vaddq_f32(t7_l, vmulq_n_f32(c7_low, alpha));
t7_h = vaddq_f32(t7_h, vmulq_n_f32(c7_high, alpha));
vst1q_f32(col_7, t7_l);
vst1q_f32(col_7 + 4, t7_h);
}
static inline void kernel_4x8(BLASLONG K, const float16_t *A, const float16_t *B, FLOAT *C, BLASLONG ldc, FLOAT alpha) {
float32x4_t c0 = vdupq_n_f32(0.0f);
float32x4_t c1 = vdupq_n_f32(0.0f);
float32x4_t c2 = vdupq_n_f32(0.0f);
float32x4_t c3 = vdupq_n_f32(0.0f);
float32x4_t c4 = vdupq_n_f32(0.0f);
float32x4_t c5 = vdupq_n_f32(0.0f);
float32x4_t c6 = vdupq_n_f32(0.0f);
float32x4_t c7 = vdupq_n_f32(0.0f);
for (BLASLONG k = 0; k < K; ++k) {
float32x4_t a_f16 = vcvt_f32_f16(vld1_f16(A));
float16x8_t b_f16 = vld1q_f16(B);
float32x4_t b_low = vcvt_f32_f16(vget_low_f16(b_f16));
float32x4_t b_high = vcvt_f32_f16(vget_high_f16(b_f16));
float32_t b0_lane0 = vgetq_lane_f32(b_low, 0);
c0 = vfmaq_n_f32(c0, a_f16, b0_lane0);
float32_t b0_lane1 = vgetq_lane_f32(b_low, 1);
c1 = vfmaq_n_f32(c1, a_f16, b0_lane1);
float32_t b0_lane2 = vgetq_lane_f32(b_low, 2);
c2 = vfmaq_n_f32(c2, a_f16, b0_lane2);
float32_t b0_lane3 = vgetq_lane_f32(b_low, 3);
c3 = vfmaq_n_f32(c3, a_f16, b0_lane3);
float32_t b1_lane0 = vgetq_lane_f32(b_high, 0);
c4 = vfmaq_n_f32(c4, a_f16, b1_lane0);
float32_t b1_lane1 = vgetq_lane_f32(b_high, 1);
c5 = vfmaq_n_f32(c5, a_f16, b1_lane1);
float32_t b1_lane2 = vgetq_lane_f32(b_high, 2);
c6 = vfmaq_n_f32(c6, a_f16, b1_lane2);
float32_t b1_lane3 = vgetq_lane_f32(b_high, 3);
c7 = vfmaq_n_f32(c7, a_f16, b1_lane3);
A += 4;
B += 8;
}
FLOAT *col_0 = C + 0 * ldc;
FLOAT *col_1 = C + 1 * ldc;
FLOAT *col_2 = C + 2 * ldc;
FLOAT *col_3 = C + 3 * ldc;
FLOAT *col_4 = C + 4 * ldc;
FLOAT *col_5 = C + 5 * ldc;
FLOAT *col_6 = C + 6 * ldc;
FLOAT *col_7 = C + 7 * ldc;
float32x4_t t0 = vld1q_f32(col_0);
t0 = vaddq_f32(t0, vmulq_n_f32(c0, alpha));
vst1q_f32(col_0, t0);
float32x4_t t1 = vld1q_f32(col_1);
t1 = vaddq_f32(t1, vmulq_n_f32(c1, alpha));
vst1q_f32(col_1, t1);
float32x4_t t2 = vld1q_f32(col_2);
t2 = vaddq_f32(t2, vmulq_n_f32(c2, alpha));
vst1q_f32(col_2, t2);
float32x4_t t3 = vld1q_f32(col_3);
t3 = vaddq_f32(t3, vmulq_n_f32(c3, alpha));
vst1q_f32(col_3, t3);
float32x4_t t4 = vld1q_f32(col_4);
t4 = vaddq_f32(t4, vmulq_n_f32(c4, alpha));
vst1q_f32(col_4, t4);
float32x4_t t5 = vld1q_f32(col_5);
t5 = vaddq_f32(t5, vmulq_n_f32(c5, alpha));
vst1q_f32(col_5, t5);
float32x4_t t6 = vld1q_f32(col_6);
t6 = vaddq_f32(t6, vmulq_n_f32(c6, alpha));
vst1q_f32(col_6, t6);
float32x4_t t7 = vld1q_f32(col_7);
t7 = vaddq_f32(t7, vmulq_n_f32(c7, alpha));
vst1q_f32(col_7, t7);
}
static inline void kernel_2x8(BLASLONG K, const float16_t *A, const float16_t *B, FLOAT *C, BLASLONG ldc, FLOAT alpha) {
float32x2_t c0 = vdup_n_f32(0.0f);
float32x2_t c1 = vdup_n_f32(0.0f);
float32x2_t c2 = vdup_n_f32(0.0f);
float32x2_t c3 = vdup_n_f32(0.0f);
float32x2_t c4 = vdup_n_f32(0.0f);
float32x2_t c5 = vdup_n_f32(0.0f);
float32x2_t c6 = vdup_n_f32(0.0f);
float32x2_t c7 = vdup_n_f32(0.0f);
for (BLASLONG k = 0; k < K; ++k) {
float32x4_t a_f32 = vcvt_f32_f16(vld1_f16(A));
float32x2_t a_low = vget_low_f32(a_f32);
float16x8_t b_f16 = vld1q_f16(B);
float32x4_t b_low = vcvt_f32_f16(vget_low_f16(b_f16));
float32x4_t b_high = vcvt_f32_f16(vget_high_f16(b_f16));
float32_t b0_lane0 = vgetq_lane_f32(b_low, 0);
c0 = vfma_n_f32(c0, a_low, b0_lane0);
float32_t b0_lane1 = vgetq_lane_f32(b_low, 1);
c1 = vfma_n_f32(c1, a_low, b0_lane1);
float32_t b0_lane2 = vgetq_lane_f32(b_low, 2);
c2 = vfma_n_f32(c2, a_low, b0_lane2);
float32_t b0_lane3 = vgetq_lane_f32(b_low, 3);
c3 = vfma_n_f32(c3, a_low, b0_lane3);
float32_t b1_lane0 = vgetq_lane_f32(b_high, 0);
c4 = vfma_n_f32(c4, a_low, b1_lane0);
float32_t b1_lane1 = vgetq_lane_f32(b_high, 1);
c5 = vfma_n_f32(c5, a_low, b1_lane1);
float32_t b1_lane2 = vgetq_lane_f32(b_high, 2);
c6 = vfma_n_f32(c6, a_low, b1_lane2);
float32_t b1_lane3 = vgetq_lane_f32(b_high, 3);
c7 = vfma_n_f32(c7, a_low, b1_lane3);
A += 2;
B += 8;
}
FLOAT *col_0 = C + 0 * ldc;
FLOAT *col_1 = C + 1 * ldc;
FLOAT *col_2 = C + 2 * ldc;
FLOAT *col_3 = C + 3 * ldc;
FLOAT *col_4 = C + 4 * ldc;
FLOAT *col_5 = C + 5 * ldc;
FLOAT *col_6 = C + 6 * ldc;
FLOAT *col_7 = C + 7 * ldc;
float32x2_t t0 = vld1_f32(col_0);
t0 = vadd_f32(t0, vmul_n_f32(c0, alpha));
vst1_f32(col_0, t0);
float32x2_t t1 = vld1_f32(col_1);
t1 = vadd_f32(t1, vmul_n_f32(c1, alpha));
vst1_f32(col_1, t1);
float32x2_t t2 = vld1_f32(col_2);
t2 = vadd_f32(t2, vmul_n_f32(c2, alpha));
vst1_f32(col_2, t2);
float32x2_t t3 = vld1_f32(col_3);
t3 = vadd_f32(t3, vmul_n_f32(c3, alpha));
vst1_f32(col_3, t3);
float32x2_t t4 = vld1_f32(col_4);
t4 = vadd_f32(t4, vmul_n_f32(c4, alpha));
vst1_f32(col_4, t4);
float32x2_t t5 = vld1_f32(col_5);
t5 = vadd_f32(t5, vmul_n_f32(c5, alpha));
vst1_f32(col_5, t5);
float32x2_t t6 = vld1_f32(col_6);
t6 = vadd_f32(t6, vmul_n_f32(c6, alpha));
vst1_f32(col_6, t6);
float32x2_t t7 = vld1_f32(col_7);
t7 = vadd_f32(t7, vmul_n_f32(c7, alpha));
vst1_f32(col_7, t7);
}
static inline void kernel_1x8(BLASLONG K, const float16_t *A, const float16_t *B, FLOAT *C, BLASLONG ldc, FLOAT alpha) {
FLOAT c0 = 0, c1 = 0, c2 = 0, c3 = 0, c4 = 0, c5 = 0, c6 = 0, c7 = 0;
for (BLASLONG k = 0; k < K; ++k) {
FLOAT a = A[0];
c0 += a * B[0];
c1 += a * B[1];
c2 += a * B[2];
c3 += a * B[3];
c4 += a * B[4];
c5 += a * B[5];
c6 += a * B[6];
c7 += a * B[7];
A += 1;
B += 8;
}
C[0 * ldc] += alpha * c0;
C[1 * ldc] += alpha * c1;
C[2 * ldc] += alpha * c2;
C[3 * ldc] += alpha * c3;
C[4 * ldc] += alpha * c4;
C[5 * ldc] += alpha * c5;
C[6 * ldc] += alpha * c6;
C[7 * ldc] += alpha * c7;
}
static inline void kernel_8x4(BLASLONG K, const float16_t *A, const float16_t *B, FLOAT *C, BLASLONG ldc, FLOAT alpha) {
float32x4_t c0_low = vdupq_n_f32(0.0f);
float32x4_t c0_high = vdupq_n_f32(0.0f);
float32x4_t c1_low = vdupq_n_f32(0.0f);
float32x4_t c1_high = vdupq_n_f32(0.0f);
float32x4_t c2_low = vdupq_n_f32(0.0f);
float32x4_t c2_high = vdupq_n_f32(0.0f);
float32x4_t c3_low = vdupq_n_f32(0.0f);
float32x4_t c3_high = vdupq_n_f32(0.0f);
for (BLASLONG k = 0; k < K; ++k) {
float16x8_t a_f16 = vld1q_f16(A);
float32x4_t a_low = vcvt_f32_f16(vget_low_f16(a_f16));
float32x4_t a_high = vcvt_f32_f16(vget_high_f16(a_f16));
float32x4_t b_f32 = vcvt_f32_f16(vld1_f16(B));
float32_t b0_lane0 = vgetq_lane_f32(b_f32, 0);
c0_low = vfmaq_n_f32(c0_low, a_low, b0_lane0);
c0_high = vfmaq_n_f32(c0_high, a_high, b0_lane0);
float32_t b0_lane1 = vgetq_lane_f32(b_f32, 1);
c1_low = vfmaq_n_f32(c1_low, a_low, b0_lane1);
c1_high = vfmaq_n_f32(c1_high, a_high, b0_lane1);
float32_t b0_lane2 = vgetq_lane_f32(b_f32, 2);
c2_low = vfmaq_n_f32(c2_low, a_low, b0_lane2);
c2_high = vfmaq_n_f32(c2_high, a_high, b0_lane2);
float32_t b0_lane3 = vgetq_lane_f32(b_f32, 3);
c3_low = vfmaq_n_f32(c3_low, a_low, b0_lane3);
c3_high = vfmaq_n_f32(c3_high, a_high, b0_lane3);
A += 8;
B += 4;
}
FLOAT *col_0 = C + 0 * ldc;
FLOAT *col_1 = C + 1 * ldc;
FLOAT *col_2 = C + 2 * ldc;
FLOAT *col_3 = C + 3 * ldc;
float32x4_t t0_l = vld1q_f32(col_0);
float32x4_t t0_h = vld1q_f32(col_0 + 4);
t0_l = vaddq_f32(t0_l, vmulq_n_f32(c0_low, alpha));
t0_h = vaddq_f32(t0_h, vmulq_n_f32(c0_high, alpha));
vst1q_f32(col_0, t0_l);
vst1q_f32(col_0 + 4, t0_h);
float32x4_t t1_l = vld1q_f32(col_1);
float32x4_t t1_h = vld1q_f32(col_1 + 4);
t1_l = vaddq_f32(t1_l, vmulq_n_f32(c1_low, alpha));
t1_h = vaddq_f32(t1_h, vmulq_n_f32(c1_high, alpha));
vst1q_f32(col_1, t1_l);
vst1q_f32(col_1 + 4, t1_h);
float32x4_t t2_l = vld1q_f32(col_2);
float32x4_t t2_h = vld1q_f32(col_2 + 4);
t2_l = vaddq_f32(t2_l, vmulq_n_f32(c2_low, alpha));
t2_h = vaddq_f32(t2_h, vmulq_n_f32(c2_high, alpha));
vst1q_f32(col_2, t2_l);
vst1q_f32(col_2 + 4, t2_h);
float32x4_t t3_l = vld1q_f32(col_3);
float32x4_t t3_h = vld1q_f32(col_3 + 4);
t3_l = vaddq_f32(t3_l, vmulq_n_f32(c3_low, alpha));
t3_h = vaddq_f32(t3_h, vmulq_n_f32(c3_high, alpha));
vst1q_f32(col_3, t3_l);
vst1q_f32(col_3 + 4, t3_h);
}
static inline void kernel_4x4(BLASLONG K, const float16_t *A, const float16_t *B, FLOAT *C, BLASLONG ldc, FLOAT alpha) {
float32x4_t c0 = vdupq_n_f32(0.0f);
float32x4_t c1 = vdupq_n_f32(0.0f);
float32x4_t c2 = vdupq_n_f32(0.0f);
float32x4_t c3 = vdupq_n_f32(0.0f);
for (BLASLONG k = 0; k < K; ++k) {
float32x4_t a_f32 = vcvt_f32_f16(vld1_f16(A));
float32x4_t b_f32 = vcvt_f32_f16(vld1_f16(B));
float32_t b0_lane0 = vgetq_lane_f32(b_f32, 0);
c0 = vfmaq_n_f32(c0, a_f32, b0_lane0);
float32_t b0_lane1 = vgetq_lane_f32(b_f32, 1);
c1 = vfmaq_n_f32(c1, a_f32, b0_lane1);
float32_t b0_lane2 = vgetq_lane_f32(b_f32, 2);
c2 = vfmaq_n_f32(c2, a_f32, b0_lane2);
float32_t b0_lane3 = vgetq_lane_f32(b_f32, 3);
c3 = vfmaq_n_f32(c3, a_f32, b0_lane3);
A += 4;
B += 4;
}
FLOAT *col_0 = C + 0 * ldc;
FLOAT *col_1 = C + 1 * ldc;
FLOAT *col_2 = C + 2 * ldc;
FLOAT *col_3 = C + 3 * ldc;
float32x4_t t0 = vld1q_f32(col_0);
t0 = vaddq_f32(t0, vmulq_n_f32(c0, alpha));
vst1q_f32(col_0, t0);
float32x4_t t1 = vld1q_f32(col_1);
t1 = vaddq_f32(t1, vmulq_n_f32(c1, alpha));
vst1q_f32(col_1, t1);
float32x4_t t2 = vld1q_f32(col_2);
t2 = vaddq_f32(t2, vmulq_n_f32(c2, alpha));
vst1q_f32(col_2, t2);
float32x4_t t3 = vld1q_f32(col_3);
t3 = vaddq_f32(t3, vmulq_n_f32(c3, alpha));
vst1q_f32(col_3, t3);
}
static inline void kernel_2x4(BLASLONG K, const float16_t *A, const float16_t *B, FLOAT *C, BLASLONG ldc, FLOAT alpha) {
float32x2_t c0 = vdup_n_f32(0.0f);
float32x2_t c1 = vdup_n_f32(0.0f);
float32x2_t c2 = vdup_n_f32(0.0f);
float32x2_t c3 = vdup_n_f32(0.0f);
for (BLASLONG k = 0; k < K; ++k) {
float32x4_t a_f32 = vcvt_f32_f16(vld1_f16(A));
float32x2_t a_low = vget_low_f32(a_f32);
float32x4_t b_f32 = vcvt_f32_f16(vld1_f16(B));
float32_t b0_lane0 = vgetq_lane_f32(b_f32, 0);
c0 = vfma_n_f32(c0, a_low, b0_lane0);
float32_t b0_lane1 = vgetq_lane_f32(b_f32, 1);
c1 = vfma_n_f32(c1, a_low, b0_lane1);
float32_t b0_lane2 = vgetq_lane_f32(b_f32, 2);
c2 = vfma_n_f32(c2, a_low, b0_lane2);
float32_t b0_lane3 = vgetq_lane_f32(b_f32, 3);
c3 = vfma_n_f32(c3, a_low, b0_lane3);
A += 2;
B += 4;
}
FLOAT *col_0 = C + 0 * ldc;
FLOAT *col_1 = C + 1 * ldc;
FLOAT *col_2 = C + 2 * ldc;
FLOAT *col_3 = C + 3 * ldc;
float32x2_t t0 = vld1_f32(col_0);
t0 = vadd_f32(t0, vmul_n_f32(c0, alpha));
vst1_f32(col_0, t0);
float32x2_t t1 = vld1_f32(col_1);
t1 = vadd_f32(t1, vmul_n_f32(c1, alpha));
vst1_f32(col_1, t1);
float32x2_t t2 = vld1_f32(col_2);
t2 = vadd_f32(t2, vmul_n_f32(c2, alpha));
vst1_f32(col_2, t2);
float32x2_t t3 = vld1_f32(col_3);
t3 = vadd_f32(t3, vmul_n_f32(c3, alpha));
vst1_f32(col_3, t3);
}
static inline void kernel_1x4(BLASLONG K, const float16_t *A, const float16_t *B, FLOAT *C, BLASLONG ldc, FLOAT alpha) {
FLOAT c0 = 0, c1 = 0, c2 = 0, c3 = 0;
for (BLASLONG k = 0; k < K; ++k) {
FLOAT a = A[0];
c0 += a * B[0];
c1 += a * B[1];
c2 += a * B[2];
c3 += a * B[3];
A += 1;
B += 4;
}
C[0 * ldc] += alpha * c0;
C[1 * ldc] += alpha * c1;
C[2 * ldc] += alpha * c2;
C[3 * ldc] += alpha * c3;
}
static inline void kernel_8x2(BLASLONG K, const float16_t *A, const float16_t *B, FLOAT *C, BLASLONG ldc, FLOAT alpha) {
float32x4_t c0_low = vdupq_n_f32(0.0f);
float32x4_t c0_high = vdupq_n_f32(0.0f);
float32x4_t c1_low = vdupq_n_f32(0.0f);
float32x4_t c1_high = vdupq_n_f32(0.0f);
for (BLASLONG k = 0; k < K; ++k) {
float16x8_t a_f16 = vld1q_f16(A);
float32x4_t a_low = vcvt_f32_f16(vget_low_f16(a_f16));
float32x4_t a_high = vcvt_f32_f16(vget_high_f16(a_f16));
float32x4_t b_f32 = vcvt_f32_f16(vld1_f16(B));
float32_t b0_lane0 = vgetq_lane_f32(b_f32, 0);
c0_low = vfmaq_n_f32(c0_low, a_low, b0_lane0);
c0_high = vfmaq_n_f32(c0_high, a_high, b0_lane0);
float32_t b0_lane1 = vgetq_lane_f32(b_f32, 1);
c1_low = vfmaq_n_f32(c1_low, a_low, b0_lane1);
c1_high = vfmaq_n_f32(c1_high, a_high, b0_lane1);
A += 8;
B += 2;
}
FLOAT *col_0 = C + 0 * ldc;
FLOAT *col_1 = C + 1 * ldc;
float32x4_t t0_l = vld1q_f32(col_0);
float32x4_t t0_h = vld1q_f32(col_0 + 4);
t0_l = vaddq_f32(t0_l, vmulq_n_f32(c0_low, alpha));
t0_h = vaddq_f32(t0_h, vmulq_n_f32(c0_high, alpha));
vst1q_f32(col_0, t0_l);
vst1q_f32(col_0 + 4, t0_h);
float32x4_t t1_l = vld1q_f32(col_1);
float32x4_t t1_h = vld1q_f32(col_1 + 4);
t1_l = vaddq_f32(t1_l, vmulq_n_f32(c1_low, alpha));
t1_h = vaddq_f32(t1_h, vmulq_n_f32(c1_high, alpha));
vst1q_f32(col_1, t1_l);
vst1q_f32(col_1 + 4, t1_h);
}
static inline void kernel_4x2(BLASLONG K, const float16_t *A, const float16_t *B, FLOAT *C, BLASLONG ldc, FLOAT alpha) {
float32x4_t c0 = vdupq_n_f32(0.0f);
float32x4_t c1 = vdupq_n_f32(0.0f);
for (BLASLONG k = 0; k < K; ++k) {
float32x4_t a_f32 = vcvt_f32_f16(vld1_f16(A));
float32x4_t b_f32 = vcvt_f32_f16(vld1_f16(B));
float32_t b0_lane0 = vgetq_lane_f32(b_f32, 0);
c0 = vfmaq_n_f32(c0, a_f32, b0_lane0);
float32_t b0_lane1 = vgetq_lane_f32(b_f32, 1);
c1 = vfmaq_n_f32(c1, a_f32, b0_lane1);
A += 4;
B += 2;
}
FLOAT *col_0 = C + 0 * ldc;
FLOAT *col_1 = C + 1 * ldc;
float32x4_t t0 = vld1q_f32(col_0);
t0 = vaddq_f32(t0, vmulq_n_f32(c0, alpha));
vst1q_f32(col_0, t0);
float32x4_t t1 = vld1q_f32(col_1);
t1 = vaddq_f32(t1, vmulq_n_f32(c1, alpha));
vst1q_f32(col_1, t1);
}
static inline void kernel_2x2(BLASLONG K, const float16_t *A, const float16_t *B, FLOAT *C, BLASLONG ldc, FLOAT alpha) {
float32x2_t c0 = vdup_n_f32(0.0f);
float32x2_t c1 = vdup_n_f32(0.0f);
for (BLASLONG k = 0; k < K; ++k) {
float32x4_t a_f32 = vcvt_f32_f16(vld1_f16(A));
float32x2_t a_low = vget_low_f32(a_f32);
float32x4_t b_f32 = vcvt_f32_f16(vld1_f16(B));
float32_t b0_lane0 = vgetq_lane_f32(b_f32, 0);
c0 = vfma_n_f32(c0, a_low, b0_lane0);
float32_t b0_lane1 = vgetq_lane_f32(b_f32, 1);
c1 = vfma_n_f32(c1, a_low, b0_lane1);
;
A += 2;
B += 2;
}
FLOAT *col_0 = C + 0 * ldc;
FLOAT *col_1 = C + 1 * ldc;
float32x2_t t0 = vld1_f32(col_0);
t0 = vadd_f32(t0, vmul_n_f32(c0, alpha));
vst1_f32(col_0, t0);
float32x2_t t1 = vld1_f32(col_1);
t1 = vadd_f32(t1, vmul_n_f32(c1, alpha));
vst1_f32(col_1, t1);
}
static inline void kernel_1x2(BLASLONG K, const float16_t *A, const float16_t *B, FLOAT *C, BLASLONG ldc, FLOAT alpha) {
FLOAT c0 = 0, c1 = 0;
for (BLASLONG k = 0; k < K; ++k) {
FLOAT a = A[0];
c0 += a * B[0];
c1 += a * B[1];
A += 1;
B += 2;
}
C[0 * ldc] += alpha * c0;
C[1 * ldc] += alpha * c1;
}
static inline void kernel_8x1(BLASLONG K, const float16_t *A, const float16_t *B, FLOAT *C, FLOAT alpha) {
float32x4_t c0_low = vdupq_n_f32(0.0f);
float32x4_t c0_high = vdupq_n_f32(0.0f);
for (BLASLONG k = 0; k < K; ++k) {
float16x8_t a_f16 = vld1q_f16(A);
float32x4_t a_low = vcvt_f32_f16(vget_low_f16(a_f16));
float32x4_t a_high = vcvt_f32_f16(vget_high_f16(a_f16));
float b_scalar = (float)B[0];
c0_low = vfmaq_n_f32(c0_low, a_low, b_scalar);
c0_high = vfmaq_n_f32(c0_high, a_high, b_scalar);
A += 8;
B += 1;
}
FLOAT *col_0 = C;
float32x4_t t0_l = vld1q_f32(col_0);
float32x4_t t0_h = vld1q_f32(col_0 + 4);
t0_l = vaddq_f32(t0_l, vmulq_n_f32(c0_low, alpha));
t0_h = vaddq_f32(t0_h, vmulq_n_f32(c0_high, alpha));
vst1q_f32(col_0, t0_l);
vst1q_f32(col_0 + 4, t0_h);
}
static inline void kernel_4x1(BLASLONG K, const float16_t *A, const float16_t *B, FLOAT *C, FLOAT alpha) {
float32x4_t c0 = vdupq_n_f32(0.0f);
for (BLASLONG k = 0; k < K; ++k) {
float32x4_t a_f32 = vcvt_f32_f16(vld1_f16(A));
float b_scalar = (float)B[0];
c0 = vfmaq_n_f32(c0, a_f32, b_scalar);
A += 4;
B += 1;
}
FLOAT *col_0 = C;
float32x4_t t0 = vld1q_f32(col_0);
t0 = vaddq_f32(t0, vmulq_n_f32(c0, alpha));
vst1q_f32(col_0, t0);
}
static inline void kernel_2x1(BLASLONG K, const float16_t *A, const float16_t *B, FLOAT *C, FLOAT alpha) {
float32x2_t c0 = vdup_n_f32(0.0f);
for (BLASLONG k = 0; k < K; ++k) {
float32x4_t a_f32 = vcvt_f32_f16(vld1_f16(A));
float32x2_t a_low = vget_low_f32(a_f32);
float b_scalar = (float)B[0];
c0 = vfma_n_f32(c0, a_low, b_scalar);
A += 2;
B += 1;
}
FLOAT *col_0 = C;
float32x2_t t0 = vld1_f32(col_0);
t0 = vadd_f32(t0, vmul_n_f32(c0, alpha));
vst1_f32(col_0, t0);
}
static inline void kernel_1x1(BLASLONG K, const float16_t *A, const float16_t *B, FLOAT *C, FLOAT alpha) {
FLOAT sum = 0.0f;
for (BLASLONG k = 0; k < K; ++k) {
sum += A[0] * B[0];
A += 1;
B += 1;
}
C[0] += alpha * sum;
}
int CNAME(BLASLONG M, BLASLONG N, BLASLONG K, FLOAT alpha, IFLOAT *A, IFLOAT *B, FLOAT *C, BLASLONG ldc) {
float16_t *A_base = (float16_t *)A;
float16_t *B_base = (float16_t *)B;
FLOAT *Ccol = C;
BLASLONG m_rem1, m_rem2, m_rem3, m_rem4;
while (N >= 8) {
const float16_t *Aptr = A_base;
const float16_t *Bptr = B_base;
FLOAT *Crow = Ccol;
m_rem1 = M;
while (m_rem1 >= 8) {
kernel_8x8(K, Aptr, Bptr, Crow, ldc, alpha);
Aptr += K * 8;
Crow += 8;
m_rem1 -= 8;
}
if (m_rem1 >= 4) {
kernel_4x8(K, Aptr, Bptr, Crow, ldc, alpha);
Aptr += K * 4;
Crow += 4;
m_rem1 -= 4;
}
if (m_rem1 >= 2) {
kernel_2x8(K, Aptr, Bptr, Crow, ldc, alpha);
Aptr += K * 2;
Crow += 2;
m_rem1 -= 2;
}
if (m_rem1 >= 1) {
kernel_1x8(K, Aptr, Bptr, Crow, ldc, alpha);
}
B_base += K * 8;
Ccol += ldc * 8;
N -= 8;
}
if (N >= 4) {
const float16_t *Aptr = A_base;
const float16_t *Bptr = B_base;
FLOAT *Crow = Ccol;
m_rem2 = M;
while (m_rem2 >= 8) {
kernel_8x4(K, Aptr, Bptr, Crow, ldc, alpha);
Aptr += K * 8;
Crow += 8;
m_rem2 -= 8;
}
if (m_rem2 >= 4) {
kernel_4x4(K, Aptr, Bptr, Crow, ldc, alpha);
Aptr += K * 4;
Crow += 4;
m_rem2 -= 4;
}
if (m_rem2 >= 2) {
kernel_2x4(K, Aptr, Bptr, Crow, ldc, alpha);
Aptr += K * 2;
Crow += 2;
m_rem2 -= 2;
}
if (m_rem2 >= 1) {
kernel_1x4(K, Aptr, Bptr, Crow, ldc, alpha);
}
B_base += K * 4;
Ccol += ldc * 4;
N -= 4;
}
if (N >= 2) {
const float16_t *Aptr = A_base;
const float16_t *Bptr = B_base;
FLOAT *Crow = Ccol;
m_rem3 = M;
while (m_rem3 >= 8) {
kernel_8x2(K, Aptr, Bptr, Crow, ldc, alpha);
Aptr += K * 8;
Crow += 8;
m_rem3 -= 8;
}
if (m_rem3 >= 4) {
kernel_4x2(K, Aptr, Bptr, Crow, ldc, alpha);
Aptr += K * 4;
Crow += 4;
m_rem3 -= 4;
}
if (m_rem3 >= 2) {
kernel_2x2(K, Aptr, Bptr, Crow, ldc, alpha);
Aptr += K * 2;
Crow += 2;
m_rem3 -= 2;
}
if (m_rem3 >= 1) {
kernel_1x2(K, Aptr, Bptr, Crow, ldc, alpha);
}
B_base += K * 2;
Ccol += ldc * 2;
N -= 2;
}
if (N >= 1) {
const float16_t *Aptr = A_base;
const float16_t *Bptr = B_base;
FLOAT *Crow = Ccol;
m_rem4 = M;
while (m_rem4 >= 8) {
kernel_8x1(K, Aptr, Bptr, Crow, alpha);
Aptr += K * 8;
Crow += 8;
m_rem4 -= 8;
}
if (m_rem4 >= 4) {
kernel_4x1(K, Aptr, Bptr, Crow, alpha);
Aptr += K * 4;
Crow += 4;
m_rem4 -= 4;
}
if (m_rem4 >= 2) {
kernel_2x1(K, Aptr, Bptr, Crow, alpha);
Aptr += K * 2;
Crow += 2;
m_rem4 -= 2;
}
if (m_rem4 >= 1) {
kernel_1x1(K, Aptr, Bptr, Crow, alpha);
}
}
return 0;
}
+258
View File
@@ -0,0 +1,258 @@
/***************************************************************************
* Copyright (c) 2026, 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 <arm_neon.h>
#include "common.h"
static inline void transpose8x8(float16x8_t *rows, float16x8_t *cols) {
float64x2_t b0 = vtrn1q_f64(vreinterpretq_f64_f16(rows[0]), vreinterpretq_f64_f16(rows[4]));
float64x2_t b1 = vtrn1q_f64(vreinterpretq_f64_f16(rows[1]), vreinterpretq_f64_f16(rows[5]));
float64x2_t b2 = vtrn1q_f64(vreinterpretq_f64_f16(rows[2]), vreinterpretq_f64_f16(rows[6]));
float64x2_t b3 = vtrn1q_f64(vreinterpretq_f64_f16(rows[3]), vreinterpretq_f64_f16(rows[7]));
float64x2_t b4 = vtrn2q_f64(vreinterpretq_f64_f16(rows[0]), vreinterpretq_f64_f16(rows[4]));
float64x2_t b5 = vtrn2q_f64(vreinterpretq_f64_f16(rows[1]), vreinterpretq_f64_f16(rows[5]));
float64x2_t b6 = vtrn2q_f64(vreinterpretq_f64_f16(rows[2]), vreinterpretq_f64_f16(rows[6]));
float64x2_t b7 = vtrn2q_f64(vreinterpretq_f64_f16(rows[3]), vreinterpretq_f64_f16(rows[7]));
float32x4_t c0 = vtrn1q_f32(vreinterpretq_f32_f64(b0), vreinterpretq_f32_f64(b2));
float32x4_t c1 = vtrn1q_f32(vreinterpretq_f32_f64(b1), vreinterpretq_f32_f64(b3));
float32x4_t c2 = vtrn2q_f32(vreinterpretq_f32_f64(b0), vreinterpretq_f32_f64(b2));
float32x4_t c3 = vtrn2q_f32(vreinterpretq_f32_f64(b1), vreinterpretq_f32_f64(b3));
float32x4_t c4 = vtrn1q_f32(vreinterpretq_f32_f64(b4), vreinterpretq_f32_f64(b6));
float32x4_t c5 = vtrn1q_f32(vreinterpretq_f32_f64(b5), vreinterpretq_f32_f64(b7));
float32x4_t c6 = vtrn2q_f32(vreinterpretq_f32_f64(b4), vreinterpretq_f32_f64(b6));
float32x4_t c7 = vtrn2q_f32(vreinterpretq_f32_f64(b5), vreinterpretq_f32_f64(b7));
float16x8_t d0 = vtrn1q_f16(vreinterpretq_f16_f32(c0), vreinterpretq_f16_f32(c1));
float16x8_t d1 = vtrn2q_f16(vreinterpretq_f16_f32(c0), vreinterpretq_f16_f32(c1));
float16x8_t d2 = vtrn1q_f16(vreinterpretq_f16_f32(c2), vreinterpretq_f16_f32(c3));
float16x8_t d3 = vtrn2q_f16(vreinterpretq_f16_f32(c2), vreinterpretq_f16_f32(c3));
float16x8_t d4 = vtrn1q_f16(vreinterpretq_f16_f32(c4), vreinterpretq_f16_f32(c5));
float16x8_t d5 = vtrn2q_f16(vreinterpretq_f16_f32(c4), vreinterpretq_f16_f32(c5));
float16x8_t d6 = vtrn1q_f16(vreinterpretq_f16_f32(c6), vreinterpretq_f16_f32(c7));
float16x8_t d7 = vtrn2q_f16(vreinterpretq_f16_f32(c6), vreinterpretq_f16_f32(c7));
cols[0] = d0;
cols[1] = d1;
cols[2] = d2;
cols[3] = d3;
cols[4] = d4;
cols[5] = d5;
cols[6] = d6;
cols[7] = d7;
}
static inline void transpose_4x4(float16x4_t *rows, float16x4_t *cols) {
float16x8_t t0 = vcombine_f16(rows[0], vdup_n_f16(0.0f));
float16x8_t t1 = vcombine_f16(rows[1], vdup_n_f16(0.0f));
float16x8_t t2 = vcombine_f16(rows[2], vdup_n_f16(0.0f));
float16x8_t t3 = vcombine_f16(rows[3], vdup_n_f16(0.0f));
float16x8_t t02 = vzip1q_f16(t0, t2);
float16x8_t t13 = vzip1q_f16(t1, t3);
float16x8x2_t t0123 = vzipq_f16(t02, t13);
cols[0] = vget_low_f16(t0123.val[0]);
cols[1] = vget_high_f16(t0123.val[0]);
cols[2] = vget_low_f16(t0123.val[1]);
cols[3] = vget_high_f16(t0123.val[1]);
}
int CNAME(BLASLONG m, BLASLONG n, IFLOAT *a, BLASLONG lda, IFLOAT *b) {
BLASLONG i, j;
IFLOAT *a_offset = a;
IFLOAT *b_offset = b;
float16x8_t v0, v1, v2, v3, v4, v5, v6, v7;
float16x4_t v8, v9, v10, v11;
BLASLONG n8 = n >> 3;
for (j = 0; j < n8; j++) {
IFLOAT *a0 = a_offset;
IFLOAT *a1 = a0 + lda;
IFLOAT *a2 = a1 + lda;
IFLOAT *a3 = a2 + lda;
IFLOAT *a4 = a3 + lda;
IFLOAT *a5 = a4 + lda;
IFLOAT *a6 = a5 + lda;
IFLOAT *a7 = a6 + lda;
a_offset += 8 * lda;
BLASLONG m8 = m >> 3;
for (i = 0; i < m8; i++) {
v0 = vld1q_f16((float16_t *)a0);
v1 = vld1q_f16((float16_t *)a1);
v2 = vld1q_f16((float16_t *)a2);
v3 = vld1q_f16((float16_t *)a3);
v4 = vld1q_f16((float16_t *)a4);
v5 = vld1q_f16((float16_t *)a5);
v6 = vld1q_f16((float16_t *)a6);
v7 = vld1q_f16((float16_t *)a7);
float16x8_t rows[8] = {v0, v1, v2, v3, v4, v5, v6, v7};
float16x8_t cols[8];
transpose8x8(rows, cols);
vst1q_f16((float16_t *)b_offset, cols[0]);
vst1q_f16((float16_t *)b_offset + 8, cols[1]);
vst1q_f16((float16_t *)b_offset + 16, cols[2]);
vst1q_f16((float16_t *)b_offset + 24, cols[3]);
vst1q_f16((float16_t *)b_offset + 32, cols[4]);
vst1q_f16((float16_t *)b_offset + 40, cols[5]);
vst1q_f16((float16_t *)b_offset + 48, cols[6]);
vst1q_f16((float16_t *)b_offset + 56, cols[7]);
a0 += 8;
a1 += 8;
a2 += 8;
a3 += 8;
a4 += 8;
a5 += 8;
a6 += 8;
a7 += 8;
b_offset += 64;
}
BLASLONG i = (m & 7);
if (i > 0) {
for (BLASLONG k = 0; k < i; k++) {
*(b_offset + 0) = *a0;
*(b_offset + 1) = *a1;
*(b_offset + 2) = *a2;
*(b_offset + 3) = *a3;
*(b_offset + 4) = *a4;
*(b_offset + 5) = *a5;
*(b_offset + 6) = *a6;
*(b_offset + 7) = *a7;
a0++;
a1++;
a2++;
a3++;
a4++;
a5++;
a6++;
a7++;
b_offset += 8;
}
}
}
if (n & 4) {
IFLOAT *a0 = a_offset;
IFLOAT *a1 = a0 + lda;
IFLOAT *a2 = a1 + lda;
IFLOAT *a3 = a2 + lda;
a_offset += 4 * lda;
BLASLONG m4 = m >> 2;
for (i = 0; i < m4; i++) {
v8 = vld1_f16((float16_t *)a0);
v9 = vld1_f16((float16_t *)a1);
v10 = vld1_f16((float16_t *)a2);
v11 = vld1_f16((float16_t *)a3);
float16x4_t rows[4] = {v8, v9, v10, v11};
float16x4_t cols[4];
transpose_4x4(rows, cols);
vst1_f16((float16_t *)b_offset, cols[0]);
vst1_f16((float16_t *)b_offset + 4, cols[1]);
vst1_f16((float16_t *)b_offset + 8, cols[2]);
vst1_f16((float16_t *)b_offset + 12, cols[3]);
a0 += 4;
a1 += 4;
a2 += 4;
a3 += 4;
b_offset += 16;
}
BLASLONG i = (m & 3);
if (i > 0) {
for (BLASLONG k = 0; k < i; k++) {
*(b_offset + 0) = *a0;
*(b_offset + 1) = *a1;
*(b_offset + 2) = *a2;
*(b_offset + 3) = *a3;
a0++;
a1++;
a2++;
a3++;
b_offset += 4;
}
}
}
if (n & 2) {
IFLOAT *a0 = a_offset;
IFLOAT *a1 = a0 + lda;
a_offset += 2 * lda;
BLASLONG m2 = m >> 1;
for (i = 0; i < m2; i++) {
v8 = vld1_f16((float16_t *)a0);
v9 = vld1_f16((float16_t *)a1);
float16_t col0[2] = {vget_lane_f16(v8, 0), vget_lane_f16(v9, 0)};
float16_t col1[2] = {vget_lane_f16(v8, 1), vget_lane_f16(v9, 1)};
b_offset[0] = col0[0];
b_offset[1] = col0[1];
b_offset[2] = col1[0];
b_offset[3] = col1[1];
a0 += 2;
a1 += 2;
b_offset += 4;
}
if (m & 1) {
b_offset[0] = *a0;
b_offset[1] = *a1;
b_offset += 2;
}
}
if (n & 1) {
IFLOAT *a0 = a_offset;
for (i = 0; i < m; i++) {
*b_offset++ = *a0;
a0++;
}
}
return 0;
}
+87
View File
@@ -0,0 +1,87 @@
/***************************************************************************
* Copyright (c) 2026, 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 <arm_sve.h>
#include "common.h"
int CNAME(BLASLONG m, BLASLONG n, IFLOAT *a, BLASLONG lda, IFLOAT *b) {
BLASLONG i, j;
IFLOAT *aoffset, *aoffset1;
IFLOAT *boffset, *boffset1;
IFLOAT *boffset2, *boffset3, *boffset4;
aoffset = a;
boffset = b;
boffset2 = b + m * (n & ~7);
boffset3 = b + m * (n & ~3);
boffset4 = b + m * (n & ~1);
svbool_t pg8 = svwhilelt_b16(0, 8);
svbool_t pg4 = svwhilelt_b16(0, 4);
for (j = 0; j < m; j++) {
aoffset1 = aoffset;
boffset1 = boffset;
aoffset += lda;
boffset += 8;
for (i = 0; i < (n >> 3); i++) {
svfloat16_t v0 = svld1_f16(pg8, (float16_t *)aoffset1);
svst1_f16(pg8, (float16_t *)boffset1, v0);
aoffset1 += 8;
boffset1 += 8 * m;
}
if (n & 4) {
svfloat16_t v0 = svld1_f16(pg4, (float16_t *)aoffset1);
svst1_f16(pg4, (float16_t *)boffset2, v0);
aoffset1 += 4;
boffset2 += 4;
}
if (n & 2) {
boffset3[0] = aoffset1[0];
boffset3[1] = aoffset1[1];
aoffset1 += 2;
boffset3 += 2;
}
if (n & 1) {
boffset4[0] = aoffset1[0];
aoffset1 += 1;
boffset4 += 1;
}
}
return 0;
}
+15 -9
View File
@@ -30,6 +30,12 @@
#include "conversion_macros.h"
#ifdef BGEMM
#define C_TO_F32 TO_F32
#else
#define C_TO_F32
#endif
int CNAME(BLASLONG bm,BLASLONG bn,BLASLONG bk,FLOAT alpha,IFLOAT* ba,IFLOAT* bb,FLOAT* C,BLASLONG ldc
#ifdef TRMMKERNEL
,BLASLONG offset
@@ -108,13 +114,13 @@ int CNAME(BLASLONG bm,BLASLONG bn,BLASLONG bk,FLOAT alpha,IFLOAT* ba,IFLOAT* bb,
ptrbb = ptrbb+2;
}
res0 = res0*ALPHA;
C0[0] = TO_OUTPUT(TO_F32(C0[0])+res0);
C0[0] = TO_OUTPUT(C_TO_F32(C0[0])+res0);
res1 = res1*ALPHA;
C0[1] = TO_OUTPUT(TO_F32(C0[1])+res1);
C0[1] = TO_OUTPUT(C_TO_F32(C0[1])+res1);
res2 = res2*ALPHA;
C1[0] = TO_OUTPUT(TO_F32(C1[0])+res2);
C1[0] = TO_OUTPUT(C_TO_F32(C1[0])+res2);
res3 = res3*ALPHA;
C1[1] = TO_OUTPUT(TO_F32(C1[1])+res3);
C1[1] = TO_OUTPUT(C_TO_F32(C1[1])+res3);
C0 = C0+2;
C1 = C1+2;
}
@@ -134,9 +140,9 @@ int CNAME(BLASLONG bm,BLASLONG bn,BLASLONG bk,FLOAT alpha,IFLOAT* ba,IFLOAT* bb,
ptrbb = ptrbb+2;
}
res0 = res0*ALPHA;
C0[0] = TO_OUTPUT(TO_F32(C0[0])+res0);
C0[0] = TO_OUTPUT(C_TO_F32(C0[0])+res0);
res1 = res1*ALPHA;
C1[0] = TO_OUTPUT(TO_F32(C1[0])+res1);
C1[0] = TO_OUTPUT(C_TO_F32(C1[0])+res1);
C0 = C0+1;
C1 = C1+1;
}
@@ -165,9 +171,9 @@ int CNAME(BLASLONG bm,BLASLONG bn,BLASLONG bk,FLOAT alpha,IFLOAT* ba,IFLOAT* bb,
ptrbb = ptrbb+1;
}
res0 = res0*ALPHA;
C0[0] = TO_OUTPUT(TO_F32(C0[0])+res0);
C0[0] = TO_OUTPUT(C_TO_F32(C0[0])+res0);
res1 = res1*ALPHA;
C0[1] = TO_OUTPUT(TO_F32(C0[1])+res1);
C0[1] = TO_OUTPUT(C_TO_F32(C0[1])+res1);
C0 = C0+2;
}
for (i=0; i<(bm&1); i+=1)
@@ -183,7 +189,7 @@ int CNAME(BLASLONG bm,BLASLONG bn,BLASLONG bk,FLOAT alpha,IFLOAT* ba,IFLOAT* bb,
ptrbb = ptrbb+1;
}
res0 = res0*ALPHA;
C0[0] = TO_OUTPUT(TO_F32(C0[0])+res0);
C0[0] = TO_OUTPUT(C_TO_F32(C0[0])+res0);
C0 = C0+1;
}
k = (bk<<0);
+4 -4
View File
@@ -1,17 +1,17 @@
ifndef SNRM2KERNEL
SNRM2KERNEL = nrm2.c
SNRM2KERNEL = ../arm/nrm2.c
endif
ifndef DNRM2KERNEL
DNRM2KERNEL = nrm2.c
DNRM2KERNEL = ../arm/nrm2.c
endif
ifndef CNRM2KERNEL
CNRM2KERNEL = znrm2.c
CNRM2KERNEL = ../arm/znrm2.c
endif
ifndef ZNRM2KERNEL
ZNRM2KERNEL = znrm2.c
ZNRM2KERNEL = ../arm/znrm2.c
endif
ifndef SCABS_KERNEL
+88 -91
View File
@@ -1,50 +1,13 @@
SAMAXKERNEL = ../mips/amax.c
DAMAXKERNEL = ../mips/amax.c
CAMAXKERNEL = ../mips/zamax.c
ZAMAXKERNEL = ../mips/zamax.c
SAMINKERNEL = ../mips/amin.c
DAMINKERNEL = ../mips/amin.c
CAMINKERNEL = ../mips/zamin.c
ZAMINKERNEL = ../mips/zamin.c
SMAXKERNEL = ../mips/max.c
DMAXKERNEL = ../mips/max.c
SMINKERNEL = ../mips/min.c
DMINKERNEL = ../mips/min.c
ISAMAXKERNEL = ../mips/iamax.c
IDAMAXKERNEL = ../mips/iamax.c
ICAMAXKERNEL = ../mips/izamax.c
IZAMAXKERNEL = ../mips/izamax.c
ISAMINKERNEL = ../mips/iamin.c
IDAMINKERNEL = ../mips/iamin.c
ICAMINKERNEL = ../mips/izamin.c
IZAMINKERNEL = ../mips/izamin.c
ISMAXKERNEL = ../mips/imax.c
IDMAXKERNEL = ../mips/imax.c
ISMINKERNEL = ../mips/imin.c
IDMINKERNEL = ../mips/imin.c
SSUMKERNEL = ../mips/sum.c
DSUMKERNEL = ../mips/sum.c
CSUMKERNEL = ../mips/zsum.c
ZSUMKERNEL = ../mips/zsum.c
ifndef NO_MSA
SASUMKERNEL = ../mips/sasum_msa.c
DASUMKERNEL = ../mips/dasum_msa.c
CASUMKERNEL = ../mips/casum_msa.c
ZASUMKERNEL = ../mips/zasum_msa.c
else
SASUMKERNEL = ../mips/asum.c
DASUMKERNEL = ../mips/asum.c
CASUMKERNEL = ../mips/zasum.c
ZASUMKERNEL = ../mips/zasum.c
SASUMKERNEL = ../arm/asum.c
DASUMKERNEL = ../arm/asum.c
CASUMKERNEL = ../arm/zasum.c
ZASUMKERNEL = ../arm/zasum.c
endif
ifndef NO_MSA
@@ -53,10 +16,10 @@ DAXPYKERNEL = ../mips/daxpy_msa.c
CAXPYKERNEL = ../mips/caxpy_msa.c
ZAXPYKERNEL = ../mips/zaxpy_msa.c
else
SAXPYKERNEL = ../mips/axpy.c
DAXPYKERNEL = ../mips/axpy.c
CAXPYKERNEL = ../mips/zaxpy.c
ZAXPYKERNEL = ../mips/zaxpy.c
SAXPYKERNEL = ../arm/axpy.c
DAXPYKERNEL = ../arm/axpy.c
CAXPYKERNEL = ../arm/zaxpy.c
ZAXPYKERNEL = ../arm/zaxpy.c
endif
ifndef NO_MSA
@@ -65,10 +28,10 @@ DCOPYKERNEL = ../mips/dcopy_msa.c
CCOPYKERNEL = ../mips/ccopy_msa.c
ZCOPYKERNEL = ../mips/zcopy_msa.c
else
SCOPYKERNEL = ../mips/copy.c
DCOPYKERNEL = ../mips/copy.c
CCOPYKERNEL = ../mips/zcopy.c
ZCOPYKERNEL = ../mips/zcopy.c
SCOPYKERNEL = ../arm/copy.c
DCOPYKERNEL = ../arm/copy.c
CCOPYKERNEL = ../arm/zcopy.c
ZCOPYKERNEL = ../arm/zcopy.c
endif
ifndef NO_MSA
@@ -77,16 +40,16 @@ DDOTKERNEL = ../mips/ddot_msa.c
CDOTKERNEL = ../mips/cdot_msa.c
ZDOTKERNEL = ../mips/zdot_msa.c
else
SDOTKERNEL = ../mips/dot.c
DDOTKERNEL = ../mips/dot.c
CDOTKERNEL = ../mips/zdot.c
ZDOTKERNEL = ../mips/zdot.c
SDOTKERNEL = ../arm/dot.c
DDOTKERNEL = ../arm/dot.c
CDOTKERNEL = ../arm/zdot.c
ZDOTKERNEL = ../arm/zdot.c
endif
SNRM2KERNEL = ../mips/nrm2.c
DNRM2KERNEL = ../mips/nrm2.c
CNRM2KERNEL = ../mips/znrm2.c
ZNRM2KERNEL = ../mips/znrm2.c
SNRM2KERNEL = ../arm/nrm2.c
DNRM2KERNEL = ../arm/nrm2.c
CNRM2KERNEL = ../arm/znrm2.c
ZNRM2KERNEL = ../arm/znrm2.c
ifndef NO_MSA
SROTKERNEL = ../mips/srot_msa.c
@@ -94,10 +57,10 @@ DROTKERNEL = ../mips/drot_msa.c
CROTKERNEL = ../mips/crot_msa.c
ZROTKERNEL = ../mips/zrot_msa.c
else
SROTKERNEL = ../mips/rot.c
DROTKERNEL = ../mips/rot.c
CROTKERNEL = ../mips/zrot.c
ZROTKERNEL = ../mips/zrot.c
SROTKERNEL = ../arm/rot.c
DROTKERNEL = ../arm/rot.c
CROTKERNEL = ../arm/zrot.c
ZROTKERNEL = ../arm/zrot.c
endif
ifndef NO_MSA
@@ -105,13 +68,13 @@ SSCALKERNEL = ../mips/sscal_msa.c
DSCALKERNEL = ../mips/dscal_msa.c
#CSCALKERNEL = ../mips/cscal_msa.c
#ZSCALKERNEL = ../mips/zscal_msa.c
CSCALKERNEL = ../mips/zscal.c
ZSCALKERNEL = ../mips/zscal.c
CSCALKERNEL = ../arm/zscal.c
ZSCALKERNEL = ../arm/zscal.c
else
SSCALKERNEL = ../mips/scal.c
DSCALKERNEL = ../mips/scal.c
CSCALKERNEL = ../mips/zscal.c
ZSCALKERNEL = ../mips/zscal.c
SSCALKERNEL = ../arm/scal.c
DSCALKERNEL = ../arm/scal.c
CSCALKERNEL = ../arm/zscal.c
ZSCALKERNEL = ../arm/zscal.c
endif
ifndef NO_MSA
@@ -120,10 +83,10 @@ DSWAPKERNEL = ../mips/dswap_msa.c
CSWAPKERNEL = ../mips/cswap_msa.c
ZSWAPKERNEL = ../mips/zswap_msa.c
else
SSWAPKERNEL = ../mips/swap.c
DSWAPKERNEL = ../mips/swap.c
CSWAPKERNEL = ../mips/zswap.c
ZSWAPKERNEL = ../mips/zswap.c
SSWAPKERNEL = ../arm/swap.c
DSWAPKERNEL = ../arm/swap.c
CSWAPKERNEL = ../arm/zswap.c
ZSWAPKERNEL = ../arm/zswap.c
endif
ifndef NO_MSA
@@ -132,10 +95,10 @@ DGEMVNKERNEL = ../mips/dgemv_n_msa.c
CGEMVNKERNEL = ../mips/cgemv_n_msa.c
ZGEMVNKERNEL = ../mips/zgemv_n_msa.c
else
SGEMVNKERNEL = ../mips/gemv_n.c
DGEMVNKERNEL = ../mips/gemv_n.c
CGEMVNKERNEL = ../mips/zgemv_n.c
ZGEMVNKERNEL = ../mips/zgemv_n.c
SGEMVNKERNEL = ../arm/gemv_n.c
DGEMVNKERNEL = ../arm/gemv_n.c
CGEMVNKERNEL = ../arm/zgemv_n.c
ZGEMVNKERNEL = ../arm/zgemv_n.c
endif
ifndef NO_MSA
@@ -144,25 +107,24 @@ DGEMVTKERNEL = ../mips/dgemv_t_msa.c
CGEMVTKERNEL = ../mips/cgemv_t_msa.c
ZGEMVTKERNEL = ../mips/zgemv_t_msa.c
else
SGEMVTKERNEL = ../mips/gemv_t.c
DGEMVTKERNEL = ../mips/gemv_t.c
CGEMVTKERNEL = ../mips/zgemv_t.c
ZGEMVTKERNEL = ../mips/zgemv_t.c
SGEMVTKERNEL = ../arm/gemv_t.c
DGEMVTKERNEL = ../arm/gemv_t.c
CGEMVTKERNEL = ../arm/zgemv_t.c
ZGEMVTKERNEL = ../arm/zgemv_t.c
endif
ifndef NO_MSA
SGEMMKERNEL = ../mips/sgemm_kernel_8x8_msa.c
SGEMMONCOPY = ../mips/sgemm_ncopy_8_msa.c
SGEMMOTCOPY = ../mips/sgemm_tcopy_8_msa.c
SGEMMONCOPYOBJ = sgemm_oncopy.o
SGEMMOTCOPYOBJ = sgemm_otcopy.o
else
SGEMMKERNEL = ../generic/gemmkernel_2x2.c
SGEMMONCOPY = ../generic/gemm_ncopy_2.c
SGEMMOTCOPY = ../generic/gemm_tcopy_2.c
endif
SGEMMONCOPYOBJ = sgemm_oncopy.o
SGEMMOTCOPYOBJ = sgemm_otcopy.o
endif
ifndef NO_MSA
DGEMMKERNEL = ../mips/dgemm_kernel_8x4_msa.c
@@ -172,15 +134,14 @@ DGEMMONCOPY = ../mips/dgemm_ncopy_4_msa.c
DGEMMOTCOPY = ../mips/dgemm_tcopy_4_msa.c
DGEMMINCOPYOBJ = dgemm_incopy.o
DGEMMITCOPYOBJ = dgemm_itcopy.o
DGEMMONCOPYOBJ = dgemm_oncopy.o
DGEMMOTCOPYOBJ = dgemm_otcopy.o
else
DGEMMKERNEL = ../generic/gemmkernel_2x2.c
DGEMMONCOPY = ../generic/gemm_ncopy_2.c
DGEMMOTCOPY = ../generic/gemm_tcopy_2.c
endif
DGEMMONCOPYOBJ = dgemm_oncopy.o
DGEMMOTCOPYOBJ = dgemm_otcopy.o
endif
ifndef NO_MSA
CGEMMKERNEL = ../mips/cgemm_kernel_8x4_msa.c
@@ -190,29 +151,27 @@ CGEMMONCOPY = ../mips/cgemm_ncopy_4_msa.c
CGEMMOTCOPY = ../mips/cgemm_tcopy_4_msa.c
CGEMMINCOPYOBJ = cgemm_incopy.o
CGEMMITCOPYOBJ = cgemm_itcopy.o
CGEMMONCOPYOBJ = cgemm_oncopy.o
CGEMMOTCOPYOBJ = cgemm_otcopy.o
else
CGEMMKERNEL = ../generic/zgemmkernel_2x2.c
CGEMMONCOPY = ../generic/zgemm_ncopy_2.c
CGEMMOTCOPY = ../generic/zgemm_tcopy_2.c
endif
CGEMMONCOPYOBJ = cgemm_oncopy.o
CGEMMOTCOPYOBJ = cgemm_otcopy.o
endif
ifndef NO_MSA
ZGEMMKERNEL = ../mips/zgemm_kernel_4x4_msa.c
ZGEMMONCOPY = ../mips/zgemm_ncopy_4_msa.c
ZGEMMOTCOPY = ../mips/zgemm_tcopy_4_msa.c
ZGEMMONCOPYOBJ = zgemm_oncopy.o
ZGEMMOTCOPYOBJ = zgemm_otcopy.o
else
ZGEMMKERNEL = ../generic/zgemmkernel_2x2.c
ZGEMMONCOPY = ../generic/zgemm_ncopy_2.c
ZGEMMOTCOPY = ../generic/zgemm_tcopy_2.c
endif
ZGEMMONCOPYOBJ = zgemm_oncopy.o
ZGEMMOTCOPYOBJ = zgemm_otcopy.o
endif
ifndef NO_MSA
STRSMKERNEL_LN = ../mips/strsm_kernel_LN_8x8_msa.c
@@ -261,3 +220,41 @@ ZTRSMKERNEL_LT = ../generic/trsm_kernel_LT.c
ZTRSMKERNEL_RN = ../generic/trsm_kernel_RN.c
ZTRSMKERNEL_RT = ../generic/trsm_kernel_RT.c
endif
#Pure C for other kernels
SAMAXKERNEL = ../arm/amax.c
DAMAXKERNEL = ../arm/amax.c
CAMAXKERNEL = ../arm/zamax.c
ZAMAXKERNEL = ../arm/zamax.c
SAMINKERNEL = ../arm/amin.c
DAMINKERNEL = ../arm/amin.c
CAMINKERNEL = ../arm/zamin.c
ZAMINKERNEL = ../arm/zamin.c
SMAXKERNEL = ../arm/max.c
DMAXKERNEL = ../arm/max.c
SMINKERNEL = ../arm/min.c
DMINKERNEL = ../arm/min.c
ISAMAXKERNEL = ../arm/iamax.c
IDAMAXKERNEL = ../arm/iamax.c
ICAMAXKERNEL = ../arm/izamax.c
IZAMAXKERNEL = ../arm/izamax.c
ISAMINKERNEL = ../arm/iamin.c
IDAMINKERNEL = ../arm/iamin.c
ICAMINKERNEL = ../arm/izamin.c
IZAMINKERNEL = ../arm/izamin.c
ISMAXKERNEL = ../arm/imax.c
IDMAXKERNEL = ../arm/imax.c
ISMINKERNEL = ../arm/imin.c
IDMINKERNEL = ../arm/imin.c
SSUMKERNEL = ../arm/sum.c
DSUMKERNEL = ../arm/sum.c
CSUMKERNEL = ../arm/zsum.c
ZSUMKERNEL = ../arm/zsum.c
+68 -68
View File
@@ -53,92 +53,92 @@ ZTRSMKERNEL_RN = ../generic/trsm_kernel_RN.c
ZTRSMKERNEL_RT = ../generic/trsm_kernel_RT.c
#Pure C for other kernels
SAMAXKERNEL = ../mips/amax.c
DAMAXKERNEL = ../mips/amax.c
CAMAXKERNEL = ../mips/zamax.c
ZAMAXKERNEL = ../mips/zamax.c
SAMAXKERNEL = ../arm/amax.c
DAMAXKERNEL = ../arm/amax.c
CAMAXKERNEL = ../arm/zamax.c
ZAMAXKERNEL = ../arm/zamax.c
SAMINKERNEL = ../mips/amin.c
DAMINKERNEL = ../mips/amin.c
CAMINKERNEL = ../mips/zamin.c
ZAMINKERNEL = ../mips/zamin.c
SAMINKERNEL = ../arm/amin.c
DAMINKERNEL = ../arm/amin.c
CAMINKERNEL = ../arm/zamin.c
ZAMINKERNEL = ../arm/zamin.c
SMAXKERNEL = ../mips/max.c
DMAXKERNEL = ../mips/max.c
SMAXKERNEL = ../arm/max.c
DMAXKERNEL = ../arm/max.c
SMINKERNEL = ../mips/min.c
DMINKERNEL = ../mips/min.c
SMINKERNEL = ../arm/min.c
DMINKERNEL = ../arm/min.c
ISAMAXKERNEL = ../mips/iamax.c
IDAMAXKERNEL = ../mips/iamax.c
ICAMAXKERNEL = ../mips/izamax.c
IZAMAXKERNEL = ../mips/izamax.c
ISAMAXKERNEL = ../arm/iamax.c
IDAMAXKERNEL = ../arm/iamax.c
ICAMAXKERNEL = ../arm/izamax.c
IZAMAXKERNEL = ../arm/izamax.c
ISAMINKERNEL = ../mips/iamin.c
IDAMINKERNEL = ../mips/iamin.c
ICAMINKERNEL = ../mips/izamin.c
IZAMINKERNEL = ../mips/izamin.c
ISAMINKERNEL = ../arm/iamin.c
IDAMINKERNEL = ../arm/iamin.c
ICAMINKERNEL = ../arm/izamin.c
IZAMINKERNEL = ../arm/izamin.c
ISMAXKERNEL = ../mips/imax.c
IDMAXKERNEL = ../mips/imax.c
ISMAXKERNEL = ../arm/imax.c
IDMAXKERNEL = ../arm/imax.c
ISMINKERNEL = ../mips/imin.c
IDMINKERNEL = ../mips/imin.c
ISMINKERNEL = ../arm/imin.c
IDMINKERNEL = ../arm/imin.c
SASUMKERNEL = ../mips/asum.c
DASUMKERNEL = ../mips/asum.c
CASUMKERNEL = ../mips/zasum.c
ZASUMKERNEL = ../mips/zasum.c
SASUMKERNEL = ../arm/asum.c
DASUMKERNEL = ../arm/asum.c
CASUMKERNEL = ../arm/zasum.c
ZASUMKERNEL = ../arm/zasum.c
SSUMKERNEL = ../mips/sum.c
DSUMKERNEL = ../mips/sum.c
CSUMKERNEL = ../mips/zsum.c
ZSUMKERNEL = ../mips/zsum.c
SSUMKERNEL = ../arm/sum.c
DSUMKERNEL = ../arm/sum.c
CSUMKERNEL = ../arm/zsum.c
ZSUMKERNEL = ../arm/zsum.c
SAXPYKERNEL = ../mips/axpy.c
DAXPYKERNEL = ../mips/axpy.c
CAXPYKERNEL = ../mips/zaxpy.c
ZAXPYKERNEL = ../mips/zaxpy.c
SAXPYKERNEL = ../arm/axpy.c
DAXPYKERNEL = ../arm/axpy.c
CAXPYKERNEL = ../arm/zaxpy.c
ZAXPYKERNEL = ../arm/zaxpy.c
SCOPYKERNEL = ../mips/copy.c
DCOPYKERNEL = ../mips/copy.c
CCOPYKERNEL = ../mips/zcopy.c
ZCOPYKERNEL = ../mips/zcopy.c
SCOPYKERNEL = ../arm/copy.c
DCOPYKERNEL = ../arm/copy.c
CCOPYKERNEL = ../arm/zcopy.c
ZCOPYKERNEL = ../arm/zcopy.c
SDOTKERNEL = ../mips/dot.c
DDOTKERNEL = ../mips/dot.c
CDOTKERNEL = ../mips/zdot.c
ZDOTKERNEL = ../mips/zdot.c
SDOTKERNEL = ../arm/dot.c
DDOTKERNEL = ../arm/dot.c
CDOTKERNEL = ../arm/zdot.c
ZDOTKERNEL = ../arm/zdot.c
SNRM2KERNEL = ../mips/nrm2.c
DNRM2KERNEL = ../mips/nrm2.c
CNRM2KERNEL = ../mips/znrm2.c
ZNRM2KERNEL = ../mips/znrm2.c
SNRM2KERNEL = ../arm/nrm2.c
DNRM2KERNEL = ../arm/nrm2.c
CNRM2KERNEL = ../arm/znrm2.c
ZNRM2KERNEL = ../arm/znrm2.c
SROTKERNEL = ../mips/rot.c
DROTKERNEL = ../mips/rot.c
CROTKERNEL = ../mips/zrot.c
ZROTKERNEL = ../mips/zrot.c
SROTKERNEL = ../arm/rot.c
DROTKERNEL = ../arm/rot.c
CROTKERNEL = ../arm/zrot.c
ZROTKERNEL = ../arm/zrot.c
SSCALKERNEL = ../mips/scal.c
DSCALKERNEL = ../mips/scal.c
CSCALKERNEL = ../mips/zscal.c
ZSCALKERNEL = ../mips/zscal.c
SSCALKERNEL = ../arm/scal.c
DSCALKERNEL = ../arm/scal.c
CSCALKERNEL = ../arm/zscal.c
ZSCALKERNEL = ../arm/zscal.c
SSWAPKERNEL = ../mips/swap.c
DSWAPKERNEL = ../mips/swap.c
CSWAPKERNEL = ../mips/zswap.c
ZSWAPKERNEL = ../mips/zswap.c
SSWAPKERNEL = ../arm/swap.c
DSWAPKERNEL = ../arm/swap.c
CSWAPKERNEL = ../arm/zswap.c
ZSWAPKERNEL = ../arm/zswap.c
SGEMVNKERNEL = ../mips/gemv_n.c
DGEMVNKERNEL = ../mips/gemv_n.c
CGEMVNKERNEL = ../mips/zgemv_n.c
ZGEMVNKERNEL = ../mips/zgemv_n.c
SGEMVNKERNEL = ../arm/gemv_n.c
DGEMVNKERNEL = ../arm/gemv_n.c
CGEMVNKERNEL = ../arm/zgemv_n.c
ZGEMVNKERNEL = ../arm/zgemv_n.c
SGEMVTKERNEL = ../mips/gemv_t.c
DGEMVTKERNEL = ../mips/gemv_t.c
CGEMVTKERNEL = ../mips/zgemv_t.c
ZGEMVTKERNEL = ../mips/zgemv_t.c
SGEMVTKERNEL = ../arm/gemv_t.c
DGEMVTKERNEL = ../arm/gemv_t.c
CGEMVTKERNEL = ../arm/zgemv_t.c
ZGEMVTKERNEL = ../arm/zgemv_t.c
SSYMV_U_KERNEL = ../generic/symv_k.c
SSYMV_L_KERNEL = ../generic/symv_k.c
-66
View File
@@ -1,66 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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 <math.h>
#if defined(DOUBLE)
#define ABS fabs
#else
#define ABS fabsf
#endif
FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
{
BLASLONG i=0;
BLASLONG ix=0;
FLOAT maxf=0.0;
if (n <= 0 || inc_x <= 0) return(maxf);
maxf=ABS(x[0]);
ix += inc_x;
i++;
while(i < n)
{
if( ABS(x[ix]) > maxf )
{
maxf = ABS(x[ix]);
}
ix += inc_x;
i++;
}
return(maxf);
}
-66
View File
@@ -1,66 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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 <math.h>
#if defined(DOUBLE)
#define ABS fabs
#else
#define ABS fabsf
#endif
FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
{
BLASLONG i=0;
BLASLONG ix=0;
FLOAT minf=0.0;
if (n <= 0 || inc_x <= 0) return(minf);
minf=ABS(x[0]);
ix += inc_x;
i++;
while(i < n)
{
if( ABS(x[ix]) < minf )
{
minf = ABS(x[ix]);
}
ix += inc_x;
i++;
}
return(minf);
}
-57
View File
@@ -1,57 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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 <math.h>
#if defined(DOUBLE)
#define ABS fabs
#else
#define ABS fabsf
#endif
FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
{
BLASLONG i=0;
FLOAT sumf = 0.0;
if (n <= 0 || inc_x <= 0) return(sumf);
n *= inc_x;
while(i < n)
{
sumf += ABS(x[i]);
i += inc_x;
}
return(sumf);
}
-95
View File
@@ -1,95 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
int CNAME(BLASLONG n, FLOAT alpha, FLOAT *x, BLASLONG inc_x, FLOAT beta, FLOAT *y, BLASLONG inc_y)
{
BLASLONG i=0;
BLASLONG ix,iy;
if ( n < 0 ) return(0);
ix = 0;
iy = 0;
if ( beta == 0.0 )
{
if ( alpha == 0.0 )
{
while(i < n)
{
y[iy] = 0.0 ;
iy += inc_y ;
i++ ;
}
}
else
{
while(i < n)
{
y[iy] = alpha * x[ix] ;
ix += inc_x ;
iy += inc_y ;
i++ ;
}
}
}
else
{
if ( alpha == 0.0 )
{
while(i < n)
{
y[iy] = beta * y[iy] ;
iy += inc_y ;
i++ ;
}
}
else
{
while(i < n)
{
y[iy] = alpha * x[ix] + beta * y[iy] ;
ix += inc_x ;
iy += inc_y ;
i++ ;
}
}
}
return(0);
}
-54
View File
@@ -1,54 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
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,iy;
if ( n < 0 ) return(0);
if ( da == 0.0 ) return(0);
ix = 0;
iy = 0;
while(i < n)
{
y[iy] += da * x[ix] ;
ix += inc_x ;
iy += inc_y ;
i++ ;
}
return(0);
}
-50
View File
@@ -1,50 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
int CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y)
{
BLASLONG i=0;
BLASLONG ix=0,iy=0;
if ( n < 0 ) return(0);
while(i < n)
{
y[iy] = x[ix] ;
ix += inc_x ;
iy += inc_y ;
i++ ;
}
return(0);
}
-58
View File
@@ -1,58 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
#if defined(DSDOT)
double CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y)
#else
FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y)
#endif
{
BLASLONG i=0;
BLASLONG ix=0,iy=0;
double dot = 0.0 ;
if ( n < 0 ) return(dot);
while(i < n)
{
#if defined(DSDOT)
dot += (double)y[iy] * (double)x[ix] ;
#else
dot += y[iy] * x[ix];
#endif
ix += inc_x ;
iy += inc_y ;
i++ ;
}
return(dot);
}
-56
View File
@@ -1,56 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
int CNAME(BLASLONG m, BLASLONG n, BLASLONG dummy1, FLOAT alpha, FLOAT *a, BLASLONG lda, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y, FLOAT *buffer)
{
BLASLONG i;
BLASLONG ix,iy;
BLASLONG j;
FLOAT *a_ptr;
FLOAT temp;
ix = 0;
a_ptr = a;
for (j=0; j<n; j++)
{
temp = alpha * x[ix];
iy = 0;
for (i=0; i<m; i++)
{
y[iy] += temp * a_ptr[i];
iy += inc_y;
}
a_ptr += lda;
ix += inc_x;
}
return(0);
}
-58
View File
@@ -1,58 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
int CNAME(BLASLONG m, BLASLONG n, BLASLONG dummy1, FLOAT alpha, FLOAT *a, BLASLONG lda, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y, FLOAT *buffer)
{
BLASLONG i;
BLASLONG ix,iy;
BLASLONG j;
FLOAT *a_ptr;
FLOAT temp;
iy = 0;
a_ptr = a;
for (j=0; j<n; j++)
{
temp = 0.0;
ix = 0;
for (i=0; i<m; i++)
{
temp += a_ptr[i] * x[ix];
ix += inc_x;
}
y[iy] += alpha * temp;
iy += inc_y;
a_ptr += lda;
}
return(0);
}
-68
View File
@@ -1,68 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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 <math.h>
#if defined(DOUBLE)
#define ABS fabs
#else
#define ABS fabsf
#endif
BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
{
BLASLONG i=0;
BLASLONG ix=0;
FLOAT maxf=0.0;
BLASLONG max=0;
if (n <= 0 || inc_x <= 0) return(max);
maxf=ABS(x[0]);
ix += inc_x;
i++;
while(i < n)
{
if( ABS(x[ix]) > maxf )
{
max = i;
maxf = ABS(x[ix]);
}
ix += inc_x;
i++;
}
return(max+1);
}
-68
View File
@@ -1,68 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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 <math.h>
#if defined(DOUBLE)
#define ABS fabs
#else
#define ABS fabsf
#endif
BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
{
BLASLONG i=0;
BLASLONG ix=0;
FLOAT minf=0.0;
BLASLONG min=0;
if (n <= 0 || inc_x <= 0) return(min);
minf=ABS(x[0]);
ix += inc_x;
i++;
while(i < n)
{
if( ABS(x[ix]) < ABS(minf) )
{
min = i;
minf = ABS(x[ix]);
}
ix += inc_x;
i++;
}
return(min+1);
}
-59
View File
@@ -1,59 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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 <math.h>
BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
{
BLASLONG i=0;
BLASLONG ix=0;
FLOAT maxf=0.0;
BLASLONG max=0;
if (n <= 0 || inc_x <= 0) return(max);
maxf=x[0];
ix += inc_x;
i++;
while(i < n)
{
if( x[ix] > maxf )
{
max = i;
maxf = x[ix];
}
ix += inc_x;
i++;
}
return(max+1);
}
-59
View File
@@ -1,59 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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 <math.h>
BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
{
BLASLONG i=0;
BLASLONG ix=0;
FLOAT minf=0.0;
BLASLONG min=0;
if (n <= 0 || inc_x <= 0) return(min);
minf=x[0];
ix += inc_x;
i++;
while(i < n)
{
if( x[ix] < minf )
{
min = i;
minf = x[ix];
}
ix += inc_x;
i++;
}
return(min+1);
}
-72
View File
@@ -1,72 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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 <math.h>
#if defined(DOUBLE)
#define ABS fabs
#else
#define ABS fabsf
#endif
#define CABS1(x,i) ABS(x[i])+ABS(x[i+1])
BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
{
BLASLONG i=0;
BLASLONG ix=0;
FLOAT maxf;
BLASLONG max=0;
BLASLONG inc_x2;
if (n <= 0 || inc_x <= 0) return(max);
inc_x2 = 2 * inc_x;
maxf = CABS1(x,0);
ix += inc_x2;
i++;
while(i < n)
{
if( CABS1(x,ix) > maxf )
{
max = i;
maxf = CABS1(x,ix);
}
ix += inc_x2;
i++;
}
return(max+1);
}
-72
View File
@@ -1,72 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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 <math.h>
#if defined(DOUBLE)
#define ABS fabs
#else
#define ABS fabsf
#endif
#define CABS1(x,i) ABS(x[i])+ABS(x[i+1])
BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
{
BLASLONG i=0;
BLASLONG ix=0;
FLOAT minf;
BLASLONG min=0;
BLASLONG inc_x2;
if (n <= 0 || inc_x <= 0) return(min);
inc_x2 = 2 * inc_x;
minf = CABS1(x,0);
ix += inc_x2;
i++;
while(i < n)
{
if( CABS1(x,ix) < minf )
{
min = i;
minf = CABS1(x,ix);
}
ix += inc_x2;
i++;
}
return(min+1);
}
-65
View File
@@ -1,65 +0,0 @@
/***************************************************************************
Copyright (c) 2013, 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.
*****************************************************************************/
/**************************************************************************************
* 2013/09/14 Saar
* BLASTEST float : NoTest
* BLASTEST double : NoTest
* CTEST : NoTest
* TEST : NoTest
*
**************************************************************************************/
#include "common.h"
#include <math.h>
FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
{
BLASLONG i=0;
BLASLONG ix=0;
FLOAT maxf=0.0;
if (n <= 0 || inc_x <= 0) return(maxf);
maxf=x[0];
ix += inc_x;
i++;
while(i < n)
{
if( x[ix] > maxf )
{
maxf = x[ix];
}
ix += inc_x;
i++;
}
return(maxf);
}
-65
View File
@@ -1,65 +0,0 @@
/***************************************************************************
Copyright (c) 2013, 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.
*****************************************************************************/
/**************************************************************************************
* 2013/09/14 Saar
* BLASTEST float : NoTest
* BLASTEST double : NoTest
* CTEST : NoTest
* TEST : NoTest
*
**************************************************************************************/
#include "common.h"
#include <math.h>
FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
{
BLASLONG i=0;
BLASLONG ix=0;
FLOAT minf=0.0;
if (n <= 0 || inc_x <= 0) return(minf);
minf=x[0];
ix += inc_x;
i++;
while(i < n)
{
if( x[ix] < minf )
{
minf = x[ix];
}
ix += inc_x;
i++;
}
return(minf);
}
-88
View File
@@ -1,88 +0,0 @@
/***************************************************************************
Copyright (c) 2013, 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.
*****************************************************************************/
/**************************************************************************************
* 2013/09/13 Saar
* BLASTEST float : OK
* BLASTEST double : OK
* CTEST : OK
* TEST : OK
*
**************************************************************************************/
#include "common.h"
#include <math.h>
#if defined(DOUBLE)
#define ABS fabs
#else
#define ABS fabsf
#endif
FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
{
BLASLONG i=0;
FLOAT scale = 0.0;
FLOAT ssq = 1.0;
FLOAT absxi = 0.0;
if (n <= 0 || inc_x == 0) return(0.0);
if ( n == 1 ) return( ABS(x[0]) );
n *= inc_x;
while(abs(i) < abs(n))
{
if ( x[i] != 0.0 )
{
absxi = ABS( x[i] );
if ( scale < absxi )
{
ssq = 1 + ssq * ( scale / absxi ) * ( scale / absxi );
scale = absxi ;
}
else
{
ssq += ( absxi/scale ) * ( absxi/scale );
}
}
i += inc_x;
}
scale = scale * sqrt( ssq );
return(scale);
}
-82
View File
@@ -1,82 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
int CNAME(BLASLONG rows, BLASLONG cols, FLOAT alpha, FLOAT *a, BLASLONG lda, FLOAT *b, BLASLONG ldb)
{
BLASLONG i,j;
FLOAT *aptr,*bptr;
if ( rows <= 0 ) return(0);
if ( cols <= 0 ) return(0);
aptr = a;
bptr = b;
if ( alpha == 0.0 )
{
for ( i=0; i<cols ; i++ )
{
for(j=0; j<rows; j++)
{
bptr[j] = 0.0;
}
bptr += ldb;
}
return(0);
}
if ( alpha == 1.0 )
{
for ( i=0; i<cols ; i++ )
{
for(j=0; j<rows; j++)
{
bptr[j] = aptr[j];
}
aptr += lda;
bptr += ldb;
}
return(0);
}
for ( i=0; i<cols ; i++ )
{
for(j=0; j<rows; j++)
{
bptr[j] = alpha * aptr[j];
}
aptr += lda;
bptr += ldb;
}
return(0);
}
-81
View File
@@ -1,81 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
int CNAME(BLASLONG rows, BLASLONG cols, FLOAT alpha, FLOAT *a, BLASLONG lda, FLOAT *b, BLASLONG ldb)
{
BLASLONG i,j;
FLOAT *aptr,*bptr;
if ( rows <= 0 ) return(0);
if ( cols <= 0 ) return(0);
aptr = a;
if ( alpha == 0.0 )
{
for ( i=0; i<cols ; i++ )
{
bptr = &b[i];
for(j=0; j<rows; j++)
{
bptr[j*ldb] = 0.0;
}
}
return(0);
}
if ( alpha == 1.0 )
{
for ( i=0; i<cols ; i++ )
{
bptr = &b[i];
for(j=0; j<rows; j++)
{
bptr[j*ldb] = aptr[j];
}
aptr += lda;
}
return(0);
}
for ( i=0; i<cols ; i++ )
{
bptr = &b[i];
for(j=0; j<rows; j++)
{
bptr[j*ldb] = alpha * aptr[j];
}
aptr += lda;
}
return(0);
}
-82
View File
@@ -1,82 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
int CNAME(BLASLONG rows, BLASLONG cols, FLOAT alpha, FLOAT *a, BLASLONG lda, FLOAT *b, BLASLONG ldb)
{
BLASLONG i,j;
FLOAT *aptr,*bptr;
if ( rows <= 0 ) return(0);
if ( cols <= 0 ) return(0);
aptr = a;
bptr = b;
if ( alpha == 0.0 )
{
for ( i=0; i<rows ; i++ )
{
for(j=0; j<cols; j++)
{
bptr[j] = 0.0;
}
bptr += ldb;
}
return(0);
}
if ( alpha == 1.0 )
{
for ( i=0; i<rows ; i++ )
{
for(j=0; j<cols; j++)
{
bptr[j] = aptr[j];
}
aptr += lda;
bptr += ldb;
}
return(0);
}
for ( i=0; i<rows ; i++ )
{
for(j=0; j<cols; j++)
{
bptr[j] = alpha * aptr[j];
}
aptr += lda;
bptr += ldb;
}
return(0);
}
-54
View File
@@ -1,54 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
int CNAME(BLASLONG rows, BLASLONG cols, FLOAT alpha, FLOAT *a, BLASLONG lda, FLOAT *b, BLASLONG ldb)
{
BLASLONG i,j;
FLOAT *aptr,*bptr;
if ( rows <= 0 ) return(0);
if ( cols <= 0 ) return(0);
aptr = a;
for ( i=0; i<rows ; i++ )
{
bptr = &b[i];
for(j=0; j<cols; j++)
{
bptr[j*ldb] = alpha * aptr[j];
}
aptr += lda;
}
return(0);
}
-53
View File
@@ -1,53 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
int CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y, FLOAT c, FLOAT s)
{
BLASLONG i=0;
BLASLONG ix=0,iy=0;
FLOAT temp;
if ( n <= 0 ) return(0);
while(i < n)
{
temp = c*x[ix] + s*y[iy] ;
y[iy] = c*y[iy] - s*x[ix] ;
x[ix] = temp ;
ix += inc_x ;
iy += inc_y ;
i++ ;
}
return(0);
}
-62
View File
@@ -1,62 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
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, j = 0;
// Resolved issue 4728 when the caller is {s/d}scal
if (da == 0.0 && dummy2 == 1)
{
while(j < n)
{
x[i] = da * x[i] ;
i += inc_x ;
j++;
}
}
else
{
while(j < n)
{
if ( da == 0.0 )
x[i] = 0.0;
else
x[i] = da * x[i] ;
i += inc_x ;
j++;
}
}
return 0;
}
-47
View File
@@ -1,47 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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 <math.h>
FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
{
BLASLONG i=0;
FLOAT sumf = 0.0;
if (n <= 0 || inc_x <= 0) return(sumf);
n *= inc_x;
while(i < n)
{
sumf += x[i];
i += inc_x;
}
return(sumf);
}
-55
View File
@@ -1,55 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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 <stdio.h>
int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT dummy3, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y, FLOAT *dummy, BLASLONG dummy2)
{
BLASLONG i=0;
BLASLONG ix=0,iy=0;
FLOAT temp;
if ( n < 0 ) return(0);
while(i < n)
{
temp = x[ix] ;
x[ix] = y[iy] ;
y[iy] = temp ;
ix += inc_x ;
iy += inc_y ;
i++ ;
}
return(0);
}
-70
View File
@@ -1,70 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
int CNAME(BLASLONG m, BLASLONG offset, FLOAT alpha, FLOAT *a, BLASLONG lda, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y, FLOAT *buffer)
{
BLASLONG i;
BLASLONG ix,iy;
BLASLONG jx,jy;
BLASLONG j;
FLOAT temp1;
FLOAT temp2;
#if 0
if ( m != offset )
printf("Symv_L: m=%d offset=%d\n",m,offset);
#endif
jx = 0;
jy = 0;
for (j=0; j<offset; j++)
{
temp1 = alpha * x[jx];
temp2 = 0.0;
y[jy] += temp1 * a[j*lda+j];
iy = jy;
ix = jx;
for (i=j+1; i<m; i++)
{
ix += inc_x;
iy += inc_y;
y[iy] += temp1 * a[j*lda+i];
temp2 += a[j*lda+i] * x[ix];
}
y[jy] += alpha * temp2;
jx += inc_x;
jy += inc_y;
}
return(0);
}
-71
View File
@@ -1,71 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
int CNAME(BLASLONG m, BLASLONG offset, FLOAT alpha, FLOAT *a, BLASLONG lda, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y, FLOAT *buffer)
{
BLASLONG i;
BLASLONG ix,iy;
BLASLONG jx,jy;
BLASLONG j;
FLOAT temp1;
FLOAT temp2;
#if 0
if( m != offset )
printf("Symv_U: m=%d offset=%d\n",m,offset);
#endif
BLASLONG m1 = m - offset;
jx = m1 * inc_x;
jy = m1 * inc_y;
for (j=m1; j<m; j++)
{
temp1 = alpha * x[jx];
temp2 = 0.0;
iy = 0;
ix = 0;
for (i=0; i<j; i++)
{
y[iy] += temp1 * a[j*lda+i];
temp2 += a[j*lda+i] * x[ix];
ix += inc_x;
iy += inc_y;
}
y[jy] += temp1 * a[j*lda+j] + alpha * temp2;
jx += inc_x;
jy += inc_y;
}
return(0);
}
-70
View File
@@ -1,70 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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 <math.h>
#if defined(DOUBLE)
#define ABS fabs
#else
#define ABS fabsf
#endif
#define CABS1(x,i) ABS(x[i])+ABS(x[i+1])
FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
{
BLASLONG i=0;
BLASLONG ix=0;
FLOAT maxf;
BLASLONG inc_x2;
if (n <= 0 || inc_x <= 0) return(0.0);
inc_x2 = 2 * inc_x;
maxf = CABS1(x,0);
ix += inc_x2;
i++;
while(i < n)
{
if( CABS1(x,ix) > maxf )
{
maxf = CABS1(x,ix);
}
ix += inc_x2;
i++;
}
return(maxf);
}
-70
View File
@@ -1,70 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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 <math.h>
#if defined(DOUBLE)
#define ABS fabs
#else
#define ABS fabsf
#endif
#define CABS1(x,i) ABS(x[i])+ABS(x[i+1])
FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
{
BLASLONG i=0;
BLASLONG ix=0;
FLOAT minf;
BLASLONG inc_x2;
if (n <= 0 || inc_x <= 0) return(0.0);
inc_x2 = 2 * inc_x;
minf = CABS1(x,0);
ix += inc_x2;
i++;
while(i < n)
{
if( CABS1(x,ix) < minf )
{
minf = CABS1(x,ix);
}
ix += inc_x2;
i++;
}
return(minf);
}
-62
View File
@@ -1,62 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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 <math.h>
#if defined(DOUBLE)
#define ABS fabs
#else
#define ABS fabsf
#endif
#define CABS1(x,i) ABS(x[i])+ABS(x[i+1])
FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
{
BLASLONG i=0;
FLOAT sumf = 0.0;
BLASLONG inc_x2;
if (n <= 0 || inc_x <= 0) return(sumf);
inc_x2 = 2 * inc_x;
n *= inc_x2;
while(i < n)
{
sumf += CABS1(x,i);
i += inc_x2;
}
return(sumf);
}
-113
View File
@@ -1,113 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
int CNAME(BLASLONG n, FLOAT alpha_r, FLOAT alpha_i, FLOAT *x, BLASLONG inc_x, FLOAT beta_r, FLOAT beta_i,FLOAT *y, BLASLONG inc_y)
{
BLASLONG i=0;
BLASLONG ix,iy;
FLOAT temp;
BLASLONG inc_x2, inc_y2;
if ( n <= 0 ) return(0);
ix = 0;
iy = 0;
inc_x2 = 2 * inc_x;
inc_y2 = 2 * inc_y;
if ( beta_r == 0.0 && beta_i == 0.0)
{
if ( alpha_r == 0.0 && alpha_i == 0.0 )
{
while(i < n)
{
y[iy] = 0.0 ;
y[iy+1] = 0.0 ;
iy += inc_y2 ;
i++ ;
}
}
else
{
while(i < n)
{
y[iy] = ( alpha_r * x[ix] - alpha_i * x[ix+1] ) ;
y[iy+1] = ( alpha_r * x[ix+1] + alpha_i * x[ix] ) ;
ix += inc_x2 ;
iy += inc_y2 ;
i++ ;
}
}
}
else
{
if ( alpha_r == 0.0 && alpha_i == 0.0 )
{
while(i < n)
{
temp = ( beta_r * y[iy] - beta_i * y[iy+1] ) ;
y[iy+1] = ( beta_r * y[iy+1] + beta_i * y[iy] ) ;
y[iy] = temp;
iy += inc_y2 ;
i++ ;
}
}
else
{
while(i < n)
{
temp = ( alpha_r * x[ix] - alpha_i * x[ix+1] ) + ( beta_r * y[iy] - beta_i * y[iy+1] ) ;
y[iy+1] = ( alpha_r * x[ix+1] + alpha_i * x[ix] ) + ( beta_r * y[iy+1] + beta_i * y[iy] ) ;
y[iy] = temp;
ix += inc_x2 ;
iy += inc_y2 ;
i++ ;
}
}
}
return(0);
}
-64
View File
@@ -1,64 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
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 ix,iy;
BLASLONG inc_x2;
BLASLONG inc_y2;
if ( n < 0 ) return(0);
if ( da_r == 0.0 && da_i == 0.0 ) return(0);
ix = 0;
iy = 0;
inc_x2 = 2 * inc_x;
inc_y2 = 2 * inc_y;
while(i < n)
{
#if !defined(CONJ)
y[iy] += ( da_r * x[ix] - da_i * x[ix+1] ) ;
y[iy+1] += ( da_r * x[ix+1] + da_i * x[ix] ) ;
#else
y[iy] += ( da_r * x[ix] + da_i * x[ix+1] ) ;
y[iy+1] -= ( da_r * x[ix+1] - da_i * x[ix] ) ;
#endif
ix += inc_x2 ;
iy += inc_y2 ;
i++ ;
}
return(0);
}
-56
View File
@@ -1,56 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
int CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y)
{
BLASLONG i=0;
BLASLONG ix=0,iy=0;
BLASLONG inc_x2;
BLASLONG inc_y2;
if ( n < 0 ) return(0);
inc_x2 = 2 * inc_x;
inc_y2 = 2 * inc_y;
while(i < n)
{
y[iy] = x[ix] ;
y[iy+1] = x[ix+1] ;
ix += inc_x2;
iy += inc_y2;
i++ ;
}
return(0);
}
-70
View File
@@ -1,70 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
OPENBLAS_COMPLEX_FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y)
{
BLASLONG i=0;
BLASLONG ix=0,iy=0;
FLOAT dot[2];
OPENBLAS_COMPLEX_FLOAT result;
BLASLONG inc_x2;
BLASLONG inc_y2;
dot[0]=0.0;
dot[1]=0.0;
CREAL(result) = 0.0 ;
CIMAG(result) = 0.0 ;
if ( n < 1 ) return(result);
inc_x2 = 2 * inc_x ;
inc_y2 = 2 * inc_y ;
while(i < n)
{
#if !defined(CONJ)
dot[0] += ( x[ix] * y[iy] - x[ix+1] * y[iy+1] ) ;
dot[1] += ( x[ix+1] * y[iy] + x[ix] * y[iy+1] ) ;
#else
dot[0] += ( x[ix] * y[iy] + x[ix+1] * y[iy+1] ) ;
dot[1] -= ( x[ix+1] * y[iy] - x[ix] * y[iy+1] ) ;
#endif
ix += inc_x2 ;
iy += inc_y2 ;
i++ ;
}
CREAL(result) = dot[0];
CIMAG(result) = dot[1];
return(result);
}
-147
View File
@@ -1,147 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
int CNAME(BLASLONG m, BLASLONG n, BLASLONG dummy1, FLOAT alpha_r, FLOAT alpha_i, FLOAT *a, BLASLONG lda, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y, FLOAT *buffer)
{
BLASLONG i;
BLASLONG ix,iy;
BLASLONG j;
FLOAT *a_ptr;
FLOAT temp_r,temp_i;
BLASLONG inc_x2,inc_y2;
BLASLONG lda2;
BLASLONG i2;
lda2 = 2*lda;
ix = 0;
a_ptr = a;
if ( inc_x == 1 && inc_y == 1 )
{
for (j=0; j<n; j++)
{
#if !defined(XCONJ)
temp_r = alpha_r * x[ix] - alpha_i * x[ix+1];
temp_i = alpha_r * x[ix+1] + alpha_i * x[ix];
#else
temp_r = alpha_r * x[ix] + alpha_i * x[ix+1];
temp_i = alpha_r * x[ix+1] - alpha_i * x[ix];
#endif
iy = 0;
i2=0;
for (i=0; i<m; i++)
{
#if !defined(CONJ)
#if !defined(XCONJ)
y[iy] += temp_r * a_ptr[i2] - temp_i * a_ptr[i2+1];
y[iy+1] += temp_r * a_ptr[i2+1] + temp_i * a_ptr[i2];
#else
y[iy] += temp_r * a_ptr[i2] + temp_i * a_ptr[i2+1];
y[iy+1] += temp_r * a_ptr[i2+1] - temp_i * a_ptr[i2];
#endif
#else
#if !defined(XCONJ)
y[iy] += temp_r * a_ptr[i2] + temp_i * a_ptr[i2+1];
y[iy+1] -= temp_r * a_ptr[i2+1] - temp_i * a_ptr[i2];
#else
y[iy] += temp_r * a_ptr[i2] - temp_i * a_ptr[i2+1];
y[iy+1] -= temp_r * a_ptr[i2+1] + temp_i * a_ptr[i2];
#endif
#endif
i2 += 2;
iy += 2;
}
a_ptr += lda2;
ix += 2;
}
return(0);
}
inc_x2 = 2 * inc_x;
inc_y2 = 2 * inc_y;
for (j=0; j<n; j++)
{
#if !defined(XCONJ)
temp_r = alpha_r * x[ix] - alpha_i * x[ix+1];
temp_i = alpha_r * x[ix+1] + alpha_i * x[ix];
#else
temp_r = alpha_r * x[ix] + alpha_i * x[ix+1];
temp_i = alpha_r * x[ix+1] - alpha_i * x[ix];
#endif
iy = 0;
i2=0;
for (i=0; i<m; i++)
{
#if !defined(CONJ)
#if !defined(XCONJ)
y[iy] += temp_r * a_ptr[i2] - temp_i * a_ptr[i2+1];
y[iy+1] += temp_r * a_ptr[i2+1] + temp_i * a_ptr[i2];
#else
y[iy] += temp_r * a_ptr[i2] + temp_i * a_ptr[i2+1];
y[iy+1] += temp_r * a_ptr[i2+1] - temp_i * a_ptr[i2];
#endif
#else
#if !defined(XCONJ)
y[iy] += temp_r * a_ptr[i2] + temp_i * a_ptr[i2+1];
y[iy+1] -= temp_r * a_ptr[i2+1] - temp_i * a_ptr[i2];
#else
y[iy] += temp_r * a_ptr[i2] - temp_i * a_ptr[i2+1];
y[iy+1] -= temp_r * a_ptr[i2+1] + temp_i * a_ptr[i2];
#endif
#endif
i2 += 2;
iy += inc_y2;
}
a_ptr += lda2;
ix += inc_x2;
}
return(0);
}
-130
View File
@@ -1,130 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
int CNAME(BLASLONG m, BLASLONG n, BLASLONG dummy1, FLOAT alpha_r, FLOAT alpha_i, FLOAT *a, BLASLONG lda, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y, FLOAT *buffer)
{
BLASLONG i;
BLASLONG ix,iy;
BLASLONG j;
FLOAT *a_ptr;
FLOAT temp_r,temp_i;
BLASLONG inc_x2,inc_y2;
BLASLONG lda2;
BLASLONG i2;
lda2 = 2*lda;
iy = 0;
a_ptr = a;
if ( inc_x == 1 && inc_y == 1 )
{
for (j=0; j<n; j++)
{
temp_r = 0.0;
temp_i = 0.0;
ix = 0;
i2=0;
for (i=0; i<m; i++)
{
#if ( !defined(CONJ) && !defined(XCONJ) ) || ( defined(CONJ) && defined(XCONJ) )
temp_r += a_ptr[i2] * x[ix] - a_ptr[i2+1] * x[ix+1];
temp_i += a_ptr[i2] * x[ix+1] + a_ptr[i2+1] * x[ix];
#else
temp_r += a_ptr[i2] * x[ix] + a_ptr[i2+1] * x[ix+1];
temp_i += a_ptr[i2] * x[ix+1] - a_ptr[i2+1] * x[ix];
#endif
i2 += 2;
ix += 2;
}
#if !defined(XCONJ)
y[iy] += alpha_r * temp_r - alpha_i * temp_i;
y[iy+1] += alpha_r * temp_i + alpha_i * temp_r;
#else
y[iy] += alpha_r * temp_r + alpha_i * temp_i;
y[iy+1] -= alpha_r * temp_i - alpha_i * temp_r;
#endif
a_ptr += lda2;
iy += 2;
}
return(0);
}
inc_x2 = 2 * inc_x;
inc_y2 = 2 * inc_y;
for (j=0; j<n; j++)
{
temp_r = 0.0;
temp_i = 0.0;
ix = 0;
i2=0;
for (i=0; i<m; i++)
{
#if ( !defined(CONJ) && !defined(XCONJ) ) || ( defined(CONJ) && defined(XCONJ) )
temp_r += a_ptr[i2] * x[ix] - a_ptr[i2+1] * x[ix+1];
temp_i += a_ptr[i2] * x[ix+1] + a_ptr[i2+1] * x[ix];
#else
temp_r += a_ptr[i2] * x[ix] + a_ptr[i2+1] * x[ix+1];
temp_i += a_ptr[i2] * x[ix+1] - a_ptr[i2+1] * x[ix];
#endif
i2 += 2;
ix += inc_x2;
}
#if !defined(XCONJ)
y[iy] += alpha_r * temp_r - alpha_i * temp_i;
y[iy+1] += alpha_r * temp_i + alpha_i * temp_r;
#else
y[iy] += alpha_r * temp_r + alpha_i * temp_i;
y[iy+1] -= alpha_r * temp_i - alpha_i * temp_r;
#endif
a_ptr += lda2;
iy += inc_y2;
}
return(0);
}
-97
View File
@@ -1,97 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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 <math.h>
#if defined(DOUBLE)
#define ABS fabs
#else
#define ABS fabsf
#endif
FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
{
BLASLONG i=0;
FLOAT scale = 0.0;
FLOAT ssq = 1.0;
BLASLONG inc_x2;
FLOAT temp;
if (n <= 0 || inc_x == 0) return(0.0);
inc_x2 = 2 * inc_x;
n *= inc_x2;
while(abs(i) < abs(n))
{
if ( x[i] != 0.0 )
{
temp = ABS( x[i] );
if ( scale < temp )
{
ssq = 1 + ssq * ( scale / temp ) * ( scale / temp );
scale = temp ;
}
else
{
ssq += ( temp / scale ) * ( temp / scale );
}
}
if ( x[i+1] != 0.0 )
{
temp = ABS( x[i+1] );
if ( scale < temp )
{
ssq = 1 + ssq * ( scale / temp ) * ( scale / temp );
scale = temp ;
}
else
{
ssq += ( temp / scale ) * ( temp / scale );
}
}
i += inc_x2;
}
scale = scale * sqrt( ssq );
return(scale);
}
-62
View File
@@ -1,62 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
int CNAME(BLASLONG rows, BLASLONG cols, FLOAT alpha_r, FLOAT alpha_i, FLOAT *a, BLASLONG lda, FLOAT *b, BLASLONG ldb)
{
BLASLONG i,j,ia;
FLOAT *aptr,*bptr;
if ( rows <= 0 ) return(0);
if ( cols <= 0 ) return(0);
aptr = a;
bptr = b;
lda *= 2;
ldb *= 2;
for ( i=0; i<cols ; i++ )
{
ia = 0;
for(j=0; j<rows; j++)
{
bptr[ia] = alpha_r * aptr[ia] - alpha_i * aptr[ia+1];
bptr[ia+1] = alpha_r * aptr[ia+1] + alpha_i * aptr[ia];
ia+=2;
}
aptr += lda;
bptr += ldb;
}
return(0);
}
-61
View File
@@ -1,61 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
int CNAME(BLASLONG rows, BLASLONG cols, FLOAT alpha_r, FLOAT alpha_i, FLOAT *a, BLASLONG lda, FLOAT *b, BLASLONG ldb)
{
BLASLONG i,j,ia;
FLOAT *aptr,*bptr;
if ( rows <= 0 ) return(0);
if ( cols <= 0 ) return(0);
aptr = a;
bptr = b;
lda *= 2;
ldb *= 2;
for ( i=0; i<cols ; i++ )
{
ia = 0;
for(j=0; j<rows; j++)
{
bptr[ia] = alpha_r * aptr[ia] + alpha_i * aptr[ia+1];
bptr[ia+1] = - alpha_r * aptr[ia+1] + alpha_i * aptr[ia];
ia += 2;
}
aptr += lda;
bptr += ldb;
}
return(0);
}
-63
View File
@@ -1,63 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
int CNAME(BLASLONG rows, BLASLONG cols, FLOAT alpha_r, FLOAT alpha_i, FLOAT *a, BLASLONG lda, FLOAT *b, BLASLONG ldb)
{
BLASLONG i,j,ia,ib;
FLOAT *aptr,*bptr;
if ( rows <= 0 ) return(0);
if ( cols <= 0 ) return(0);
aptr = a;
lda *= 2;
ldb *= 2;
ib = 0;
for ( i=0; i<cols ; i++ )
{
bptr = &b[ib];
ia = 0;
for(j=0; j<rows; j++)
{
bptr[0] = alpha_r * aptr[ia] - alpha_i * aptr[ia+1];
bptr[1] = alpha_r * aptr[ia+1] + alpha_i * aptr[ia];
ia += 2;
bptr += ldb;
}
aptr += lda;
ib += 2;
}
return(0);
}
-63
View File
@@ -1,63 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
int CNAME(BLASLONG rows, BLASLONG cols, FLOAT alpha_r, FLOAT alpha_i, FLOAT *a, BLASLONG lda, FLOAT *b, BLASLONG ldb)
{
BLASLONG i,j,ia,ib;
FLOAT *aptr,*bptr;
if ( rows <= 0 ) return(0);
if ( cols <= 0 ) return(0);
aptr = a;
lda *= 2;
ldb *= 2;
ib = 0;
for ( i=0; i<cols ; i++ )
{
bptr = &b[ib];
ia = 0;
for(j=0; j<rows; j++)
{
bptr[0] = alpha_r * aptr[ia] + alpha_i * aptr[ia+1];
bptr[1] = - alpha_r * aptr[ia+1] + alpha_i * aptr[ia];
ia += 2;
bptr += ldb;
}
aptr += lda;
ib += 2;
}
return(0);
}
-62
View File
@@ -1,62 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
int CNAME(BLASLONG rows, BLASLONG cols, FLOAT alpha_r, FLOAT alpha_i, FLOAT *a, BLASLONG lda, FLOAT *b, BLASLONG ldb)
{
BLASLONG i,j,ia;
FLOAT *aptr,*bptr;
if ( rows <= 0 ) return(0);
if ( cols <= 0 ) return(0);
aptr = a;
bptr = b;
lda *=2;
ldb *=2;
for ( i=0; i<rows ; i++ )
{
ia = 0;
for(j=0; j<cols; j++)
{
bptr[ia] = alpha_r * aptr[ia] - alpha_i * aptr[ia+1];
bptr[ia+1] = alpha_r * aptr[ia+1] + alpha_i * aptr[ia];
ia += 2;
}
aptr += lda;
bptr += ldb;
}
return(0);
}
-61
View File
@@ -1,61 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
int CNAME(BLASLONG rows, BLASLONG cols, FLOAT alpha_r, FLOAT alpha_i, FLOAT *a, BLASLONG lda, FLOAT *b, BLASLONG ldb)
{
BLASLONG i,j,ia;
FLOAT *aptr,*bptr;
if ( rows <= 0 ) return(0);
if ( cols <= 0 ) return(0);
aptr = a;
bptr = b;
lda *=2;
ldb *=2;
for ( i=0; i<rows ; i++ )
{
ia = 0;
for(j=0; j<cols; j++)
{
bptr[ia] = alpha_r * aptr[ia] + alpha_i * aptr[ia+1];
bptr[ia+1] = - alpha_r * aptr[ia+1] + alpha_i * aptr[ia];
ia += 2;
}
aptr += lda;
bptr += ldb;
}
return(0);
}
-64
View File
@@ -1,64 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
int CNAME(BLASLONG rows, BLASLONG cols, FLOAT alpha_r, FLOAT alpha_i, FLOAT *a, BLASLONG lda, FLOAT *b, BLASLONG ldb)
{
BLASLONG i,j,ia,ib;
FLOAT *aptr,*bptr;
if ( rows <= 0 ) return(0);
if ( cols <= 0 ) return(0);
aptr = a;
lda *= 2;
ldb *= 2;
ib = 0;
for ( i=0; i<rows ; i++ )
{
bptr = &b[ib];
ia = 0;
for(j=0; j<cols; j++)
{
bptr[0] = alpha_r * aptr[ia] - alpha_i * aptr[ia+1];
bptr[1] = alpha_r * aptr[ia+1] + alpha_i * aptr[ia];
ia += 2;
bptr += ldb;
}
aptr += lda;
ib += 2;
}
return(0);
}
-64
View File
@@ -1,64 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
int CNAME(BLASLONG rows, BLASLONG cols, FLOAT alpha_r, FLOAT alpha_i, FLOAT *a, BLASLONG lda, FLOAT *b, BLASLONG ldb)
{
BLASLONG i,j,ia,ib;
FLOAT *aptr,*bptr;
if ( rows <= 0 ) return(0);
if ( cols <= 0 ) return(0);
aptr = a;
lda *= 2;
ldb *= 2;
ib = 0;
for ( i=0; i<rows ; i++ )
{
bptr = &b[ib];
ia = 0;
for(j=0; j<cols; j++)
{
bptr[0] = alpha_r * aptr[ia] + alpha_i * aptr[ia+1];
bptr[1] = - alpha_r * aptr[ia+1] + alpha_i * aptr[ia];
ia += 2;
bptr += ldb;
}
aptr += lda;
ib += 2;
}
return(0);
}
-61
View File
@@ -1,61 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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"
int CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y, FLOAT c, FLOAT s)
{
BLASLONG i=0;
BLASLONG ix=0,iy=0;
FLOAT temp[2];
BLASLONG inc_x2;
BLASLONG inc_y2;
if ( n <= 0 ) return(0);
inc_x2 = 2 * inc_x ;
inc_y2 = 2 * inc_y ;
while(i < n)
{
temp[0] = c*x[ix] + s*y[iy] ;
temp[1] = c*x[ix+1] + s*y[iy+1] ;
y[iy] = c*y[iy] - s*x[ix] ;
y[iy+1] = c*y[iy+1] - s*x[ix+1] ;
x[ix] = temp[0] ;
x[ix+1] = temp[1] ;
ix += inc_x2 ;
iy += inc_y2 ;
i++ ;
}
return(0);
}
-82
View File
@@ -1,82 +0,0 @@
/***************************************************************************
Copyright (c) 2013, 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.
*****************************************************************************/
/**************************************************************************************
* 2013/09/14 Saar
* 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;
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;
}
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] ;
x[ip] = temp;
ip += inc_x2;
}
return(0);
}
-52
View File
@@ -1,52 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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 <math.h>
#define CSUM1(x,i) x[i]+x[i+1]
FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
{
BLASLONG i=0;
FLOAT sumf = 0.0;
BLASLONG inc_x2;
if (n <= 0 || inc_x <= 0) return(sumf);
inc_x2 = 2 * inc_x;
n *= inc_x2;
while(i < n)
{
sumf += CSUM1(x,i);
i += inc_x2;
}
return(sumf);
}
-63
View File
@@ -1,63 +0,0 @@
/***************************************************************************
Copyright (c) 2016, 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 <stdio.h>
int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT dummy3, FLOAT dummy4, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y, FLOAT *dummy, BLASLONG dummy2)
{
BLASLONG i=0;
BLASLONG ix=0,iy=0;
FLOAT temp[2];
BLASLONG inc_x2;
BLASLONG inc_y2;
if ( n < 0 ) return(0);
inc_x2 = 2 * inc_x;
inc_y2 = 2 * inc_y;
while(i < n)
{
temp[0] = x[ix] ;
temp[1] = x[ix+1] ;
x[ix] = y[iy] ;
x[ix+1] = y[iy+1] ;
y[iy] = temp[0] ;
y[iy+1] = temp[1] ;
ix += inc_x2 ;
iy += inc_y2 ;
i++ ;
}
return(0);
}
+12 -12
View File
@@ -1,16 +1,16 @@
CAXPYKERNEL = ../mips/zaxpy.c
ZAXPYKERNEL = ../mips/zaxpy.c
SROTKERNEL = ../mips/rot.c
DROTKERNEL = ../mips/rot.c
CROTKERNEL = ../mips/zrot.c
ZROTKERNEL = ../mips/zrot.c
CSWAPKERNEL = ../mips/zswap.c
ZSWAPKERNEL = ../mips/zswap.c
CAXPYKERNEL = ../arm/zaxpy.c
ZAXPYKERNEL = ../arm/zaxpy.c
SROTKERNEL = ../arm/rot.c
DROTKERNEL = ../arm/rot.c
CROTKERNEL = ../arm/zrot.c
ZROTKERNEL = ../arm/zrot.c
CSWAPKERNEL = ../arm/zswap.c
ZSWAPKERNEL = ../arm/zswap.c
CSCALKERNEL = ../arm/zscal.c
ZSCALKERNEL = ../arm/zscal.c
CSCALKERNEL = ../mips/zscal.c
ZSCALKERNEL = ../mips/zscal.c
ifndef SNRM2KERNEL
SNRM2KERNEL = snrm2.S
endif
+1 -1
View File
@@ -63,4 +63,4 @@ ZTRSMKERNEL_LT = ../generic/trsm_kernel_LT.c
ZTRSMKERNEL_RN = ../generic/trsm_kernel_RN.c
ZTRSMKERNEL_RT = ../generic/trsm_kernel_RT.c
DSDOTKERNEL = ../mips/dot.c
DSDOTKERNEL = ../arm/dot.c
+1 -1
View File
@@ -21,7 +21,7 @@ DDOTKERNEL = ../mips/ddot_msa.c
CDOTKERNEL = ../mips/cdot_msa.c
ZDOTKERNEL = ../mips/zdot_msa.c
endif
DSDOTKERNEL = ../mips/dot.c
DSDOTKERNEL = ../arm/dot.c
ifndef NO_MSA
SROTKERNEL = ../mips/srot_msa.c
+68 -68
View File
@@ -53,92 +53,92 @@ ZTRSMKERNEL_RN = ../generic/trsm_kernel_RN.c
ZTRSMKERNEL_RT = ../generic/trsm_kernel_RT.c
#Pure C for other kernels
SAMAXKERNEL = ../mips/amax.c
DAMAXKERNEL = ../mips/amax.c
CAMAXKERNEL = ../mips/zamax.c
ZAMAXKERNEL = ../mips/zamax.c
SAMAXKERNEL = ../arm/amax.c
DAMAXKERNEL = ../arm/amax.c
CAMAXKERNEL = ../arm/zamax.c
ZAMAXKERNEL = ../arm/zamax.c
SAMINKERNEL = ../mips/amin.c
DAMINKERNEL = ../mips/amin.c
CAMINKERNEL = ../mips/zamin.c
ZAMINKERNEL = ../mips/zamin.c
SAMINKERNEL = ../arm/amin.c
DAMINKERNEL = ../arm/amin.c
CAMINKERNEL = ../arm/zamin.c
ZAMINKERNEL = ../arm/zamin.c
SMAXKERNEL = ../mips/max.c
DMAXKERNEL = ../mips/max.c
SMAXKERNEL = ../arm/max.c
DMAXKERNEL = ../arm/max.c
SMINKERNEL = ../mips/min.c
DMINKERNEL = ../mips/min.c
SMINKERNEL = ../arm/min.c
DMINKERNEL = ../arm/min.c
ISAMAXKERNEL = ../mips/iamax.c
IDAMAXKERNEL = ../mips/iamax.c
ICAMAXKERNEL = ../mips/izamax.c
IZAMAXKERNEL = ../mips/izamax.c
ISAMAXKERNEL = ../arm/iamax.c
IDAMAXKERNEL = ../arm/iamax.c
ICAMAXKERNEL = ../arm/izamax.c
IZAMAXKERNEL = ../arm/izamax.c
ISAMINKERNEL = ../mips/iamin.c
IDAMINKERNEL = ../mips/iamin.c
ICAMINKERNEL = ../mips/izamin.c
IZAMINKERNEL = ../mips/izamin.c
ISAMINKERNEL = ../arm/iamin.c
IDAMINKERNEL = ../arm/iamin.c
ICAMINKERNEL = ../arm/izamin.c
IZAMINKERNEL = ../arm/izamin.c
ISMAXKERNEL = ../mips/imax.c
IDMAXKERNEL = ../mips/imax.c
ISMAXKERNEL = ../arm/imax.c
IDMAXKERNEL = ../arm/imax.c
ISMINKERNEL = ../mips/imin.c
IDMINKERNEL = ../mips/imin.c
ISMINKERNEL = ../arm/imin.c
IDMINKERNEL = ../arm/imin.c
SASUMKERNEL = ../mips/asum.c
DASUMKERNEL = ../mips/asum.c
CASUMKERNEL = ../mips/zasum.c
ZASUMKERNEL = ../mips/zasum.c
SASUMKERNEL = ../arm/asum.c
DASUMKERNEL = ../arm/asum.c
CASUMKERNEL = ../arm/zasum.c
ZASUMKERNEL = ../arm/zasum.c
SSUMKERNEL = ../mips/sum.c
DSUMKERNEL = ../mips/sum.c
CSUMKERNEL = ../mips/zsum.c
ZSUMKERNEL = ../mips/zsum.c
SSUMKERNEL = ../arm/sum.c
DSUMKERNEL = ../arm/sum.c
CSUMKERNEL = ../arm/zsum.c
ZSUMKERNEL = ../arm/zsum.c
SAXPYKERNEL = ../mips/axpy.c
DAXPYKERNEL = ../mips/axpy.c
CAXPYKERNEL = ../mips/zaxpy.c
ZAXPYKERNEL = ../mips/zaxpy.c
SAXPYKERNEL = ../arm/axpy.c
DAXPYKERNEL = ../arm/axpy.c
CAXPYKERNEL = ../arm/zaxpy.c
ZAXPYKERNEL = ../arm/zaxpy.c
SCOPYKERNEL = ../mips/copy.c
DCOPYKERNEL = ../mips/copy.c
CCOPYKERNEL = ../mips/zcopy.c
ZCOPYKERNEL = ../mips/zcopy.c
SCOPYKERNEL = ../arm/copy.c
DCOPYKERNEL = ../arm/copy.c
CCOPYKERNEL = ../arm/zcopy.c
ZCOPYKERNEL = ../arm/zcopy.c
SDOTKERNEL = ../mips/dot.c
DDOTKERNEL = ../mips/dot.c
CDOTKERNEL = ../mips/zdot.c
ZDOTKERNEL = ../mips/zdot.c
SDOTKERNEL = ../arm/dot.c
DDOTKERNEL = ../arm/dot.c
CDOTKERNEL = ../arm/zdot.c
ZDOTKERNEL = ../arm/zdot.c
SNRM2KERNEL = ../mips/nrm2.c
DNRM2KERNEL = ../mips/nrm2.c
CNRM2KERNEL = ../mips/znrm2.c
ZNRM2KERNEL = ../mips/znrm2.c
SNRM2KERNEL = ../arm/nrm2.c
DNRM2KERNEL = ../arm/nrm2.c
CNRM2KERNEL = ../arm/znrm2.c
ZNRM2KERNEL = ../arm/znrm2.c
SROTKERNEL = ../mips/rot.c
DROTKERNEL = ../mips/rot.c
CROTKERNEL = ../mips/zrot.c
ZROTKERNEL = ../mips/zrot.c
SROTKERNEL = ../arm/rot.c
DROTKERNEL = ../arm/rot.c
CROTKERNEL = ../arm/zrot.c
ZROTKERNEL = ../arm/zrot.c
SSCALKERNEL = ../mips/scal.c
DSCALKERNEL = ../mips/scal.c
CSCALKERNEL = ../mips/zscal.c
ZSCALKERNEL = ../mips/zscal.c
SSCALKERNEL = ../arm/scal.c
DSCALKERNEL = ../arm/scal.c
CSCALKERNEL = ../arm/zscal.c
ZSCALKERNEL = ../arm/zscal.c
SSWAPKERNEL = ../mips/swap.c
DSWAPKERNEL = ../mips/swap.c
CSWAPKERNEL = ../mips/zswap.c
ZSWAPKERNEL = ../mips/zswap.c
SSWAPKERNEL = ../arm/swap.c
DSWAPKERNEL = ../arm/swap.c
CSWAPKERNEL = ../arm/zswap.c
ZSWAPKERNEL = ../arm/zswap.c
SGEMVNKERNEL = ../mips/gemv_n.c
DGEMVNKERNEL = ../mips/gemv_n.c
CGEMVNKERNEL = ../mips/zgemv_n.c
ZGEMVNKERNEL = ../mips/zgemv_n.c
SGEMVNKERNEL = ../arm/gemv_n.c
DGEMVNKERNEL = ../arm/gemv_n.c
CGEMVNKERNEL = ../arm/zgemv_n.c
ZGEMVNKERNEL = ../arm/zgemv_n.c
SGEMVTKERNEL = ../mips/gemv_t.c
DGEMVTKERNEL = ../mips/gemv_t.c
CGEMVTKERNEL = ../mips/zgemv_t.c
ZGEMVTKERNEL = ../mips/zgemv_t.c
SGEMVTKERNEL = ../arm/gemv_t.c
DGEMVTKERNEL = ../arm/gemv_t.c
CGEMVTKERNEL = ../arm/zgemv_t.c
ZGEMVTKERNEL = ../arm/zgemv_t.c
SSYMV_U_KERNEL = ../generic/symv_k.c
SSYMV_L_KERNEL = ../generic/symv_k.c
+68 -68
View File
@@ -53,92 +53,92 @@ ZTRSMKERNEL_RN = ../generic/trsm_kernel_RN.c
ZTRSMKERNEL_RT = ../generic/trsm_kernel_RT.c
#Pure C for other kernels
SAMAXKERNEL = ../mips/amax.c
DAMAXKERNEL = ../mips/amax.c
CAMAXKERNEL = ../mips/zamax.c
ZAMAXKERNEL = ../mips/zamax.c
SAMAXKERNEL = ../arm/amax.c
DAMAXKERNEL = ../arm/amax.c
CAMAXKERNEL = ../arm/zamax.c
ZAMAXKERNEL = ../arm/zamax.c
SAMINKERNEL = ../mips/amin.c
DAMINKERNEL = ../mips/amin.c
CAMINKERNEL = ../mips/zamin.c
ZAMINKERNEL = ../mips/zamin.c
SAMINKERNEL = ../arm/amin.c
DAMINKERNEL = ../arm/amin.c
CAMINKERNEL = ../arm/zamin.c
ZAMINKERNEL = ../arm/zamin.c
SMAXKERNEL = ../mips/max.c
DMAXKERNEL = ../mips/max.c
SMAXKERNEL = ../arm/max.c
DMAXKERNEL = ../arm/max.c
SMINKERNEL = ../mips/min.c
DMINKERNEL = ../mips/min.c
SMINKERNEL = ../arm/min.c
DMINKERNEL = ../arm/min.c
ISAMAXKERNEL = ../mips/iamax.c
IDAMAXKERNEL = ../mips/iamax.c
ICAMAXKERNEL = ../mips/izamax.c
IZAMAXKERNEL = ../mips/izamax.c
ISAMAXKERNEL = ../arm/iamax.c
IDAMAXKERNEL = ../arm/iamax.c
ICAMAXKERNEL = ../arm/izamax.c
IZAMAXKERNEL = ../arm/izamax.c
ISAMINKERNEL = ../mips/iamin.c
IDAMINKERNEL = ../mips/iamin.c
ICAMINKERNEL = ../mips/izamin.c
IZAMINKERNEL = ../mips/izamin.c
ISAMINKERNEL = ../arm/iamin.c
IDAMINKERNEL = ../arm/iamin.c
ICAMINKERNEL = ../arm/izamin.c
IZAMINKERNEL = ../arm/izamin.c
ISMAXKERNEL = ../mips/imax.c
IDMAXKERNEL = ../mips/imax.c
ISMAXKERNEL = ../arm/imax.c
IDMAXKERNEL = ../arm/imax.c
ISMINKERNEL = ../mips/imin.c
IDMINKERNEL = ../mips/imin.c
ISMINKERNEL = ../arm/imin.c
IDMINKERNEL = ../arm/imin.c
SASUMKERNEL = ../mips/asum.c
DASUMKERNEL = ../mips/asum.c
CASUMKERNEL = ../mips/zasum.c
ZASUMKERNEL = ../mips/zasum.c
SASUMKERNEL = ../arm/asum.c
DASUMKERNEL = ../arm/asum.c
CASUMKERNEL = ../arm/zasum.c
ZASUMKERNEL = ../arm/zasum.c
SSUMKERNEL = ../mips/sum.c
DSUMKERNEL = ../mips/sum.c
CSUMKERNEL = ../mips/zsum.c
ZSUMKERNEL = ../mips/zsum.c
SSUMKERNEL = ../arm/sum.c
DSUMKERNEL = ../arm/sum.c
CSUMKERNEL = ../arm/zsum.c
ZSUMKERNEL = ../arm/zsum.c
SAXPYKERNEL = ../mips/axpy.c
DAXPYKERNEL = ../mips/axpy.c
CAXPYKERNEL = ../mips/zaxpy.c
ZAXPYKERNEL = ../mips/zaxpy.c
SAXPYKERNEL = ../arm/axpy.c
DAXPYKERNEL = ../arm/axpy.c
CAXPYKERNEL = ../arm/zaxpy.c
ZAXPYKERNEL = ../arm/zaxpy.c
SCOPYKERNEL = ../mips/copy.c
DCOPYKERNEL = ../mips/copy.c
CCOPYKERNEL = ../mips/zcopy.c
ZCOPYKERNEL = ../mips/zcopy.c
SCOPYKERNEL = ../arm/copy.c
DCOPYKERNEL = ../arm/copy.c
CCOPYKERNEL = ../arm/zcopy.c
ZCOPYKERNEL = ../arm/zcopy.c
SDOTKERNEL = ../mips/dot.c
DDOTKERNEL = ../mips/dot.c
CDOTKERNEL = ../mips/zdot.c
ZDOTKERNEL = ../mips/zdot.c
SDOTKERNEL = ../arm/dot.c
DDOTKERNEL = ../arm/dot.c
CDOTKERNEL = ../arm/zdot.c
ZDOTKERNEL = ../arm/zdot.c
SNRM2KERNEL = ../mips/nrm2.c
DNRM2KERNEL = ../mips/nrm2.c
CNRM2KERNEL = ../mips/znrm2.c
ZNRM2KERNEL = ../mips/znrm2.c
SNRM2KERNEL = ../arm/nrm2.c
DNRM2KERNEL = ../arm/nrm2.c
CNRM2KERNEL = ../arm/znrm2.c
ZNRM2KERNEL = ../arm/znrm2.c
SROTKERNEL = ../mips/rot.c
DROTKERNEL = ../mips/rot.c
CROTKERNEL = ../mips/zrot.c
ZROTKERNEL = ../mips/zrot.c
SROTKERNEL = ../arm/rot.c
DROTKERNEL = ../arm/rot.c
CROTKERNEL = ../arm/zrot.c
ZROTKERNEL = ../arm/zrot.c
SSCALKERNEL = ../mips/scal.c
DSCALKERNEL = ../mips/scal.c
CSCALKERNEL = ../mips/zscal.c
ZSCALKERNEL = ../mips/zscal.c
SSCALKERNEL = ../arm/scal.c
DSCALKERNEL = ../arm/scal.c
CSCALKERNEL = ../arm/zscal.c
ZSCALKERNEL = ../arm/zscal.c
SSWAPKERNEL = ../mips/swap.c
DSWAPKERNEL = ../mips/swap.c
CSWAPKERNEL = ../mips/zswap.c
ZSWAPKERNEL = ../mips/zswap.c
SSWAPKERNEL = ../arm/swap.c
DSWAPKERNEL = ../arm/swap.c
CSWAPKERNEL = ../arm/zswap.c
ZSWAPKERNEL = ../arm/zswap.c
SGEMVNKERNEL = ../mips/gemv_n.c
DGEMVNKERNEL = ../mips/gemv_n.c
CGEMVNKERNEL = ../mips/zgemv_n.c
ZGEMVNKERNEL = ../mips/zgemv_n.c
SGEMVNKERNEL = ../arm/gemv_n.c
DGEMVNKERNEL = ../arm/gemv_n.c
CGEMVNKERNEL = ../arm/zgemv_n.c
ZGEMVNKERNEL = ../arm/zgemv_n.c
SGEMVTKERNEL = ../mips/gemv_t.c
DGEMVTKERNEL = ../mips/gemv_t.c
CGEMVTKERNEL = ../mips/zgemv_t.c
ZGEMVTKERNEL = ../mips/zgemv_t.c
SGEMVTKERNEL = ../arm/gemv_t.c
DGEMVTKERNEL = ../arm/gemv_t.c
CGEMVTKERNEL = ../arm/zgemv_t.c
ZGEMVTKERNEL = ../arm/zgemv_t.c
SSYMV_U_KERNEL = ../generic/symv_k.c
SSYMV_L_KERNEL = ../generic/symv_k.c
+15
View File
@@ -1,7 +1,12 @@
include $(KERNELDIR)/KERNEL.HASWELL
ifeq ($(C_COMPILER)$(OSNAME), CLANGWINNT)
SGEMMKERNEL = sgemm_kernel_16x4_skylakex.S
STRMMKERNEL = sgemm_kernel_16x4_skylakex.S
else
SGEMMKERNEL = sgemm_kernel_16x4_skylakex_3.c
STRMMKERNEL = sgemm_kernel_16x4_skylakex_2.c
endif
SGEMMINCOPY = ../generic/gemm_ncopy_16.c
SGEMMITCOPY = sgemm_tcopy_16_skylakex.c
SGEMMONCOPY = sgemm_ncopy_4_skylakex.c
@@ -20,8 +25,13 @@ SGEMM_SMALL_K_B0_TN = sgemm_small_kernel_tn_skylakex.c
SGEMM_SMALL_K_TT = sgemm_small_kernel_tt_skylakex.c
SGEMM_SMALL_K_B0_TT = sgemm_small_kernel_tt_skylakex.c
ifeq ($(C_COMPILER)$(OSNAME), CLANGWINNT)
DGEMMKERNEL = dgemm_kernel_16x2_skylakex.S
DTRMMKERNEL = dgemm_kernel_16x2_skylakex.S
else
DGEMMKERNEL = dgemm_kernel_16x2_skylakex.c
DTRMMKERNEL = dgemm_kernel_16x2_skylakex.c
endif
DGEMMINCOPY = ../generic/gemm_ncopy_16.c
DGEMMITCOPY = dgemm_tcopy_16_skylakex.c
DGEMMONCOPY = ../generic/gemm_ncopy_2.c
@@ -41,8 +51,13 @@ DGEMM_SMALL_K_B0_TT = dgemm_small_kernel_tt_skylakex.c
SGEMM_BETA = sgemm_beta_skylakex.c
DGEMM_BETA = dgemm_beta_skylakex.c
ifeq ($(C_COMPILER)$(OSNAME), CLANGWINNT)
CGEMMKERNEL = cgemm_kernel_8x2_haswell.c
ZGEMMKERNEL = zgemm_kernel_4x2_haswell.c
else
CGEMMKERNEL = cgemm_kernel_8x2_skylakex.c
ZGEMMKERNEL = zgemm_kernel_4x2_skylakex.c
endif
CASUMKERNEL = casum.c
ZASUMKERNEL = zasum.c
@@ -50,12 +50,42 @@ lapack_int LAPACKE_cgesvdq_work( int matrix_layout, char joba, char jobp,
info = info - 1;
}
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
lapack_int nrows_u = ( LAPACKE_lsame( jobu, 'a' ) ||
LAPACKE_lsame( jobu, 's' ) ) ? m : 1;
lapack_int ncols_u = LAPACKE_lsame( jobu, 'a' ) ? m :
(LAPACKE_lsame( jobu, 's' ) ? MIN(m,n) : 1);
lapack_int nrows_v = LAPACKE_lsame( jobv, 'a' ) ? n :
( LAPACKE_lsame( jobv, 's' ) ? MIN(m,n) : 1);
lapack_int nrows_u;
lapack_int ncols_u;
lapack_int nrows_v;
lapack_int ncols_v;
if( LAPACKE_lsame( jobu, 'a' ) ) {
nrows_u = m;
ncols_u = m;
}
else if( LAPACKE_lsame( jobu, 's' ) ||
LAPACKE_lsame( jobu, 'u' ) ||
LAPACKE_lsame( jobu, 'r' ) ) {
nrows_u = m;
ncols_u = n;
}
else if( LAPACKE_lsame( jobu, 'f' ) ) {
nrows_u = n;
ncols_u = n;
} else {
nrows_u = 1;
ncols_u = 1;
}
/* in the case joba == 'e', v_t is used as a workspace */
if( LAPACKE_lsame( jobv, 'a' ) ||
LAPACKE_lsame( jobv, 'v' ) ||
LAPACKE_lsame( jobv, 'r' ) ||
LAPACKE_lsame( joba, 'e' ) ) {
nrows_v = n;
ncols_v = n;
} else {
nrows_v = 1;
ncols_v = 1;
}
lapack_int lda_t = MAX(1,m);
lapack_int ldu_t = MAX(1,nrows_u);
lapack_int ldv_t = MAX(1,nrows_v);
@@ -73,69 +103,80 @@ lapack_int LAPACKE_cgesvdq_work( int matrix_layout, char joba, char jobp,
LAPACKE_xerbla( "LAPACKE_cgesvdq_work", info );
return info;
}
if( ldv < n ) {
if( ldv < ncols_v ) {
info = -14;
LAPACKE_xerbla( "LAPACKE_cgesvdq_work", info );
return info;
}
/* Query optimal working array(s) size if requested */
if( lcwork == -1 ) {
if ( ( liwork == -1 ) || ( lcwork == -1 ) || ( lrwork == -1 ) ) {
LAPACK_cgesvdq( &joba, &jobp, &jobr, &jobu, &jobv, &m, &n, a, &lda_t,
s, u, &ldu_t, v, &ldv_t, numrank, iwork, &liwork,
cwork, &lcwork, rwork, &lrwork, &info );
return (info < 0) ? (info - 1) : info;
}
/* Allocate memory for temporary array(s) */
a_t = (lapack_complex_float*)LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
if( LAPACKE_lsame( jobu, 'a' ) || LAPACKE_lsame( jobu, 's' ) ) {
u_t = (lapack_complex_float*)
LAPACKE_malloc( sizeof(lapack_complex_float) * ldu_t * MAX(1,ncols_u) );
if ( ( m > 0 ) && ( n > 0 ) ){
a_t = (lapack_complex_float*)LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
u_t = (lapack_complex_float*)LAPACKE_malloc( sizeof(lapack_complex_float) * ldu_t * MAX(1,ncols_u) );
if( u_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_1;
}
}
if( LAPACKE_lsame( jobv, 'a' ) || LAPACKE_lsame( jobv, 's' ) ) {
v_t = (lapack_complex_float*)
LAPACKE_malloc( sizeof(lapack_complex_float) * ldv_t * MAX(1,n) );
v_t = (lapack_complex_float*)LAPACKE_malloc( sizeof(lapack_complex_float) * ldv_t * MAX(1,ncols_v) );
if( v_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_2;
}
}
/* Transpose input matrices */
LAPACKE_cge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
if ( ( m > 0 ) && ( n > 0 ) ){
LAPACKE_cge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
}
/* Call LAPACK function and adjust info */
LAPACK_cgesvdq( &joba, &jobp, &jobr, &jobu, &jobv, &m, &n, a, &lda_t,
s, u, &ldu_t, v, &ldv_t, numrank, iwork, &liwork,
cwork, &lcwork, rwork, &lrwork, &info );
LAPACK_cgesvdq( &joba, &jobp, &jobr, &jobu, &jobv, &m, &n, a, &lda_t,
s, u, &ldu_t, v, &ldv_t, numrank, iwork, &liwork,
cwork, &lcwork, rwork, &lrwork, &info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
if( LAPACKE_lsame( jobu, 'a' ) || LAPACKE_lsame( jobu, 's' ) ) {
LAPACKE_cge_trans( LAPACK_COL_MAJOR, nrows_u, ncols_u, u_t, ldu_t,
u, ldu );
}
if( LAPACKE_lsame( jobv, 'a' ) || LAPACKE_lsame( jobv, 's' ) ) {
LAPACKE_cge_trans( LAPACK_COL_MAJOR, nrows_v, n, v_t, ldv_t, v,
ldv );
if ( ( m > 0 ) && ( n > 0 ) ){
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
if( LAPACKE_lsame( jobu, 'a' ) ||
LAPACKE_lsame( jobu, 's' ) ||
LAPACKE_lsame( jobu, 'u' ) ||
LAPACKE_lsame( jobu, 'r' ) ||
LAPACKE_lsame( jobu, 'f' ) ) {
LAPACKE_cge_trans( LAPACK_COL_MAJOR, nrows_u, ncols_u, u_t, ldu_t,
u, ldu );
}
/* we do not transpose v_t back to v in the case (joba == 'e') because, in this case, v_t is used as a workspace */
if( LAPACKE_lsame( jobv, 'a' ) ||
LAPACKE_lsame( jobv, 'v' ) ||
LAPACKE_lsame( jobv, 'r' )) {
LAPACKE_cge_trans( LAPACK_COL_MAJOR, nrows_v, ncols_v, v_t, ldv_t, v,
ldv );
}
}
/* Release memory and exit */
if( LAPACKE_lsame( jobv, 'a' ) || LAPACKE_lsame( jobv, 's' ) ) {
LAPACKE_free( v_t );
}
if ( ( m > 0 ) && ( n > 0 ) ) { LAPACKE_free( v_t ); v_t = NULL; }
exit_level_2:
if( LAPACKE_lsame( jobu, 'a' ) || LAPACKE_lsame( jobu, 's' ) ) {
LAPACKE_free( u_t );
}
if ( ( m > 0 ) && ( n > 0 ) ) { LAPACKE_free( u_t ); u_t = NULL; }
exit_level_1:
LAPACKE_free( a_t );
if ( ( m > 0 ) && ( n > 0 ) ) { LAPACKE_free( a_t ); a_t = NULL; }
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cgesvdq_work", info );
@@ -50,12 +50,42 @@ lapack_int LAPACKE_dgesvdq_work( int matrix_layout, char joba, char jobp,
info = info - 1;
}
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
lapack_int nrows_u = ( LAPACKE_lsame( jobu, 'a' ) ||
LAPACKE_lsame( jobu, 's' ) ) ? m : 1;
lapack_int ncols_u = LAPACKE_lsame( jobu, 'a' ) ? m :
(LAPACKE_lsame( jobu, 's' ) ? MIN(m,n) : 1);
lapack_int nrows_v = LAPACKE_lsame( jobv, 'a' ) ? n :
( LAPACKE_lsame( jobv, 's' ) ? MIN(m,n) : 1);
lapack_int nrows_u;
lapack_int ncols_u;
lapack_int nrows_v;
lapack_int ncols_v;
if( LAPACKE_lsame( jobu, 'a' ) ) {
nrows_u = m;
ncols_u = m;
}
else if( LAPACKE_lsame( jobu, 's' ) ||
LAPACKE_lsame( jobu, 'u' ) ||
LAPACKE_lsame( jobu, 'r' ) ) {
nrows_u = m;
ncols_u = n;
}
else if( LAPACKE_lsame( jobu, 'f' ) ) {
nrows_u = n;
ncols_u = n;
} else {
nrows_u = 1;
ncols_u = 1;
}
/* in the case joba == 'e', v_t is used as a workspace */
if( LAPACKE_lsame( jobv, 'a' ) ||
LAPACKE_lsame( jobv, 'v' ) ||
LAPACKE_lsame( jobv, 'r' ) ||
LAPACKE_lsame( joba, 'e' ) ) {
nrows_v = n;
ncols_v = n;
} else {
nrows_v = 1;
ncols_v = 1;
}
lapack_int lda_t = MAX(1,m);
lapack_int ldu_t = MAX(1,nrows_u);
lapack_int ldv_t = MAX(1,nrows_v);
@@ -73,42 +103,46 @@ lapack_int LAPACKE_dgesvdq_work( int matrix_layout, char joba, char jobp,
LAPACKE_xerbla( "LAPACKE_dgesvdq_work", info );
return info;
}
if( ldv < n ) {
if( ldv < ncols_v ) {
info = -14;
LAPACKE_xerbla( "LAPACKE_dgesvdq_work", info );
return info;
}
/* Query optimal working array(s) size if requested */
if( lwork == -1 ) {
if ( ( liwork == -1 ) || ( lwork == -1 ) || ( lrwork == -1 ) ) {
LAPACK_dgesvdq( &joba, &jobp, &jobr, &jobu, &jobv, &m, &n, a, &lda_t,
s, u, &ldu_t, v, &ldv_t, numrank, iwork, &liwork,
work, &lwork, rwork, &lrwork, &info );
return (info < 0) ? (info - 1) : info;
}
/* Allocate memory for temporary array(s) */
a_t = (double*)LAPACKE_malloc( sizeof(double) * lda_t * MAX(1,n) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
if( LAPACKE_lsame( jobu, 'a' ) || LAPACKE_lsame( jobu, 's' ) ) {
u_t = (double*)
LAPACKE_malloc( sizeof(double) * ldu_t * MAX(1,ncols_u) );
if ( ( m > 0 ) && ( n > 0 ) ){
a_t = (double*)LAPACKE_malloc( sizeof(double) * lda_t * MAX(1,n) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
u_t = (double*)LAPACKE_malloc( sizeof(double) * ldu_t * MAX(1,ncols_u) );
if( u_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_1;
}
}
if( LAPACKE_lsame( jobv, 'a' ) || LAPACKE_lsame( jobv, 's' ) ) {
v_t = (double*)
LAPACKE_malloc( sizeof(double) * ldv_t * MAX(1,n) );
v_t = (double*)LAPACKE_malloc( sizeof(double) * ldv_t * MAX(1,ncols_v) );
if( v_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_2;
}
}
/* Transpose input matrices */
LAPACKE_dge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
if ( ( m > 0 ) && ( n > 0 ) ){
LAPACKE_dge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
}
/* Call LAPACK function and adjust info */
LAPACK_dgesvdq( &joba, &jobp, &jobr, &jobu, &jobv, &m, &n, a, &lda_t,
s, u, &ldu_t, v, &ldv_t, numrank, iwork, &liwork,
@@ -116,26 +150,35 @@ lapack_int LAPACKE_dgesvdq_work( int matrix_layout, char joba, char jobp,
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_dge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
if( LAPACKE_lsame( jobu, 'a' ) || LAPACKE_lsame( jobu, 's' ) ) {
LAPACKE_dge_trans( LAPACK_COL_MAJOR, nrows_u, ncols_u, u_t, ldu_t,
u, ldu );
}
if( LAPACKE_lsame( jobv, 'a' ) || LAPACKE_lsame( jobv, 's' ) ) {
LAPACKE_dge_trans( LAPACK_COL_MAJOR, nrows_v, n, v_t, ldv_t, v,
ldv );
if ( ( m > 0 ) && ( n > 0 ) ){
LAPACKE_dge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
if( LAPACKE_lsame( jobu, 'a' ) ||
LAPACKE_lsame( jobu, 's' ) ||
LAPACKE_lsame( jobu, 'u' ) ||
LAPACKE_lsame( jobu, 'r' ) ||
LAPACKE_lsame( jobu, 'f' ) ) {
LAPACKE_dge_trans( LAPACK_COL_MAJOR, nrows_u, ncols_u, u_t, ldu_t,
u, ldu );
}
/* we do not transpose v_t back to v in the case (joba == 'e') because, in this case, v_t is used as a workspace */
if( LAPACKE_lsame( jobv, 'a' ) ||
LAPACKE_lsame( jobv, 'v' ) ||
LAPACKE_lsame( jobv, 'r' )) {
LAPACKE_dge_trans( LAPACK_COL_MAJOR, nrows_v, ncols_v, v_t, ldv_t, v,
ldv );
}
}
/* Release memory and exit */
if( LAPACKE_lsame( jobv, 'a' ) || LAPACKE_lsame( jobv, 's' ) ) {
LAPACKE_free( v_t );
}
if ( ( m > 0 ) && ( n > 0 ) ) { LAPACKE_free( v_t ); v_t = NULL; }
exit_level_2:
if( LAPACKE_lsame( jobu, 'a' ) || LAPACKE_lsame( jobu, 's' ) ) {
LAPACKE_free( u_t );
}
if ( ( m > 0 ) && ( n > 0 ) ) { LAPACKE_free( u_t ); u_t = NULL; }
exit_level_1:
LAPACKE_free( a_t );
if ( ( m > 0 ) && ( n > 0 ) ) { LAPACKE_free( a_t ); a_t = NULL; }
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_dgesvdq_work", info );
@@ -50,11 +50,42 @@ lapack_int LAPACKE_sgesvdq_work( int matrix_layout, char joba, char jobp,
info = info - 1;
}
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
lapack_int nrows_u = ( LAPACKE_lsame( jobu, 'a' ) ||
LAPACKE_lsame( jobu, 's' ) ) ? m : 1;
lapack_int ncols_u = LAPACKE_lsame( jobu, 'a' ) ? m :
(LAPACKE_lsame( jobu, 's' ) ? MIN(m,n) : 1);
lapack_int nrows_v = LAPACKE_lsame( jobv, 'a' ) ? n : 1;
lapack_int nrows_u;
lapack_int ncols_u;
lapack_int nrows_v;
lapack_int ncols_v;
if( LAPACKE_lsame( jobu, 'a' ) ) {
nrows_u = m;
ncols_u = m;
}
else if( LAPACKE_lsame( jobu, 's' ) ||
LAPACKE_lsame( jobu, 'u' ) ||
LAPACKE_lsame( jobu, 'r' ) ) {
nrows_u = m;
ncols_u = n;
}
else if( LAPACKE_lsame( jobu, 'f' ) ) {
nrows_u = n;
ncols_u = n;
} else {
nrows_u = 1;
ncols_u = 1;
}
/* in the case joba == 'e', v_t is used as a workspace */
if( LAPACKE_lsame( jobv, 'a' ) ||
LAPACKE_lsame( jobv, 'v' ) ||
LAPACKE_lsame( jobv, 'r' ) ||
LAPACKE_lsame( joba, 'e' ) ) {
nrows_v = n;
ncols_v = n;
} else {
nrows_v = 1;
ncols_v = 1;
}
lapack_int lda_t = MAX(1,m);
lapack_int ldu_t = MAX(1,nrows_u);
lapack_int ldv_t = MAX(1,nrows_v);
@@ -72,42 +103,46 @@ lapack_int LAPACKE_sgesvdq_work( int matrix_layout, char joba, char jobp,
LAPACKE_xerbla( "LAPACKE_sgesvdq_work", info );
return info;
}
if( ldv < n ) {
if( ldv < ncols_v ) {
info = -14;
LAPACKE_xerbla( "LAPACKE_sgesvdq_work", info );
return info;
}
/* Query optimal working array(s) size if requested */
if( lwork == -1 ) {
if ( ( liwork == -1 ) || ( lwork == -1 ) || ( lrwork == -1 ) ) {
LAPACK_sgesvdq( &joba, &jobp, &jobr, &jobu, &jobv, &m, &n, a, &lda_t,
s, u, &ldu_t, v, &ldv_t, numrank, iwork, &liwork,
work, &lwork, rwork, &lrwork, &info );
return (info < 0) ? (info - 1) : info;
}
/* Allocate memory for temporary array(s) */
a_t = (float*)LAPACKE_malloc( sizeof(float) * lda_t * MAX(1,n) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
if( LAPACKE_lsame( jobu, 'a' ) || LAPACKE_lsame( jobu, 's' ) ) {
u_t = (float*)
LAPACKE_malloc( sizeof(float) * ldu_t * MAX(1,ncols_u) );
if ( ( m > 0 ) && ( n > 0 ) ){
a_t = (float*)LAPACKE_malloc( sizeof(float) * lda_t * MAX(1,n) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
u_t = (float*)LAPACKE_malloc( sizeof(float) * ldu_t * MAX(1,ncols_u) );
if( u_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_1;
}
}
if( LAPACKE_lsame( jobv, 'a' ) || LAPACKE_lsame( jobv, 's' ) ) {
v_t = (float*)
LAPACKE_malloc( sizeof(float) * ldv_t * MAX(1,n) );
v_t = (float*)LAPACKE_malloc( sizeof(float) * ldv_t * MAX(1,ncols_v) );
if( v_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_2;
}
}
/* Transpose input matrices */
LAPACKE_sge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
if ( ( m > 0 ) && ( n > 0 ) ){
LAPACKE_sge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
}
/* Call LAPACK function and adjust info */
LAPACK_sgesvdq( &joba, &jobp, &jobr, &jobu, &jobv, &m, &n, a, &lda_t,
s, u, &ldu_t, v, &ldv_t, numrank, iwork, &liwork,
@@ -115,26 +150,35 @@ lapack_int LAPACKE_sgesvdq_work( int matrix_layout, char joba, char jobp,
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_sge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
if( LAPACKE_lsame( jobu, 'a' ) || LAPACKE_lsame( jobu, 's' ) ) {
LAPACKE_sge_trans( LAPACK_COL_MAJOR, nrows_u, ncols_u, u_t, ldu_t,
u, ldu );
}
if( LAPACKE_lsame( jobv, 'a' ) || LAPACKE_lsame( jobv, 's' ) ) {
LAPACKE_sge_trans( LAPACK_COL_MAJOR, nrows_v, n, v_t, ldv_t, v,
ldv );
if ( ( m > 0 ) && ( n > 0 ) ){
LAPACKE_sge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
if( LAPACKE_lsame( jobu, 'a' ) ||
LAPACKE_lsame( jobu, 's' ) ||
LAPACKE_lsame( jobu, 'u' ) ||
LAPACKE_lsame( jobu, 'r' ) ||
LAPACKE_lsame( jobu, 'f' ) ) {
LAPACKE_sge_trans( LAPACK_COL_MAJOR, nrows_u, ncols_u, u_t, ldu_t,
u, ldu );
}
/* we do not transpose v_t back to v in the case (joba == 'e') because, in this case, v_t is used as a workspace */
if( LAPACKE_lsame( jobv, 'a' ) ||
LAPACKE_lsame( jobv, 'v' ) ||
LAPACKE_lsame( jobv, 'r' )) {
LAPACKE_sge_trans( LAPACK_COL_MAJOR, nrows_v, ncols_v, v_t, ldv_t, v,
ldv );
}
}
/* Release memory and exit */
if( LAPACKE_lsame( jobv, 'a' ) || LAPACKE_lsame( jobv, 's' ) ) {
LAPACKE_free( v_t );
}
if ( ( m > 0 ) && ( n > 0 ) ) { LAPACKE_free( v_t ); v_t = NULL; }
exit_level_2:
if( LAPACKE_lsame( jobu, 'a' ) || LAPACKE_lsame( jobu, 's' ) ) {
LAPACKE_free( u_t );
}
if ( ( m > 0 ) && ( n > 0 ) ) { LAPACKE_free( u_t ); u_t = NULL; }
exit_level_1:
LAPACKE_free( a_t );
if ( ( m > 0 ) && ( n > 0 ) ) { LAPACKE_free( a_t ); a_t = NULL; }
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_sgesvdq_work", info );
@@ -50,12 +50,42 @@ lapack_int LAPACKE_zgesvdq_work( int matrix_layout, char joba, char jobp,
info = info - 1;
}
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
lapack_int nrows_u = ( LAPACKE_lsame( jobu, 'a' ) ||
LAPACKE_lsame( jobu, 's' ) ) ? m : 1;
lapack_int ncols_u = LAPACKE_lsame( jobu, 'a' ) ? m :
(LAPACKE_lsame( jobu, 's' ) ? MIN(m,n) : 1);
lapack_int nrows_v = LAPACKE_lsame( jobv, 'a' ) ? n :
( LAPACKE_lsame( jobv, 's' ) ? MIN(m,n) : 1);
lapack_int nrows_u;
lapack_int ncols_u;
lapack_int nrows_v;
lapack_int ncols_v;
if( LAPACKE_lsame( jobu, 'a' ) ) {
nrows_u = m;
ncols_u = m;
}
else if( LAPACKE_lsame( jobu, 's' ) ||
LAPACKE_lsame( jobu, 'u' ) ||
LAPACKE_lsame( jobu, 'r' ) ) {
nrows_u = m;
ncols_u = n;
}
else if( LAPACKE_lsame( jobu, 'f' ) ) {
nrows_u = n;
ncols_u = n;
} else {
nrows_u = 1;
ncols_u = 1;
}
/* in the case joba == 'e', v_t is used as a workspace */
if( LAPACKE_lsame( jobv, 'a' ) ||
LAPACKE_lsame( jobv, 'v' ) ||
LAPACKE_lsame( jobv, 'r' ) ||
LAPACKE_lsame( joba, 'e' ) ) {
nrows_v = n;
ncols_v = n;
} else {
nrows_v = 1;
ncols_v = 1;
}
lapack_int lda_t = MAX(1,m);
lapack_int ldu_t = MAX(1,nrows_u);
lapack_int ldv_t = MAX(1,nrows_v);
@@ -73,69 +103,80 @@ lapack_int LAPACKE_zgesvdq_work( int matrix_layout, char joba, char jobp,
LAPACKE_xerbla( "LAPACKE_zgesvdq_work", info );
return info;
}
if( ldv < n ) {
if( ldv < ncols_v ) {
info = -14;
LAPACKE_xerbla( "LAPACKE_zgesvdq_work", info );
return info;
}
/* Query optimal working array(s) size if requested */
if( lcwork == -1 ) {
if ( ( liwork == -1 ) || ( lcwork == -1 ) || ( lrwork == -1 ) ) {
LAPACK_zgesvdq( &joba, &jobp, &jobr, &jobu, &jobv, &m, &n, a, &lda_t,
s, u, &ldu_t, v, &ldv_t, numrank, iwork, &liwork,
cwork, &lcwork, rwork, &lrwork, &info );
return (info < 0) ? (info - 1) : info;
}
/* Allocate memory for temporary array(s) */
a_t = (lapack_complex_double*)LAPACKE_malloc( sizeof(lapack_complex_double) * lda_t * MAX(1,n) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
if( LAPACKE_lsame( jobu, 'a' ) || LAPACKE_lsame( jobu, 's' ) ) {
u_t = (lapack_complex_double*)
LAPACKE_malloc( sizeof(lapack_complex_double) * ldu_t * MAX(1,ncols_u) );
if ( ( m > 0 ) && ( n > 0 ) ){
a_t = (lapack_complex_double*)LAPACKE_malloc( sizeof(lapack_complex_double) * lda_t * MAX(1,n) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
u_t = (lapack_complex_double*)LAPACKE_malloc( sizeof(lapack_complex_double) * ldu_t * MAX(1,ncols_u) );
if( u_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_1;
}
}
if( LAPACKE_lsame( jobv, 'a' ) || LAPACKE_lsame( jobv, 's' ) ) {
v_t = (lapack_complex_double*)
LAPACKE_malloc( sizeof(lapack_complex_double) * ldv_t * MAX(1,n) );
v_t = (lapack_complex_double*)LAPACKE_malloc( sizeof(lapack_complex_double) * ldv_t * MAX(1,ncols_v) );
if( v_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_2;
}
}
/* Transpose input matrices */
LAPACKE_zge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
if ( ( m > 0 ) && ( n > 0 ) ){
LAPACKE_zge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
}
/* Call LAPACK function and adjust info */
LAPACK_zgesvdq( &joba, &jobp, &jobr, &jobu, &jobv, &m, &n, a, &lda_t,
s, u, &ldu_t, v, &ldv_t, numrank, iwork, &liwork,
cwork, &lcwork, rwork, &lrwork, &info );
LAPACK_zgesvdq( &joba, &jobp, &jobr, &jobu, &jobv, &m, &n, a, &lda_t,
s, u, &ldu_t, v, &ldv_t, numrank, iwork, &liwork,
cwork, &lcwork, rwork, &lrwork, &info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_zge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
if( LAPACKE_lsame( jobu, 'a' ) || LAPACKE_lsame( jobu, 's' ) ) {
LAPACKE_zge_trans( LAPACK_COL_MAJOR, nrows_u, ncols_u, u_t, ldu_t,
u, ldu );
}
if( LAPACKE_lsame( jobv, 'a' ) || LAPACKE_lsame( jobv, 's' ) ) {
LAPACKE_zge_trans( LAPACK_COL_MAJOR, nrows_v, n, v_t, ldv_t, v,
ldv );
if ( ( m > 0 ) && ( n > 0 ) ){
LAPACKE_zge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
if( LAPACKE_lsame( jobu, 'a' ) ||
LAPACKE_lsame( jobu, 's' ) ||
LAPACKE_lsame( jobu, 'u' ) ||
LAPACKE_lsame( jobu, 'r' ) ||
LAPACKE_lsame( jobu, 'f' ) ) {
LAPACKE_zge_trans( LAPACK_COL_MAJOR, nrows_u, ncols_u, u_t, ldu_t,
u, ldu );
}
/* we do not transpose v_t back to v in the case (joba == 'e') because, in this case, v_t is used as a workspace */
if( LAPACKE_lsame( jobv, 'a' ) ||
LAPACKE_lsame( jobv, 'v' ) ||
LAPACKE_lsame( jobv, 'r' )) {
LAPACKE_zge_trans( LAPACK_COL_MAJOR, nrows_v, ncols_v, v_t, ldv_t, v,
ldv );
}
}
/* Release memory and exit */
if( LAPACKE_lsame( jobv, 'a' ) || LAPACKE_lsame( jobv, 's' ) ) {
LAPACKE_free( v_t );
}
if ( ( m > 0 ) && ( n > 0 ) ) { LAPACKE_free( v_t ); v_t = NULL; }
exit_level_2:
if( LAPACKE_lsame( jobu, 'a' ) || LAPACKE_lsame( jobu, 's' ) ) {
LAPACKE_free( u_t );
}
if ( ( m > 0 ) && ( n > 0 ) ) { LAPACKE_free( u_t ); u_t = NULL; }
exit_level_1:
LAPACKE_free( a_t );
if ( ( m > 0 ) && ( n > 0 ) ) { LAPACKE_free( a_t ); a_t = NULL; }
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_zgesvdq_work", info );
+2 -2
View File
@@ -16,7 +16,7 @@
* ..
* .. Array Arguments ..
* COMPLEX A( LDA, * ), B( LDB, * ), TAU( * ),
* $ WORK( LWORK )
* $ WORK( * )
* ..
*
*
@@ -128,7 +128,7 @@
* ..
* .. Array Arguments ..
COMPLEX A( LDA, * ), B( LDB, * ), TAU( * ),
$ WORK( LWORK )
$ WORK( * )
* ..
*
* =====================================================================
+2 -2
View File
@@ -16,7 +16,7 @@
* ..
* .. Array Arguments ..
* COMPLEX A( LDA, * ), B( LDB, * ), TAU( * ),
* $ WORK( LWORK )
* $ WORK( * )
* ..
*
*
@@ -128,7 +128,7 @@
* ..
* .. Array Arguments ..
COMPLEX A( LDA, * ), B( LDB, * ), TAU( * ),
$ WORK( LWORK )
$ WORK( * )
* ..
*
* =====================================================================
+8 -7
View File
@@ -16,7 +16,7 @@
* ..
* .. Array Arguments ..
* DOUBLE PRECISION A( LDA, * ), B( LDB, * ), TAU( * ),
* $ WORK( LWORK )
* $ WORK( * )
* ..
*
*
@@ -128,7 +128,7 @@
* ..
* .. Array Arguments ..
DOUBLE PRECISION A( LDA, * ), B( LDB, * ), TAU( * ),
$ WORK( LWORK )
$ WORK( * )
* ..
*
* =====================================================================
@@ -174,18 +174,19 @@
*
* Solve L*X = B(1:m,:)
*
CALL DTRSM( 'Left', 'Lower', 'No transpose', 'Non-unit', M, NRHS,
$ ONE, A, LDA, B, LDB )
CALL DTRSM( 'Left', 'Lower', 'No transpose', 'Non-unit', M,
$ NRHS, ONE, A, LDA, B, LDB )
*
* Set B(m+1:n,:) to zero
*
IF( M.LT.N )
$ CALL DLASET( 'Full', N-M, NRHS, ZERO, ZERO, B( M+1, 1 ), LDB )
$ CALL DLASET( 'Full', N-M, NRHS, ZERO, ZERO, B( M+1, 1 ),
$ LDB )
*
* B := Q' * B
*
CALL DORMLQ( 'Left', 'Transpose', N, NRHS, M, A, LDA, TAU, B, LDB,
$ WORK, LWORK, INFO )
CALL DORMLQ( 'Left', 'Transpose', N, NRHS, M, A, LDA, TAU, B,
$ LDB, WORK, LWORK, INFO )
*
RETURN
*
+2 -2
View File
@@ -16,7 +16,7 @@
* ..
* .. Array Arguments ..
* DOUBLE PRECISION A( LDA, * ), B( LDB, * ), TAU( * ),
* $ WORK( LWORK )
* $ WORK( * )
* ..
*
*
@@ -128,7 +128,7 @@
* ..
* .. Array Arguments ..
DOUBLE PRECISION A( LDA, * ), B( LDB, * ), TAU( * ),
$ WORK( LWORK )
$ WORK( * )
* ..
*
* =====================================================================
+8 -7
View File
@@ -16,7 +16,7 @@
* ..
* .. Array Arguments ..
* REAL A( LDA, * ), B( LDB, * ), TAU( * ),
* $ WORK( LWORK )
* $ WORK( * )
* ..
*
*
@@ -128,7 +128,7 @@
* ..
* .. Array Arguments ..
REAL A( LDA, * ), B( LDB, * ), TAU( * ),
$ WORK( LWORK )
$ WORK( * )
* ..
*
* =====================================================================
@@ -174,18 +174,19 @@
*
* Solve L*X = B(1:m,:)
*
CALL STRSM( 'Left', 'Lower', 'No transpose', 'Non-unit', M, NRHS,
$ ONE, A, LDA, B, LDB )
CALL STRSM( 'Left', 'Lower', 'No transpose', 'Non-unit', M,
$ NRHS, ONE, A, LDA, B, LDB )
*
* Set B(m+1:n,:) to zero
*
IF( M.LT.N )
$ CALL SLASET( 'Full', N-M, NRHS, ZERO, ZERO, B( M+1, 1 ), LDB )
$ CALL SLASET( 'Full', N-M, NRHS, ZERO, ZERO, B( M+1, 1 ),
$ LDB )
*
* B := Q' * B
*
CALL SORMLQ( 'Left', 'Transpose', N, NRHS, M, A, LDA, TAU, B, LDB,
$ WORK, LWORK, INFO )
CALL SORMLQ( 'Left', 'Transpose', N, NRHS, M, A, LDA, TAU, B,
$ LDB, WORK, LWORK, INFO )
*
RETURN
*
+2 -2
View File
@@ -16,7 +16,7 @@
* ..
* .. Array Arguments ..
* REAL A( LDA, * ), B( LDB, * ), TAU( * ),
* $ WORK( LWORK )
* $ WORK( * )
* ..
*
*
@@ -128,7 +128,7 @@
* ..
* .. Array Arguments ..
REAL A( LDA, * ), B( LDB, * ), TAU( * ),
$ WORK( LWORK )
$ WORK( * )
* ..
*
* =====================================================================
+2 -2
View File
@@ -16,7 +16,7 @@
* ..
* .. Array Arguments ..
* COMPLEX*16 A( LDA, * ), B( LDB, * ), TAU( * ),
* $ WORK( LWORK )
* $ WORK( * )
* ..
*
*
@@ -128,7 +128,7 @@
* ..
* .. Array Arguments ..
COMPLEX*16 A( LDA, * ), B( LDB, * ), TAU( * ),
$ WORK( LWORK )
$ WORK( * )
* ..
*
* =====================================================================
+2 -2
View File
@@ -16,7 +16,7 @@
* ..
* .. Array Arguments ..
* COMPLEX*16 A( LDA, * ), B( LDB, * ), TAU( * ),
* $ WORK( LWORK )
* $ WORK( * )
* ..
*
*
@@ -128,7 +128,7 @@
* ..
* .. Array Arguments ..
COMPLEX*16 A( LDA, * ), B( LDB, * ), TAU( * ),
$ WORK( LWORK )
$ WORK( * )
* ..
*
* =====================================================================
+4 -3
View File
@@ -155,7 +155,7 @@ SLASRC_O = \
slaqr0.o slaqr1.o slaqr2.o slaqr3.o slaqr4.o slaqr5.o \
slaqtr.o slar1v.o slar2v.o ilaslr.o ilaslc.o \
slarf.o slarfb.o slarfb_gett.o slarfg.o slarfgp.o slarft.o slarfx.o slarfy.o slargv.o \
slarrv.o slartv.o \
slarf1f.o slarf1l.o slarrv.o slartv.o \
slarz.o slarzb.o slarzt.o slaswp.o slasy2.o slasyf.o slasyf_rook.o \
slasyf_rk.o \
slatbs.o slatdf.o slatps.o slatrd.o slatrs.o slatrz.o \
@@ -271,6 +271,7 @@ CLASRC_O = \
claqsp.o claqsy.o clar1v.o clar2v.o ilaclr.o ilaclc.o \
claqz0.o claqz1.o claqz2.o claqz3.o \
clarf.o clarfb.o clarfb_gett.o clarfg.o clarft.o clarfgp.o \
clarf1f.o clarf1l.o \
clarfx.o clarfy.o clargv.o clarnv.o clarrv.o clartg.o clartv.o \
clarz.o clarzb.o clarzt.o clascl.o claset.o clasr.o classq.o \
claswp.o clasyf.o clasyf_rook.o clasyf_rk.o clasyf_aa.o \
@@ -364,7 +365,7 @@ DLASRC_O = \
dlaqr0.o dlaqr1.o dlaqr2.o dlaqr3.o dlaqr4.o dlaqr5.o \
dlaqtr.o dlar1v.o dlar2v.o iladlr.o iladlc.o \
dlarf.o dlarfb.o dlarfb_gett.o dlarfg.o dlarfgp.o dlarft.o dlarfx.o dlarfy.o \
dlargv.o dlarrv.o dlartv.o \
dlarf1f.o dlarf1l.o dlargv.o dlarrv.o dlartv.o \
dlarz.o dlarzb.o dlarzt.o dlaswp.o dlasy2.o \
dlasyf.o dlasyf_rook.o dlasyf_rk.o \
dlatbs.o dlatdf.o dlatps.o dlatrd.o dlatrs.o dlatrz.o dlauu2.o \
@@ -478,7 +479,7 @@ ZLASRC_O = \
zlaqsp.o zlaqsy.o zlar1v.o zlar2v.o ilazlr.o ilazlc.o \
zlaqz0.o zlaqz1.o zlaqz2.o zlaqz3.o \
zlarcm.o zlarf.o zlarfb.o zlarfb_gett.o \
zlarfg.o zlarft.o zlarfgp.o \
zlarfg.o zlarft.o zlarfgp.o zlarf1f.o zlarf1l.o \
zlarfx.o zlarfy.o zlargv.o zlarnv.o zlarrv.o zlartg.o zlartv.o \
zlarz.o zlarzb.o zlarzt.o zlascl.o zlaset.o zlasr.o \
zlassq.o zlaswp.o zlasyf.o zlasyf_rook.o zlasyf_rk.o zlasyf_aa.o \
+15 -20
View File
@@ -5,7 +5,6 @@
* Online html documentation available at
* http://www.netlib.org/lapack/explore-html/
*
*> \htmlonly
*> Download CGEBD2 + dependencies
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/cgebd2.f">
*> [TGZ]</a>
@@ -13,7 +12,6 @@
*> [ZIP]</a>
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgebd2.f">
*> [TXT]</a>
*> \endhtmlonly
*
* Definition:
* ===========
@@ -132,7 +130,7 @@
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \ingroup complexGEcomputational
*> \ingroup gebd2
* @precisions normal c -> s d z
*
*> \par Further Details:
@@ -187,6 +185,7 @@
*>
* =====================================================================
SUBROUTINE CGEBD2( M, N, A, LDA, D, E, TAUQ, TAUP, WORK, INFO )
IMPLICIT NONE
*
* -- LAPACK computational routine --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
@@ -203,16 +202,15 @@
* =====================================================================
*
* .. Parameters ..
COMPLEX ZERO, ONE
PARAMETER ( ZERO = ( 0.0E+0, 0.0E+0 ),
$ ONE = ( 1.0E+0, 0.0E+0 ) )
COMPLEX ZERO
PARAMETER ( ZERO = ( 0.0E+0, 0.0E+0 ) )
* ..
* .. Local Scalars ..
INTEGER I
COMPLEX ALPHA
* ..
* .. External Subroutines ..
EXTERNAL CLACGV, CLARF, CLARFG, XERBLA
EXTERNAL CLACGV, CLARF1F, CLARFG, XERBLA
* ..
* .. Intrinsic Functions ..
INTRINSIC CONJG, MAX, MIN
@@ -246,13 +244,13 @@
CALL CLARFG( M-I+1, ALPHA, A( MIN( I+1, M ), I ), 1,
$ TAUQ( I ) )
D( I ) = REAL( ALPHA )
A( I, I ) = ONE
*
* Apply H(i)**H to A(i:m,i+1:n) from the left
*
IF( I.LT.N )
$ CALL CLARF( 'Left', M-I+1, N-I, A( I, I ), 1,
$ CONJG( TAUQ( I ) ), A( I, I+1 ), LDA, WORK )
$ CALL CLARF1F( 'Left', M-I+1, N-I, A( I, I ), 1,
$ CONJG( TAUQ( I ) ), A( I, I+1 ), LDA,
$ WORK )
A( I, I ) = D( I )
*
IF( I.LT.N ) THEN
@@ -265,12 +263,11 @@
CALL CLARFG( N-I, ALPHA, A( I, MIN( I+2, N ) ),
$ LDA, TAUP( I ) )
E( I ) = REAL( ALPHA )
A( I, I+1 ) = ONE
*
* Apply G(i) to A(i+1:m,i+1:n) from the right
*
CALL CLARF( 'Right', M-I, N-I, A( I, I+1 ), LDA,
$ TAUP( I ), A( I+1, I+1 ), LDA, WORK )
CALL CLARF1F( 'Right', M-I, N-I, A( I, I+1 ), LDA,
$ TAUP( I ), A( I+1, I+1 ), LDA, WORK )
CALL CLACGV( N-I, A( I, I+1 ), LDA )
A( I, I+1 ) = E( I )
ELSE
@@ -290,13 +287,12 @@
CALL CLARFG( N-I+1, ALPHA, A( I, MIN( I+1, N ) ), LDA,
$ TAUP( I ) )
D( I ) = REAL( ALPHA )
A( I, I ) = ONE
*
* Apply G(i) to A(i+1:m,i:n) from the right
*
IF( I.LT.M )
$ CALL CLARF( 'Right', M-I, N-I+1, A( I, I ), LDA,
$ TAUP( I ), A( I+1, I ), LDA, WORK )
$ CALL CLARF1F( 'Right', M-I, N-I+1, A( I, I ), LDA,
$ TAUP( I ), A( I+1, I ), LDA, WORK )
CALL CLACGV( N-I+1, A( I, I ), LDA )
A( I, I ) = D( I )
*
@@ -309,13 +305,12 @@
CALL CLARFG( M-I, ALPHA, A( MIN( I+2, M ), I ), 1,
$ TAUQ( I ) )
E( I ) = REAL( ALPHA )
A( I+1, I ) = ONE
*
* Apply H(i)**H to A(i+1:m,i+1:n) from the left
*
CALL CLARF( 'Left', M-I, N-I, A( I+1, I ), 1,
$ CONJG( TAUQ( I ) ), A( I+1, I+1 ), LDA,
$ WORK )
CALL CLARF1F( 'Left', M-I, N-I, A( I+1, I ), 1,
$ CONJG( TAUQ( I ) ), A( I+1, I+1 ), LDA,
$ WORK )
A( I+1, I ) = E( I )
ELSE
TAUQ( I ) = ZERO
+5 -1
View File
@@ -216,7 +216,7 @@
$ CHSEQR, CLACPY, CLASCL, CSCAL, CTREVC3, CUNGHR
* ..
* .. External Functions ..
LOGICAL LSAME
LOGICAL LSAME, SISNAN
INTEGER ISAMAX, ILAENV
REAL SLAMCH, SCNRM2, CLANGE, SROUNDUP_LWORK
EXTERNAL LSAME, ISAMAX, ILAENV, SLAMCH, SCNRM2, CLANGE,
@@ -329,6 +329,10 @@
ELSE IF( ANRM.GT.BIGNUM ) THEN
SCALEA = .TRUE.
CSCALE = BIGNUM
ELSE IF ( SISNAN( ANRM ) ) THEN
INFO = -4
CALL XERBLA( 'CGEEV', -INFO )
RETURN
END IF
IF( SCALEA )
$ CALL CLASCL( 'G', 0, 0, ANRM, CSCALE, N, N, A, LDA, IERR )
+9 -17
View File
@@ -5,7 +5,6 @@
* Online html documentation available at
* http://www.netlib.org/lapack/explore-html/
*
*> \htmlonly
*> Download CGEHD2 + dependencies
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/cgehd2.f">
*> [TGZ]</a>
@@ -13,7 +12,6 @@
*> [ZIP]</a>
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgehd2.f">
*> [TXT]</a>
*> \endhtmlonly
*
* Definition:
* ===========
@@ -106,7 +104,7 @@
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \ingroup complexGEcomputational
*> \ingroup gehd2
*
*> \par Further Details:
* =====================
@@ -146,6 +144,7 @@
*>
* =====================================================================
SUBROUTINE CGEHD2( N, ILO, IHI, A, LDA, TAU, WORK, INFO )
IMPLICIT NONE
*
* -- LAPACK computational routine --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
@@ -160,16 +159,11 @@
*
* =====================================================================
*
* .. Parameters ..
COMPLEX ONE
PARAMETER ( ONE = ( 1.0E+0, 0.0E+0 ) )
* ..
* .. Local Scalars ..
INTEGER I
COMPLEX ALPHA
* ..
* .. External Subroutines ..
EXTERNAL CLARF, CLARFG, XERBLA
EXTERNAL CLARF1F, CLARFG, XERBLA
* ..
* .. Intrinsic Functions ..
INTRINSIC CONJG, MAX, MIN
@@ -197,21 +191,19 @@
*
* Compute elementary reflector H(i) to annihilate A(i+2:ihi,i)
*
ALPHA = A( I+1, I )
CALL CLARFG( IHI-I, ALPHA, A( MIN( I+2, N ), I ), 1, TAU( I ) )
A( I+1, I ) = ONE
CALL CLARFG( IHI-I, A( I+1, I ), A( MIN( I+2, N ), I ), 1,
$ TAU( I ) )
*
* Apply H(i) to A(1:ihi,i+1:ihi) from the right
*
CALL CLARF( 'Right', IHI, IHI-I, A( I+1, I ), 1, TAU( I ),
$ A( 1, I+1 ), LDA, WORK )
CALL CLARF1F( 'Right', IHI, IHI-I, A( I+1, I ), 1, TAU( I ),
$ A( 1, I+1 ), LDA, WORK )
*
* Apply H(i)**H to A(i+1:ihi,i+1:n) from the left
*
CALL CLARF( 'Left', IHI-I, N-I, A( I+1, I ), 1,
$ CONJG( TAU( I ) ), A( I+1, I+1 ), LDA, WORK )
CALL CLARF1F( 'Left', IHI-I, N-I, A( I+1, I ), 1,
$ CONJG( TAU( I ) ), A( I+1, I+1 ), LDA, WORK )
*
A( I+1, I ) = ALPHA
10 CONTINUE
*
RETURN
+6 -15
View File
@@ -5,7 +5,6 @@
* Online html documentation available at
* http://www.netlib.org/lapack/explore-html/
*
*> \htmlonly
*> Download CGELQ2 + dependencies
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/cgelq2.f">
*> [TGZ]</a>
@@ -13,7 +12,6 @@
*> [ZIP]</a>
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgelq2.f">
*> [TXT]</a>
*> \endhtmlonly
*
* Definition:
* ===========
@@ -104,7 +102,7 @@
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \ingroup complexGEcomputational
*> \ingroup gelq2
*
*> \par Further Details:
* =====================
@@ -126,6 +124,7 @@
*>
* =====================================================================
SUBROUTINE CGELQ2( M, N, A, LDA, TAU, WORK, INFO )
IMPLICIT NONE
*
* -- LAPACK computational routine --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
@@ -140,16 +139,11 @@
*
* =====================================================================
*
* .. Parameters ..
COMPLEX ONE
PARAMETER ( ONE = ( 1.0E+0, 0.0E+0 ) )
* ..
* .. Local Scalars ..
INTEGER I, K
COMPLEX ALPHA
* ..
* .. External Subroutines ..
EXTERNAL CLACGV, CLARF, CLARFG, XERBLA
EXTERNAL CLACGV, CLARF1F, CLARFG, XERBLA
* ..
* .. Intrinsic Functions ..
INTRINSIC MAX, MIN
@@ -178,18 +172,15 @@
* Generate elementary reflector H(i) to annihilate A(i,i+1:n)
*
CALL CLACGV( N-I+1, A( I, I ), LDA )
ALPHA = A( I, I )
CALL CLARFG( N-I+1, ALPHA, A( I, MIN( I+1, N ) ), LDA,
CALL CLARFG( N-I+1, A( I, I ), A( I, MIN( I+1, N ) ), LDA,
$ TAU( I ) )
IF( I.LT.M ) THEN
*
* Apply H(i) to A(i+1:m,i:n) from the right
*
A( I, I ) = ONE
CALL CLARF( 'Right', M-I, N-I+1, A( I, I ), LDA, TAU( I ),
$ A( I+1, I ), LDA, WORK )
CALL CLARF1F( 'Right', M-I, N-I+1, A( I, I ), LDA,
$ TAU( I ), A( I+1, I ), LDA, WORK )
END IF
A( I, I ) = ALPHA
CALL CLACGV( N-I+1, A( I, I ), LDA )
10 CONTINUE
RETURN
+7 -15
View File
@@ -5,7 +5,6 @@
* Online html documentation available at
* http://www.netlib.org/lapack/explore-html/
*
*> \htmlonly
*> Download CGEQL2 + dependencies
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/cgeql2.f">
*> [TGZ]</a>
@@ -13,7 +12,6 @@
*> [ZIP]</a>
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgeql2.f">
*> [TXT]</a>
*> \endhtmlonly
*
* Definition:
* ===========
@@ -98,7 +96,7 @@
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \ingroup complexGEcomputational
*> \ingroup geql2
*
*> \par Further Details:
* =====================
@@ -120,6 +118,7 @@
*>
* =====================================================================
SUBROUTINE CGEQL2( M, N, A, LDA, TAU, WORK, INFO )
IMPLICIT NONE
*
* -- LAPACK computational routine --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
@@ -134,16 +133,11 @@
*
* =====================================================================
*
* .. Parameters ..
COMPLEX ONE
PARAMETER ( ONE = ( 1.0E+0, 0.0E+0 ) )
* ..
* .. Local Scalars ..
INTEGER I, K
COMPLEX ALPHA
* ..
* .. External Subroutines ..
EXTERNAL CLARF, CLARFG, XERBLA
EXTERNAL CLARF1L, CLARFG, XERBLA
* ..
* .. Intrinsic Functions ..
INTRINSIC CONJG, MAX, MIN
@@ -172,15 +166,13 @@
* Generate elementary reflector H(i) to annihilate
* A(1:m-k+i-1,n-k+i)
*
ALPHA = A( M-K+I, N-K+I )
CALL CLARFG( M-K+I, ALPHA, A( 1, N-K+I ), 1, TAU( I ) )
CALL CLARFG( M-K+I, A( M-K+I, N-K+I ), A( 1, N-K+I ), 1,
$ TAU( I ) )
*
* Apply H(i)**H to A(1:m-k+i,1:n-k+i-1) from the left
*
A( M-K+I, N-K+I ) = ONE
CALL CLARF( 'Left', M-K+I, N-K+I-1, A( 1, N-K+I ), 1,
$ CONJG( TAU( I ) ), A, LDA, WORK )
A( M-K+I, N-K+I ) = ALPHA
CALL CLARF1L( 'Left', M-K+I, N-K+I-1, A( 1, N-K+I ), 1,
$ CONJG( TAU( I ) ), A, LDA, WORK )
10 CONTINUE
RETURN
*
+4 -13
View File
@@ -5,7 +5,6 @@
* Online html documentation available at
* http://www.netlib.org/lapack/explore-html/
*
*> \htmlonly
*> Download CGEQP3RK + dependencies
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/cgeqp3rk.f">
*> [TGZ]</a>
@@ -13,7 +12,6 @@
*> [ZIP]</a>
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgeqp3rk.f">
*> [TXT]</a>
*> \endhtmlonly
*
* Definition:
* ===========
@@ -552,27 +550,19 @@
*> C. H. Bischof, Math. and Comp. Sci. Div., Argonne National Lab, USA.
*> A BLAS-3 version of the QR factorization with column pivoting.
*> LAPACK Working Note 114
*> \htmlonly
*> <a href="https://www.netlib.org/lapack/lawnspdf/lawn114.pdf">https://www.netlib.org/lapack/lawnspdf/lawn114.pdf</a>
*> \endhtmlonly
*> and in
*> SIAM J. Sci. Comput., 19(5):1486-1494, Sept. 1998.
*> \htmlonly
*> <a href="https://doi.org/10.1137/S1064827595296732">https://doi.org/10.1137/S1064827595296732</a>
*> \endhtmlonly
*>
*> [2] A partial column norm updating strategy developed in 2006.
*> Z. Drmac and Z. Bujanovic, Dept. of Math., University of Zagreb, Croatia.
*> On the failure of rank revealing QR factorization software a case study.
*> LAPACK Working Note 176.
*> \htmlonly
*> <a href="http://www.netlib.org/lapack/lawnspdf/lawn176.pdf">http://www.netlib.org/lapack/lawnspdf/lawn176.pdf</a>
*> \endhtmlonly
*> and in
*> ACM Trans. Math. Softw. 35, 2, Article 12 (July 2008), 28 pages.
*> \htmlonly
*> <a href="https://doi.org/10.1145/1377612.1377616">https://doi.org/10.1145/1377612.1377616</a>
*> \endhtmlonly
*
*> \par Contributors:
* ==================
@@ -678,7 +668,7 @@
* Minimal workspace size in case of using only unblocked
* BLAS 2 code in CLAQP2RK.
* 1) CLAQP2RK: N+NRHS-1 to use in WORK array that is used
* in CLARF subroutine inside CLAQP2RK to apply an
* in CLARF1F subroutine inside CLAQP2RK to apply an
* elementary reflector from the left.
* TOTAL_WORK_SIZE = 3*N + NRHS - 1
*
@@ -694,7 +684,7 @@
* 1) CGEQP3RK, CLAQP2RK, CLAQP3RK: 2*N to store full and
* partial column 2-norms.
* 2) CLAQP2RK: N+NRHS-1 to use in WORK array that is used
* in CLARF subroutine to apply an elementary reflector
* in CLARF1F subroutine to apply an elementary reflector
* from the left.
* 3) CLAQP3RK: NB*(N+NRHS) to use in the work array F that
* is used to apply a block reflector from
@@ -894,7 +884,8 @@
* Determine when to cross over from blocked to unblocked code.
* (for N less than NX, unblocked code should be used).
*
NX = MAX( 0, ILAENV( IXOVER, 'CGEQP3RK', ' ', M, N, -1, -1 ) )
NX = MAX( 0, ILAENV( IXOVER, 'CGEQP3RK', ' ', M, N, -1,
$ -1 ) )
*
IF( NX.LT.MINMN ) THEN
*
+5 -14
View File
@@ -5,7 +5,6 @@
* Online html documentation available at
* http://www.netlib.org/lapack/explore-html/
*
*> \htmlonly
*> Download CGEQR2 + dependencies
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/cgeqr2.f">
*> [TGZ]</a>
@@ -13,7 +12,6 @@
*> [ZIP]</a>
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgeqr2.f">
*> [TXT]</a>
*> \endhtmlonly
*
* Definition:
* ===========
@@ -105,7 +103,7 @@
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \ingroup complexGEcomputational
*> \ingroup geqr2
*
*> \par Further Details:
* =====================
@@ -127,6 +125,7 @@
*>
* =====================================================================
SUBROUTINE CGEQR2( M, N, A, LDA, TAU, WORK, INFO )
IMPLICIT NONE
*
* -- LAPACK computational routine --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
@@ -141,16 +140,11 @@
*
* =====================================================================
*
* .. Parameters ..
COMPLEX ONE
PARAMETER ( ONE = ( 1.0E+0, 0.0E+0 ) )
* ..
* .. Local Scalars ..
INTEGER I, K
COMPLEX ALPHA
* ..
* .. External Subroutines ..
EXTERNAL CLARF, CLARFG, XERBLA
EXTERNAL CLARF1F, CLARFG, XERBLA
* ..
* .. Intrinsic Functions ..
INTRINSIC CONJG, MAX, MIN
@@ -184,11 +178,8 @@
*
* Apply H(i)**H to A(i:m,i+1:n) from the left
*
ALPHA = A( I, I )
A( I, I ) = ONE
CALL CLARF( 'Left', M-I+1, N-I, A( I, I ), 1,
$ CONJG( TAU( I ) ), A( I, I+1 ), LDA, WORK )
A( I, I ) = ALPHA
CALL CLARF1F( 'Left', M-I+1, N-I, A( I, I ), 1,
$ CONJG( TAU( I ) ), A( I, I+1 ), LDA, WORK )
END IF
10 CONTINUE
RETURN
+5 -14
View File
@@ -5,7 +5,6 @@
* Online html documentation available at
* http://www.netlib.org/lapack/explore-html/
*
*> \htmlonly
*> Download CGEQR2P + dependencies
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/cgeqr2p.f">
*> [TGZ]</a>
@@ -13,7 +12,6 @@
*> [ZIP]</a>
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgeqr2p.f">
*> [TXT]</a>
*> \endhtmlonly
*
* Definition:
* ===========
@@ -107,7 +105,7 @@
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \ingroup complexGEcomputational
*> \ingroup geqr2p
*
*> \par Further Details:
* =====================
@@ -131,6 +129,7 @@
*>
* =====================================================================
SUBROUTINE CGEQR2P( M, N, A, LDA, TAU, WORK, INFO )
IMPLICIT NONE
*
* -- LAPACK computational routine --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
@@ -145,16 +144,11 @@
*
* =====================================================================
*
* .. Parameters ..
COMPLEX ONE
PARAMETER ( ONE = ( 1.0E+0, 0.0E+0 ) )
* ..
* .. Local Scalars ..
INTEGER I, K
COMPLEX ALPHA
* ..
* .. External Subroutines ..
EXTERNAL CLARF, CLARFGP, XERBLA
EXTERNAL CLARF1F, CLARFGP, XERBLA
* ..
* .. Intrinsic Functions ..
INTRINSIC CONJG, MAX, MIN
@@ -188,11 +182,8 @@
*
* Apply H(i)**H to A(i:m,i+1:n) from the left
*
ALPHA = A( I, I )
A( I, I ) = ONE
CALL CLARF( 'Left', M-I+1, N-I, A( I, I ), 1,
$ CONJG( TAU( I ) ), A( I, I+1 ), LDA, WORK )
A( I, I ) = ALPHA
CALL CLARF1F( 'Left', M-I+1, N-I, A( I, I ), 1,
$ CONJG( TAU( I ) ), A( I, I+1 ), LDA, WORK )
END IF
10 CONTINUE
RETURN
+6 -15
View File
@@ -5,7 +5,6 @@
* Online html documentation available at
* http://www.netlib.org/lapack/explore-html/
*
*> \htmlonly
*> Download CGERQ2 + dependencies
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/cgerq2.f">
*> [TGZ]</a>
@@ -13,7 +12,6 @@
*> [ZIP]</a>
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgerq2.f">
*> [TXT]</a>
*> \endhtmlonly
*
* Definition:
* ===========
@@ -98,7 +96,7 @@
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \ingroup complexGEcomputational
*> \ingroup gerq2
*
*> \par Further Details:
* =====================
@@ -120,6 +118,7 @@
*>
* =====================================================================
SUBROUTINE CGERQ2( M, N, A, LDA, TAU, WORK, INFO )
IMPLICIT NONE
*
* -- LAPACK computational routine --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
@@ -134,16 +133,11 @@
*
* =====================================================================
*
* .. Parameters ..
COMPLEX ONE
PARAMETER ( ONE = ( 1.0E+0, 0.0E+0 ) )
* ..
* .. Local Scalars ..
INTEGER I, K
COMPLEX ALPHA
* ..
* .. External Subroutines ..
EXTERNAL CLACGV, CLARF, CLARFG, XERBLA
EXTERNAL CLACGV, CLARF1L, CLARFG, XERBLA
* ..
* .. Intrinsic Functions ..
INTRINSIC MAX, MIN
@@ -173,16 +167,13 @@
* A(m-k+i,1:n-k+i-1)
*
CALL CLACGV( N-K+I, A( M-K+I, 1 ), LDA )
ALPHA = A( M-K+I, N-K+I )
CALL CLARFG( N-K+I, ALPHA, A( M-K+I, 1 ), LDA,
CALL CLARFG( N-K+I, A( M-K+I, N-K+I ), A( M-K+I, 1 ), LDA,
$ TAU( I ) )
*
* Apply H(i) to A(1:m-k+i-1,1:n-k+i) from the right
*
A( M-K+I, N-K+I ) = ONE
CALL CLARF( 'Right', M-K+I-1, N-K+I, A( M-K+I, 1 ), LDA,
$ TAU( I ), A, LDA, WORK )
A( M-K+I, N-K+I ) = ALPHA
CALL CLARF1L( 'Right', M-K+I-1, N-K+I, A( M-K+I, 1 ), LDA,
$ TAU( I ), A, LDA, WORK )
CALL CLACGV( N-K+I-1, A( M-K+I, 1 ), LDA )
10 CONTINUE
RETURN
+5 -7
View File
@@ -5,7 +5,6 @@
* Online html documentation available at
* http://www.netlib.org/lapack/explore-html/
*
*> \htmlonly
*> Download CGETC2 + dependencies
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/cgetc2.f">
*> [TGZ]</a>
@@ -13,7 +12,6 @@
*> [ZIP]</a>
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgetc2.f">
*> [TXT]</a>
*> \endhtmlonly
*
* Definition:
* ===========
@@ -98,7 +96,7 @@
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \ingroup complexGEauxiliary
*> \ingroup getc2
*
*> \par Contributors:
* ==================
@@ -108,6 +106,7 @@
*
* =====================================================================
SUBROUTINE CGETC2( N, A, LDA, IPIV, JPIV, INFO )
IMPLICIT NONE
*
* -- LAPACK auxiliary routine --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
@@ -132,7 +131,7 @@
REAL BIGNUM, EPS, SMIN, SMLNUM, XMAX
* ..
* .. External Subroutines ..
EXTERNAL CGERU, CSWAP, SLABAD
EXTERNAL CGERU, CSWAP
* ..
* .. External Functions ..
REAL SLAMCH
@@ -155,7 +154,6 @@
EPS = SLAMCH( 'P' )
SMLNUM = SLAMCH( 'S' ) / EPS
BIGNUM = ONE / SMLNUM
CALL SLABAD( SMLNUM, BIGNUM )
*
* Handle the case N=1 by itself
*
@@ -177,8 +175,8 @@
* Find max element in matrix A
*
XMAX = ZERO
DO 20 IP = I, N
DO 10 JP = I, N
DO 20 JP = I, N
DO 10 IP = I, N
IF( ABS( A( IP, JP ) ).GE.XMAX ) THEN
XMAX = ABS( A( IP, JP ) )
IPV = IP

Some files were not shown because too many files have changed in this diff Show More