├── ext ├── build_includes │ ├── .gitignore │ ├── Project.toml │ └── build_includes.jl ├── clang_extraction │ ├── Project.toml │ ├── generate_func_list.jl │ └── Manifest.toml └── gensymbol │ ├── README.md │ └── generate_func_list.sh ├── include ├── ILP64 │ ├── common │ │ ├── f77blas.h │ │ ├── lapack.h │ │ ├── lapacke.h │ │ ├── lapacke_config.h │ │ ├── lapacke_utils.h │ │ └── lapacke_mangling.h │ ├── aarch64-linux-gnu │ │ ├── lapack.h │ │ ├── f77blas.h │ │ ├── lapacke.h │ │ ├── lapacke_utils.h │ │ ├── lapacke_config.h │ │ ├── lapacke_mangling.h │ │ └── openblas_config.h │ ├── i686-linux-gnu │ │ ├── lapack.h │ │ ├── f77blas.h │ │ ├── lapacke.h │ │ ├── lapacke_utils.h │ │ ├── lapacke_config.h │ │ └── lapacke_mangling.h │ ├── riscv64-linux-gnu │ │ ├── lapack.h │ │ ├── f77blas.h │ │ ├── lapacke.h │ │ ├── lapacke_utils.h │ │ ├── lapacke_config.h │ │ ├── lapacke_mangling.h │ │ └── openblas_config.h │ ├── aarch64-linux-musl │ │ ├── lapack.h │ │ ├── f77blas.h │ │ ├── lapacke.h │ │ ├── lapacke_config.h │ │ ├── lapacke_utils.h │ │ ├── lapacke_mangling.h │ │ └── openblas_config.h │ ├── i686-linux-musl │ │ ├── f77blas.h │ │ ├── lapack.h │ │ ├── lapacke.h │ │ ├── lapacke_utils.h │ │ ├── lapacke_config.h │ │ └── lapacke_mangling.h │ ├── i686-w64-mingw32 │ │ ├── f77blas.h │ │ ├── lapack.h │ │ ├── lapacke.h │ │ ├── lapacke_config.h │ │ ├── lapacke_utils.h │ │ └── lapacke_mangling.h │ ├── riscv64-linux-musl │ │ ├── lapack.h │ │ ├── f77blas.h │ │ ├── lapacke.h │ │ ├── lapacke_config.h │ │ ├── lapacke_utils.h │ │ ├── lapacke_mangling.h │ │ └── openblas_config.h │ ├── x86_64-apple-darwin │ │ ├── lapack.h │ │ ├── f77blas.h │ │ ├── lapacke.h │ │ ├── lapacke_utils.h │ │ ├── lapacke_config.h │ │ └── lapacke_mangling.h │ ├── x86_64-linux-gnu │ │ ├── f77blas.h │ │ ├── lapack.h │ │ ├── lapacke.h │ │ ├── lapacke_config.h │ │ ├── lapacke_utils.h │ │ └── lapacke_mangling.h │ ├── x86_64-linux-musl │ │ ├── f77blas.h │ │ ├── lapack.h │ │ ├── lapacke.h │ │ ├── lapacke_config.h │ │ ├── lapacke_utils.h │ │ └── lapacke_mangling.h │ ├── x86_64-w64-mingw32 │ │ ├── lapack.h │ │ ├── f77blas.h │ │ ├── lapacke.h │ │ ├── lapacke_config.h │ │ ├── lapacke_utils.h │ │ └── lapacke_mangling.h │ ├── armv7l-linux-gnueabihf │ │ ├── f77blas.h │ │ ├── lapack.h │ │ ├── lapacke.h │ │ ├── lapacke_config.h │ │ ├── lapacke_utils.h │ │ ├── lapacke_mangling.h │ │ └── openblas_config.h │ ├── armv7l-linux-musleabihf │ │ ├── lapack.h │ │ ├── f77blas.h │ │ ├── lapacke.h │ │ ├── lapacke_config.h │ │ ├── lapacke_utils.h │ │ ├── lapacke_mangling.h │ │ └── openblas_config.h │ ├── powerpc64le-linux-gnu │ │ ├── f77blas.h │ │ ├── lapack.h │ │ ├── lapacke.h │ │ ├── lapacke_config.h │ │ ├── lapacke_utils.h │ │ ├── lapacke_mangling.h │ │ └── openblas_config.h │ └── x86_64-unknown-freebsd │ │ ├── f77blas.h │ │ ├── lapack.h │ │ ├── lapacke.h │ │ ├── lapacke_config.h │ │ ├── lapacke_utils.h │ │ └── lapacke_mangling.h ├── LP64 │ ├── common │ │ ├── f77blas.h │ │ ├── lapack.h │ │ ├── lapacke.h │ │ ├── lapacke_utils.h │ │ ├── lapacke_config.h │ │ └── lapacke_mangling.h │ ├── i686-linux-gnu │ │ ├── cblas.h │ │ ├── lapack.h │ │ ├── f77blas.h │ │ ├── lapacke.h │ │ ├── lapacke_config.h │ │ ├── lapacke_utils.h │ │ └── lapacke_mangling.h │ ├── i686-linux-musl │ │ ├── cblas.h │ │ ├── lapack.h │ │ ├── f77blas.h │ │ ├── lapacke.h │ │ ├── lapacke_utils.h │ │ ├── lapacke_config.h │ │ └── lapacke_mangling.h │ ├── aarch64-linux-gnu │ │ ├── cblas.h │ │ ├── lapack.h │ │ ├── f77blas.h │ │ ├── lapacke.h │ │ ├── lapacke_config.h │ │ ├── lapacke_utils.h │ │ ├── lapacke_mangling.h │ │ └── openblas_config.h │ ├── aarch64-linux-musl │ │ ├── cblas.h │ │ ├── f77blas.h │ │ ├── lapack.h │ │ ├── lapacke.h │ │ ├── lapacke_config.h │ │ ├── lapacke_utils.h │ │ ├── lapacke_mangling.h │ │ └── openblas_config.h │ ├── i686-w64-mingw32 │ │ ├── cblas.h │ │ ├── f77blas.h │ │ ├── lapack.h │ │ ├── lapacke.h │ │ ├── lapacke_utils.h │ │ ├── lapacke_config.h │ │ └── lapacke_mangling.h │ ├── riscv64-linux-gnu │ │ ├── cblas.h │ │ ├── lapack.h │ │ ├── f77blas.h │ │ ├── lapacke.h │ │ ├── lapacke_config.h │ │ ├── lapacke_utils.h │ │ └── lapacke_mangling.h │ ├── riscv64-linux-musl │ │ ├── cblas.h │ │ ├── f77blas.h │ │ ├── lapack.h │ │ ├── lapacke.h │ │ ├── lapacke_config.h │ │ ├── lapacke_utils.h │ │ └── lapacke_mangling.h │ ├── x86_64-apple-darwin │ │ ├── cblas.h │ │ ├── lapack.h │ │ ├── f77blas.h │ │ ├── lapacke.h │ │ ├── lapacke_config.h │ │ ├── lapacke_utils.h │ │ └── lapacke_mangling.h │ ├── x86_64-linux-gnu │ │ ├── cblas.h │ │ ├── f77blas.h │ │ ├── lapack.h │ │ ├── lapacke.h │ │ ├── lapacke_utils.h │ │ ├── lapacke_config.h │ │ └── lapacke_mangling.h │ ├── x86_64-linux-musl │ │ ├── cblas.h │ │ ├── f77blas.h │ │ ├── lapack.h │ │ ├── lapacke.h │ │ ├── lapacke_config.h │ │ ├── lapacke_utils.h │ │ └── lapacke_mangling.h │ ├── x86_64-w64-mingw32 │ │ ├── cblas.h │ │ ├── f77blas.h │ │ ├── lapack.h │ │ ├── lapacke.h │ │ ├── lapacke_config.h │ │ ├── lapacke_utils.h │ │ └── lapacke_mangling.h │ ├── armv7l-linux-gnueabihf │ │ ├── cblas.h │ │ ├── f77blas.h │ │ ├── lapack.h │ │ ├── lapacke.h │ │ ├── lapacke_config.h │ │ ├── lapacke_utils.h │ │ ├── lapacke_mangling.h │ │ └── openblas_config.h │ ├── armv7l-linux-musleabihf │ │ ├── cblas.h │ │ ├── f77blas.h │ │ ├── lapack.h │ │ ├── lapacke.h │ │ ├── lapacke_config.h │ │ ├── lapacke_utils.h │ │ ├── lapacke_mangling.h │ │ └── openblas_config.h │ ├── powerpc64le-linux-gnu │ │ ├── cblas.h │ │ ├── f77blas.h │ │ ├── lapack.h │ │ ├── lapacke.h │ │ ├── lapacke_utils.h │ │ ├── lapacke_config.h │ │ ├── lapacke_mangling.h │ │ └── openblas_config.h │ └── x86_64-unknown-freebsd │ │ ├── cblas.h │ │ ├── f77blas.h │ │ ├── lapack.h │ │ ├── lapacke.h │ │ ├── lapacke_config.h │ │ ├── lapacke_utils.h │ │ └── lapacke_mangling.h └── common │ ├── lapacke_mangling.h │ └── lapacke_config.h ├── .gitignore ├── .buildkite ├── instantiate_and_test.sh ├── test_macos.yml ├── test_windows.yml ├── test_linux.yml └── pipeline.yml ├── src ├── trampolines │ ├── README.md │ ├── ilp64_doubling.h │ ├── trampolines_i686.S │ ├── trampolines_riscv64.S │ ├── trampolines_aarch64.S │ ├── trampolines_loongarch64.S │ ├── trampolines_x86_64.S │ ├── trampolines_arm.S │ ├── trampolines_powerpc64le.S │ └── common.h ├── libblastrampoline_cblasdata.h ├── win_utils.c ├── libblastrampoline_f2cdata.h ├── env_utils.c ├── libblastrampoline_trampdata.h ├── Makefile ├── libblastrampoline_complex_retdata.h ├── deepbindless.c ├── libblastrampoline_internal.h ├── dl_utils.c ├── Make.inc ├── config.c └── complex_return_style_adapters.c ├── .github ├── dependabot.yml └── release.yml ├── test ├── sdot_test │ ├── Makefile │ └── sdot_test.c ├── cdotc_test │ ├── Makefile │ └── cdotc_test.c ├── dgemm_test │ ├── Makefile │ └── dgemm_test.c ├── sgesv_test │ ├── Makefile │ └── sgesv_test.c ├── dgemmt_test │ ├── Makefile │ └── dgemmt_test.c ├── dpstrf_test │ ├── Makefile │ └── dpstrf_test.c ├── isamax_test │ ├── Makefile │ └── isamax_test.c ├── inconsolable_test │ ├── Makefile │ └── inconsolable_test.c ├── Project.toml ├── README.md └── accelerate.jl ├── LICENSE.md └── .cirrus.yml /ext/build_includes/.gitignore: -------------------------------------------------------------------------------- 1 | products/ 2 | build/ -------------------------------------------------------------------------------- /include/ILP64/common/f77blas.h: -------------------------------------------------------------------------------- 1 | ../../common/f77blas.h -------------------------------------------------------------------------------- /include/ILP64/common/lapack.h: -------------------------------------------------------------------------------- 1 | ../../common/lapack.h -------------------------------------------------------------------------------- /include/ILP64/common/lapacke.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke.h -------------------------------------------------------------------------------- /include/LP64/common/f77blas.h: -------------------------------------------------------------------------------- 1 | ../../common/f77blas.h -------------------------------------------------------------------------------- /include/LP64/common/lapack.h: -------------------------------------------------------------------------------- 1 | ../../common/lapack.h -------------------------------------------------------------------------------- /include/LP64/common/lapacke.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke.h -------------------------------------------------------------------------------- /include/LP64/i686-linux-gnu/cblas.h: -------------------------------------------------------------------------------- 1 | ../common/cblas.h -------------------------------------------------------------------------------- /include/LP64/i686-linux-musl/cblas.h: -------------------------------------------------------------------------------- 1 | ../common/cblas.h -------------------------------------------------------------------------------- /include/ILP64/aarch64-linux-gnu/lapack.h: -------------------------------------------------------------------------------- 1 | ../common/lapack.h -------------------------------------------------------------------------------- /include/ILP64/i686-linux-gnu/lapack.h: -------------------------------------------------------------------------------- 1 | ../../common/lapack.h -------------------------------------------------------------------------------- /include/ILP64/riscv64-linux-gnu/lapack.h: -------------------------------------------------------------------------------- 1 | ../common/lapack.h -------------------------------------------------------------------------------- /include/LP64/aarch64-linux-gnu/cblas.h: -------------------------------------------------------------------------------- 1 | ../common/cblas.h -------------------------------------------------------------------------------- /include/LP64/aarch64-linux-gnu/lapack.h: -------------------------------------------------------------------------------- 1 | ../common/lapack.h -------------------------------------------------------------------------------- /include/LP64/aarch64-linux-musl/cblas.h: -------------------------------------------------------------------------------- 1 | ../common/cblas.h -------------------------------------------------------------------------------- /include/LP64/i686-linux-gnu/lapack.h: -------------------------------------------------------------------------------- 1 | ../../common/lapack.h -------------------------------------------------------------------------------- /include/LP64/i686-linux-musl/lapack.h: -------------------------------------------------------------------------------- 1 | ../../common/lapack.h -------------------------------------------------------------------------------- /include/LP64/i686-w64-mingw32/cblas.h: -------------------------------------------------------------------------------- 1 | ../common/cblas.h -------------------------------------------------------------------------------- /include/LP64/riscv64-linux-gnu/cblas.h: -------------------------------------------------------------------------------- 1 | ../common/cblas.h -------------------------------------------------------------------------------- /include/LP64/riscv64-linux-gnu/lapack.h: -------------------------------------------------------------------------------- 1 | ../common/lapack.h -------------------------------------------------------------------------------- /include/LP64/riscv64-linux-musl/cblas.h: -------------------------------------------------------------------------------- 1 | ../common/cblas.h -------------------------------------------------------------------------------- /include/LP64/x86_64-apple-darwin/cblas.h: -------------------------------------------------------------------------------- 1 | ../common/cblas.h -------------------------------------------------------------------------------- /include/LP64/x86_64-linux-gnu/cblas.h: -------------------------------------------------------------------------------- 1 | ../common/cblas.h -------------------------------------------------------------------------------- /include/LP64/x86_64-linux-musl/cblas.h: -------------------------------------------------------------------------------- 1 | ../common/cblas.h -------------------------------------------------------------------------------- /include/LP64/x86_64-w64-mingw32/cblas.h: -------------------------------------------------------------------------------- 1 | ../common/cblas.h -------------------------------------------------------------------------------- /include/ILP64/aarch64-linux-gnu/f77blas.h: -------------------------------------------------------------------------------- 1 | ../common/f77blas.h -------------------------------------------------------------------------------- /include/ILP64/aarch64-linux-gnu/lapacke.h: -------------------------------------------------------------------------------- 1 | ../common/lapacke.h -------------------------------------------------------------------------------- /include/ILP64/aarch64-linux-musl/lapack.h: -------------------------------------------------------------------------------- 1 | ../../common/lapack.h -------------------------------------------------------------------------------- /include/ILP64/i686-linux-gnu/f77blas.h: -------------------------------------------------------------------------------- 1 | ../../common/f77blas.h -------------------------------------------------------------------------------- /include/ILP64/i686-linux-gnu/lapacke.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke.h -------------------------------------------------------------------------------- /include/ILP64/i686-linux-musl/f77blas.h: -------------------------------------------------------------------------------- 1 | ../../common/f77blas.h -------------------------------------------------------------------------------- /include/ILP64/i686-linux-musl/lapack.h: -------------------------------------------------------------------------------- 1 | ../../common/lapack.h -------------------------------------------------------------------------------- /include/ILP64/i686-linux-musl/lapacke.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke.h -------------------------------------------------------------------------------- /include/ILP64/i686-w64-mingw32/f77blas.h: -------------------------------------------------------------------------------- 1 | ../../common/f77blas.h -------------------------------------------------------------------------------- /include/ILP64/i686-w64-mingw32/lapack.h: -------------------------------------------------------------------------------- 1 | ../../common/lapack.h -------------------------------------------------------------------------------- /include/ILP64/i686-w64-mingw32/lapacke.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke.h -------------------------------------------------------------------------------- /include/ILP64/riscv64-linux-gnu/f77blas.h: -------------------------------------------------------------------------------- 1 | ../common/f77blas.h -------------------------------------------------------------------------------- /include/ILP64/riscv64-linux-gnu/lapacke.h: -------------------------------------------------------------------------------- 1 | ../common/lapacke.h -------------------------------------------------------------------------------- /include/ILP64/riscv64-linux-musl/lapack.h: -------------------------------------------------------------------------------- 1 | ../../common/lapack.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-apple-darwin/lapack.h: -------------------------------------------------------------------------------- 1 | ../../common/lapack.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-linux-gnu/f77blas.h: -------------------------------------------------------------------------------- 1 | ../../common/f77blas.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-linux-gnu/lapack.h: -------------------------------------------------------------------------------- 1 | ../../common/lapack.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-linux-gnu/lapacke.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-linux-musl/f77blas.h: -------------------------------------------------------------------------------- 1 | ../../common/f77blas.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-linux-musl/lapack.h: -------------------------------------------------------------------------------- 1 | ../../common/lapack.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-linux-musl/lapacke.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-w64-mingw32/lapack.h: -------------------------------------------------------------------------------- 1 | ../../common/lapack.h -------------------------------------------------------------------------------- /include/LP64/aarch64-linux-gnu/f77blas.h: -------------------------------------------------------------------------------- 1 | ../common/f77blas.h -------------------------------------------------------------------------------- /include/LP64/aarch64-linux-gnu/lapacke.h: -------------------------------------------------------------------------------- 1 | ../common/lapacke.h -------------------------------------------------------------------------------- /include/LP64/aarch64-linux-musl/f77blas.h: -------------------------------------------------------------------------------- 1 | ../../common/f77blas.h -------------------------------------------------------------------------------- /include/LP64/aarch64-linux-musl/lapack.h: -------------------------------------------------------------------------------- 1 | ../../common/lapack.h -------------------------------------------------------------------------------- /include/LP64/aarch64-linux-musl/lapacke.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke.h -------------------------------------------------------------------------------- /include/LP64/armv7l-linux-gnueabihf/cblas.h: -------------------------------------------------------------------------------- 1 | ../common/cblas.h -------------------------------------------------------------------------------- /include/LP64/armv7l-linux-musleabihf/cblas.h: -------------------------------------------------------------------------------- 1 | ../common/cblas.h -------------------------------------------------------------------------------- /include/LP64/common/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/LP64/i686-linux-gnu/f77blas.h: -------------------------------------------------------------------------------- 1 | ../../common/f77blas.h -------------------------------------------------------------------------------- /include/LP64/i686-linux-gnu/lapacke.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke.h -------------------------------------------------------------------------------- /include/LP64/i686-linux-musl/f77blas.h: -------------------------------------------------------------------------------- 1 | ../../common/f77blas.h -------------------------------------------------------------------------------- /include/LP64/i686-linux-musl/lapacke.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke.h -------------------------------------------------------------------------------- /include/LP64/i686-w64-mingw32/f77blas.h: -------------------------------------------------------------------------------- 1 | ../../common/f77blas.h -------------------------------------------------------------------------------- /include/LP64/i686-w64-mingw32/lapack.h: -------------------------------------------------------------------------------- 1 | ../../common/lapack.h -------------------------------------------------------------------------------- /include/LP64/i686-w64-mingw32/lapacke.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke.h -------------------------------------------------------------------------------- /include/LP64/powerpc64le-linux-gnu/cblas.h: -------------------------------------------------------------------------------- 1 | ../common/cblas.h -------------------------------------------------------------------------------- /include/LP64/riscv64-linux-gnu/f77blas.h: -------------------------------------------------------------------------------- 1 | ../common/f77blas.h -------------------------------------------------------------------------------- /include/LP64/riscv64-linux-gnu/lapacke.h: -------------------------------------------------------------------------------- 1 | ../common/lapacke.h -------------------------------------------------------------------------------- /include/LP64/riscv64-linux-musl/f77blas.h: -------------------------------------------------------------------------------- 1 | ../../common/f77blas.h -------------------------------------------------------------------------------- /include/LP64/riscv64-linux-musl/lapack.h: -------------------------------------------------------------------------------- 1 | ../../common/lapack.h -------------------------------------------------------------------------------- /include/LP64/riscv64-linux-musl/lapacke.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke.h -------------------------------------------------------------------------------- /include/LP64/x86_64-apple-darwin/lapack.h: -------------------------------------------------------------------------------- 1 | ../../common/lapack.h -------------------------------------------------------------------------------- /include/LP64/x86_64-linux-gnu/f77blas.h: -------------------------------------------------------------------------------- 1 | ../../common/f77blas.h -------------------------------------------------------------------------------- /include/LP64/x86_64-linux-gnu/lapack.h: -------------------------------------------------------------------------------- 1 | ../../common/lapack.h -------------------------------------------------------------------------------- /include/LP64/x86_64-linux-gnu/lapacke.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke.h -------------------------------------------------------------------------------- /include/LP64/x86_64-linux-musl/f77blas.h: -------------------------------------------------------------------------------- 1 | ../../common/f77blas.h -------------------------------------------------------------------------------- /include/LP64/x86_64-linux-musl/lapack.h: -------------------------------------------------------------------------------- 1 | ../../common/lapack.h -------------------------------------------------------------------------------- /include/LP64/x86_64-linux-musl/lapacke.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke.h -------------------------------------------------------------------------------- /include/LP64/x86_64-unknown-freebsd/cblas.h: -------------------------------------------------------------------------------- 1 | ../common/cblas.h -------------------------------------------------------------------------------- /include/LP64/x86_64-w64-mingw32/f77blas.h: -------------------------------------------------------------------------------- 1 | ../../common/f77blas.h -------------------------------------------------------------------------------- /include/LP64/x86_64-w64-mingw32/lapack.h: -------------------------------------------------------------------------------- 1 | ../../common/lapack.h -------------------------------------------------------------------------------- /include/LP64/x86_64-w64-mingw32/lapacke.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke.h -------------------------------------------------------------------------------- /include/ILP64/aarch64-linux-musl/f77blas.h: -------------------------------------------------------------------------------- 1 | ../../common/f77blas.h -------------------------------------------------------------------------------- /include/ILP64/aarch64-linux-musl/lapacke.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke.h -------------------------------------------------------------------------------- /include/ILP64/armv7l-linux-gnueabihf/f77blas.h: -------------------------------------------------------------------------------- 1 | ../../common/f77blas.h -------------------------------------------------------------------------------- /include/ILP64/armv7l-linux-gnueabihf/lapack.h: -------------------------------------------------------------------------------- 1 | ../../common/lapack.h -------------------------------------------------------------------------------- /include/ILP64/armv7l-linux-gnueabihf/lapacke.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke.h -------------------------------------------------------------------------------- /include/ILP64/armv7l-linux-musleabihf/lapack.h: -------------------------------------------------------------------------------- 1 | ../../common/lapack.h -------------------------------------------------------------------------------- /include/ILP64/common/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_config.h -------------------------------------------------------------------------------- /include/ILP64/common/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/ILP64/powerpc64le-linux-gnu/f77blas.h: -------------------------------------------------------------------------------- 1 | ../../common/f77blas.h -------------------------------------------------------------------------------- /include/ILP64/powerpc64le-linux-gnu/lapack.h: -------------------------------------------------------------------------------- 1 | ../../common/lapack.h -------------------------------------------------------------------------------- /include/ILP64/powerpc64le-linux-gnu/lapacke.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke.h -------------------------------------------------------------------------------- /include/ILP64/riscv64-linux-musl/f77blas.h: -------------------------------------------------------------------------------- 1 | ../../common/f77blas.h -------------------------------------------------------------------------------- /include/ILP64/riscv64-linux-musl/lapacke.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-apple-darwin/f77blas.h: -------------------------------------------------------------------------------- 1 | ../../common/f77blas.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-apple-darwin/lapacke.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-unknown-freebsd/f77blas.h: -------------------------------------------------------------------------------- 1 | ../../common/f77blas.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-unknown-freebsd/lapack.h: -------------------------------------------------------------------------------- 1 | ../../common/lapack.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-unknown-freebsd/lapacke.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-w64-mingw32/f77blas.h: -------------------------------------------------------------------------------- 1 | ../../common/f77blas.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-w64-mingw32/lapacke.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke.h -------------------------------------------------------------------------------- /include/LP64/armv7l-linux-gnueabihf/f77blas.h: -------------------------------------------------------------------------------- 1 | ../../common/f77blas.h -------------------------------------------------------------------------------- /include/LP64/armv7l-linux-gnueabihf/lapack.h: -------------------------------------------------------------------------------- 1 | ../../common/lapack.h -------------------------------------------------------------------------------- /include/LP64/armv7l-linux-gnueabihf/lapacke.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke.h -------------------------------------------------------------------------------- /include/LP64/armv7l-linux-musleabihf/f77blas.h: -------------------------------------------------------------------------------- 1 | ../../common/f77blas.h -------------------------------------------------------------------------------- /include/LP64/armv7l-linux-musleabihf/lapack.h: -------------------------------------------------------------------------------- 1 | ../../common/lapack.h -------------------------------------------------------------------------------- /include/LP64/armv7l-linux-musleabihf/lapacke.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke.h -------------------------------------------------------------------------------- /include/LP64/common/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_config.h -------------------------------------------------------------------------------- /include/LP64/powerpc64le-linux-gnu/f77blas.h: -------------------------------------------------------------------------------- 1 | ../../common/f77blas.h -------------------------------------------------------------------------------- /include/LP64/powerpc64le-linux-gnu/lapack.h: -------------------------------------------------------------------------------- 1 | ../../common/lapack.h -------------------------------------------------------------------------------- /include/LP64/powerpc64le-linux-gnu/lapacke.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke.h -------------------------------------------------------------------------------- /include/LP64/x86_64-apple-darwin/f77blas.h: -------------------------------------------------------------------------------- 1 | ../../common/f77blas.h -------------------------------------------------------------------------------- /include/LP64/x86_64-apple-darwin/lapacke.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke.h -------------------------------------------------------------------------------- /include/LP64/x86_64-unknown-freebsd/f77blas.h: -------------------------------------------------------------------------------- 1 | ../../common/f77blas.h -------------------------------------------------------------------------------- /include/LP64/x86_64-unknown-freebsd/lapack.h: -------------------------------------------------------------------------------- 1 | ../../common/lapack.h -------------------------------------------------------------------------------- /include/LP64/x86_64-unknown-freebsd/lapacke.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke.h -------------------------------------------------------------------------------- /include/ILP64/aarch64-linux-gnu/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/ILP64/armv7l-linux-musleabihf/f77blas.h: -------------------------------------------------------------------------------- 1 | ../../common/f77blas.h -------------------------------------------------------------------------------- /include/ILP64/armv7l-linux-musleabihf/lapacke.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke.h -------------------------------------------------------------------------------- /include/ILP64/common/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/ILP64/i686-linux-gnu/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/ILP64/i686-linux-musl/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/ILP64/riscv64-linux-gnu/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/LP64/aarch64-linux-gnu/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../common/lapacke_config.h -------------------------------------------------------------------------------- /include/LP64/aarch64-linux-gnu/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/LP64/common/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/LP64/i686-linux-gnu/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_config.h -------------------------------------------------------------------------------- /include/LP64/i686-linux-gnu/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/LP64/i686-linux-musl/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/LP64/i686-w64-mingw32/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/LP64/riscv64-linux-gnu/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../common/lapacke_config.h -------------------------------------------------------------------------------- /include/LP64/riscv64-linux-gnu/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/LP64/x86_64-linux-gnu/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/ILP64/aarch64-linux-gnu/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../common/lapacke_config.h -------------------------------------------------------------------------------- /include/ILP64/aarch64-linux-gnu/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/ILP64/aarch64-linux-musl/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_config.h -------------------------------------------------------------------------------- /include/ILP64/aarch64-linux-musl/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/ILP64/i686-linux-gnu/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_config.h -------------------------------------------------------------------------------- /include/ILP64/i686-linux-gnu/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/ILP64/i686-linux-musl/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_config.h -------------------------------------------------------------------------------- /include/ILP64/i686-w64-mingw32/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_config.h -------------------------------------------------------------------------------- /include/ILP64/i686-w64-mingw32/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/ILP64/riscv64-linux-gnu/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../common/lapacke_config.h -------------------------------------------------------------------------------- /include/ILP64/riscv64-linux-gnu/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/ILP64/riscv64-linux-musl/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_config.h -------------------------------------------------------------------------------- /include/ILP64/riscv64-linux-musl/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-apple-darwin/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-linux-gnu/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_config.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-linux-gnu/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-linux-musl/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_config.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-linux-musl/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-w64-mingw32/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_config.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-w64-mingw32/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/LP64/aarch64-linux-gnu/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/LP64/aarch64-linux-musl/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_config.h -------------------------------------------------------------------------------- /include/LP64/aarch64-linux-musl/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/LP64/i686-linux-gnu/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/LP64/i686-linux-musl/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_config.h -------------------------------------------------------------------------------- /include/LP64/i686-linux-musl/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/LP64/i686-w64-mingw32/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_config.h -------------------------------------------------------------------------------- /include/LP64/powerpc64le-linux-gnu/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/LP64/riscv64-linux-gnu/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/LP64/riscv64-linux-musl/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_config.h -------------------------------------------------------------------------------- /include/LP64/riscv64-linux-musl/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/LP64/x86_64-apple-darwin/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_config.h -------------------------------------------------------------------------------- /include/LP64/x86_64-apple-darwin/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/LP64/x86_64-linux-gnu/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_config.h -------------------------------------------------------------------------------- /include/LP64/x86_64-linux-musl/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_config.h -------------------------------------------------------------------------------- /include/LP64/x86_64-linux-musl/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/LP64/x86_64-w64-mingw32/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_config.h -------------------------------------------------------------------------------- /include/LP64/x86_64-w64-mingw32/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/ILP64/aarch64-linux-musl/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/ILP64/armv7l-linux-gnueabihf/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_config.h -------------------------------------------------------------------------------- /include/ILP64/armv7l-linux-gnueabihf/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/ILP64/armv7l-linux-musleabihf/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_config.h -------------------------------------------------------------------------------- /include/ILP64/armv7l-linux-musleabihf/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/ILP64/i686-linux-musl/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/ILP64/i686-w64-mingw32/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/ILP64/powerpc64le-linux-gnu/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_config.h -------------------------------------------------------------------------------- /include/ILP64/powerpc64le-linux-gnu/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/ILP64/riscv64-linux-musl/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-apple-darwin/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_config.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-apple-darwin/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-linux-gnu/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-linux-musl/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-unknown-freebsd/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_config.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-unknown-freebsd/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-w64-mingw32/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/LP64/aarch64-linux-musl/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/LP64/armv7l-linux-gnueabihf/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_config.h -------------------------------------------------------------------------------- /include/LP64/armv7l-linux-gnueabihf/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/LP64/armv7l-linux-musleabihf/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_config.h -------------------------------------------------------------------------------- /include/LP64/armv7l-linux-musleabihf/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/LP64/i686-w64-mingw32/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/LP64/powerpc64le-linux-gnu/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_config.h -------------------------------------------------------------------------------- /include/LP64/riscv64-linux-musl/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/LP64/x86_64-apple-darwin/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/LP64/x86_64-linux-gnu/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/LP64/x86_64-linux-musl/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/LP64/x86_64-unknown-freebsd/lapacke_config.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_config.h -------------------------------------------------------------------------------- /include/LP64/x86_64-unknown-freebsd/lapacke_utils.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_utils.h -------------------------------------------------------------------------------- /include/LP64/x86_64-w64-mingw32/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/ILP64/armv7l-linux-gnueabihf/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/ILP64/armv7l-linux-musleabihf/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/ILP64/powerpc64le-linux-gnu/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/ILP64/x86_64-unknown-freebsd/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/LP64/armv7l-linux-gnueabihf/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/LP64/armv7l-linux-musleabihf/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/LP64/powerpc64le-linux-gnu/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_mangling.h -------------------------------------------------------------------------------- /include/LP64/x86_64-unknown-freebsd/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | ../../common/lapacke_mangling.h -------------------------------------------------------------------------------- /ext/clang_extraction/Project.toml: -------------------------------------------------------------------------------- 1 | [deps] 2 | Clang = "40e3b903-d033-50b4-a0cc-940c62c95e31" 3 | -------------------------------------------------------------------------------- /ext/build_includes/Project.toml: -------------------------------------------------------------------------------- 1 | [deps] 2 | BinaryBuilder = "12aac903-9f7c-5d81-afc2-d9565ea332ae" 3 | SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce" 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.so 3 | *.dll 4 | *.dylib 5 | 6 | .vscode/ 7 | 8 | # Build and output 9 | src/build/ 10 | src/prefix/ 11 | test/Manifest.toml 12 | -------------------------------------------------------------------------------- /.buildkite/instantiate_and_test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | 4 | julia --project=test -e 'import Pkg; Pkg.instantiate()' 5 | echo '+++ runtests.jl' 6 | julia --project=test test/runtests.jl 7 | -------------------------------------------------------------------------------- /src/trampolines/README.md: -------------------------------------------------------------------------------- 1 | # Trampoline definitions 2 | 3 | These trampoline definitions are taken from the [Julia repository](https://github.com/JuliaLang/julia/tree/master/cli), and modified slightly to enable defining both `foo` and `foo64_` in one definition. -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 2 | version: 2 3 | updates: 4 | - package-ecosystem: "github-actions" 5 | directory: "/" # Location of package manifests 6 | schedule: 7 | interval: "monthly" 8 | -------------------------------------------------------------------------------- /test/sdot_test/Makefile: -------------------------------------------------------------------------------- 1 | include ../../src/Make.inc 2 | 3 | all: $(prefix)/sdot_test$(EXE) 4 | 5 | $(prefix): 6 | @mkdir -p $@ 7 | 8 | $(prefix)/sdot_test$(EXE): sdot_test.c | $(prefix) 9 | @$(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS) 10 | 11 | clean: 12 | @rm -f $(prefix)/sdot_test$(EXE) 13 | 14 | run: $(prefix)/sdot_test$(EXE) 15 | @$(prefix)/sdot_test$(EXE) 16 | -------------------------------------------------------------------------------- /ext/gensymbol/README.md: -------------------------------------------------------------------------------- 1 | # gensymbol 2 | 3 | This uses [the `gensymbol` script from OpenBLAS](https://github.com/xianyi/OpenBLAS/blob/develop/exports/gensymbol.pl) to generate a list of BLAS/LAPACK symbols from first principles. 4 | To use this, run `./generate_func_list.sh` and it will automatically populate [the `src/exported_funcs.inc` file](../../src/exported_funcs.inc). 5 | -------------------------------------------------------------------------------- /test/cdotc_test/Makefile: -------------------------------------------------------------------------------- 1 | include ../../src/Make.inc 2 | 3 | all: $(prefix)/cdotc_test$(EXE) 4 | 5 | $(prefix): 6 | @mkdir -p $@ 7 | 8 | $(prefix)/cdotc_test$(EXE): cdotc_test.c | $(prefix) 9 | @$(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS) 10 | 11 | clean: 12 | @rm -f $(prefix)/cdotc_test$(EXE) 13 | 14 | run: $(prefix)/cdotc_test$(EXE) 15 | @$(prefix)/cdotc_test$(EXE) 16 | -------------------------------------------------------------------------------- /test/dgemm_test/Makefile: -------------------------------------------------------------------------------- 1 | include ../../src/Make.inc 2 | 3 | all: $(prefix)/dgemm_test$(EXE) 4 | 5 | $(prefix): 6 | @mkdir -p $@ 7 | 8 | $(prefix)/dgemm_test$(EXE): dgemm_test.c | $(prefix) 9 | @$(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS) 10 | 11 | clean: 12 | @rm -f $(prefix)/dgemm_test$(EXE) 13 | 14 | run: $(prefix)/dgemm_test$(EXE) 15 | @$(prefix)/dgemm_test$(EXE) 16 | -------------------------------------------------------------------------------- /test/sgesv_test/Makefile: -------------------------------------------------------------------------------- 1 | include ../../src/Make.inc 2 | 3 | all: $(prefix)/sgesv_test$(EXE) 4 | 5 | $(prefix): 6 | @mkdir -p $@ 7 | 8 | $(prefix)/sgesv_test$(EXE): sgesv_test.c | $(prefix) 9 | @$(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS) 10 | 11 | clean: 12 | @rm -f $(prefix)/sgesv_test$(EXE) 13 | 14 | run: $(prefix)/sgesv_test$(EXE) 15 | @$(prefix)/sgesv_test$(EXE) 16 | -------------------------------------------------------------------------------- /test/dgemmt_test/Makefile: -------------------------------------------------------------------------------- 1 | include ../../src/Make.inc 2 | 3 | all: $(prefix)/dgemmt_test$(EXE) 4 | 5 | $(prefix): 6 | @mkdir -p $@ 7 | 8 | $(prefix)/dgemmt_test$(EXE): dgemmt_test.c | $(prefix) 9 | @$(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS) 10 | 11 | clean: 12 | @rm -f $(prefix)/dgemmt_test$(EXE) 13 | 14 | run: $(prefix)/dgemmt_test$(EXE) 15 | @$(prefix)/dgemmt_test$(EXE) 16 | -------------------------------------------------------------------------------- /test/dpstrf_test/Makefile: -------------------------------------------------------------------------------- 1 | include ../../src/Make.inc 2 | 3 | all: $(prefix)/dpstrf_test$(EXE) 4 | 5 | $(prefix): 6 | @mkdir -p $@ 7 | 8 | $(prefix)/dpstrf_test$(EXE): dpstrf_test.c | $(prefix) 9 | @$(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS) 10 | 11 | clean: 12 | @rm -f $(prefix)/dpstrf_test$(EXE) 13 | 14 | run: $(prefix)/dpstrf_test$(EXE) 15 | @$(prefix)/dpstrf_test$(EXE) 16 | -------------------------------------------------------------------------------- /test/isamax_test/Makefile: -------------------------------------------------------------------------------- 1 | include ../../src/Make.inc 2 | 3 | all: $(prefix)/isamax_test$(EXE) 4 | 5 | $(prefix): 6 | @mkdir -p $@ 7 | 8 | $(prefix)/isamax_test$(EXE): isamax_test.c | $(prefix) 9 | @$(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS) 10 | 11 | clean: 12 | @rm -f $(prefix)/isamax_test$(EXE) 13 | 14 | run: $(prefix)/isamax_test$(EXE) 15 | @$(prefix)/isamax_test$(EXE) 16 | -------------------------------------------------------------------------------- /src/trampolines/ilp64_doubling.h: -------------------------------------------------------------------------------- 1 | // Once for the 32-bit versions 2 | #define MANGLE(x) x 3 | #define SYMBOL_IDX(idx) (idx) 4 | EXPORTED_FUNCS(XX) 5 | #undef MANGLE 6 | #undef SYMBOL_IDX 7 | 8 | // Once for the 64-bit versions 9 | #define MANGLE(x) CONCAT(x,64_) 10 | #define SYMBOL_IDX(idx) (idx + NUM_EXPORTED_FUNCS) 11 | EXPORTED_FUNCS(XX) 12 | #undef MANGLE 13 | #undef SYMBOL_IDX 14 | -------------------------------------------------------------------------------- /test/inconsolable_test/Makefile: -------------------------------------------------------------------------------- 1 | include ../../src/Make.inc 2 | 3 | all: $(prefix)/inconsolable_test$(EXE) 4 | 5 | $(prefix): 6 | @mkdir -p $@ 7 | 8 | $(prefix)/inconsolable_test$(EXE): inconsolable_test.c | $(prefix) 9 | @$(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS) 10 | 11 | clean: 12 | @rm -f $(prefix)/inconsolable_test$(EXE) 13 | 14 | run: $(prefix)/inconsolable_test$(EXE) 15 | @$(prefix)/inconsolable_test$(EXE) 16 | -------------------------------------------------------------------------------- /test/isamax_test/isamax_test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | extern int64_t isamax_64_(int64_t *, float *, int64_t *); 5 | 6 | #define N 4 7 | int main() 8 | { 9 | int64_t n = 0xffffffff00000003; 10 | float X[3] = {1.0f, 2.0f, 1.0f}; 11 | int64_t incx = 1; 12 | 13 | int64_t max_idx = isamax_64_(&n, X, &incx); 14 | printf("max_idx: %lld\n", max_idx); 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /test/Project.toml: -------------------------------------------------------------------------------- 1 | [deps] 2 | Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" 3 | CompilerSupportLibraries_jll = "e66e0078-7015-5450-92f7-15fbd957f2ae" 4 | MKL_jll = "856f044c-d86e-5d09-b602-aeab76dc8ba7" 5 | OpenBLAS32_jll = "656ef2d0-ae68-5445-9ca0-591084a874a2" 6 | OpenBLAS_jll = "4536629a-c528-5b80-bd46-f80d51c5b363" 7 | 8 | # Force an old version of OpenBLAS32_jll so that it's missing some newer symbols 9 | [compat] 10 | OpenBLAS32_jll = "=0.3.10" 11 | -------------------------------------------------------------------------------- /.buildkite/test_macos.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - label: ":julia: :macos: ${ARCH?} Julia ${JULIA_VERSION?}" 3 | plugins: 4 | - JuliaCI/julia#v1: 5 | version: "${JULIA_VERSION?}" 6 | - staticfloat/metahook#sf/windows_backslashes: 7 | pre-command: | 8 | echo "This is a test" 9 | command: "bash .buildkite/instantiate_and_test.sh" 10 | agents: 11 | queue: "juliaecosystem" 12 | os: "macos" 13 | arch: "${AGENT_ARCH?}" 14 | -------------------------------------------------------------------------------- /.github/release.yml: -------------------------------------------------------------------------------- 1 | # .github/release.yml 2 | 3 | changelog: 4 | exclude: 5 | labels: 6 | - ignore-for-release 7 | authors: 8 | - octocat 9 | categories: 10 | - title: Breaking Changes 🛠 11 | labels: 12 | - Semver-Major 13 | - breaking-change 14 | - title: Exciting New Features 🎉 15 | labels: 16 | - Semver-Minor 17 | - enhancement 18 | - title: Other Changes 19 | labels: 20 | - "*" 21 | -------------------------------------------------------------------------------- /src/trampolines/trampolines_i686.S: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "../exported_funcs.inc" 3 | 4 | #define XX(name, idx) \ 5 | DEBUGINFO(name); \ 6 | .global MANGLE(UNDERSCORE(name)); \ 7 | MANGLE(UNDERSCORE(name))##:; \ 8 | .cfi_startproc; \ 9 | CET_START(); \ 10 | mov $SYMBOL_IDX(idx),%eax; \ 11 | jmpl *(NAMEADDR(name)); \ 12 | ud2; \ 13 | .cfi_endproc; \ 14 | EXPORT(name); \ 15 | 16 | // Generate both `dgemm_` and `dgemm_64_` 17 | #include "ilp64_doubling.h" 18 | #undef XX 19 | -------------------------------------------------------------------------------- /src/trampolines/trampolines_riscv64.S: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "../exported_funcs.inc" 3 | 4 | #define SEP ; 5 | 6 | #define XX(name, idx) \ 7 | .global MANGLE(UNDERSCORE(name)) SEP \ 8 | .cfi_startproc SEP \ 9 | MANGLE(UNDERSCORE(name))##: SEP \ 10 | .p2align 2 SEP \ 11 | li t4, SYMBOL_IDX(idx) SEP \ 12 | la t3, NAMEADDR(name) SEP \ 13 | ld t3, 0(t3) SEP \ 14 | jr t3 SEP \ 15 | .cfi_endproc SEP \ 16 | 17 | // Generate both `dgemm_` and `dgemm_64_` 18 | #include "ilp64_doubling.h" 19 | #undef XX 20 | -------------------------------------------------------------------------------- /src/trampolines/trampolines_aarch64.S: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "../exported_funcs.inc" 3 | 4 | #define XX(name, idx) \ 5 | .global MANGLE(UNDERSCORE(name)) SEP \ 6 | MANGLE(UNDERSCORE(name))##: SEP \ 7 | .cfi_startproc SEP \ 8 | .p2align 2 SEP \ 9 | mov x17, SYMBOL_IDX(idx) SEP \ 10 | adrp x16, PAGE(NAMEADDR(name)) SEP \ 11 | ldr x16, [x16, PAGEOFF(NAMEADDR(name))] SEP \ 12 | br x16 SEP \ 13 | .cfi_endproc SEP \ 14 | 15 | // Generate both `dgemm_` and `dgemm_64_` 16 | #include "ilp64_doubling.h" 17 | #undef XX 18 | -------------------------------------------------------------------------------- /include/common/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | #ifndef LAPACK_HEADER_INCLUDED 2 | #define LAPACK_HEADER_INCLUDED 3 | 4 | #ifndef LAPACK_GLOBAL 5 | #if defined(LAPACK_GLOBAL_PATTERN_LC) || defined(ADD_) 6 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_ 7 | #elif defined(LAPACK_GLOBAL_PATTERN_UC) || defined(UPPER) 8 | #define LAPACK_GLOBAL(lcname,UCNAME) UCNAME 9 | #elif defined(LAPACK_GLOBAL_PATTERN_MC) || defined(NOCHANGE) 10 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname 11 | #else 12 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_ 13 | #endif 14 | #endif 15 | 16 | #endif 17 | 18 | -------------------------------------------------------------------------------- /src/trampolines/trampolines_loongarch64.S: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "../exported_funcs.inc" 3 | 4 | #define SEP ; 5 | 6 | #define XX(name, idx) \ 7 | .global MANGLE(UNDERSCORE(name)) SEP \ 8 | .cfi_startproc SEP \ 9 | .p2align 2 SEP \ 10 | MANGLE(UNDERSCORE(name))##: SEP \ 11 | li.d $t8, SYMBOL_IDX(idx) SEP \ 12 | la.pcrel $t3, NAMEADDR(name) SEP \ 13 | ld.d $t3, $t3, 0 SEP \ 14 | jr $t3 SEP \ 15 | amswap.w $zero, $zero, $zero SEP \ 16 | .cfi_endproc SEP \ 17 | 18 | // Generate both `dgemm_` and `dgemm_64_` 19 | #include "ilp64_doubling.h" 20 | #undef XX 21 | -------------------------------------------------------------------------------- /src/trampolines/trampolines_x86_64.S: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "../exported_funcs.inc" 3 | 4 | #define XX(name, idx) \ 5 | DEBUGINFO(name); \ 6 | .global MANGLE(UNDERSCORE(name)); \ 7 | MANGLE(UNDERSCORE(name))##:; \ 8 | .cfi_startproc; \ 9 | SEH_START1(name); \ 10 | SEH_START2(); \ 11 | CET_START(); \ 12 | mov $SYMBOL_IDX(idx),%r10; \ 13 | mov NAMEADDR(name)(%rip),%r11; \ 14 | jmpq *%r11; \ 15 | ud2; \ 16 | SEH_END(); \ 17 | .cfi_endproc; \ 18 | EXPORT(name); \ 19 | 20 | // Generate both `dgemm_` and `dgemm_64_` 21 | #include "ilp64_doubling.h" 22 | #undef XX 23 | -------------------------------------------------------------------------------- /src/trampolines/trampolines_arm.S: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "../exported_funcs.inc" 3 | 4 | #define XX(name, idx) \ 5 | .global MANGLE(UNDERSCORE(name)); \ 6 | MANGLE(UNDERSCORE(name))##:; \ 7 | .cfi_startproc; \ 8 | ldr ip, CONCAT(.L,NAMEADDR(name)); \ 9 | CONCAT(.L,MANGLE(UNDERSCORE(name))): ;\ 10 | add ip, pc, ip; \ 11 | ldr pc, [ip]; \ 12 | .align 2; \ 13 | CONCAT(.L,NAMEADDR(name))##: ; \ 14 | .word NAMEADDR(name)##-(CONCAT(.L,MANGLE(UNDERSCORE(name))) + 8); \ 15 | .cfi_endproc; \ 16 | 17 | // Generate both `dgemm_` and `dgemm_64_` 18 | #include "ilp64_doubling.h" 19 | #undef XX 20 | -------------------------------------------------------------------------------- /test/README.md: -------------------------------------------------------------------------------- 1 | # Simple libblastrampoline tests 2 | 3 | This is a simple battery of tests to ensure the trampolines are working properly. 4 | We have three simple test programs, `dgemm_test`, `dgemmt_test` and `sgesv_test`, which test the FORTRAN interfaces of `dgemm_`, `dgemmt_` and `sgesv_` to ensure proper execution. 5 | We compile these tests first against vanilla OpenBLAS installations (both LP64 and ILP64, if available) and then against `libblastrampoline` with various backing BLAS libraries. 6 | If available, we will test against `MKL` and `libblas64` as well. 7 | If we are on a 64-bit platform, we will build a test case that uses LP64 and ILP64 routines in the same executable. 8 | 9 | Note that these tests require Julia v1.7+, especially on aarch64 where we switched from shipping an LP64 to ILP64 OpenBLAS by default. 10 | 11 | Run via: 12 | ``` 13 | julia --project runtests.jl 14 | ``` 15 | -------------------------------------------------------------------------------- /test/sdot_test/sdot_test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifdef ILP64 5 | #define MANGLE(x) x##64_ 6 | typedef int64_t blasint; 7 | #else 8 | #define MANGLE(x) x 9 | typedef int32_t blasint; 10 | #endif 11 | 12 | extern float MANGLE(sdot_)(blasint *, float *, blasint *, float *, blasint *); 13 | 14 | #define N 3 15 | int main() 16 | { 17 | float A[N], B[N]; 18 | 19 | // Initialize `A` with known values (transposed into FORTRAN ordering) 20 | A[0] = 3.1; 21 | A[1] = 1.0; 22 | A[2] = 3.4; 23 | 24 | // Initialize `b` with known values 25 | B[0] = -1.3; 26 | B[1] = -0.1; 27 | B[2] = 1.8; 28 | 29 | // Perform dot product 30 | blasint len = N; 31 | blasint inca = 1; 32 | blasint incb = 1; 33 | float C = MANGLE(sdot_)(&len, &A[0], &inca, &B[0], &incb); 34 | 35 | // Print out C 36 | printf("C is: %8.4f\n", C); 37 | } 38 | -------------------------------------------------------------------------------- /.buildkite/test_windows.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - label: ":julia: :windows: ${ARCH?} Julia ${JULIA_VERSION?}" 3 | plugins: 4 | - JuliaCI/julia#v1: 5 | version: "${JULIA_VERSION?}" 6 | arch: "${ARCH?}" 7 | - staticfloat/metahook#sf/windows_backslashes: 8 | # Copy our julia installation to a known location that we can mount with docker 9 | pre-command: | 10 | cp -r $(dirname $(dirname $(which julia)))/* /c/buildkite-agent 11 | - docker#v3.13.0: 12 | image: "${DOCKER_IMAGE?}" 13 | always-pull: true 14 | volumes: 15 | # Abuse the fact that we have a `PATH` mapping for `buildkite-agent` 16 | # to mount in our build of Julia for use within the container: 17 | - "C:\\buildkite-agent:C:\\buildkite-agent" 18 | command: ["bash", "-c", ".buildkite/instantiate_and_test.sh"] 19 | agents: 20 | queue: "juliaecosystem" 21 | os: "windows" 22 | arch: "${AGENT_ARCH?}" 23 | -------------------------------------------------------------------------------- /src/libblastrampoline_cblasdata.h: -------------------------------------------------------------------------------- 1 | #define XX(name, index) extern const void * lbt_##name ; 2 | #define XX_64(name, index) extern const void * lbt_##name##64_ ; 3 | CBLAS_WORKAROUND_FUNCS(XX) 4 | CBLAS_WORKAROUND_FUNCS(XX_64) 5 | #undef XX 6 | #undef XX_64 7 | 8 | 9 | // Next, create an array that that points to all of our wrapper code 10 | // locations, allowing a cblas index -> function lookup 11 | #define XX(name, index) &lbt_##name, 12 | #define XX_64(name, index) &lbt_##name##64_, 13 | const void ** cblas32_workaround_func_wrappers[] = { 14 | CBLAS_WORKAROUND_FUNCS(XX) 15 | NULL 16 | }; 17 | const void ** cblas64_workaround_func_wrappers[] = { 18 | CBLAS_WORKAROUND_FUNCS(XX_64) 19 | NULL 20 | }; 21 | #undef XX 22 | #undef XX_64 23 | 24 | // Finally, arrays that map cblas index -> exported symbol index 25 | #define XX(name, index) index, 26 | const int cblas_func_idxs[] = { 27 | CBLAS_FUNCS(XX) 28 | -1 29 | }; 30 | const int cblas_workaround_func_idxs[] = { 31 | CBLAS_WORKAROUND_FUNCS(XX) 32 | -1 33 | }; 34 | #undef XX 35 | -------------------------------------------------------------------------------- /src/trampolines/trampolines_powerpc64le.S: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "../exported_funcs.inc" 3 | 4 | // Notes: 5 | // bctr: branch to CTR without LR update (tail-call) 6 | // localentry: On PPC functions have a localentry that assumes r2 contains 7 | // the TOC pointer, and a global entry point that sets r2. 8 | // See 64-Bit ELF V2 ABI Specification: Power Architecture v1.4 9 | 10 | #define XX(name, idx) \ 11 | .global MANGLE(UNDERSCORE(name)); \ 12 | .type MANGLE(UNDERSCORE(name))##, @function; \ 13 | MANGLE(UNDERSCORE(name))##: ; \ 14 | .cfi_startproc; \ 15 | addis 2, 12, .TOC.-MANGLE(UNDERSCORE(name))##@ha; \ 16 | addi 2, 2, .TOC.-MANGLE(UNDERSCORE(name))##@l; \ 17 | .localentry MANGLE(UNDERSCORE(name))##,.-MANGLE(UNDERSCORE(name))##; \ 18 | addis 12,2,NAMEADDR(name)##@toc@ha; \ 19 | ld 12,NAMEADDR(name)##@toc@l(12); \ 20 | li 11,SYMBOL_IDX(idx); \ 21 | mtctr 12; \ 22 | bctr; \ 23 | .cfi_endproc; \ 24 | .size MANGLE(UNDERSCORE(name))##,.-MANGLE(UNDERSCORE(name))##; \ 25 | 26 | // Generate both `dgemm_` and `dgemm_64_` 27 | #include "ilp64_doubling.h" 28 | #undef XX 29 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT LICENSE 2 | 3 | Copyright (c) 2021-2025: Elliot Saba, Viral B. Shah, JuliaHub, and contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/win_utils.c: -------------------------------------------------------------------------------- 1 | #include "libblastrampoline_internal.h" 2 | 3 | /* Utilities to convert from Windows' wchar_t stuff to UTF-8 */ 4 | int wchar_to_utf8(const wchar_t * wstr, char *str, size_t maxlen) { 5 | /* Fast-path empty strings, as WideCharToMultiByte() returns zero for them. */ 6 | if (wstr[0] == L'\0') { 7 | str[0] = '\0'; 8 | return 1; 9 | } 10 | size_t len = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, NULL, 0, NULL, NULL); 11 | if (!len) 12 | return 0; 13 | if (len > maxlen) 14 | return 0; 15 | if (!WideCharToMultiByte(CP_UTF8, 0, wstr, -1, str, len, NULL, NULL)) 16 | return 0; 17 | return 1; 18 | } 19 | 20 | int utf8_to_wchar(const char * str, wchar_t * wstr, size_t maxlen) { 21 | /* Fast-path empty strings, as WideCharToMultiByte() returns zero for them. */ 22 | if (str[0] == '\0') { 23 | wstr[0] = L'\0'; 24 | return 1; 25 | } 26 | size_t len = MultiByteToWideChar(CP_UTF8, 0, str, -1, NULL, 0); 27 | if (!len) 28 | return 0; 29 | if (len > maxlen) 30 | return 0; 31 | if (!MultiByteToWideChar(CP_UTF8, 0, str, -1, wstr, len)) 32 | return 0; 33 | return 1; 34 | } 35 | -------------------------------------------------------------------------------- /.buildkite/test_linux.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - label: ":julia: :linux: ${ARCH?} Julia ${JULIA_VERSION?}" 3 | plugins: 4 | # Install Julia for the agent first, so that we can run `sandbox` 5 | - JuliaCI/julia#v1: 6 | version: "1.7" 7 | arch: "${AGENT_ARCH?}" 8 | - staticfloat/sandbox#v1: 9 | rootfs_url: "${ROOTFS_URL?}" 10 | rootfs_treehash: "${ROOTFS_HASH?}" 11 | uid: 0 12 | gid: 0 13 | workspaces: 14 | - "/cache:/cache" 15 | # Then install Julia for the rootfs arch 16 | - JuliaCI/julia#v1: 17 | version: "${JULIA_VERSION?}" 18 | arch: "${ARCH?}" 19 | - staticfloat/metahook#sf/windows_backslashes: 20 | pre-command: | 21 | # Upgrade our debian package to bullseye (wowza) and get an ILP64 blas 22 | if [[ "${ARCH?}" == *64 ]]; then 23 | echo "deb http://deb.debian.org/debian bullseye main" > /etc/apt/sources.list.d/bullseye.list 24 | apt update && apt install -y libblas64-dev liblapack64-dev 25 | fi 26 | command: "bash .buildkite/instantiate_and_test.sh" 27 | agents: 28 | queue: "juliaecosystem" 29 | os: "linux" 30 | sandbox_capable: "true" 31 | arch: "${AGENT_ARCH?}" 32 | -------------------------------------------------------------------------------- /test/cdotc_test/cdotc_test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef ILP64 6 | #define MANGLE(x) x##64_ 7 | typedef int64_t blasint; 8 | #else 9 | #define MANGLE(x) x 10 | typedef int32_t blasint; 11 | #endif 12 | 13 | extern void MANGLE(cblas_cdotc_sub)(blasint, float complex *, blasint, float complex *, blasint, float complex *); 14 | extern float complex MANGLE(cdotc_)(blasint *, float complex *, blasint *, float complex *, blasint *); 15 | 16 | #define N 2 17 | int main() 18 | { 19 | float complex A[N], B[N]; 20 | 21 | // Initialize `A` with known values (transposed into FORTRAN ordering) 22 | A[0] = 3.1 + 1.4*I; 23 | A[1] = -1.0 + 1.2*I; 24 | 25 | // Initialize `b` with known values 26 | B[0] = 1.3 + 0.3*I; 27 | B[1] = -1.1 + -3.4*I; 28 | 29 | // Perform complex dot product 30 | blasint len = N; 31 | blasint inca = 1; 32 | blasint incb = 1; 33 | complex float C; 34 | MANGLE(cblas_cdotc_sub)(len, &A[0], inca, &B[0], incb, &C); 35 | 36 | // Print out C 37 | printf("C (cblas) is: (%8.4f, %8.4f)\n", creal(C), cimag(C)); 38 | 39 | // Do the same thing, but with the FORTRAN interface 40 | C = MANGLE(cdotc_)(&len, &A[0], &inca, &B[0], &incb); 41 | printf("C (fortran) is: (%8.4f, %8.4f)\n", creal(C), cimag(C)); 42 | } 43 | -------------------------------------------------------------------------------- /.cirrus.yml: -------------------------------------------------------------------------------- 1 | task: 2 | matrix: 3 | - name: FreeBSD 4 | freebsd_instance: 5 | image_family: freebsd-14-2 6 | env: 7 | matrix: 8 | - JULIA_VERSION: 1 9 | - name: musl Linux 10 | container: 11 | image: alpine:3.14 12 | env: 13 | - JULIA_VERSION: 1 14 | install_script: | 15 | URL="https://raw.githubusercontent.com/ararslan/CirrusCI.jl/master/bin/install.sh" 16 | set -x 17 | if [ "$(uname -s)" = "Linux" ] && command -v apt; then 18 | apt update 19 | apt install -y curl 20 | fi 21 | if command -v curl; then 22 | sh -c "$(curl ${URL})" 23 | elif command -v wget; then 24 | sh -c "$(wget ${URL} -O-)" 25 | elif command -v fetch; then 26 | sh -c "$(fetch ${URL} -o -)" 27 | else 28 | echo "No downloader installed! :( Install one! :)" 29 | fi 30 | 31 | if command -v apk; then 32 | # Install build tools on Alpine Linux 33 | apk update 34 | apk add build-base linux-headers 35 | elif command -v pkg; then 36 | # Install GNU Make on FreeBSD 37 | pkg update 38 | pkg install -y gmake 39 | fi 40 | build_script: 41 | - julia --project=test/ -e 'using Pkg; Pkg.instantiate()' 42 | test_script: 43 | - julia --project=test/ test/runtests.jl 44 | -------------------------------------------------------------------------------- /src/libblastrampoline_f2cdata.h: -------------------------------------------------------------------------------- 1 | // These hold the "true" address that the f2c wrapper invokes in turn 2 | #define XX(name, idx) LBT_HIDDEN const void * f2c_##name##_addr; 3 | #define XX_64(name, idx) LBT_HIDDEN const void * f2c_##name##64__addr; 4 | FLOAT32_FUNCS(XX) 5 | FLOAT32_FUNCS(XX_64) 6 | #undef XX 7 | #undef XX_64 8 | 9 | // Generate indices mapping each f2c function to its upstream symbol 10 | #define XX(name, index) index, 11 | const int f2c_func_idxs[] = { 12 | FLOAT32_FUNCS(XX) 13 | -1 14 | }; 15 | #undef XX 16 | 17 | 18 | // Forward-declare some functions 19 | #define XX(name, index) extern const void * f2c_##name ; 20 | #define XX_64(name, index) extern const void * f2c_##name##64_ ; 21 | FLOAT32_FUNCS(XX) 22 | FLOAT32_FUNCS(XX_64) 23 | #undef XX 24 | #undef XX_64 25 | 26 | // Generate list of function addresses to tie names -> f2c adapters 27 | // These point to the actual wrappers, we'll generate the lists of addresses next 28 | #define XX(name, index) &f2c_##name, 29 | #define XX_64(name, index) &f2c_##name##64_, 30 | const void ** f2c_func32_wrappers[] = { 31 | FLOAT32_FUNCS(XX) 32 | NULL 33 | }; 34 | const void ** f2c_func64_wrappers[] = { 35 | FLOAT32_FUNCS(XX_64) 36 | NULL 37 | }; 38 | #undef XX 39 | #undef XX_64 40 | 41 | 42 | #define XX(name, index) &f2c_##name##_addr, 43 | #define XX_64(name, index) &f2c_##name##64__addr, 44 | const void ** f2c_func32_addrs[] = { 45 | FLOAT32_FUNCS(XX) 46 | NULL 47 | }; 48 | const void ** f2c_func64_addrs[] = { 49 | FLOAT32_FUNCS(XX_64) 50 | NULL 51 | }; 52 | #undef XX 53 | #undef XX_64 54 | -------------------------------------------------------------------------------- /test/sgesv_test/sgesv_test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifdef ILP64 5 | #define MANGLE(x) x##64_ 6 | typedef int64_t blasint; 7 | #else 8 | #define MANGLE(x) x 9 | typedef int32_t blasint; 10 | #endif 11 | 12 | extern void MANGLE(sgesv_)(blasint *, blasint *, float *, blasint *, blasint *, float *, blasint *, blasint *); 13 | 14 | #define N 3 15 | int main() 16 | { 17 | blasint pivot[N], ok; 18 | float A[N][N], b[N]; 19 | 20 | // Initialize `A` with known values (transposed into FORTRAN ordering) 21 | A[0][0] = 3.1; A[1][0] = 1.3; A[2][0] = -5.7; 22 | A[0][1] = 1.0; A[1][1] = -6.9; A[2][1] = 5.8; 23 | A[0][2] = 3.4; A[1][2] = 7.2; A[2][2] = -8.8; 24 | 25 | // Initialize `b` with known values 26 | b[0] = -1.3; 27 | b[1] = -0.1; 28 | b[2] = 1.8; 29 | 30 | blasint c1 = N; 31 | blasint c2 = 1; 32 | 33 | // find solution using LAPACK routine SGESV, all the arguments have to 34 | // be pointers and you have to add an underscore to the routine name 35 | 36 | // parameters in the order as they appear in the function call 37 | // order of matrix A, number of right hand sides (b), matrix A, 38 | // leading dimension of A, array that records pivoting, 39 | // result vector b on entry, x on exit, leading dimension of b 40 | // return value 41 | MANGLE(sgesv_)(&c1, &c2, &A[0][0], &c1, pivot, b, &c1, &ok); 42 | 43 | // Print out sum(b[j]^2) 44 | float sum = 0.0f; 45 | for (blasint j=0; j 3 | 4 | const char * env_lowercase(const char * env_name) { 5 | // Get environment value, if it's not set, return false 6 | char * env_value = getenv(env_name); 7 | if (env_value == NULL) { 8 | return NULL; 9 | } 10 | 11 | // If it is set, convert to lowercase. 12 | env_value = strdup(env_value); 13 | for (size_t idx=0; idx variables 24 | #define XX(name, idx) &name##_addr, 25 | #define XX_64(name, idx) &name##64__addr, 26 | const void ** exported_func32_addrs[] = { 27 | EXPORTED_FUNCS(XX) 28 | NULL 29 | }; 30 | const void ** exported_func64_addrs[] = { 31 | EXPORTED_FUNCS(XX_64) 32 | NULL 33 | }; 34 | #undef XX 35 | #undef XX_64 36 | 37 | // Generate list of our own function addresses, so that we can filter 38 | // out libraries that link against us (such as LAPACK_jll) so that we 39 | // don't accidentally loop back to ourselves. 40 | #define XX(name, idx) extern void ** name; 41 | #define XX_64(name, idx) extern void ** name##64_; 42 | EXPORTED_FUNCS(XX) 43 | EXPORTED_FUNCS(XX_64) 44 | #undef XX 45 | #undef XX_64 46 | 47 | #define XX(name, idx) ((const void **)&name), 48 | #define XX_64(name, idx) ((const void **)&name##64_), 49 | const void ** self_func32[] = { 50 | EXPORTED_FUNCS(XX) 51 | NULL 52 | }; 53 | const void ** self_func64[] = { 54 | EXPORTED_FUNCS(XX_64) 55 | NULL 56 | }; 57 | #undef XX 58 | #undef XX_64 59 | -------------------------------------------------------------------------------- /test/dpstrf_test/dpstrf_test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifdef ILP64 5 | #define MANGLE(x) x##64_ 6 | typedef int64_t blasint; 7 | #else 8 | #define MANGLE(x) x 9 | typedef int32_t blasint; 10 | #endif 11 | 12 | extern blasint MANGLE(dpstrf_)(char *, blasint *, double *, blasint *, blasint *, blasint *, double *, double*, blasint *); 13 | 14 | #define N 4 15 | int main() 16 | { 17 | blasint pivot[N]; 18 | blasint info; 19 | double A[N][N]; 20 | double work[2*N]; 21 | blasint order = N; 22 | blasint rank = 0; 23 | blasint lda = N; 24 | blasint stride = 1; 25 | double tol = 0.0; 26 | 27 | 28 | // Initialize `A` with known values (transposed into FORTRAN ordering) 29 | A[0][0] = 3.4291134; A[1][0] = -0.61112815; A[2][0] = 0.8155207; A[3][0] = -0.9183448; 30 | A[0][1] = -0.61112815; A[1][1] = 3.1250076; A[2][1] = -0.44400603; A[3][1] = 0.97749346; 31 | A[0][2] = 0.8155207; A[1][2] = -0.44400603; A[2][2] = 0.5413656; A[3][2] = 0.53000593; 32 | A[0][3] = -0.9183448; A[1][3] = 0.97749346; A[2][3] = 0.53000593; A[3][3] = 5.108155; 33 | 34 | // find solution using LAPACK routine dpstrf, all the arguments have to 35 | // be pointers and you have to add an underscore to the routine name 36 | 37 | // parameters in the order as they appear in the function call 38 | // order of matrix A, number of right hand sides (b), matrix A, 39 | // leading dimension of A, array that records pivoting, 40 | // result vector b on entry, x on exit, leading dimension of b 41 | // return value 42 | MANGLE(dpstrf_)("U", &order, &A[0][0], &lda, &pivot[0], &rank, &tol, &work[0], &info); 43 | if (info != 0) { 44 | printf("ERROR: info == %ld!\n", info); 45 | return 1; 46 | } 47 | 48 | // Print out diagonal of A 49 | printf("diag(A):"); 50 | for (blasint j=0; j 2 | #include 3 | 4 | #ifdef ILP64 5 | #define MANGLE(x) x##64_ 6 | typedef int64_t blasint; 7 | #else 8 | #define MANGLE(x) x 9 | typedef int32_t blasint; 10 | #endif 11 | 12 | #define MATRIX_IDX(n, i, j) j*n + i 13 | #define MATRIX_ELEMENT(A, m, n, i, j) A[ MATRIX_IDX(m, i, j) ] 14 | extern void MANGLE(dgemm_)(char *, char *, blasint *, blasint *, blasint *, double *, double *, blasint *, double *, blasint *, double *, double *, blasint *); 15 | 16 | void init_matrix(double* A, int m, int n) { 17 | double element = 1.0; 18 | for (int j = 0; j < n; j++) { 19 | for (int i = 0; i < m; i++) { 20 | MATRIX_ELEMENT(A, m, n, i, j) = element; 21 | element *= 0.9; 22 | } 23 | } 24 | } 25 | 26 | float frobnorm2(const double * A, int m, int n) { 27 | float norm = 0.0f; 28 | for (int i = 0; i < m; i++) { 29 | for (int j = 0; j < n; j++) { 30 | float elem = MATRIX_ELEMENT(A, m, n, i, j); 31 | norm += elem*elem; 32 | } 33 | } 34 | return norm; 35 | } 36 | 37 | void print_matrix(const double* A, int m, int n) { 38 | for (int i = 0; i < m; i++) { 39 | for (int j = 0; j < n; j++) { 40 | printf("%8.4f", MATRIX_ELEMENT(A, m, n, i, j)); 41 | } 42 | printf("\n"); 43 | } 44 | } 45 | 46 | int main(int argc, char** argv) { 47 | blasint m = 3; 48 | blasint n = 4; 49 | blasint k = 5; 50 | 51 | double A[m * k]; 52 | double B[k * n]; 53 | double C[m * n]; 54 | 55 | init_matrix(A, m, k); 56 | init_matrix(B, k, n); 57 | 58 | printf("Matrix A (%d x %d) is:\n", (int)m, (int)k); 59 | print_matrix(A, m, k); 60 | 61 | printf("\nMatrix B (%d x %d) is:\n", (int)k, (int)n); 62 | print_matrix(B, k, n); 63 | 64 | double alpha = 1.0, beta=0.0; 65 | char no = 'N'; 66 | MANGLE(dgemm_)(&no, &no, &m, &n, &k, &alpha, A, &m, B, &k, &beta, C, &m); 67 | 68 | printf("\nMatrix C (%d x %d) = AB is:\n", (int)m, (int)n); 69 | print_matrix(C, m, n); 70 | printf("\n||C||^2 is: %8.4f\n", frobnorm2(C, m, n)); 71 | 72 | return 0; 73 | } -------------------------------------------------------------------------------- /test/dgemmt_test/dgemmt_test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifdef ILP64 5 | #define MANGLE(x) x##64_ 6 | typedef int64_t blasint; 7 | #else 8 | #define MANGLE(x) x 9 | typedef int32_t blasint; 10 | #endif 11 | 12 | #define MATRIX_IDX(n, i, j) j*n + i 13 | #define MATRIX_ELEMENT(A, m, n, i, j) A[ MATRIX_IDX(m, i, j) ] 14 | extern void MANGLE(dgemmt_)(char *, char *, char *, blasint *, blasint *, double *, double *, blasint *, double *, blasint *, double *, double *, blasint *); 15 | 16 | void init_matrix(double* A, int m, int n) { 17 | double element = 1.0; 18 | for (int j = 0; j < n; j++) { 19 | for (int i = 0; i < m; i++) { 20 | MATRIX_ELEMENT(A, m, n, i, j) = element; 21 | element *= 0.9; 22 | } 23 | } 24 | } 25 | 26 | float frobnorm2(const double * A, int m, int n) { 27 | float norm = 0.0f; 28 | for (int i = 0; i < m; i++) { 29 | for (int j = 0; j < n; j++) { 30 | float elem = MATRIX_ELEMENT(A, m, n, i, j); 31 | norm += elem*elem; 32 | } 33 | } 34 | return norm; 35 | } 36 | 37 | void print_matrix(const double* A, int m, int n) { 38 | for (int i = 0; i < m; i++) { 39 | for (int j = 0; j < n; j++) { 40 | printf("%8.4f", MATRIX_ELEMENT(A, m, n, i, j)); 41 | } 42 | printf("\n"); 43 | } 44 | } 45 | 46 | int main(int argc, char** argv) { 47 | blasint n = 4; 48 | blasint k = 5; 49 | 50 | double A[n * k]; 51 | double B[k * n]; 52 | double C[n * n]; 53 | 54 | init_matrix(A, n, k); 55 | init_matrix(B, k, n); 56 | 57 | printf("Matrix A (%d x %d) is:\n", (int)n, (int)k); 58 | print_matrix(A, n, k); 59 | 60 | printf("\nMatrix B (%d x %d) is:\n", (int)k, (int)n); 61 | print_matrix(B, k, n); 62 | 63 | double alpha = 1.0, beta=0.0; 64 | char uploL = 'L'; 65 | char uploU = 'U'; 66 | char no = 'N'; 67 | MANGLE(dgemmt_)(&uploL, &no, &no, &n, &k, &alpha, A, &n, B, &k, &beta, C, &n); 68 | MANGLE(dgemmt_)(&uploU, &no, &no, &n, &k, &alpha, A, &n, B, &k, &beta, C, &n); 69 | 70 | printf("\nMatrix C (%d x %d) = AB is:\n", (int)n, (int)n); 71 | print_matrix(C, n, n); 72 | printf("\n||C||^2 is: %8.4f\n", frobnorm2(C, n, n)); 73 | 74 | return 0; 75 | } 76 | -------------------------------------------------------------------------------- /test/inconsolable_test/inconsolable_test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | 5 | #define MATRIX_IDX(n, i, j) j*n + i 6 | #define MATRIX_ELEMENT(A, m, n, i, j) A[ MATRIX_IDX(m, i, j) ] 7 | 8 | // 32-bit DGEMM 9 | extern void dgemm_(char *, char *, int32_t *, int32_t *, int32_t *, double *, double *, int32_t *, double *, int32_t *, double *, double *, int32_t *); 10 | 11 | // 64-bit SGESV 12 | extern void sgesv_64_(int64_t *, int64_t *, float *, int64_t *, int64_t *, float *, int64_t *, int64_t *); 13 | 14 | void init_matrix(double* A, int m, int n) { 15 | double element = 1.0; 16 | for (int j = 0; j < n; j++) { 17 | for (int i = 0; i < m; i++) { 18 | MATRIX_ELEMENT(A, m, n, i, j) = element; 19 | element *= 0.9; 20 | } 21 | } 22 | } 23 | 24 | float frobnorm2(const double * A, int m, int n) { 25 | float norm = 0.0f; 26 | for (int i = 0; i < m; i++) { 27 | for (int j = 0; j < n; j++) { 28 | float elem = MATRIX_ELEMENT(A, m, n, i, j); 29 | norm += elem*elem; 30 | } 31 | } 32 | return norm; 33 | } 34 | 35 | int main(int argc, char** argv) { 36 | // Invoke a 32-bit DGEMM 37 | { 38 | int32_t m = 3; 39 | int32_t n = 4; 40 | int32_t k = 5; 41 | 42 | double A[m * k]; 43 | double B[k * n]; 44 | double C[m * n]; 45 | 46 | init_matrix(A, m, k); 47 | init_matrix(B, k, n); 48 | 49 | double alpha = 1.0, beta=0.0; 50 | char no = 'N'; 51 | dgemm_(&no, &no, &m, &n, &k, &alpha, A, &m, B, &k, &beta, C, &m); 52 | printf("\n||C||^2 is: %8.4f\n", frobnorm2(C, m, n)); 53 | } 54 | 55 | // Next, invoke a 64-bit SGESV on another matrix 56 | { 57 | int N = 3; 58 | int64_t pivot[N], ok; 59 | float A[N][N], b[N]; 60 | 61 | A[0][0] = 3.1; A[1][0] = 1.3; A[2][0] = -5.7; 62 | A[0][1] = 1.0; A[1][1] = -6.9; A[2][1] = 5.8; 63 | A[0][2] = 3.4; A[1][2] = 7.2; A[2][2] = -8.8; 64 | 65 | b[0] = -1.3; 66 | b[1] = -0.1; 67 | b[2] = 1.8; 68 | 69 | int64_t c1 = N; 70 | int64_t c2 = 1; 71 | 72 | sgesv_64_(&c1, &c2, &A[0][0], &c1, pivot, b, &c1, &ok); 73 | 74 | // Print out sum(b[j]^2) 75 | float sum = 0.0f; 76 | for (int64_t j=0; j function lookup 57 | #define XX(name, index) &cmplxret_##name, 58 | #define XX_64(name, index) &cmplxret_##name##64_, 59 | const void ** cmplx64ret_func32_wrappers[] = { 60 | COMPLEX64_FUNCS(XX) 61 | NULL 62 | }; 63 | const void ** cmplx128ret_func32_wrappers[] = { 64 | COMPLEX128_FUNCS(XX) 65 | NULL 66 | }; 67 | const void ** cmplx64ret_func64_wrappers[] = { 68 | COMPLEX64_FUNCS(XX_64) 69 | NULL 70 | }; 71 | const void ** cmplx128ret_func64_wrappers[] = { 72 | COMPLEX128_FUNCS(XX_64) 73 | NULL 74 | }; 75 | #undef XX 76 | #undef XX_64 77 | 78 | const void *** cmplxret_func32_wrappers[] = { 79 | cmplx64ret_func32_wrappers, 80 | cmplx128ret_func32_wrappers 81 | }; 82 | const void *** cmplxret_func64_wrappers[] = { 83 | cmplx64ret_func64_wrappers, 84 | cmplx128ret_func64_wrappers 85 | }; 86 | 87 | 88 | 89 | // Finally, an array that maps cmplxret index -> exported symbol index 90 | #define XX(name, index) index, 91 | const int cmplx64ret_func_idxs[] = { 92 | COMPLEX64_FUNCS(XX) 93 | -1 94 | }; 95 | const int cmplx128ret_func_idxs[] = { 96 | COMPLEX128_FUNCS(XX) 97 | -1 98 | }; 99 | #undef XX 100 | 101 | const int * cmplxret_func_idxs[] = { 102 | cmplx64ret_func_idxs, 103 | cmplx128ret_func_idxs 104 | }; 105 | -------------------------------------------------------------------------------- /ext/clang_extraction/generate_func_list.jl: -------------------------------------------------------------------------------- 1 | using Clang 2 | using Clang.LibClang.Clang_jll 3 | 4 | const LBT_ROOT = abspath(dirname(dirname(@__DIR__))) 5 | 6 | # Steal default include path from `cc` 7 | function get_default_include_path() 8 | io = IOBuffer() 9 | run(pipeline(`cc -E -Wp,-v -`, stdout=devnull, stderr=io, stdin=devnull)) 10 | lines = split(String(take!(io)), "\n") 11 | start_idx = findfirst(l -> startswith(l, "#include <") && endswith(l, "search starts here:"), lines) 12 | stop_idx = findfirst(l -> startswith(l, "End of search list"), lines[start_idx+1:end]) 13 | return strip.(lines[start_idx+1:start_idx+stop_idx-1]) 14 | end 15 | 16 | function extract_symbol_names(include_dir::String = joinpath(LBT_ROOT, "include", "LP64", "x86_64-linux-gnu")) 17 | # Collect all headers in that directory (nonrecursive because I'm lazy) 18 | headers = [joinpath(include_dir, header) for header in readdir(include_dir) if endswith(header, ".h")] 19 | 20 | # Build `-I` arguments to all the places we'll need 21 | clang_args = String[ 22 | # Include standard locations 23 | ["-I$(inc)" for inc in get_default_include_path()]..., 24 | 25 | # Include our own include directory 26 | "-I$(include_dir)", 27 | ] 28 | 29 | # Parse the headers into a `Clang.jl` context 30 | @info("Extracting symbols from $(length(headers)) headers in $(include_dir)") 31 | ctx = DefaultContext() 32 | parse_headers!(ctx, headers, args=clang_args, includes=headers) 33 | 34 | # Collect all symbol names defined within these translation units 35 | symbol_names = String[] 36 | for trans_unit in ctx.trans_units 37 | root_cursor = getcursor(trans_unit) 38 | push!(ctx.cursor_stack, root_cursor) 39 | header = spelling(root_cursor) 40 | # loop over all of the child cursors and wrap them, if appropriate. 41 | ctx.children = children(root_cursor) 42 | for (i, child) in enumerate(ctx.children) 43 | # Skip everything except function declarations 44 | if !isa(child, CLFunctionDecl) 45 | continue 46 | end 47 | # Skip functions that aren't defined in this header 48 | if filename(child) != header 49 | continue 50 | end 51 | 52 | push!(symbol_names, spelling(child)) 53 | end 54 | empty!(ctx.api_buffer) # clean up api_buffer for the next header 55 | end 56 | 57 | # Drop duplicate `__`-prefixed functions 58 | @info("Extracted $(length(symbol_names)) symbols") 59 | return sort(symbol_names) 60 | end 61 | 62 | # By default, we extract symbols corresponding to an LP64 (32-bit) x86_64-linux-gnu build of OpenBLAS 63 | symbol_names = extract_symbol_names() 64 | 65 | open(joinpath(LBT_ROOT, "src", "exported_funcs.inc"), "w") do io 66 | println(io, "// This file generated by `ext/clang/generate_func_list.jl`") 67 | println(io, "#ifndef EXPORTED_FUNCS") 68 | println(io, "#define EXPORTED_FUNCS(XX) \\") 69 | for name in symbol_names 70 | println(io, " XX($(name)) \\") 71 | end 72 | println(io) 73 | println(io, "#endif") 74 | end -------------------------------------------------------------------------------- /src/deepbindless.c: -------------------------------------------------------------------------------- 1 | #include "libblastrampoline_internal.h" 2 | 3 | /* 4 | * Users can force an RTLD_DEEPBIND-capable system to avoid using RTLD_DEEPBIND 5 | * by setting `LBT_USE_RTLD_DEEPBIND=0` in their environment. This function 6 | * returns `0x01` if it will use `RTLD_DEEPBIND` when loading a library, and 7 | * `0x00` otherwise. 8 | */ 9 | #if defined(LBT_DEEPBINDLESS) || !defined(RTLD_DEEPBIND) 10 | uint8_t use_deepbind = 0x00; 11 | #else 12 | uint8_t use_deepbind = 0x01; 13 | #endif 14 | LBT_DLLEXPORT uint8_t lbt_get_use_deepbind() { 15 | return use_deepbind; 16 | } 17 | 18 | 19 | int lsame_idx = -1; 20 | const void *old_lsame32 = NULL, *old_lsame64 = NULL; 21 | uint8_t push_fake_lsame() { 22 | // Find `lsame_` in our symbol list (if we haven't done so before) 23 | if (lsame_idx == -1) { 24 | lsame_idx = find_symbol_idx("lsame_"); 25 | if (lsame_idx == -1) { 26 | fprintf(stderr, "Error: Unable to find lsame_ in our symbol list. " 27 | "This signifies a libblastrampoline compilation failure. " 28 | "Aborting interface autodetection.\n"); 29 | return 0; 30 | } 31 | } 32 | 33 | // Save old values of `lsame_` and `lsame_64_` to our swap location 34 | old_lsame32 = (*exported_func32_addrs[lsame_idx]); 35 | old_lsame64 = (*exported_func64_addrs[lsame_idx]); 36 | 37 | // Insert our "fake" lsame in so that we always have a half-functional copy 38 | (*exported_func32_addrs[lsame_idx]) = &fake_lsame; 39 | (*exported_func64_addrs[lsame_idx]) = &fake_lsame; 40 | return 1; 41 | } 42 | 43 | uint8_t pop_fake_lsame() { 44 | if (lsame_idx == -1) { 45 | // Did you call `pop_fake_lsame()` without calling `push_fake_lsame()` first?! 46 | fprintf(stderr, "Error: Invalid lsame_ index. This is an internal libblastrampoline error. " 47 | "Aborting interface autodetection.\n"); 48 | return 0; 49 | } 50 | 51 | (*exported_func32_addrs[lsame_idx]) = old_lsame32; 52 | (*exported_func64_addrs[lsame_idx]) = old_lsame64; 53 | 54 | old_lsame32 = NULL; 55 | old_lsame64 = NULL; 56 | return 1; 57 | } 58 | 59 | 60 | /* `lsame_` implementation taken from `http://www.netlib.org/clapack/cblas/lsame.c`*/ 61 | int fake_lsame(char * ca, char * cb) { 62 | /* Local variables */ 63 | static int inta, intb, zcode; 64 | 65 | if (*(unsigned char *)ca == *(unsigned char *)cb) { 66 | return 1; 67 | } 68 | 69 | zcode = 'Z'; 70 | inta = *(unsigned char *)ca; 71 | intb = *(unsigned char *)cb; 72 | 73 | if (zcode == 90 || zcode == 122) { 74 | if (inta >= 97 && inta <= 122) { 75 | inta += -32; 76 | } 77 | if (intb >= 97 && intb <= 122) { 78 | intb += -32; 79 | } 80 | } else if (zcode == 233 || zcode == 169) { 81 | if ((inta >= 129 && inta <= 137) || (inta >= 145 && inta <= 153) || (inta >= 162 && inta <= 169)) { 82 | inta += 64; 83 | } 84 | if ((intb >= 129 && intb <= 137) || (intb >= 145 && intb <= 153) || (intb >= 162 && intb <= 169)) { 85 | intb += 64; 86 | } 87 | } else if (zcode == 218 || zcode == 250) { 88 | if (inta >= 225 && inta <= 250) { 89 | inta += -32; 90 | } 91 | if (intb >= 225 && intb <= 250) { 92 | intb += -32; 93 | } 94 | } 95 | return inta == intb; 96 | } 97 | -------------------------------------------------------------------------------- /src/libblastrampoline_internal.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | // Load in our publicly-defined functions/types 9 | #include "libblastrampoline.h" 10 | 11 | #ifdef _OS_LINUX_ 12 | #include 13 | #include 14 | #include 15 | #endif 16 | 17 | #ifdef _OS_WINDOWS_ 18 | #define WIN32_LEAN_AND_MEAN 19 | #include 20 | #endif 21 | 22 | #ifdef _OS_DARWIN_ 23 | #include 24 | #include 25 | #include 26 | #endif 27 | 28 | #if defined(_OS_FREEBSD_) || defined(_OS_OPENBSD_) 29 | #include 30 | #include 31 | #include 32 | #include 33 | #endif 34 | 35 | #ifdef _OS_HAIKU_ 36 | #include 37 | #include 38 | #include 39 | #endif 40 | 41 | #if !defined(RTLD_DEEPBIND) && (defined(_OS_LINUX_) || defined(_OS_FREEBSD_)) 42 | #define LBT_DEEPBINDLESS 43 | #endif 44 | 45 | // This is the maximum length of a symbol that we'll allow 46 | #define MAX_SYMBOL_LEN 64 47 | 48 | // Data defined in `libblastrampoline_trampdata.h 49 | extern const char *const exported_func_names[]; 50 | extern const void ** exported_func32_addrs[]; 51 | extern const void ** exported_func64_addrs[]; 52 | 53 | // The config type you get back from lbt_get_config() 54 | #define MAX_TRACKED_LIBS 31 55 | 56 | // Functions in `libblastrampoline.c` 57 | int32_t find_symbol_idx(const char * name); 58 | 59 | // Functions in `config.c` 60 | void init_config(); 61 | void clear_loaded_libraries(); 62 | void clear_forwarding_mark(int32_t symbol_idx, int32_t interface); 63 | void record_library_load(const char * libname, void * handle, const char * suffix, uint8_t * forwards, 64 | int32_t interface, int32_t complex_retstyle, int32_t f2c, int32_t cblas); 65 | 66 | // Functions in `win_utils.c` 67 | #ifdef _OS_WINDOWS_ 68 | int wchar_to_utf8(const wchar_t * wstr, char *str, size_t maxlen); 69 | int utf8_to_wchar(const char * str, wchar_t * wstr, size_t maxlen); 70 | #endif 71 | 72 | // Functions in `dl_utils.c` 73 | void * load_library(const char * path); 74 | void * lookup_symbol(const void * lib_handle, const char * symbol_name); 75 | void * lookup_self_symbol(const char * symbol_name); 76 | const char * lookup_self_path(); 77 | void close_library(void * handle); 78 | 79 | // Functions in `env_utils.c` 80 | uint8_t env_lowercase_match(const char * env_name, const char * value); 81 | uint8_t env_lowercase_match_any(const char * env_name, uint32_t num_values, ...); 82 | uint8_t env_match_bool(const char * env_name, uint8_t default_value); 83 | 84 | // Functions in `autodetection.c` 85 | void build_symbol_name(char * out, const char *symbol_name, const char *suffix); 86 | const char * autodetect_symbol_suffix(void * handle, const char * suffix_hint); 87 | int32_t autodetect_blas_interface(void * isamax_addr); 88 | int32_t autodetect_lapack_interface(void * dpotrf_addr); 89 | int32_t autodetect_interface(void * handle, const char * suffix); 90 | int32_t autodetect_complex_return_style(void * handle, const char * suffix); 91 | int32_t autodetect_f2c(void * handle, const char * suffix); 92 | int32_t autodetect_cblas_divergence(void * handle, const char * suffix); 93 | 94 | // Functions in deepbindless_surrogates.c 95 | uint8_t push_fake_lsame(); 96 | uint8_t pop_fake_lsame(); 97 | int fake_lsame(char * ca, char * cb); 98 | extern uint8_t use_deepbind; 99 | -------------------------------------------------------------------------------- /test/accelerate.jl: -------------------------------------------------------------------------------- 1 | using Libdl, Test 2 | 3 | # Taken from AppleAccelerate.jl to avoid a dependency on it 4 | const libacc = "/System/Library/Frameworks/Accelerate.framework/Accelerate" 5 | const libacc_info_plist = "/System/Library/Frameworks/Accelerate.framework/Versions/Current/Resources/Info.plist" 6 | 7 | function get_macos_version(normalize=true) 8 | @static if !Sys.isapple() 9 | return nothing 10 | end 11 | 12 | plist_lines = split(String(read("/System/Library/CoreServices/SystemVersion.plist")), "\n") 13 | vers_idx = findfirst(l -> occursin("ProductVersion", l), plist_lines) 14 | if vers_idx === nothing 15 | return nothing 16 | end 17 | 18 | m = match(r">([\d\.]+)<", plist_lines[vers_idx+1]) 19 | if m === nothing 20 | return nothing 21 | end 22 | 23 | ver = VersionNumber(only(m.captures)) 24 | if normalize && ver.major == 16 25 | return VersionNumber(26, ver.minor, ver.patch) 26 | end 27 | return ver 28 | end 29 | 30 | 31 | # Load the Accelerate library 32 | libacc_handle = dlopen(libacc) 33 | @testset "Accelerate ILP64 loading" begin 34 | # ILP64 requires macOS 13.3+ 35 | if get_macos_version() >= v"13.3" 36 | # Load the ILP64 interface 37 | lbt_forward(lbt_handle, libacc; clear=true, suffix_hint="\x1a\$NEWLAPACK\$ILP64") 38 | 39 | # Test that we have only one library loaded 40 | config = lbt_get_config(lbt_handle) 41 | libs = unpack_loaded_libraries(config) 42 | @test length(libs) == 1 43 | 44 | # Test that it's Accelerate and it's correctly identified 45 | @test libs[1].libname == libacc 46 | @test libs[1].interface == LBT_INTERFACE_ILP64 47 | 48 | # Test that `dgemm` forwards to `dgemm_` within the Accelerate library 49 | acc_dgemm = dlsym(libacc_handle, "dgemm\$NEWLAPACK\$ILP64") 50 | @test lbt_get_forward(lbt_handle, "dgemm_", LBT_INTERFACE_ILP64) == acc_dgemm 51 | end 52 | end 53 | 54 | @testset "Accelerate LP64 loading" begin 55 | # New LAPACK interface requires macOS 13.3+ 56 | if get_macos_version() >= v"13.3" 57 | # Load the LP64 interface 58 | lbt_forward(lbt_handle, libacc; clear=true, suffix_hint="\x1a\$NEWLAPACK") 59 | 60 | # Test that we have only one library loaded 61 | config = lbt_get_config(lbt_handle) 62 | libs = unpack_loaded_libraries(config) 63 | @test length(libs) == 1 64 | 65 | # Test that it's Accelerate and it's correctly identified 66 | @test libs[1].libname == libacc 67 | @test libs[1].interface == LBT_INTERFACE_LP64 68 | 69 | # Test that `dgemm` forwards to `dgemm_` within the Accelerate library 70 | acc_dgemm = dlsym(libacc_handle, "dgemm\$NEWLAPACK") 71 | @test lbt_get_forward(lbt_handle, "dgemm_", LBT_INTERFACE_LP64) == acc_dgemm 72 | end 73 | end 74 | 75 | @testset "Accelerate threading" begin 76 | # This threading API will only work on v15 and above 77 | if get_macos_version() >= v"15" 78 | lbt_forward(lbt_handle, libacc; clear=true) 79 | 80 | # Set to single-threaded 81 | lbt_set_num_threads(lbt_handle, 1) 82 | @test lbt_get_num_threads(lbt_handle) == 1 83 | 84 | # Set to multi-threaded 85 | # Accelerate doesn't actually let us say how many threads, so we must test for greater than 86 | lbt_set_num_threads(lbt_handle, 2) 87 | @test lbt_get_num_threads(lbt_handle) > 1 88 | 89 | # Set back to single-threaded 90 | lbt_set_num_threads(lbt_handle, 1) 91 | @test lbt_get_num_threads(lbt_handle) == 1 92 | end 93 | end 94 | -------------------------------------------------------------------------------- /ext/clang_extraction/Manifest.toml: -------------------------------------------------------------------------------- 1 | # This file is machine-generated - editing it directly is not advised 2 | 3 | [[Base64]] 4 | uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" 5 | 6 | [[CEnum]] 7 | git-tree-sha1 = "215a9aa4a1f23fbd05b92769fdd62559488d70e9" 8 | uuid = "fa961155-64e5-5f13-b03f-caf6b980ea82" 9 | version = "0.4.1" 10 | 11 | [[Clang]] 12 | deps = ["CEnum", "Clang_jll", "DataStructures", "Libdl"] 13 | git-tree-sha1 = "5237d0c6c52179b958df0aeef171658a791456ab" 14 | uuid = "40e3b903-d033-50b4-a0cc-940c62c95e31" 15 | version = "0.12.1" 16 | 17 | [[Clang_jll]] 18 | deps = ["Libdl", "Pkg", "libLLVM_jll"] 19 | git-tree-sha1 = "ff31103423b99f59859d4b0505af4093a1e99079" 20 | uuid = "0ee61d77-7f21-5576-8119-9fcc46b10100" 21 | version = "9.0.1+4" 22 | 23 | [[Compat]] 24 | deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "SHA", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"] 25 | git-tree-sha1 = "919c7f3151e79ff196add81d7f4e45d91bbf420b" 26 | uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" 27 | version = "3.25.0" 28 | 29 | [[DataStructures]] 30 | deps = ["Compat", "InteractiveUtils", "OrderedCollections"] 31 | git-tree-sha1 = "4437b64df1e0adccc3e5d1adbc3ac741095e4677" 32 | uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" 33 | version = "0.18.9" 34 | 35 | [[Dates]] 36 | deps = ["Printf"] 37 | uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" 38 | 39 | [[DelimitedFiles]] 40 | deps = ["Mmap"] 41 | uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab" 42 | 43 | [[Distributed]] 44 | deps = ["Random", "Serialization", "Sockets"] 45 | uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" 46 | 47 | [[InteractiveUtils]] 48 | deps = ["Markdown"] 49 | uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" 50 | 51 | [[LibGit2]] 52 | deps = ["Printf"] 53 | uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" 54 | 55 | [[Libdl]] 56 | uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" 57 | 58 | [[LinearAlgebra]] 59 | deps = ["Libdl"] 60 | uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" 61 | 62 | [[Logging]] 63 | uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" 64 | 65 | [[Markdown]] 66 | deps = ["Base64"] 67 | uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" 68 | 69 | [[Mmap]] 70 | uuid = "a63ad114-7e13-5084-954f-fe012c677804" 71 | 72 | [[OrderedCollections]] 73 | git-tree-sha1 = "cf59cfed2e2c12e8a2ff0a4f1e9b2cd8650da6db" 74 | uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" 75 | version = "1.3.2" 76 | 77 | [[Pkg]] 78 | deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"] 79 | uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" 80 | 81 | [[Printf]] 82 | deps = ["Unicode"] 83 | uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" 84 | 85 | [[REPL]] 86 | deps = ["InteractiveUtils", "Markdown", "Sockets"] 87 | uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" 88 | 89 | [[Random]] 90 | deps = ["Serialization"] 91 | uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" 92 | 93 | [[SHA]] 94 | uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" 95 | 96 | [[Serialization]] 97 | uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" 98 | 99 | [[SharedArrays]] 100 | deps = ["Distributed", "Mmap", "Random", "Serialization"] 101 | uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383" 102 | 103 | [[Sockets]] 104 | uuid = "6462fe0b-24de-5631-8697-dd941f90decc" 105 | 106 | [[SparseArrays]] 107 | deps = ["LinearAlgebra", "Random"] 108 | uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" 109 | 110 | [[Statistics]] 111 | deps = ["LinearAlgebra", "SparseArrays"] 112 | uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" 113 | 114 | [[Test]] 115 | deps = ["Distributed", "InteractiveUtils", "Logging", "Random"] 116 | uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" 117 | 118 | [[UUIDs]] 119 | deps = ["Random", "SHA"] 120 | uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" 121 | 122 | [[Unicode]] 123 | uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" 124 | 125 | [[libLLVM_jll]] 126 | deps = ["Libdl", "Pkg"] 127 | git-tree-sha1 = "8bbcb2ac071438cd061ac210f6ba6754f45b8672" 128 | uuid = "8f36deef-c2a5-5394-99ed-8e07531fb29a" 129 | version = "9.0.1+5" 130 | -------------------------------------------------------------------------------- /src/dl_utils.c: -------------------------------------------------------------------------------- 1 | #include "libblastrampoline_internal.h" 2 | 3 | void throw_dl_error(const char * path) { 4 | fprintf(stderr, "ERROR: Unable to load dependent library %s\n", path); 5 | #if defined(_OS_WINDOWS_) 6 | LPWSTR wmsg = NULL; 7 | FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | 8 | FORMAT_MESSAGE_FROM_SYSTEM | 9 | FORMAT_MESSAGE_IGNORE_INSERTS | 10 | FORMAT_MESSAGE_MAX_WIDTH_MASK, 11 | NULL, GetLastError(), 12 | MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), 13 | (LPWSTR)&wmsg, 0, NULL); 14 | char err[256] = {0}; 15 | wchar_to_utf8(wmsg, err, 255); 16 | #else 17 | const char * err = dlerror(); 18 | #endif 19 | fprintf(stderr, "Message: %s\n", err); 20 | } 21 | 22 | 23 | /* 24 | * Load the given `path`, using `RTLD_NOW | RTLD_LOCAL` and `RTLD_DEEPBIND`, if available 25 | * If `use_deepbind` is set to `0`, don't use `RTLD_DEEPBIND` even if it's available. 26 | */ 27 | void * load_library(const char * path) { 28 | void * new_handle = NULL; 29 | 30 | #if defined(_OS_WINDOWS_) 31 | wchar_t wpath[2*PATH_MAX + 1] = {0}; 32 | if (!utf8_to_wchar(path, wpath, 2*PATH_MAX)) { 33 | fprintf(stderr, "ERROR: Unable to convert path %s to wide string!\n", path); 34 | return NULL; 35 | } 36 | new_handle = (void *)LoadLibraryExW(wpath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); 37 | #else 38 | 39 | // If `use_deepbind` is set to `0`, we voluntarily avoid using 40 | // `RTLD_DEEPBIND` even if it's available. This is primarily used 41 | // in conjunction with sanitizer tools, which abhor the presence of 42 | // deepbound libraries. 43 | if (use_deepbind == 0) { 44 | new_handle = dlopen(path, RTLD_NOW | RTLD_LOCAL); 45 | } 46 | #if defined(RTLD_DEEPBIND) 47 | else { 48 | new_handle = dlopen(path, RTLD_NOW | RTLD_LOCAL | RTLD_DEEPBIND); 49 | } 50 | #endif 51 | #endif // defined(_OS_WINDOWS_) 52 | 53 | if (new_handle == NULL) { 54 | throw_dl_error(path); 55 | } 56 | return new_handle; 57 | } 58 | 59 | /* 60 | * Close the given library handle 61 | */ 62 | void close_library(void * handle) { 63 | #if defined(_OS_WINDOWS_) 64 | FreeLibrary((HMODULE)handle); 65 | #else 66 | dlclose(handle); 67 | #endif 68 | } 69 | 70 | /* 71 | * Look up the given symbol within the given library denoted by `handle`. 72 | */ 73 | void * lookup_symbol(const void * handle, const char * symbol_name) { 74 | #if defined(_OS_WINDOWS_) 75 | return GetProcAddress((HMODULE) handle, symbol_name); 76 | #else 77 | return dlsym((void *)handle, symbol_name); 78 | #endif 79 | } 80 | 81 | /* 82 | * Work around protected symbol visibility and GCC/ld.bfd bug: 83 | * https://sourceware.org/bugzilla/show_bug.cgi?id=26815 84 | */ 85 | extern void * _win32_self_handle; 86 | void * lookup_self_symbol(const char * symbol_name) { 87 | void * self_handle = NULL; 88 | #if defined(_OS_WINDOWS_) 89 | self_handle = _win32_self_handle; 90 | #elif defined(_OS_DARWIN_) 91 | self_handle = RTLD_SELF; 92 | #elif defined(RTLD_DEFAULT) 93 | self_handle = RTLD_DEFAULT; 94 | #endif 95 | return lookup_symbol(self_handle, symbol_name); 96 | } 97 | 98 | 99 | 100 | char self_path[PATH_MAX] = {0}; 101 | const char * lookup_self_path() 102 | { 103 | // Reuse the path if this is not the first call. 104 | if (self_path[0] != 0) { 105 | return self_path; 106 | } 107 | #if defined(_OS_WINDOWS_) 108 | if (!GetModuleFileNameA(_win32_self_handle, self_path, PATH_MAX)) { 109 | fprintf(stderr, "ERROR: GetModuleFileName() failed\n"); 110 | strcpy(self_path, ""); 111 | return self_path; 112 | } 113 | #else 114 | // On all other platforms, use dladdr() 115 | Dl_info info; 116 | if (!dladdr(lookup_self_symbol("lbt_forward"), &info)) { 117 | fprintf(stderr, "ERROR: Unable to dladdr(\"lbt_forward\"): %s\n", dlerror()); 118 | strcpy(self_path, ""); 119 | return self_path; 120 | } 121 | strcpy(self_path, info.dli_fname); 122 | #endif 123 | return self_path; 124 | } 125 | -------------------------------------------------------------------------------- /src/Make.inc: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | 3 | # ARCH detection in Make, used to pick out which trampoline assembly syntax we're gonna use 4 | ARCH := $(shell $(CC) -dumpmachine | sed "s/\([^-]*\).*$$/\1/") 5 | 6 | # Normalize ppc64le to powerpc64le 7 | ifeq ($(ARCH),ppc64le) 8 | ARCH := powerpc64le 9 | endif 10 | # We map amd64 to x86_64 for compatibility with systems that identify 64-bit systems as such 11 | ifeq ($(ARCH),amd64) 12 | ARCH := x86_64 13 | endif 14 | # We map arm64 (Apple spelling) to aarch64 to avoid having to deal with both spellings everywhere 15 | ifeq ($(ARCH),arm64) 16 | ARCH := aarch64 17 | endif 18 | 19 | # Figure out OS and architecture (used to set `shlib_ext`) 20 | OS := $(shell uname) 21 | TRIPLET := $(shell $(CC) -dumpmachine) 22 | ifneq (,$(findstring MINGW,$(OS))$(findstring MSYS,$(OS))$(findstring CYGWIN,$(OS))$(findstring mingw,$(TRIPLET))) 23 | OS := WINNT 24 | endif 25 | 26 | LBT_SOVERSION_MAJOR := 5 27 | LBT_SOVERSION_MINOR := 15 28 | LBT_SOVERSION_PATCH := 0 29 | 30 | ifeq ($(OS), WINNT) 31 | SHLIB_EXT := dll 32 | EXE := .exe 33 | binlib := bin 34 | 35 | LIB_FULL_VERSION := libblastrampoline-$(LBT_SOVERSION_MAJOR)-$(LBT_SOVERSION_MINOR)-$(LBT_SOVERSION_PATCH).dll 36 | LIB_MAJOR_VERSION := libblastrampoline-$(LBT_SOVERSION_MAJOR).dll 37 | SONAME_FLAG := 38 | else ifeq ($(OS), Darwin) 39 | FPIC := -fPIC 40 | SHLIB_EXT := dylib 41 | binlib := lib 42 | 43 | LIB_FULL_VERSION := libblastrampoline.$(LBT_SOVERSION_MAJOR).$(LBT_SOVERSION_MINOR).$(LBT_SOVERSION_PATCH).dylib 44 | LIB_MAJOR_VERSION := libblastrampoline.$(LBT_SOVERSION_MAJOR).dylib 45 | SONAME_FLAG := -install_name @rpath/$(LIB_MAJOR_VERSION) 46 | else 47 | FPIC := -fPIC 48 | SHLIB_EXT := so 49 | binlib := lib 50 | 51 | LIB_FULL_VERSION := libblastrampoline.so.$(LBT_SOVERSION_MAJOR).$(LBT_SOVERSION_MINOR).$(LBT_SOVERSION_PATCH) 52 | LIB_MAJOR_VERSION := libblastrampoline.so.$(LBT_SOVERSION_MAJOR) 53 | SONAME_FLAG := -Wl,-soname=$(LIB_MAJOR_VERSION) 54 | endif 55 | 56 | LBT_CFLAGS := -g -O2 -std=gnu99 $(FPIC) -DLIBRARY_EXPORTS -D_GNU_SOURCE -DARCH_$(ARCH) $(CFLAGS) 57 | LBT_LDFLAGS := $(LDFLAGS) 58 | 59 | ifeq ($(OS),Linux) 60 | # On linux, we need to link `libdl` to get `dlopen` 61 | # and linker doesn't detect automatically executable stack isn't needed 62 | LBT_LDFLAGS += -ldl -Wl,-z,noexecstack 63 | endif 64 | 65 | ifeq ($(OS),WINNT) 66 | # On windows, we need to enable unicode mode 67 | LBT_CFLAGS += -municode 68 | endif 69 | 70 | # On windows, we must generate import libraries 71 | ifeq ($(OS),WINNT) 72 | define IMPLIB_FLAGS 73 | -Wl,--out-implib,$(1).a 74 | endef 75 | else 76 | define IMPLIB_FLAGS 77 | endef 78 | endif 79 | 80 | # If we're on x86_64 or i686, we may need to convert back f2c-style bindings (such as Apple's Accelerate) 81 | # from returning doubles to instead return float's. We enable automatic F2C detection on those platforms. 82 | F2C_AUTODETECTION := 0 83 | ifneq (,$(filter $(ARCH), x86_64 i686 aarch64 arm64)) 84 | LBT_CFLAGS += -DF2C_AUTODETECTION 85 | F2C_AUTODETECTION := 1 86 | endif 87 | 88 | # If we're on x86_64 or i686, we may need to autodetect MKL v2022's incomplete ILP64 suffixing. 89 | CBLAS_DIVERGENCE_AUTODETECTION := 0 90 | ifneq (,$(filter $(ARCH), x86_64 i686)) 91 | LBT_CFLAGS += -DCBLAS_DIVERGENCE_AUTODETECTION 92 | CBLAS_DIVERGENCE_AUTODETECTION := 1 93 | endif 94 | 95 | # If we're on x86_64, we can do complex return style autodetection 96 | ifneq (,$(filter $(ARCH), x86_64 aarch64)) 97 | LBT_CFLAGS += -DCOMPLEX_RETSTYLE_AUTODETECTION 98 | COMPLEX_RETSTYLE_AUTODETECTION := 1 99 | endif 100 | 101 | # If we're on an apple platform, we need to support symbol name trimming 102 | ifeq ($(OS), Darwin) 103 | LBT_CFLAGS += -DSYMBOL_TRIMMING 104 | SYMBOL_TRIMMING := 1 105 | endif 106 | 107 | ifeq ($(VERBOSE),0) 108 | ENDCOLOR := "\033[0m" 109 | CCCOLOR := "\033[34m" 110 | SRCCOLOR:="\033[33m" 111 | 112 | PRINT_CC = printf '%b %b\n' $(CCCOLOR)CC$(ENDCOLOR) $(SRCCOLOR)$@$(ENDCOLOR); $(1) 113 | else 114 | PRINT_CC = echo $(1); $(1) 115 | endif 116 | 117 | # Default installation location; we expect you to be overriding this 118 | prefix ?= prefix 119 | builddir ?= build 120 | 121 | shlibdir := $(prefix)/$(binlib) 122 | libdir := $(prefix)/lib 123 | includedir := $(prefix)/include 124 | 125 | define newline # a literal \n 126 | 127 | 128 | endef 129 | 130 | # Makefile debugging trick: 131 | # call print-VARIABLE to see the runtime value of any variable 132 | # (hardened against any special characters appearing in the output) 133 | print-%: 134 | @echo '$*=$(subst ','\'',$(subst $(newline),\n,$($*)))' 135 | -------------------------------------------------------------------------------- /include/common/lapacke_config.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | Copyright (c) 2010, Intel Corp. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | * Neither the name of Intel Corporation nor the names of its contributors 14 | may be used to endorse or promote products derived from this software 15 | without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 27 | THE POSSIBILITY OF SUCH DAMAGE. 28 | ****************************************************************************** 29 | * Contents: Native C interface to LAPACK 30 | * Author: Intel Corporation 31 | * Generated May, 2011 32 | *****************************************************************************/ 33 | 34 | #ifndef _LAPACKE_CONFIG_H_ 35 | #define _LAPACKE_CONFIG_H_ 36 | 37 | // For Android prior to API 21 (no include) 38 | #if defined(__ANDROID__) 39 | #if __ANDROID_API__ < 21 40 | #define LAPACK_COMPLEX_STRUCTURE 41 | #endif 42 | #endif 43 | 44 | #ifdef __cplusplus 45 | #if defined(LAPACK_COMPLEX_CPP) 46 | #include 47 | #endif 48 | extern "C" { 49 | #endif /* __cplusplus */ 50 | 51 | #include 52 | 53 | #ifndef lapack_int 54 | #if defined(LAPACK_ILP64) 55 | #define lapack_int long 56 | #else 57 | #define lapack_int int 58 | #endif 59 | #endif 60 | 61 | #ifndef lapack_logical 62 | #define lapack_logical lapack_int 63 | #endif 64 | 65 | #ifndef LAPACK_COMPLEX_CUSTOM 66 | 67 | #if defined(LAPACK_COMPLEX_STRUCTURE) 68 | 69 | typedef struct { float real, imag; } _lapack_complex_float; 70 | typedef struct { double real, imag; } _lapack_complex_double; 71 | #define lapack_complex_float _lapack_complex_float 72 | #define lapack_complex_double _lapack_complex_double 73 | #define lapack_complex_float_real(z) ((z).real) 74 | #define lapack_complex_float_imag(z) ((z).imag) 75 | #define lapack_complex_double_real(z) ((z).real) 76 | #define lapack_complex_double_imag(z) ((z).imag) 77 | 78 | #elif defined(LAPACK_COMPLEX_C99) 79 | 80 | #include 81 | #define lapack_complex_float float _Complex 82 | #define lapack_complex_double double _Complex 83 | #define lapack_complex_float_real(z) (creal(z)) 84 | #define lapack_complex_float_imag(z) (cimag(z)) 85 | #define lapack_complex_double_real(z) (creal(z)) 86 | #define lapack_complex_double_imag(z) (cimag(z)) 87 | 88 | #elif defined(LAPACK_COMPLEX_CPP) 89 | 90 | #define lapack_complex_float std::complex 91 | #define lapack_complex_double std::complex 92 | #define lapack_complex_float_real(z) ((z).real()) 93 | #define lapack_complex_float_imag(z) ((z).imag()) 94 | #define lapack_complex_double_real(z) ((z).real()) 95 | #define lapack_complex_double_imag(z) ((z).imag()) 96 | 97 | #else 98 | 99 | #include 100 | #define lapack_complex_float float _Complex 101 | #define lapack_complex_double double _Complex 102 | #define lapack_complex_float_real(z) (creal(z)) 103 | #define lapack_complex_float_imag(z) (cimag(z)) 104 | #define lapack_complex_double_real(z) (creal(z)) 105 | #define lapack_complex_double_imag(z) (cimag(z)) 106 | 107 | #endif 108 | 109 | lapack_complex_float lapack_make_complex_float( float re, float im ); 110 | lapack_complex_double lapack_make_complex_double( double re, double im ); 111 | 112 | #endif 113 | 114 | #ifndef LAPACK_malloc 115 | #define LAPACK_malloc( size ) malloc( size ) 116 | #endif 117 | 118 | #ifndef LAPACK_free 119 | #define LAPACK_free( p ) free( p ) 120 | #endif 121 | 122 | #ifdef __cplusplus 123 | } 124 | #endif /* __cplusplus */ 125 | 126 | #endif /* _LAPACKE_CONFIG_H_ */ 127 | -------------------------------------------------------------------------------- /src/config.c: -------------------------------------------------------------------------------- 1 | #include "libblastrampoline_internal.h" 2 | #include "exported_funcs.inc" 3 | 4 | lbt_config_t lbt_config; 5 | 6 | void init_config() { 7 | lbt_config.loaded_libs = (lbt_library_info_t **)malloc(sizeof(lbt_library_info_t *)*(MAX_TRACKED_LIBS + 1)); 8 | memset(lbt_config.loaded_libs, 0, sizeof(lbt_library_info_t*)*(MAX_TRACKED_LIBS + 1)); 9 | lbt_config.build_flags = 0x00000000; 10 | } 11 | 12 | LBT_DLLEXPORT const lbt_config_t * lbt_get_config() { 13 | // Set build flags (e.g. what we are capable of) 14 | lbt_config.build_flags = 0x00000000; 15 | 16 | #if defined(LBT_DEEPBINDLESS) 17 | lbt_config.build_flags |= LBT_BUILDFLAGS_DEEPBINDLESS; 18 | #endif 19 | 20 | #if defined(F2C_AUTODETECTION) 21 | lbt_config.build_flags |= LBT_BUILDFLAGS_F2C_CAPABLE; 22 | #endif 23 | 24 | #if defined(CBLAS_DIVERGENCE_AUTODETECTION) 25 | lbt_config.build_flags |= LBT_BUILDFLAGS_CBLAS_DIVERGENCE; 26 | #endif 27 | 28 | #if defined(COMPLEX_RETSTYLE_AUTODETECTION) 29 | lbt_config.build_flags |= LBT_BUILDFLAGS_COMPLEX_RETSTYLE; 30 | #endif 31 | 32 | #if defined(SYMBOL_TRIMMING) 33 | lbt_config.build_flags |= LBT_BUILDFLAGS_SYMBOL_TRIMMING; 34 | #endif 35 | 36 | lbt_config.exported_symbols = (const char **)&exported_func_names[0]; 37 | lbt_config.num_exported_symbols = NUM_EXPORTED_FUNCS; 38 | 39 | return &lbt_config; 40 | } 41 | 42 | void clear_loaded_libraries() { 43 | for (int idx=0; idxlibname); 46 | free(lbt_config.loaded_libs[idx]->active_forwards); 47 | //close_library(lbt_config.loaded_libs[idx]->handle); 48 | free(lbt_config.loaded_libs[idx]); 49 | lbt_config.loaded_libs[idx] = NULL; 50 | } 51 | } 52 | } 53 | 54 | void clear_forwarding_mark(int32_t symbol_idx, int32_t interface) { 55 | for (int idx=0; idxinterface != interface) { 60 | continue; 61 | } 62 | 63 | BITFIELD_CLEAR(lbt_config.loaded_libs[idx]->active_forwards, symbol_idx); 64 | } 65 | } 66 | 67 | void clear_other_forwards(int skip_idx, uint8_t * forwards, int32_t interface) { 68 | for (int idx=0; idxinterface != interface) { 74 | continue; 75 | } 76 | 77 | // Flip off anything in this library that is flipped on in the passed-in forwards 78 | for (uint32_t chunk_idx=0; chunk_idx < (NUM_EXPORTED_FUNCS/8)+1; ++chunk_idx) { 79 | lbt_config.loaded_libs[idx]->active_forwards[chunk_idx] &= (forwards[chunk_idx] ^ 0xff); 80 | } 81 | } 82 | } 83 | 84 | void record_library_load(const char * libname, void * handle, const char * suffix, uint8_t * forwards, 85 | int32_t interface, int32_t complex_retstyle, int32_t f2c, int32_t cblas) { 86 | // Scan for the an empty slot, and also check to see if this library has been loaded before. 87 | int free_idx = -1; 88 | for (int idx=0; idxhandle == handle && lbt_config.loaded_libs[idx]->interface == interface) { 97 | memcpy(lbt_config.loaded_libs[idx]->active_forwards, forwards, sizeof(uint8_t)*(NUM_EXPORTED_FUNCS/8 + 1)); 98 | clear_other_forwards(idx, forwards, interface); 99 | return; 100 | } 101 | } 102 | if (free_idx == -1) { 103 | // Uh-oh. Someone has tried to load more than MAX_TRACKED_LIBS at a time! 104 | return; 105 | } 106 | 107 | lbt_library_info_t * new_libinfo = (lbt_library_info_t *) malloc(sizeof(lbt_library_info_t)); 108 | 109 | size_t namelen = strlen(libname) + 1; 110 | new_libinfo->libname = (char *) malloc(namelen); 111 | memcpy(new_libinfo->libname, libname, namelen); 112 | new_libinfo->handle = handle; 113 | new_libinfo->suffix = suffix; 114 | new_libinfo->active_forwards = (uint8_t *)malloc(sizeof(uint8_t)*(NUM_EXPORTED_FUNCS/8 + 1)); 115 | memcpy(new_libinfo->active_forwards, forwards, sizeof(uint8_t)*(NUM_EXPORTED_FUNCS/8 + 1)); 116 | new_libinfo->interface = interface; 117 | new_libinfo->complex_retstyle = complex_retstyle; 118 | new_libinfo->f2c = f2c; 119 | new_libinfo->cblas = cblas; 120 | 121 | lbt_config.loaded_libs[free_idx] = new_libinfo; 122 | 123 | // Next, we go through and un-set all other loaded libraries of the same interface's `forwards`: 124 | clear_other_forwards(free_idx, forwards, interface); 125 | } 126 | -------------------------------------------------------------------------------- /ext/build_includes/build_includes.jl: -------------------------------------------------------------------------------- 1 | using BinaryBuilder, SHA 2 | 3 | LBT_ROOT = abspath(dirname(dirname(@__DIR__))) 4 | 5 | # This script heavily borroed from the OpenBLAS build recipe in Yggdrasil 6 | # X-ref: https://github.com/JuliaPackaging/Yggdrasil/blob/master/O/OpenBLAS/common.jl 7 | version = v"0.3.13" 8 | for openblas32 in (true, false) 9 | sources = [ 10 | ArchiveSource("https://github.com/xianyi/OpenBLAS/archive/v$(version).tar.gz", 11 | "79197543b17cc314b7e43f7a33148c308b0807cd6381ee77f77e15acf3e6459e") 12 | ] 13 | 14 | script = """ 15 | # We always want threading 16 | flags=(USE_THREAD=1 GEMM_MULTITHREADING_THRESHOLD=50 NO_AFFINITY=1) 17 | 18 | # We are cross-compiling 19 | flags+=(CROSS=1 PREFIX=/ "CROSS_SUFFIX=\${target}-") 20 | 21 | if [[ \${nbits} == 64 && "$(openblas32)" != "true" ]]; then 22 | # We're building an ILP64 BLAS with 64-bit BlasInt 23 | flags+=("LIBPREFIX=libopenblas64_" INTERFACE64=1 SYMBOLSUFFIX=64_) 24 | else 25 | flags+=("LIBPREFIX=libopenblas" INTERFACE64=1) 26 | fi 27 | flags+=(BINARY=\${nbits}) 28 | 29 | # "build" the project, but only install the headers 30 | cd \${WORKSPACE}/srcdir/OpenBLAS*/ 31 | 32 | # Fake out the buildsystem, make it think the libraries have been built 33 | touch lib.grd 34 | make "\${flags[@]}" "PREFIX=\${prefix}" dummy 35 | cp config.h config_last.h 36 | 37 | # Call `make install`, fully expecting this to blow up in our faces. 38 | make "\${flags[@]}" "PREFIX=\${prefix}" install || true 39 | 40 | # Comment out vendor-specific functions like `openblas_{s,g}et_num_threads` 41 | find \${prefix}/include -name \\*.h | xargs sed -i -E 's&(.*openblas_[sg]et_.*)&//\\1&' 42 | find \${prefix}/include -name \\*.bak | xargs rm -f 43 | """ 44 | 45 | products = [ 46 | FileProduct("include/cblas.h", :cblas_h), 47 | FileProduct("include/f77blas.h", :f77blas_h), 48 | FileProduct("include/lapack.h", :lapack_h), 49 | FileProduct("include/lapacke.h", :lapack_h), 50 | FileProduct("include/openblas_config.h", :openblas_config_h), 51 | ] 52 | name = "OpenBLASHeaders$(openblas32 ? "32" : "64")" 53 | build_tarballs(ARGS, name, version, sources, script, supported_platforms(;experimental=false), products, Dependency[], lock_microarchitecture=false) 54 | end 55 | 56 | # Unpack each set of headers into its own directory inside of `include/`: 57 | rm(joinpath(LBT_ROOT, "include"), recursive=true, force=true) 58 | for tarball_path in readdir("products") 59 | interface = startswith(tarball_path, "OpenBLASHeaders32") ? "LP64" : "ILP64" 60 | triplet = split(tarball_path, ".v$(version).")[end][1:end-7] 61 | tarball_path = joinpath("products", tarball_path) 62 | target_path = joinpath(LBT_ROOT, "include", interface, triplet) 63 | 64 | mkpath(target_path) 65 | run(`tar -C $(target_path) -xzf $(tarball_path) --strip-components=1 include/`) 66 | end 67 | 68 | # de-duplicate headers that share the exact same contents 69 | targets = unique(vcat([readdir(joinpath(LBT_ROOT, "include", interface)) for interface in ("LP64", "ILP64")]...)) 70 | function collect_hashes(fname, interfaces=("LP64", "ILP64")) 71 | return vec([open(sha256, joinpath(LBT_ROOT, "include", interface, target, fname)) for interface in interfaces, target in targets]) 72 | end 73 | function is_file_identical_across_targets(fname; interfaces=("LP64", "ILP64")) 74 | hashes = collect_hashes(fname, interfaces) 75 | return all(Ref(hashes[1]) .== hashes) 76 | end 77 | function symlink_common_file(fname; interfaces = ("LP64", "ILP64"), common_dir = joinpath(LBT_ROOT, "include", "common")) 78 | mkpath(common_dir) 79 | # Copy the file out to `common` 80 | common_path = joinpath(common_dir, fname) 81 | rm(common_path; force=true) 82 | mv(joinpath(LBT_ROOT, "include", interfaces[1], targets[1], fname), common_path) 83 | 84 | for interface in interfaces 85 | for target in targets 86 | src_path = joinpath(LBT_ROOT, "include", interface, target, fname) 87 | if islink(src_path) 88 | continue 89 | end 90 | rm(src_path; force=true) 91 | symlink(relpath(common_path, dirname(src_path)), src_path) 92 | end 93 | end 94 | end 95 | 96 | function cleanup_common_headers() 97 | @info("Cleaning up identical headers across targets/interfaces") 98 | common_filenames = unique(vcat([readdir(joinpath(LBT_ROOT, "include", interface, target)) for target in targets, interface in ("LP64", "ILP64")]...)) 99 | for fname in common_filenames 100 | if is_file_identical_across_targets(fname; interfaces=("LP64", "ILP64")) 101 | @info(" -> $(fname)") 102 | symlink_common_file(fname; interfaces=("LP64", "ILP64"), common_dir=joinpath(LBT_ROOT, "include", "common")) 103 | end 104 | end 105 | @info("Cleaning up identical headers across target but not interface") 106 | for interface in ("LP64", "ILP64") 107 | common_filenames = unique(vcat([readdir(joinpath(LBT_ROOT, "include", interface, target)) for target in targets]...)) 108 | for fname in common_filenames 109 | if is_file_identical_across_targets(fname; interfaces=(interface,)) 110 | @info(" -> $(interface)/$(fname)") 111 | symlink_common_file(fname; interfaces=(interface,), common_dir=joinpath(LBT_ROOT, "include", interface, "common")) 112 | end 113 | end 114 | end 115 | end 116 | 117 | cleanup_common_headers() 118 | -------------------------------------------------------------------------------- /src/complex_return_style_adapters.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "libblastrampoline_internal.h" 3 | 4 | /* 5 | * Some libraries use an argument-passing convention for returning complex numbers. 6 | * We create wrappers to work around this behavior and provide a consistent ABI 7 | * across all libraries. An example of this style of library is MKL, x-ref: 8 | * - https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ARPACK-with-MKL-crashes-when-calling-zdotc/td-p/1054316 9 | * - https://scicomp.stackexchange.com/questions/5380/intel-mkl-difference-between-mkl-intel-lp64-and-mkl-gf-lp64 10 | */ 11 | 12 | 13 | // zdotc 14 | extern void (*cmplxret_zdotc__addr)(double complex * z, 15 | const int32_t *, 16 | const double complex *, const int32_t *, 17 | const double complex *, const int32_t *); 18 | double complex cmplxret_zdotc_(const int32_t * N, 19 | const double complex *X, const int32_t * incX, 20 | const double complex *Y, const int32_t * incY) 21 | { 22 | double complex c; 23 | cmplxret_zdotc__addr(&c, N, X, incX, Y, incY); 24 | return c; 25 | } 26 | 27 | extern void (*cmplxret_zdotc_64__addr)(double complex * z, 28 | const int64_t *, 29 | const double complex *, const int64_t *, 30 | const double complex *, const int64_t *); 31 | double complex cmplxret_zdotc_64_(const int64_t * N, 32 | const double complex *X, const int64_t * incX, 33 | const double complex *Y, const int64_t * incY) 34 | { 35 | double complex c; 36 | cmplxret_zdotc_64__addr(&c, N, X, incX, Y, incY); 37 | return c; 38 | } 39 | 40 | 41 | // zdotu 42 | extern void (*cmplxret_zdotu__addr)(double complex * z, 43 | const int32_t *, 44 | const double complex *, const int32_t *, 45 | const double complex *, const int32_t *); 46 | double complex cmplxret_zdotu_(const int32_t * N, 47 | const double complex *X, const int32_t * incX, 48 | const double complex *Y, const int32_t * incY) 49 | { 50 | double complex c; 51 | cmplxret_zdotu__addr(&c, N, X, incX, Y, incY); 52 | return c; 53 | } 54 | 55 | extern void (*cmplxret_zdotu_64__addr)(double complex * z, 56 | const int64_t *, 57 | const double complex *, const int64_t *, 58 | const double complex *, const int64_t *); 59 | double complex cmplxret_zdotu_64_(const int64_t * N, 60 | const double complex *X, const int64_t * incX, 61 | const double complex *Y, const int64_t * incY) 62 | { 63 | double complex c; 64 | cmplxret_zdotu_64__addr(&c, N, X, incX, Y, incY); 65 | return c; 66 | } 67 | 68 | 69 | // cdotc 70 | extern void (*cmplxret_cdotc__addr)(float complex * z, 71 | const int32_t *, 72 | const float complex *, const int32_t *, 73 | const float complex *, const int32_t *); 74 | float complex cmplxret_cdotc_(const int32_t * N, 75 | const float complex *X, const int32_t * incX, 76 | const float complex *Y, const int32_t * incY) 77 | { 78 | float complex c; 79 | cmplxret_cdotc__addr(&c, N, X, incX, Y, incY); 80 | return c; 81 | } 82 | 83 | extern void (*cmplxret_cdotc_64__addr)(float complex * z, 84 | const int64_t *, 85 | const float complex *, const int64_t *, 86 | const float complex *, const int64_t *); 87 | float complex cmplxret_cdotc_64_(const int64_t * N, 88 | const float complex *X, const int64_t * incX, 89 | const float complex *Y, const int64_t * incY) 90 | { 91 | float complex c; 92 | cmplxret_cdotc_64__addr(&c, N, X, incX, Y, incY); 93 | return c; 94 | } 95 | 96 | 97 | // cdotu 98 | extern void (*cmplxret_cdotu__addr)(float complex * z, 99 | const int32_t *, 100 | const float complex *, const int32_t *, 101 | const float complex *, const int32_t *); 102 | float complex cmplxret_cdotu_(const int32_t * N, 103 | const float complex *X, const int32_t * incX, 104 | const float complex *Y, const int32_t * incY) 105 | { 106 | float complex c; 107 | cmplxret_cdotu__addr(&c, N, X, incX, Y, incY); 108 | return c; 109 | } 110 | 111 | extern void (*cmplxret_cdotu_64__addr)(float complex * z, 112 | const int64_t *, 113 | const float complex *, const int64_t *, 114 | const float complex *, const int64_t *); 115 | float complex cmplxret_cdotu_64_(const int64_t * N, 116 | const float complex *X, const int64_t * incX, 117 | const float complex *Y, const int64_t * incY) 118 | { 119 | float complex c; 120 | cmplxret_cdotu_64__addr(&c, N, X, incX, Y, incY); 121 | return c; 122 | } 123 | 124 | -------------------------------------------------------------------------------- /ext/gensymbol/generate_func_list.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | LBT_DIR="$(dirname $(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null && pwd)"))" 4 | 5 | SYS=osx 6 | ARCH=x86_64 7 | BU=_ 8 | EXPRECISION=1 9 | NO_CBLAS=0 10 | NO_LAPACK=0 11 | NO_LAPACKE=0 12 | NEED2UNDERSCORES=0 13 | ONLY_CBLAS=0 14 | SYMBOLPREFIX="" 15 | SYMBOLSUFFIX="" 16 | BUILD_LAPACK_DEPRECATED=1 17 | BUILD_BFLOAT16=1 18 | BUILD_SINGLE=1 19 | BUILD_DOUBLE=1 20 | BUILD_COMPLEX=1 21 | BUILD_COMPLEX16=1 22 | 23 | perl ./gensymbol ${SYS} ${ARCH} ${BU} ${EXPRECISION} \ 24 | ${NO_CBLAS} ${NO_LAPACK} ${NO_LAPACKE} ${NEED2UNDERSCORES} \ 25 | ${ONLY_CBLAS} "" "" \ 26 | ${BUILD_LAPACK_DEPRECATED} ${BUILD_BFLOAT16} ${BUILD_SINGLE} ${BUILD_DOUBLE} ${BUILD_COMPLEX} ${BUILD_COMPLEX16} | LC_COLLATE=C sort > tempsymbols.def 27 | 28 | OUTPUT_FILE="${LBT_DIR}/src/exported_funcs.inc" 29 | echo -n "Outputting to ${OUTPUT_FILE}....." 30 | echo "// This file generated by 'ext/gensymbol/generate_func_list.sh'" > "${OUTPUT_FILE}" 31 | echo "// Do not edit manually; your changes will be overwritten" >> "${OUTPUT_FILE}" 32 | 33 | # These are all the symbols we will export 34 | # Note that we filter out all openblas-specific stuff. 35 | EXPORTED_FUNCS=$(cut -b2-100 tempsymbols.def | grep -v openblas_ | grep -v goto_) 36 | echo "#ifndef EXPORTED_FUNCS" >> "${OUTPUT_FILE}" 37 | echo "#define EXPORTED_FUNCS(XX) \\" >> "${OUTPUT_FILE}" 38 | NUM_EXPORTED=0 39 | for s in ${EXPORTED_FUNCS}; do 40 | echo " XX(${s}, ${NUM_EXPORTED}) \\" >> "${OUTPUT_FILE}" 41 | NUM_EXPORTED=$((${NUM_EXPORTED} + 1)) 42 | [ $((${NUM_EXPORTED} % 100)) == 0 ] && echo -n "." 43 | done 44 | echo >> "${OUTPUT_FILE}" 45 | echo "#define NUM_EXPORTED_FUNCS ${NUM_EXPORTED}" >> "${OUTPUT_FILE}" 46 | echo "#endif" >> "${OUTPUT_FILE}" 47 | 48 | 49 | # Helper function that finds the index of a word in a list of words 50 | word_idx() { 51 | idx=0 52 | for word in $1; do 53 | if [[ "$word" == "$2" ]]; then 54 | echo $idx 55 | break 56 | fi 57 | idx=$((idx+1)) 58 | done 59 | } 60 | 61 | # Also generate a list of functions that need an f2c wrapper 62 | NUM_SYMBOLS=0 63 | function output_func() { 64 | # Skip floatret functions that don't actually exist in our exported funcs 65 | widx=$(word_idx "${EXPORTED_FUNCS}" ${1}) 66 | if [[ -n "${widx}" ]]; then 67 | echo " XX(${1}, ${widx}) \\" >> "${OUTPUT_FILE}" 68 | NUM_SYMBOLS=$((${NUM_SYMBOLS} + 1)) 69 | [ $((${NUM_SYMBOLS} % 10)) == 0 ] && echo -n "." 70 | fi 71 | } 72 | 73 | NUM_SYMBOLS=0 74 | FLOAT32_FUNCS="sdot_ sdsdot_ sasum_ scasum_ ssum_ scsum_ samax_ scamax_ samin_ scamin_ smax_ scmax_ smin_ scmin_ snrm2_ scnrm2_ slamch_ slamc3_ " 75 | echo >> "${OUTPUT_FILE}" 76 | echo "#ifndef FLOAT32_FUNCS" >> "${OUTPUT_FILE}" 77 | echo "#define FLOAT32_FUNCS(XX) \\" >> "${OUTPUT_FILE}" 78 | for func_name in ${FLOAT32_FUNCS}; do 79 | output_func "${func_name}" 80 | done 81 | echo >> "${OUTPUT_FILE}" 82 | echo "#endif" >> "${OUTPUT_FILE}" 83 | NUM_FLOAT32_SYMBOLS="${NUM_SYMBOLS}" 84 | 85 | NUM_SYMBOLS=0 86 | COMPLEX64_FUNCS="cdotu_ cdotc_" 87 | echo >> "${OUTPUT_FILE}" 88 | echo "#ifndef COMPLEX64_FUNCS" >> "${OUTPUT_FILE}" 89 | echo "#define COMPLEX64_FUNCS(XX) \\" >> "${OUTPUT_FILE}" 90 | for func_name in ${COMPLEX64_FUNCS}; do 91 | output_func "${func_name}" 92 | done 93 | echo >> "${OUTPUT_FILE}" 94 | echo "#endif" >> "${OUTPUT_FILE}" 95 | NUM_COMPLEX64_SYMBOLS="${NUM_SYMBOLS}" 96 | 97 | NUM_SYMBOLS=0 98 | COMPLEX128_FUNCS="zdotu_ zdotc_" 99 | echo >> "${OUTPUT_FILE}" 100 | echo "#ifndef COMPLEX128_FUNCS" >> "${OUTPUT_FILE}" 101 | echo "#define COMPLEX128_FUNCS(XX) \\" >> "${OUTPUT_FILE}" 102 | for func_name in ${COMPLEX128_FUNCS}; do 103 | output_func "${func_name}" 104 | done 105 | echo >> "${OUTPUT_FILE}" 106 | echo "#endif" >> "${OUTPUT_FILE}" 107 | NUM_COMPLEX128_SYMBOLS="${NUM_SYMBOLS}" 108 | 109 | NUM_SYMBOLS=0 110 | CBLAS_FUNCS="$(grep -e '^cblas_.*$' <<< "${EXPORTED_FUNCS}")" 111 | echo >> "${OUTPUT_FILE}" 112 | echo "#ifndef CBLAS_FUNCS" >> "${OUTPUT_FILE}" 113 | echo "#define CBLAS_FUNCS(XX) \\" >> "${OUTPUT_FILE}" 114 | for func_name in ${CBLAS_FUNCS}; do 115 | output_func "${func_name}" 116 | done 117 | echo >> "${OUTPUT_FILE}" 118 | echo "#endif" >> "${OUTPUT_FILE}" 119 | NUM_CBLAS_SYMBOLS="${NUM_SYMBOLS}" 120 | 121 | NUM_SYMBOLS=0 122 | # We manually curate a list of cblas functions that we have defined adapters for 123 | # in `src/cblas_adapters.c`. This is our compromise between the crushing workload 124 | # of manually defining every single CBLAS function we need, and the practical need 125 | # to get Julia to pass its LinearAlgebra tests using MKL v2022. 126 | CBLAS_WORKAROUND_FUNCS="$(grep -e '^cblas_.*_sub$' <<< "${EXPORTED_FUNCS}")" 127 | CBLAS_WORKAROUND_FUNCS="${CBLAS_WORKAROUND_FUNCS} $(grep -e '^cblas_.dot$' <<< "${EXPORTED_FUNCS}")" 128 | echo >> "${OUTPUT_FILE}" 129 | echo "#ifndef CBLAS_WORKAROUND_FUNCS" >> "${OUTPUT_FILE}" 130 | echo "#define CBLAS_WORKAROUND_FUNCS(XX) \\" >> "${OUTPUT_FILE}" 131 | for func_name in ${CBLAS_WORKAROUND_FUNCS}; do 132 | output_func "${func_name}" 133 | done 134 | echo >> "${OUTPUT_FILE}" 135 | echo "#endif" >> "${OUTPUT_FILE}" 136 | NUM_CBLAS_WORKAROUND_SYMBOLS="${NUM_SYMBOLS}" 137 | 138 | 139 | # Report to the user and cleanup 140 | echo 141 | NUM_F2C_SYMBOLS="$((NUM_FLOAT32_SYMBOLS + NUM_COMPLEX64_SYMBOLS + NUM_COMPLEX128_SYMBOLS))" 142 | NUM_CMPLX_SYMBOLS="$((NUM_COMPLEX64_SYMBOLS + NUM_COMPLEX128_SYMBOLS))" 143 | echo "Done, with ${NUM_EXPORTED} symbols generated (${NUM_F2C_SYMBOLS} f2c, ${NUM_CMPLX_SYMBOLS} complex-returning, ${NUM_CBLAS_SYMBOLS} cblas, ${NUM_CBLAS_WORKAROUND_SYMBOLS} cblas-workaround functions)." 144 | rm -f tempsymbols.def 145 | -------------------------------------------------------------------------------- /include/ILP64/armv7l-linux-gnueabihf/openblas_config.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENBLAS_CONFIG_H 2 | #define OPENBLAS_CONFIG_H 3 | #define OPENBLAS_OS_LINUX 1 4 | #define OPENBLAS_ARCH_ARM 1 5 | #define OPENBLAS_C_GCC 1 6 | #define OPENBLAS___32BIT__ 1 7 | #define OPENBLAS_PTHREAD_CREATE_FUNC pthread_create 8 | #define OPENBLAS_BUNDERSCORE _ 9 | #define OPENBLAS_NEEDBUNDERSCORE 1 10 | #define OPENBLAS_BARCELONA 11 | #define OPENBLAS_L1_CODE_SIZE 32768 12 | #define OPENBLAS_L1_CODE_ASSOCIATIVE 8 13 | #define OPENBLAS_L1_CODE_LINESIZE 64 14 | #define OPENBLAS_L1_DATA_SIZE 32768 15 | #define OPENBLAS_L1_DATA_ASSOCIATIVE 8 16 | #define OPENBLAS_L1_DATA_LINESIZE 64 17 | #define OPENBLAS_L2_SIZE 524288 18 | #define OPENBLAS_L2_ASSOCIATIVE 8 19 | #define OPENBLAS_L2_LINESIZE 64 20 | #define OPENBLAS_L3_SIZE 67108864 21 | #define OPENBLAS_L3_ASSOCIATIVE 9 22 | #define OPENBLAS_L3_LINESIZE 64 23 | #define OPENBLAS_ITB_SIZE 4096 24 | #define OPENBLAS_ITB_ASSOCIATIVE 0 25 | #define OPENBLAS_ITB_ENTRIES 64 26 | #define OPENBLAS_DTB_SIZE 4096 27 | #define OPENBLAS_DTB_ASSOCIATIVE 0 28 | #define OPENBLAS_DTB_DEFAULT_ENTRIES 64 29 | #define OPENBLAS_HAVE_CMOV 30 | #define OPENBLAS_HAVE_MMX 31 | #define OPENBLAS_HAVE_SSE 32 | #define OPENBLAS_HAVE_SSE2 33 | #define OPENBLAS_HAVE_SSE3 34 | #define OPENBLAS_HAVE_SSSE3 35 | #define OPENBLAS_HAVE_SSE4_1 36 | #define OPENBLAS_HAVE_SSE4_2 37 | #define OPENBLAS_HAVE_SSE4A 38 | #define OPENBLAS_HAVE_CFLUSH 39 | #define OPENBLAS_HAVE_MISALIGNSSE 40 | #define OPENBLAS_HAVE_FASTMOVU 41 | #define OPENBLAS_NUM_SHAREDCACHE 1 42 | #define OPENBLAS_NUM_CORES 1 43 | #define OPENBLAS_CORE_BARCELONA 44 | #define OPENBLAS_CHAR_CORENAME "BARCELONA" 45 | #define OPENBLAS_USE64BITINT 46 | #define OPENBLAS_GEMM_MULTITHREAD_THRESHOLD 4 47 | #define OPENBLAS_VERSION " OpenBLAS 0.3.13 " 48 | /*This is only for "make install" target.*/ 49 | 50 | #if defined(OPENBLAS_OS_WINNT) || defined(OPENBLAS_OS_CYGWIN_NT) || defined(OPENBLAS_OS_INTERIX) 51 | #define OPENBLAS_WINDOWS_ABI 52 | #define OPENBLAS_OS_WINDOWS 53 | 54 | #ifdef DOUBLE 55 | #define DOUBLE_DEFINED DOUBLE 56 | #undef DOUBLE 57 | #endif 58 | #endif 59 | 60 | #ifdef OPENBLAS_NEEDBUNDERSCORE 61 | #define BLASFUNC(FUNC) FUNC##_ 62 | #else 63 | #define BLASFUNC(FUNC) FUNC 64 | #endif 65 | 66 | #ifdef OPENBLAS_QUAD_PRECISION 67 | typedef struct { 68 | unsigned long x[2]; 69 | } xdouble; 70 | #elif defined OPENBLAS_EXPRECISION 71 | #define xdouble long double 72 | #else 73 | #define xdouble double 74 | #endif 75 | 76 | #if defined(OPENBLAS_OS_WINDOWS) && defined(OPENBLAS___64BIT__) 77 | typedef long long BLASLONG; 78 | typedef unsigned long long BLASULONG; 79 | #else 80 | typedef long BLASLONG; 81 | typedef unsigned long BLASULONG; 82 | #endif 83 | 84 | #ifndef BFLOAT16 85 | #include 86 | typedef uint16_t bfloat16; 87 | #endif 88 | 89 | #ifdef OPENBLAS_USE64BITINT 90 | typedef BLASLONG blasint; 91 | #else 92 | typedef int blasint; 93 | #endif 94 | 95 | #if defined(XDOUBLE) || defined(DOUBLE) 96 | #define FLOATRET FLOAT 97 | #else 98 | #ifdef NEED_F2CCONV 99 | #define FLOATRET double 100 | #else 101 | #define FLOATRET float 102 | #endif 103 | #endif 104 | 105 | /* Inclusion of a standard header file is needed for definition of __STDC_* 106 | predefined macros with some compilers (e.g. GCC 4.7 on Linux). This occurs 107 | as a side effect of including either or . */ 108 | #include 109 | 110 | /* C99 supports complex floating numbers natively, which GCC also offers as an 111 | extension since version 3.0. If neither are available, use a compatible 112 | structure as fallback (see Clause 6.2.5.13 of the C99 standard). */ 113 | #if ((defined(__STDC_IEC_559_COMPLEX__) || __STDC_VERSION__ >= 199901L || \ 114 | (__GNUC__ >= 3 && !defined(__cplusplus))) && !(defined(FORCE_OPENBLAS_COMPLEX_STRUCT))) && !defined(_MSC_VER) 115 | #define OPENBLAS_COMPLEX_C99 116 | #ifndef __cplusplus 117 | #include 118 | #endif 119 | typedef float _Complex openblas_complex_float; 120 | typedef double _Complex openblas_complex_double; 121 | typedef xdouble _Complex openblas_complex_xdouble; 122 | #define openblas_make_complex_float(real, imag) ((real) + ((imag) * _Complex_I)) 123 | #define openblas_make_complex_double(real, imag) ((real) + ((imag) * _Complex_I)) 124 | #define openblas_make_complex_xdouble(real, imag) ((real) + ((imag) * _Complex_I)) 125 | #define openblas_complex_float_real(z) (creal(z)) 126 | #define openblas_complex_float_imag(z) (cimag(z)) 127 | #define openblas_complex_double_real(z) (creal(z)) 128 | #define openblas_complex_double_imag(z) (cimag(z)) 129 | #define openblas_complex_xdouble_real(z) (creal(z)) 130 | #define openblas_complex_xdouble_imag(z) (cimag(z)) 131 | #else 132 | #define OPENBLAS_COMPLEX_STRUCT 133 | typedef struct { float real, imag; } openblas_complex_float; 134 | typedef struct { double real, imag; } openblas_complex_double; 135 | typedef struct { xdouble real, imag; } openblas_complex_xdouble; 136 | #define openblas_make_complex_float(real, imag) {(real), (imag)} 137 | #define openblas_make_complex_double(real, imag) {(real), (imag)} 138 | #define openblas_make_complex_xdouble(real, imag) {(real), (imag)} 139 | #define openblas_complex_float_real(z) ((z).real) 140 | #define openblas_complex_float_imag(z) ((z).imag) 141 | #define openblas_complex_double_real(z) ((z).real) 142 | #define openblas_complex_double_imag(z) ((z).imag) 143 | #define openblas_complex_xdouble_real(z) ((z).real) 144 | #define openblas_complex_xdouble_imag(z) ((z).imag) 145 | #endif 146 | 147 | /* Inclusion of Linux-specific header is needed for definition of cpu_set_t. */ 148 | #ifdef OPENBLAS_OS_LINUX 149 | #include 150 | #endif 151 | #endif /* OPENBLAS_CONFIG_H */ 152 | -------------------------------------------------------------------------------- /include/LP64/armv7l-linux-gnueabihf/openblas_config.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENBLAS_CONFIG_H 2 | #define OPENBLAS_CONFIG_H 3 | #define OPENBLAS_OS_LINUX 1 4 | #define OPENBLAS_ARCH_ARM 1 5 | #define OPENBLAS_C_GCC 1 6 | #define OPENBLAS___32BIT__ 1 7 | #define OPENBLAS_PTHREAD_CREATE_FUNC pthread_create 8 | #define OPENBLAS_BUNDERSCORE _ 9 | #define OPENBLAS_NEEDBUNDERSCORE 1 10 | #define OPENBLAS_BARCELONA 11 | #define OPENBLAS_L1_CODE_SIZE 32768 12 | #define OPENBLAS_L1_CODE_ASSOCIATIVE 8 13 | #define OPENBLAS_L1_CODE_LINESIZE 64 14 | #define OPENBLAS_L1_DATA_SIZE 32768 15 | #define OPENBLAS_L1_DATA_ASSOCIATIVE 8 16 | #define OPENBLAS_L1_DATA_LINESIZE 64 17 | #define OPENBLAS_L2_SIZE 524288 18 | #define OPENBLAS_L2_ASSOCIATIVE 8 19 | #define OPENBLAS_L2_LINESIZE 64 20 | #define OPENBLAS_L3_SIZE 67108864 21 | #define OPENBLAS_L3_ASSOCIATIVE 9 22 | #define OPENBLAS_L3_LINESIZE 64 23 | #define OPENBLAS_ITB_SIZE 4096 24 | #define OPENBLAS_ITB_ASSOCIATIVE 0 25 | #define OPENBLAS_ITB_ENTRIES 64 26 | #define OPENBLAS_DTB_SIZE 4096 27 | #define OPENBLAS_DTB_ASSOCIATIVE 0 28 | #define OPENBLAS_DTB_DEFAULT_ENTRIES 64 29 | #define OPENBLAS_HAVE_CMOV 30 | #define OPENBLAS_HAVE_MMX 31 | #define OPENBLAS_HAVE_SSE 32 | #define OPENBLAS_HAVE_SSE2 33 | #define OPENBLAS_HAVE_SSE3 34 | #define OPENBLAS_HAVE_SSSE3 35 | #define OPENBLAS_HAVE_SSE4_1 36 | #define OPENBLAS_HAVE_SSE4_2 37 | #define OPENBLAS_HAVE_SSE4A 38 | #define OPENBLAS_HAVE_CFLUSH 39 | #define OPENBLAS_HAVE_MISALIGNSSE 40 | #define OPENBLAS_HAVE_FASTMOVU 41 | #define OPENBLAS_NUM_SHAREDCACHE 1 42 | #define OPENBLAS_NUM_CORES 1 43 | #define OPENBLAS_CORE_BARCELONA 44 | #define OPENBLAS_CHAR_CORENAME "BARCELONA" 45 | #define OPENBLAS_USE64BITINT 46 | #define OPENBLAS_GEMM_MULTITHREAD_THRESHOLD 4 47 | #define OPENBLAS_VERSION " OpenBLAS 0.3.13 " 48 | /*This is only for "make install" target.*/ 49 | 50 | #if defined(OPENBLAS_OS_WINNT) || defined(OPENBLAS_OS_CYGWIN_NT) || defined(OPENBLAS_OS_INTERIX) 51 | #define OPENBLAS_WINDOWS_ABI 52 | #define OPENBLAS_OS_WINDOWS 53 | 54 | #ifdef DOUBLE 55 | #define DOUBLE_DEFINED DOUBLE 56 | #undef DOUBLE 57 | #endif 58 | #endif 59 | 60 | #ifdef OPENBLAS_NEEDBUNDERSCORE 61 | #define BLASFUNC(FUNC) FUNC##_ 62 | #else 63 | #define BLASFUNC(FUNC) FUNC 64 | #endif 65 | 66 | #ifdef OPENBLAS_QUAD_PRECISION 67 | typedef struct { 68 | unsigned long x[2]; 69 | } xdouble; 70 | #elif defined OPENBLAS_EXPRECISION 71 | #define xdouble long double 72 | #else 73 | #define xdouble double 74 | #endif 75 | 76 | #if defined(OPENBLAS_OS_WINDOWS) && defined(OPENBLAS___64BIT__) 77 | typedef long long BLASLONG; 78 | typedef unsigned long long BLASULONG; 79 | #else 80 | typedef long BLASLONG; 81 | typedef unsigned long BLASULONG; 82 | #endif 83 | 84 | #ifndef BFLOAT16 85 | #include 86 | typedef uint16_t bfloat16; 87 | #endif 88 | 89 | #ifdef OPENBLAS_USE64BITINT 90 | typedef BLASLONG blasint; 91 | #else 92 | typedef int blasint; 93 | #endif 94 | 95 | #if defined(XDOUBLE) || defined(DOUBLE) 96 | #define FLOATRET FLOAT 97 | #else 98 | #ifdef NEED_F2CCONV 99 | #define FLOATRET double 100 | #else 101 | #define FLOATRET float 102 | #endif 103 | #endif 104 | 105 | /* Inclusion of a standard header file is needed for definition of __STDC_* 106 | predefined macros with some compilers (e.g. GCC 4.7 on Linux). This occurs 107 | as a side effect of including either or . */ 108 | #include 109 | 110 | /* C99 supports complex floating numbers natively, which GCC also offers as an 111 | extension since version 3.0. If neither are available, use a compatible 112 | structure as fallback (see Clause 6.2.5.13 of the C99 standard). */ 113 | #if ((defined(__STDC_IEC_559_COMPLEX__) || __STDC_VERSION__ >= 199901L || \ 114 | (__GNUC__ >= 3 && !defined(__cplusplus))) && !(defined(FORCE_OPENBLAS_COMPLEX_STRUCT))) && !defined(_MSC_VER) 115 | #define OPENBLAS_COMPLEX_C99 116 | #ifndef __cplusplus 117 | #include 118 | #endif 119 | typedef float _Complex openblas_complex_float; 120 | typedef double _Complex openblas_complex_double; 121 | typedef xdouble _Complex openblas_complex_xdouble; 122 | #define openblas_make_complex_float(real, imag) ((real) + ((imag) * _Complex_I)) 123 | #define openblas_make_complex_double(real, imag) ((real) + ((imag) * _Complex_I)) 124 | #define openblas_make_complex_xdouble(real, imag) ((real) + ((imag) * _Complex_I)) 125 | #define openblas_complex_float_real(z) (creal(z)) 126 | #define openblas_complex_float_imag(z) (cimag(z)) 127 | #define openblas_complex_double_real(z) (creal(z)) 128 | #define openblas_complex_double_imag(z) (cimag(z)) 129 | #define openblas_complex_xdouble_real(z) (creal(z)) 130 | #define openblas_complex_xdouble_imag(z) (cimag(z)) 131 | #else 132 | #define OPENBLAS_COMPLEX_STRUCT 133 | typedef struct { float real, imag; } openblas_complex_float; 134 | typedef struct { double real, imag; } openblas_complex_double; 135 | typedef struct { xdouble real, imag; } openblas_complex_xdouble; 136 | #define openblas_make_complex_float(real, imag) {(real), (imag)} 137 | #define openblas_make_complex_double(real, imag) {(real), (imag)} 138 | #define openblas_make_complex_xdouble(real, imag) {(real), (imag)} 139 | #define openblas_complex_float_real(z) ((z).real) 140 | #define openblas_complex_float_imag(z) ((z).imag) 141 | #define openblas_complex_double_real(z) ((z).real) 142 | #define openblas_complex_double_imag(z) ((z).imag) 143 | #define openblas_complex_xdouble_real(z) ((z).real) 144 | #define openblas_complex_xdouble_imag(z) ((z).imag) 145 | #endif 146 | 147 | /* Inclusion of Linux-specific header is needed for definition of cpu_set_t. */ 148 | #ifdef OPENBLAS_OS_LINUX 149 | #include 150 | #endif 151 | #endif /* OPENBLAS_CONFIG_H */ 152 | -------------------------------------------------------------------------------- /include/LP64/armv7l-linux-musleabihf/openblas_config.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENBLAS_CONFIG_H 2 | #define OPENBLAS_CONFIG_H 3 | #define OPENBLAS_OS_LINUX 1 4 | #define OPENBLAS_ARCH_ARM 1 5 | #define OPENBLAS_C_GCC 1 6 | #define OPENBLAS___32BIT__ 1 7 | #define OPENBLAS_PTHREAD_CREATE_FUNC pthread_create 8 | #define OPENBLAS_BUNDERSCORE _ 9 | #define OPENBLAS_NEEDBUNDERSCORE 1 10 | #define OPENBLAS_BARCELONA 11 | #define OPENBLAS_L1_CODE_SIZE 32768 12 | #define OPENBLAS_L1_CODE_ASSOCIATIVE 8 13 | #define OPENBLAS_L1_CODE_LINESIZE 64 14 | #define OPENBLAS_L1_DATA_SIZE 32768 15 | #define OPENBLAS_L1_DATA_ASSOCIATIVE 8 16 | #define OPENBLAS_L1_DATA_LINESIZE 64 17 | #define OPENBLAS_L2_SIZE 524288 18 | #define OPENBLAS_L2_ASSOCIATIVE 8 19 | #define OPENBLAS_L2_LINESIZE 64 20 | #define OPENBLAS_L3_SIZE 67108864 21 | #define OPENBLAS_L3_ASSOCIATIVE 9 22 | #define OPENBLAS_L3_LINESIZE 64 23 | #define OPENBLAS_ITB_SIZE 4096 24 | #define OPENBLAS_ITB_ASSOCIATIVE 0 25 | #define OPENBLAS_ITB_ENTRIES 64 26 | #define OPENBLAS_DTB_SIZE 4096 27 | #define OPENBLAS_DTB_ASSOCIATIVE 0 28 | #define OPENBLAS_DTB_DEFAULT_ENTRIES 64 29 | #define OPENBLAS_HAVE_CMOV 30 | #define OPENBLAS_HAVE_MMX 31 | #define OPENBLAS_HAVE_SSE 32 | #define OPENBLAS_HAVE_SSE2 33 | #define OPENBLAS_HAVE_SSE3 34 | #define OPENBLAS_HAVE_SSSE3 35 | #define OPENBLAS_HAVE_SSE4_1 36 | #define OPENBLAS_HAVE_SSE4_2 37 | #define OPENBLAS_HAVE_SSE4A 38 | #define OPENBLAS_HAVE_CFLUSH 39 | #define OPENBLAS_HAVE_MISALIGNSSE 40 | #define OPENBLAS_HAVE_FASTMOVU 41 | #define OPENBLAS_NUM_SHAREDCACHE 1 42 | #define OPENBLAS_NUM_CORES 1 43 | #define OPENBLAS_CORE_BARCELONA 44 | #define OPENBLAS_CHAR_CORENAME "BARCELONA" 45 | #define OPENBLAS_USE64BITINT 46 | #define OPENBLAS_GEMM_MULTITHREAD_THRESHOLD 4 47 | #define OPENBLAS_VERSION " OpenBLAS 0.3.13 " 48 | /*This is only for "make install" target.*/ 49 | 50 | #if defined(OPENBLAS_OS_WINNT) || defined(OPENBLAS_OS_CYGWIN_NT) || defined(OPENBLAS_OS_INTERIX) 51 | #define OPENBLAS_WINDOWS_ABI 52 | #define OPENBLAS_OS_WINDOWS 53 | 54 | #ifdef DOUBLE 55 | #define DOUBLE_DEFINED DOUBLE 56 | #undef DOUBLE 57 | #endif 58 | #endif 59 | 60 | #ifdef OPENBLAS_NEEDBUNDERSCORE 61 | #define BLASFUNC(FUNC) FUNC##_ 62 | #else 63 | #define BLASFUNC(FUNC) FUNC 64 | #endif 65 | 66 | #ifdef OPENBLAS_QUAD_PRECISION 67 | typedef struct { 68 | unsigned long x[2]; 69 | } xdouble; 70 | #elif defined OPENBLAS_EXPRECISION 71 | #define xdouble long double 72 | #else 73 | #define xdouble double 74 | #endif 75 | 76 | #if defined(OPENBLAS_OS_WINDOWS) && defined(OPENBLAS___64BIT__) 77 | typedef long long BLASLONG; 78 | typedef unsigned long long BLASULONG; 79 | #else 80 | typedef long BLASLONG; 81 | typedef unsigned long BLASULONG; 82 | #endif 83 | 84 | #ifndef BFLOAT16 85 | #include 86 | typedef uint16_t bfloat16; 87 | #endif 88 | 89 | #ifdef OPENBLAS_USE64BITINT 90 | typedef BLASLONG blasint; 91 | #else 92 | typedef int blasint; 93 | #endif 94 | 95 | #if defined(XDOUBLE) || defined(DOUBLE) 96 | #define FLOATRET FLOAT 97 | #else 98 | #ifdef NEED_F2CCONV 99 | #define FLOATRET double 100 | #else 101 | #define FLOATRET float 102 | #endif 103 | #endif 104 | 105 | /* Inclusion of a standard header file is needed for definition of __STDC_* 106 | predefined macros with some compilers (e.g. GCC 4.7 on Linux). This occurs 107 | as a side effect of including either or . */ 108 | #include 109 | 110 | /* C99 supports complex floating numbers natively, which GCC also offers as an 111 | extension since version 3.0. If neither are available, use a compatible 112 | structure as fallback (see Clause 6.2.5.13 of the C99 standard). */ 113 | #if ((defined(__STDC_IEC_559_COMPLEX__) || __STDC_VERSION__ >= 199901L || \ 114 | (__GNUC__ >= 3 && !defined(__cplusplus))) && !(defined(FORCE_OPENBLAS_COMPLEX_STRUCT))) && !defined(_MSC_VER) 115 | #define OPENBLAS_COMPLEX_C99 116 | #ifndef __cplusplus 117 | #include 118 | #endif 119 | typedef float _Complex openblas_complex_float; 120 | typedef double _Complex openblas_complex_double; 121 | typedef xdouble _Complex openblas_complex_xdouble; 122 | #define openblas_make_complex_float(real, imag) ((real) + ((imag) * _Complex_I)) 123 | #define openblas_make_complex_double(real, imag) ((real) + ((imag) * _Complex_I)) 124 | #define openblas_make_complex_xdouble(real, imag) ((real) + ((imag) * _Complex_I)) 125 | #define openblas_complex_float_real(z) (creal(z)) 126 | #define openblas_complex_float_imag(z) (cimag(z)) 127 | #define openblas_complex_double_real(z) (creal(z)) 128 | #define openblas_complex_double_imag(z) (cimag(z)) 129 | #define openblas_complex_xdouble_real(z) (creal(z)) 130 | #define openblas_complex_xdouble_imag(z) (cimag(z)) 131 | #else 132 | #define OPENBLAS_COMPLEX_STRUCT 133 | typedef struct { float real, imag; } openblas_complex_float; 134 | typedef struct { double real, imag; } openblas_complex_double; 135 | typedef struct { xdouble real, imag; } openblas_complex_xdouble; 136 | #define openblas_make_complex_float(real, imag) {(real), (imag)} 137 | #define openblas_make_complex_double(real, imag) {(real), (imag)} 138 | #define openblas_make_complex_xdouble(real, imag) {(real), (imag)} 139 | #define openblas_complex_float_real(z) ((z).real) 140 | #define openblas_complex_float_imag(z) ((z).imag) 141 | #define openblas_complex_double_real(z) ((z).real) 142 | #define openblas_complex_double_imag(z) ((z).imag) 143 | #define openblas_complex_xdouble_real(z) ((z).real) 144 | #define openblas_complex_xdouble_imag(z) ((z).imag) 145 | #endif 146 | 147 | /* Inclusion of Linux-specific header is needed for definition of cpu_set_t. */ 148 | #ifdef OPENBLAS_OS_LINUX 149 | #include 150 | #endif 151 | #endif /* OPENBLAS_CONFIG_H */ 152 | -------------------------------------------------------------------------------- /include/ILP64/armv7l-linux-musleabihf/openblas_config.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENBLAS_CONFIG_H 2 | #define OPENBLAS_CONFIG_H 3 | #define OPENBLAS_OS_LINUX 1 4 | #define OPENBLAS_ARCH_ARM 1 5 | #define OPENBLAS_C_GCC 1 6 | #define OPENBLAS___32BIT__ 1 7 | #define OPENBLAS_PTHREAD_CREATE_FUNC pthread_create 8 | #define OPENBLAS_BUNDERSCORE _ 9 | #define OPENBLAS_NEEDBUNDERSCORE 1 10 | #define OPENBLAS_BARCELONA 11 | #define OPENBLAS_L1_CODE_SIZE 32768 12 | #define OPENBLAS_L1_CODE_ASSOCIATIVE 8 13 | #define OPENBLAS_L1_CODE_LINESIZE 64 14 | #define OPENBLAS_L1_DATA_SIZE 32768 15 | #define OPENBLAS_L1_DATA_ASSOCIATIVE 8 16 | #define OPENBLAS_L1_DATA_LINESIZE 64 17 | #define OPENBLAS_L2_SIZE 524288 18 | #define OPENBLAS_L2_ASSOCIATIVE 8 19 | #define OPENBLAS_L2_LINESIZE 64 20 | #define OPENBLAS_L3_SIZE 67108864 21 | #define OPENBLAS_L3_ASSOCIATIVE 9 22 | #define OPENBLAS_L3_LINESIZE 64 23 | #define OPENBLAS_ITB_SIZE 4096 24 | #define OPENBLAS_ITB_ASSOCIATIVE 0 25 | #define OPENBLAS_ITB_ENTRIES 64 26 | #define OPENBLAS_DTB_SIZE 4096 27 | #define OPENBLAS_DTB_ASSOCIATIVE 0 28 | #define OPENBLAS_DTB_DEFAULT_ENTRIES 64 29 | #define OPENBLAS_HAVE_CMOV 30 | #define OPENBLAS_HAVE_MMX 31 | #define OPENBLAS_HAVE_SSE 32 | #define OPENBLAS_HAVE_SSE2 33 | #define OPENBLAS_HAVE_SSE3 34 | #define OPENBLAS_HAVE_SSSE3 35 | #define OPENBLAS_HAVE_SSE4_1 36 | #define OPENBLAS_HAVE_SSE4_2 37 | #define OPENBLAS_HAVE_SSE4A 38 | #define OPENBLAS_HAVE_CFLUSH 39 | #define OPENBLAS_HAVE_MISALIGNSSE 40 | #define OPENBLAS_HAVE_FASTMOVU 41 | #define OPENBLAS_NUM_SHAREDCACHE 1 42 | #define OPENBLAS_NUM_CORES 1 43 | #define OPENBLAS_CORE_BARCELONA 44 | #define OPENBLAS_CHAR_CORENAME "BARCELONA" 45 | #define OPENBLAS_USE64BITINT 46 | #define OPENBLAS_GEMM_MULTITHREAD_THRESHOLD 4 47 | #define OPENBLAS_VERSION " OpenBLAS 0.3.13 " 48 | /*This is only for "make install" target.*/ 49 | 50 | #if defined(OPENBLAS_OS_WINNT) || defined(OPENBLAS_OS_CYGWIN_NT) || defined(OPENBLAS_OS_INTERIX) 51 | #define OPENBLAS_WINDOWS_ABI 52 | #define OPENBLAS_OS_WINDOWS 53 | 54 | #ifdef DOUBLE 55 | #define DOUBLE_DEFINED DOUBLE 56 | #undef DOUBLE 57 | #endif 58 | #endif 59 | 60 | #ifdef OPENBLAS_NEEDBUNDERSCORE 61 | #define BLASFUNC(FUNC) FUNC##_ 62 | #else 63 | #define BLASFUNC(FUNC) FUNC 64 | #endif 65 | 66 | #ifdef OPENBLAS_QUAD_PRECISION 67 | typedef struct { 68 | unsigned long x[2]; 69 | } xdouble; 70 | #elif defined OPENBLAS_EXPRECISION 71 | #define xdouble long double 72 | #else 73 | #define xdouble double 74 | #endif 75 | 76 | #if defined(OPENBLAS_OS_WINDOWS) && defined(OPENBLAS___64BIT__) 77 | typedef long long BLASLONG; 78 | typedef unsigned long long BLASULONG; 79 | #else 80 | typedef long BLASLONG; 81 | typedef unsigned long BLASULONG; 82 | #endif 83 | 84 | #ifndef BFLOAT16 85 | #include 86 | typedef uint16_t bfloat16; 87 | #endif 88 | 89 | #ifdef OPENBLAS_USE64BITINT 90 | typedef BLASLONG blasint; 91 | #else 92 | typedef int blasint; 93 | #endif 94 | 95 | #if defined(XDOUBLE) || defined(DOUBLE) 96 | #define FLOATRET FLOAT 97 | #else 98 | #ifdef NEED_F2CCONV 99 | #define FLOATRET double 100 | #else 101 | #define FLOATRET float 102 | #endif 103 | #endif 104 | 105 | /* Inclusion of a standard header file is needed for definition of __STDC_* 106 | predefined macros with some compilers (e.g. GCC 4.7 on Linux). This occurs 107 | as a side effect of including either or . */ 108 | #include 109 | 110 | /* C99 supports complex floating numbers natively, which GCC also offers as an 111 | extension since version 3.0. If neither are available, use a compatible 112 | structure as fallback (see Clause 6.2.5.13 of the C99 standard). */ 113 | #if ((defined(__STDC_IEC_559_COMPLEX__) || __STDC_VERSION__ >= 199901L || \ 114 | (__GNUC__ >= 3 && !defined(__cplusplus))) && !(defined(FORCE_OPENBLAS_COMPLEX_STRUCT))) && !defined(_MSC_VER) 115 | #define OPENBLAS_COMPLEX_C99 116 | #ifndef __cplusplus 117 | #include 118 | #endif 119 | typedef float _Complex openblas_complex_float; 120 | typedef double _Complex openblas_complex_double; 121 | typedef xdouble _Complex openblas_complex_xdouble; 122 | #define openblas_make_complex_float(real, imag) ((real) + ((imag) * _Complex_I)) 123 | #define openblas_make_complex_double(real, imag) ((real) + ((imag) * _Complex_I)) 124 | #define openblas_make_complex_xdouble(real, imag) ((real) + ((imag) * _Complex_I)) 125 | #define openblas_complex_float_real(z) (creal(z)) 126 | #define openblas_complex_float_imag(z) (cimag(z)) 127 | #define openblas_complex_double_real(z) (creal(z)) 128 | #define openblas_complex_double_imag(z) (cimag(z)) 129 | #define openblas_complex_xdouble_real(z) (creal(z)) 130 | #define openblas_complex_xdouble_imag(z) (cimag(z)) 131 | #else 132 | #define OPENBLAS_COMPLEX_STRUCT 133 | typedef struct { float real, imag; } openblas_complex_float; 134 | typedef struct { double real, imag; } openblas_complex_double; 135 | typedef struct { xdouble real, imag; } openblas_complex_xdouble; 136 | #define openblas_make_complex_float(real, imag) {(real), (imag)} 137 | #define openblas_make_complex_double(real, imag) {(real), (imag)} 138 | #define openblas_make_complex_xdouble(real, imag) {(real), (imag)} 139 | #define openblas_complex_float_real(z) ((z).real) 140 | #define openblas_complex_float_imag(z) ((z).imag) 141 | #define openblas_complex_double_real(z) ((z).real) 142 | #define openblas_complex_double_imag(z) ((z).imag) 143 | #define openblas_complex_xdouble_real(z) ((z).real) 144 | #define openblas_complex_xdouble_imag(z) ((z).imag) 145 | #endif 146 | 147 | /* Inclusion of Linux-specific header is needed for definition of cpu_set_t. */ 148 | #ifdef OPENBLAS_OS_LINUX 149 | #include 150 | #endif 151 | #endif /* OPENBLAS_CONFIG_H */ 152 | -------------------------------------------------------------------------------- /include/ILP64/aarch64-linux-gnu/openblas_config.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENBLAS_CONFIG_H 2 | #define OPENBLAS_CONFIG_H 3 | #define OPENBLAS_OS_LINUX 1 4 | #define OPENBLAS_ARCH_ARM64 1 5 | #define OPENBLAS_C_GCC 1 6 | #define OPENBLAS___64BIT__ 1 7 | #define OPENBLAS_PTHREAD_CREATE_FUNC pthread_create 8 | #define OPENBLAS_BUNDERSCORE _ 9 | #define OPENBLAS_NEEDBUNDERSCORE 1 10 | #define OPENBLAS_ZEN 11 | #define OPENBLAS_L1_CODE_SIZE 32768 12 | #define OPENBLAS_L1_CODE_ASSOCIATIVE 8 13 | #define OPENBLAS_L1_CODE_LINESIZE 64 14 | #define OPENBLAS_L1_DATA_SIZE 32768 15 | #define OPENBLAS_L1_DATA_ASSOCIATIVE 8 16 | #define OPENBLAS_L1_DATA_LINESIZE 64 17 | #define OPENBLAS_L2_SIZE 524288 18 | #define OPENBLAS_L2_ASSOCIATIVE 8 19 | #define OPENBLAS_L2_LINESIZE 64 20 | #define OPENBLAS_L3_SIZE 67108864 21 | #define OPENBLAS_L3_ASSOCIATIVE 9 22 | #define OPENBLAS_L3_LINESIZE 64 23 | #define OPENBLAS_ITB_SIZE 4096 24 | #define OPENBLAS_ITB_ASSOCIATIVE 0 25 | #define OPENBLAS_ITB_ENTRIES 64 26 | #define OPENBLAS_DTB_SIZE 4096 27 | #define OPENBLAS_DTB_ASSOCIATIVE 0 28 | #define OPENBLAS_DTB_DEFAULT_ENTRIES 64 29 | #define OPENBLAS_HAVE_CMOV 30 | #define OPENBLAS_HAVE_MMX 31 | #define OPENBLAS_HAVE_SSE 32 | #define OPENBLAS_HAVE_SSE2 33 | #define OPENBLAS_HAVE_SSE3 34 | #define OPENBLAS_HAVE_SSSE3 35 | #define OPENBLAS_HAVE_SSE4_1 36 | #define OPENBLAS_HAVE_SSE4_2 37 | #define OPENBLAS_HAVE_SSE4A 38 | #define OPENBLAS_HAVE_AVX 39 | #define OPENBLAS_HAVE_AVX2 40 | #define OPENBLAS_HAVE_FMA3 41 | #define OPENBLAS_HAVE_CFLUSH 42 | #define OPENBLAS_HAVE_MISALIGNSSE 43 | #define OPENBLAS_HAVE_FASTMOVU 44 | #define OPENBLAS_NUM_SHAREDCACHE 1 45 | #define OPENBLAS_NUM_CORES 1 46 | #define OPENBLAS_CORE_ZEN 47 | #define OPENBLAS_CHAR_CORENAME "ZEN" 48 | #define OPENBLAS_USE64BITINT 49 | #define OPENBLAS_GEMM_MULTITHREAD_THRESHOLD 4 50 | #define OPENBLAS_VERSION " OpenBLAS 0.3.13 " 51 | /*This is only for "make install" target.*/ 52 | 53 | #if defined(OPENBLAS_OS_WINNT) || defined(OPENBLAS_OS_CYGWIN_NT) || defined(OPENBLAS_OS_INTERIX) 54 | #define OPENBLAS_WINDOWS_ABI 55 | #define OPENBLAS_OS_WINDOWS 56 | 57 | #ifdef DOUBLE 58 | #define DOUBLE_DEFINED DOUBLE 59 | #undef DOUBLE 60 | #endif 61 | #endif 62 | 63 | #ifdef OPENBLAS_NEEDBUNDERSCORE 64 | #define BLASFUNC(FUNC) FUNC##_ 65 | #else 66 | #define BLASFUNC(FUNC) FUNC 67 | #endif 68 | 69 | #ifdef OPENBLAS_QUAD_PRECISION 70 | typedef struct { 71 | unsigned long x[2]; 72 | } xdouble; 73 | #elif defined OPENBLAS_EXPRECISION 74 | #define xdouble long double 75 | #else 76 | #define xdouble double 77 | #endif 78 | 79 | #if defined(OPENBLAS_OS_WINDOWS) && defined(OPENBLAS___64BIT__) 80 | typedef long long BLASLONG; 81 | typedef unsigned long long BLASULONG; 82 | #else 83 | typedef long BLASLONG; 84 | typedef unsigned long BLASULONG; 85 | #endif 86 | 87 | #ifndef BFLOAT16 88 | #include 89 | typedef uint16_t bfloat16; 90 | #endif 91 | 92 | #ifdef OPENBLAS_USE64BITINT 93 | typedef BLASLONG blasint; 94 | #else 95 | typedef int blasint; 96 | #endif 97 | 98 | #if defined(XDOUBLE) || defined(DOUBLE) 99 | #define FLOATRET FLOAT 100 | #else 101 | #ifdef NEED_F2CCONV 102 | #define FLOATRET double 103 | #else 104 | #define FLOATRET float 105 | #endif 106 | #endif 107 | 108 | /* Inclusion of a standard header file is needed for definition of __STDC_* 109 | predefined macros with some compilers (e.g. GCC 4.7 on Linux). This occurs 110 | as a side effect of including either or . */ 111 | #include 112 | 113 | /* C99 supports complex floating numbers natively, which GCC also offers as an 114 | extension since version 3.0. If neither are available, use a compatible 115 | structure as fallback (see Clause 6.2.5.13 of the C99 standard). */ 116 | #if ((defined(__STDC_IEC_559_COMPLEX__) || __STDC_VERSION__ >= 199901L || \ 117 | (__GNUC__ >= 3 && !defined(__cplusplus))) && !(defined(FORCE_OPENBLAS_COMPLEX_STRUCT))) && !defined(_MSC_VER) 118 | #define OPENBLAS_COMPLEX_C99 119 | #ifndef __cplusplus 120 | #include 121 | #endif 122 | typedef float _Complex openblas_complex_float; 123 | typedef double _Complex openblas_complex_double; 124 | typedef xdouble _Complex openblas_complex_xdouble; 125 | #define openblas_make_complex_float(real, imag) ((real) + ((imag) * _Complex_I)) 126 | #define openblas_make_complex_double(real, imag) ((real) + ((imag) * _Complex_I)) 127 | #define openblas_make_complex_xdouble(real, imag) ((real) + ((imag) * _Complex_I)) 128 | #define openblas_complex_float_real(z) (creal(z)) 129 | #define openblas_complex_float_imag(z) (cimag(z)) 130 | #define openblas_complex_double_real(z) (creal(z)) 131 | #define openblas_complex_double_imag(z) (cimag(z)) 132 | #define openblas_complex_xdouble_real(z) (creal(z)) 133 | #define openblas_complex_xdouble_imag(z) (cimag(z)) 134 | #else 135 | #define OPENBLAS_COMPLEX_STRUCT 136 | typedef struct { float real, imag; } openblas_complex_float; 137 | typedef struct { double real, imag; } openblas_complex_double; 138 | typedef struct { xdouble real, imag; } openblas_complex_xdouble; 139 | #define openblas_make_complex_float(real, imag) {(real), (imag)} 140 | #define openblas_make_complex_double(real, imag) {(real), (imag)} 141 | #define openblas_make_complex_xdouble(real, imag) {(real), (imag)} 142 | #define openblas_complex_float_real(z) ((z).real) 143 | #define openblas_complex_float_imag(z) ((z).imag) 144 | #define openblas_complex_double_real(z) ((z).real) 145 | #define openblas_complex_double_imag(z) ((z).imag) 146 | #define openblas_complex_xdouble_real(z) ((z).real) 147 | #define openblas_complex_xdouble_imag(z) ((z).imag) 148 | #endif 149 | 150 | /* Inclusion of Linux-specific header is needed for definition of cpu_set_t. */ 151 | #ifdef OPENBLAS_OS_LINUX 152 | #include 153 | #endif 154 | #endif /* OPENBLAS_CONFIG_H */ 155 | -------------------------------------------------------------------------------- /include/LP64/aarch64-linux-gnu/openblas_config.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENBLAS_CONFIG_H 2 | #define OPENBLAS_CONFIG_H 3 | #define OPENBLAS_OS_LINUX 1 4 | #define OPENBLAS_ARCH_ARM64 1 5 | #define OPENBLAS_C_GCC 1 6 | #define OPENBLAS___64BIT__ 1 7 | #define OPENBLAS_PTHREAD_CREATE_FUNC pthread_create 8 | #define OPENBLAS_BUNDERSCORE _ 9 | #define OPENBLAS_NEEDBUNDERSCORE 1 10 | #define OPENBLAS_ZEN 11 | #define OPENBLAS_L1_CODE_SIZE 32768 12 | #define OPENBLAS_L1_CODE_ASSOCIATIVE 8 13 | #define OPENBLAS_L1_CODE_LINESIZE 64 14 | #define OPENBLAS_L1_DATA_SIZE 32768 15 | #define OPENBLAS_L1_DATA_ASSOCIATIVE 8 16 | #define OPENBLAS_L1_DATA_LINESIZE 64 17 | #define OPENBLAS_L2_SIZE 524288 18 | #define OPENBLAS_L2_ASSOCIATIVE 8 19 | #define OPENBLAS_L2_LINESIZE 64 20 | #define OPENBLAS_L3_SIZE 67108864 21 | #define OPENBLAS_L3_ASSOCIATIVE 9 22 | #define OPENBLAS_L3_LINESIZE 64 23 | #define OPENBLAS_ITB_SIZE 4096 24 | #define OPENBLAS_ITB_ASSOCIATIVE 0 25 | #define OPENBLAS_ITB_ENTRIES 64 26 | #define OPENBLAS_DTB_SIZE 4096 27 | #define OPENBLAS_DTB_ASSOCIATIVE 0 28 | #define OPENBLAS_DTB_DEFAULT_ENTRIES 64 29 | #define OPENBLAS_HAVE_CMOV 30 | #define OPENBLAS_HAVE_MMX 31 | #define OPENBLAS_HAVE_SSE 32 | #define OPENBLAS_HAVE_SSE2 33 | #define OPENBLAS_HAVE_SSE3 34 | #define OPENBLAS_HAVE_SSSE3 35 | #define OPENBLAS_HAVE_SSE4_1 36 | #define OPENBLAS_HAVE_SSE4_2 37 | #define OPENBLAS_HAVE_SSE4A 38 | #define OPENBLAS_HAVE_AVX 39 | #define OPENBLAS_HAVE_AVX2 40 | #define OPENBLAS_HAVE_FMA3 41 | #define OPENBLAS_HAVE_CFLUSH 42 | #define OPENBLAS_HAVE_MISALIGNSSE 43 | #define OPENBLAS_HAVE_FASTMOVU 44 | #define OPENBLAS_NUM_SHAREDCACHE 1 45 | #define OPENBLAS_NUM_CORES 1 46 | #define OPENBLAS_CORE_ZEN 47 | #define OPENBLAS_CHAR_CORENAME "ZEN" 48 | #define OPENBLAS_USE64BITINT 49 | #define OPENBLAS_GEMM_MULTITHREAD_THRESHOLD 4 50 | #define OPENBLAS_VERSION " OpenBLAS 0.3.13 " 51 | /*This is only for "make install" target.*/ 52 | 53 | #if defined(OPENBLAS_OS_WINNT) || defined(OPENBLAS_OS_CYGWIN_NT) || defined(OPENBLAS_OS_INTERIX) 54 | #define OPENBLAS_WINDOWS_ABI 55 | #define OPENBLAS_OS_WINDOWS 56 | 57 | #ifdef DOUBLE 58 | #define DOUBLE_DEFINED DOUBLE 59 | #undef DOUBLE 60 | #endif 61 | #endif 62 | 63 | #ifdef OPENBLAS_NEEDBUNDERSCORE 64 | #define BLASFUNC(FUNC) FUNC##_ 65 | #else 66 | #define BLASFUNC(FUNC) FUNC 67 | #endif 68 | 69 | #ifdef OPENBLAS_QUAD_PRECISION 70 | typedef struct { 71 | unsigned long x[2]; 72 | } xdouble; 73 | #elif defined OPENBLAS_EXPRECISION 74 | #define xdouble long double 75 | #else 76 | #define xdouble double 77 | #endif 78 | 79 | #if defined(OPENBLAS_OS_WINDOWS) && defined(OPENBLAS___64BIT__) 80 | typedef long long BLASLONG; 81 | typedef unsigned long long BLASULONG; 82 | #else 83 | typedef long BLASLONG; 84 | typedef unsigned long BLASULONG; 85 | #endif 86 | 87 | #ifndef BFLOAT16 88 | #include 89 | typedef uint16_t bfloat16; 90 | #endif 91 | 92 | #ifdef OPENBLAS_USE64BITINT 93 | typedef BLASLONG blasint; 94 | #else 95 | typedef int blasint; 96 | #endif 97 | 98 | #if defined(XDOUBLE) || defined(DOUBLE) 99 | #define FLOATRET FLOAT 100 | #else 101 | #ifdef NEED_F2CCONV 102 | #define FLOATRET double 103 | #else 104 | #define FLOATRET float 105 | #endif 106 | #endif 107 | 108 | /* Inclusion of a standard header file is needed for definition of __STDC_* 109 | predefined macros with some compilers (e.g. GCC 4.7 on Linux). This occurs 110 | as a side effect of including either or . */ 111 | #include 112 | 113 | /* C99 supports complex floating numbers natively, which GCC also offers as an 114 | extension since version 3.0. If neither are available, use a compatible 115 | structure as fallback (see Clause 6.2.5.13 of the C99 standard). */ 116 | #if ((defined(__STDC_IEC_559_COMPLEX__) || __STDC_VERSION__ >= 199901L || \ 117 | (__GNUC__ >= 3 && !defined(__cplusplus))) && !(defined(FORCE_OPENBLAS_COMPLEX_STRUCT))) && !defined(_MSC_VER) 118 | #define OPENBLAS_COMPLEX_C99 119 | #ifndef __cplusplus 120 | #include 121 | #endif 122 | typedef float _Complex openblas_complex_float; 123 | typedef double _Complex openblas_complex_double; 124 | typedef xdouble _Complex openblas_complex_xdouble; 125 | #define openblas_make_complex_float(real, imag) ((real) + ((imag) * _Complex_I)) 126 | #define openblas_make_complex_double(real, imag) ((real) + ((imag) * _Complex_I)) 127 | #define openblas_make_complex_xdouble(real, imag) ((real) + ((imag) * _Complex_I)) 128 | #define openblas_complex_float_real(z) (creal(z)) 129 | #define openblas_complex_float_imag(z) (cimag(z)) 130 | #define openblas_complex_double_real(z) (creal(z)) 131 | #define openblas_complex_double_imag(z) (cimag(z)) 132 | #define openblas_complex_xdouble_real(z) (creal(z)) 133 | #define openblas_complex_xdouble_imag(z) (cimag(z)) 134 | #else 135 | #define OPENBLAS_COMPLEX_STRUCT 136 | typedef struct { float real, imag; } openblas_complex_float; 137 | typedef struct { double real, imag; } openblas_complex_double; 138 | typedef struct { xdouble real, imag; } openblas_complex_xdouble; 139 | #define openblas_make_complex_float(real, imag) {(real), (imag)} 140 | #define openblas_make_complex_double(real, imag) {(real), (imag)} 141 | #define openblas_make_complex_xdouble(real, imag) {(real), (imag)} 142 | #define openblas_complex_float_real(z) ((z).real) 143 | #define openblas_complex_float_imag(z) ((z).imag) 144 | #define openblas_complex_double_real(z) ((z).real) 145 | #define openblas_complex_double_imag(z) ((z).imag) 146 | #define openblas_complex_xdouble_real(z) ((z).real) 147 | #define openblas_complex_xdouble_imag(z) ((z).imag) 148 | #endif 149 | 150 | /* Inclusion of Linux-specific header is needed for definition of cpu_set_t. */ 151 | #ifdef OPENBLAS_OS_LINUX 152 | #include 153 | #endif 154 | #endif /* OPENBLAS_CONFIG_H */ 155 | -------------------------------------------------------------------------------- /include/LP64/aarch64-linux-musl/openblas_config.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENBLAS_CONFIG_H 2 | #define OPENBLAS_CONFIG_H 3 | #define OPENBLAS_OS_LINUX 1 4 | #define OPENBLAS_ARCH_ARM64 1 5 | #define OPENBLAS_C_GCC 1 6 | #define OPENBLAS___64BIT__ 1 7 | #define OPENBLAS_PTHREAD_CREATE_FUNC pthread_create 8 | #define OPENBLAS_BUNDERSCORE _ 9 | #define OPENBLAS_NEEDBUNDERSCORE 1 10 | #define OPENBLAS_ZEN 11 | #define OPENBLAS_L1_CODE_SIZE 32768 12 | #define OPENBLAS_L1_CODE_ASSOCIATIVE 8 13 | #define OPENBLAS_L1_CODE_LINESIZE 64 14 | #define OPENBLAS_L1_DATA_SIZE 32768 15 | #define OPENBLAS_L1_DATA_ASSOCIATIVE 8 16 | #define OPENBLAS_L1_DATA_LINESIZE 64 17 | #define OPENBLAS_L2_SIZE 524288 18 | #define OPENBLAS_L2_ASSOCIATIVE 8 19 | #define OPENBLAS_L2_LINESIZE 64 20 | #define OPENBLAS_L3_SIZE 67108864 21 | #define OPENBLAS_L3_ASSOCIATIVE 9 22 | #define OPENBLAS_L3_LINESIZE 64 23 | #define OPENBLAS_ITB_SIZE 4096 24 | #define OPENBLAS_ITB_ASSOCIATIVE 0 25 | #define OPENBLAS_ITB_ENTRIES 64 26 | #define OPENBLAS_DTB_SIZE 4096 27 | #define OPENBLAS_DTB_ASSOCIATIVE 0 28 | #define OPENBLAS_DTB_DEFAULT_ENTRIES 64 29 | #define OPENBLAS_HAVE_CMOV 30 | #define OPENBLAS_HAVE_MMX 31 | #define OPENBLAS_HAVE_SSE 32 | #define OPENBLAS_HAVE_SSE2 33 | #define OPENBLAS_HAVE_SSE3 34 | #define OPENBLAS_HAVE_SSSE3 35 | #define OPENBLAS_HAVE_SSE4_1 36 | #define OPENBLAS_HAVE_SSE4_2 37 | #define OPENBLAS_HAVE_SSE4A 38 | #define OPENBLAS_HAVE_AVX 39 | #define OPENBLAS_HAVE_AVX2 40 | #define OPENBLAS_HAVE_FMA3 41 | #define OPENBLAS_HAVE_CFLUSH 42 | #define OPENBLAS_HAVE_MISALIGNSSE 43 | #define OPENBLAS_HAVE_FASTMOVU 44 | #define OPENBLAS_NUM_SHAREDCACHE 1 45 | #define OPENBLAS_NUM_CORES 1 46 | #define OPENBLAS_CORE_ZEN 47 | #define OPENBLAS_CHAR_CORENAME "ZEN" 48 | #define OPENBLAS_USE64BITINT 49 | #define OPENBLAS_GEMM_MULTITHREAD_THRESHOLD 4 50 | #define OPENBLAS_VERSION " OpenBLAS 0.3.13 " 51 | /*This is only for "make install" target.*/ 52 | 53 | #if defined(OPENBLAS_OS_WINNT) || defined(OPENBLAS_OS_CYGWIN_NT) || defined(OPENBLAS_OS_INTERIX) 54 | #define OPENBLAS_WINDOWS_ABI 55 | #define OPENBLAS_OS_WINDOWS 56 | 57 | #ifdef DOUBLE 58 | #define DOUBLE_DEFINED DOUBLE 59 | #undef DOUBLE 60 | #endif 61 | #endif 62 | 63 | #ifdef OPENBLAS_NEEDBUNDERSCORE 64 | #define BLASFUNC(FUNC) FUNC##_ 65 | #else 66 | #define BLASFUNC(FUNC) FUNC 67 | #endif 68 | 69 | #ifdef OPENBLAS_QUAD_PRECISION 70 | typedef struct { 71 | unsigned long x[2]; 72 | } xdouble; 73 | #elif defined OPENBLAS_EXPRECISION 74 | #define xdouble long double 75 | #else 76 | #define xdouble double 77 | #endif 78 | 79 | #if defined(OPENBLAS_OS_WINDOWS) && defined(OPENBLAS___64BIT__) 80 | typedef long long BLASLONG; 81 | typedef unsigned long long BLASULONG; 82 | #else 83 | typedef long BLASLONG; 84 | typedef unsigned long BLASULONG; 85 | #endif 86 | 87 | #ifndef BFLOAT16 88 | #include 89 | typedef uint16_t bfloat16; 90 | #endif 91 | 92 | #ifdef OPENBLAS_USE64BITINT 93 | typedef BLASLONG blasint; 94 | #else 95 | typedef int blasint; 96 | #endif 97 | 98 | #if defined(XDOUBLE) || defined(DOUBLE) 99 | #define FLOATRET FLOAT 100 | #else 101 | #ifdef NEED_F2CCONV 102 | #define FLOATRET double 103 | #else 104 | #define FLOATRET float 105 | #endif 106 | #endif 107 | 108 | /* Inclusion of a standard header file is needed for definition of __STDC_* 109 | predefined macros with some compilers (e.g. GCC 4.7 on Linux). This occurs 110 | as a side effect of including either or . */ 111 | #include 112 | 113 | /* C99 supports complex floating numbers natively, which GCC also offers as an 114 | extension since version 3.0. If neither are available, use a compatible 115 | structure as fallback (see Clause 6.2.5.13 of the C99 standard). */ 116 | #if ((defined(__STDC_IEC_559_COMPLEX__) || __STDC_VERSION__ >= 199901L || \ 117 | (__GNUC__ >= 3 && !defined(__cplusplus))) && !(defined(FORCE_OPENBLAS_COMPLEX_STRUCT))) && !defined(_MSC_VER) 118 | #define OPENBLAS_COMPLEX_C99 119 | #ifndef __cplusplus 120 | #include 121 | #endif 122 | typedef float _Complex openblas_complex_float; 123 | typedef double _Complex openblas_complex_double; 124 | typedef xdouble _Complex openblas_complex_xdouble; 125 | #define openblas_make_complex_float(real, imag) ((real) + ((imag) * _Complex_I)) 126 | #define openblas_make_complex_double(real, imag) ((real) + ((imag) * _Complex_I)) 127 | #define openblas_make_complex_xdouble(real, imag) ((real) + ((imag) * _Complex_I)) 128 | #define openblas_complex_float_real(z) (creal(z)) 129 | #define openblas_complex_float_imag(z) (cimag(z)) 130 | #define openblas_complex_double_real(z) (creal(z)) 131 | #define openblas_complex_double_imag(z) (cimag(z)) 132 | #define openblas_complex_xdouble_real(z) (creal(z)) 133 | #define openblas_complex_xdouble_imag(z) (cimag(z)) 134 | #else 135 | #define OPENBLAS_COMPLEX_STRUCT 136 | typedef struct { float real, imag; } openblas_complex_float; 137 | typedef struct { double real, imag; } openblas_complex_double; 138 | typedef struct { xdouble real, imag; } openblas_complex_xdouble; 139 | #define openblas_make_complex_float(real, imag) {(real), (imag)} 140 | #define openblas_make_complex_double(real, imag) {(real), (imag)} 141 | #define openblas_make_complex_xdouble(real, imag) {(real), (imag)} 142 | #define openblas_complex_float_real(z) ((z).real) 143 | #define openblas_complex_float_imag(z) ((z).imag) 144 | #define openblas_complex_double_real(z) ((z).real) 145 | #define openblas_complex_double_imag(z) ((z).imag) 146 | #define openblas_complex_xdouble_real(z) ((z).real) 147 | #define openblas_complex_xdouble_imag(z) ((z).imag) 148 | #endif 149 | 150 | /* Inclusion of Linux-specific header is needed for definition of cpu_set_t. */ 151 | #ifdef OPENBLAS_OS_LINUX 152 | #include 153 | #endif 154 | #endif /* OPENBLAS_CONFIG_H */ 155 | -------------------------------------------------------------------------------- /include/ILP64/aarch64-linux-musl/openblas_config.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENBLAS_CONFIG_H 2 | #define OPENBLAS_CONFIG_H 3 | #define OPENBLAS_OS_LINUX 1 4 | #define OPENBLAS_ARCH_ARM64 1 5 | #define OPENBLAS_C_GCC 1 6 | #define OPENBLAS___64BIT__ 1 7 | #define OPENBLAS_PTHREAD_CREATE_FUNC pthread_create 8 | #define OPENBLAS_BUNDERSCORE _ 9 | #define OPENBLAS_NEEDBUNDERSCORE 1 10 | #define OPENBLAS_ZEN 11 | #define OPENBLAS_L1_CODE_SIZE 32768 12 | #define OPENBLAS_L1_CODE_ASSOCIATIVE 8 13 | #define OPENBLAS_L1_CODE_LINESIZE 64 14 | #define OPENBLAS_L1_DATA_SIZE 32768 15 | #define OPENBLAS_L1_DATA_ASSOCIATIVE 8 16 | #define OPENBLAS_L1_DATA_LINESIZE 64 17 | #define OPENBLAS_L2_SIZE 524288 18 | #define OPENBLAS_L2_ASSOCIATIVE 8 19 | #define OPENBLAS_L2_LINESIZE 64 20 | #define OPENBLAS_L3_SIZE 67108864 21 | #define OPENBLAS_L3_ASSOCIATIVE 9 22 | #define OPENBLAS_L3_LINESIZE 64 23 | #define OPENBLAS_ITB_SIZE 4096 24 | #define OPENBLAS_ITB_ASSOCIATIVE 0 25 | #define OPENBLAS_ITB_ENTRIES 64 26 | #define OPENBLAS_DTB_SIZE 4096 27 | #define OPENBLAS_DTB_ASSOCIATIVE 0 28 | #define OPENBLAS_DTB_DEFAULT_ENTRIES 64 29 | #define OPENBLAS_HAVE_CMOV 30 | #define OPENBLAS_HAVE_MMX 31 | #define OPENBLAS_HAVE_SSE 32 | #define OPENBLAS_HAVE_SSE2 33 | #define OPENBLAS_HAVE_SSE3 34 | #define OPENBLAS_HAVE_SSSE3 35 | #define OPENBLAS_HAVE_SSE4_1 36 | #define OPENBLAS_HAVE_SSE4_2 37 | #define OPENBLAS_HAVE_SSE4A 38 | #define OPENBLAS_HAVE_AVX 39 | #define OPENBLAS_HAVE_AVX2 40 | #define OPENBLAS_HAVE_FMA3 41 | #define OPENBLAS_HAVE_CFLUSH 42 | #define OPENBLAS_HAVE_MISALIGNSSE 43 | #define OPENBLAS_HAVE_FASTMOVU 44 | #define OPENBLAS_NUM_SHAREDCACHE 1 45 | #define OPENBLAS_NUM_CORES 1 46 | #define OPENBLAS_CORE_ZEN 47 | #define OPENBLAS_CHAR_CORENAME "ZEN" 48 | #define OPENBLAS_USE64BITINT 49 | #define OPENBLAS_GEMM_MULTITHREAD_THRESHOLD 4 50 | #define OPENBLAS_VERSION " OpenBLAS 0.3.13 " 51 | /*This is only for "make install" target.*/ 52 | 53 | #if defined(OPENBLAS_OS_WINNT) || defined(OPENBLAS_OS_CYGWIN_NT) || defined(OPENBLAS_OS_INTERIX) 54 | #define OPENBLAS_WINDOWS_ABI 55 | #define OPENBLAS_OS_WINDOWS 56 | 57 | #ifdef DOUBLE 58 | #define DOUBLE_DEFINED DOUBLE 59 | #undef DOUBLE 60 | #endif 61 | #endif 62 | 63 | #ifdef OPENBLAS_NEEDBUNDERSCORE 64 | #define BLASFUNC(FUNC) FUNC##_ 65 | #else 66 | #define BLASFUNC(FUNC) FUNC 67 | #endif 68 | 69 | #ifdef OPENBLAS_QUAD_PRECISION 70 | typedef struct { 71 | unsigned long x[2]; 72 | } xdouble; 73 | #elif defined OPENBLAS_EXPRECISION 74 | #define xdouble long double 75 | #else 76 | #define xdouble double 77 | #endif 78 | 79 | #if defined(OPENBLAS_OS_WINDOWS) && defined(OPENBLAS___64BIT__) 80 | typedef long long BLASLONG; 81 | typedef unsigned long long BLASULONG; 82 | #else 83 | typedef long BLASLONG; 84 | typedef unsigned long BLASULONG; 85 | #endif 86 | 87 | #ifndef BFLOAT16 88 | #include 89 | typedef uint16_t bfloat16; 90 | #endif 91 | 92 | #ifdef OPENBLAS_USE64BITINT 93 | typedef BLASLONG blasint; 94 | #else 95 | typedef int blasint; 96 | #endif 97 | 98 | #if defined(XDOUBLE) || defined(DOUBLE) 99 | #define FLOATRET FLOAT 100 | #else 101 | #ifdef NEED_F2CCONV 102 | #define FLOATRET double 103 | #else 104 | #define FLOATRET float 105 | #endif 106 | #endif 107 | 108 | /* Inclusion of a standard header file is needed for definition of __STDC_* 109 | predefined macros with some compilers (e.g. GCC 4.7 on Linux). This occurs 110 | as a side effect of including either or . */ 111 | #include 112 | 113 | /* C99 supports complex floating numbers natively, which GCC also offers as an 114 | extension since version 3.0. If neither are available, use a compatible 115 | structure as fallback (see Clause 6.2.5.13 of the C99 standard). */ 116 | #if ((defined(__STDC_IEC_559_COMPLEX__) || __STDC_VERSION__ >= 199901L || \ 117 | (__GNUC__ >= 3 && !defined(__cplusplus))) && !(defined(FORCE_OPENBLAS_COMPLEX_STRUCT))) && !defined(_MSC_VER) 118 | #define OPENBLAS_COMPLEX_C99 119 | #ifndef __cplusplus 120 | #include 121 | #endif 122 | typedef float _Complex openblas_complex_float; 123 | typedef double _Complex openblas_complex_double; 124 | typedef xdouble _Complex openblas_complex_xdouble; 125 | #define openblas_make_complex_float(real, imag) ((real) + ((imag) * _Complex_I)) 126 | #define openblas_make_complex_double(real, imag) ((real) + ((imag) * _Complex_I)) 127 | #define openblas_make_complex_xdouble(real, imag) ((real) + ((imag) * _Complex_I)) 128 | #define openblas_complex_float_real(z) (creal(z)) 129 | #define openblas_complex_float_imag(z) (cimag(z)) 130 | #define openblas_complex_double_real(z) (creal(z)) 131 | #define openblas_complex_double_imag(z) (cimag(z)) 132 | #define openblas_complex_xdouble_real(z) (creal(z)) 133 | #define openblas_complex_xdouble_imag(z) (cimag(z)) 134 | #else 135 | #define OPENBLAS_COMPLEX_STRUCT 136 | typedef struct { float real, imag; } openblas_complex_float; 137 | typedef struct { double real, imag; } openblas_complex_double; 138 | typedef struct { xdouble real, imag; } openblas_complex_xdouble; 139 | #define openblas_make_complex_float(real, imag) {(real), (imag)} 140 | #define openblas_make_complex_double(real, imag) {(real), (imag)} 141 | #define openblas_make_complex_xdouble(real, imag) {(real), (imag)} 142 | #define openblas_complex_float_real(z) ((z).real) 143 | #define openblas_complex_float_imag(z) ((z).imag) 144 | #define openblas_complex_double_real(z) ((z).real) 145 | #define openblas_complex_double_imag(z) ((z).imag) 146 | #define openblas_complex_xdouble_real(z) ((z).real) 147 | #define openblas_complex_xdouble_imag(z) ((z).imag) 148 | #endif 149 | 150 | /* Inclusion of Linux-specific header is needed for definition of cpu_set_t. */ 151 | #ifdef OPENBLAS_OS_LINUX 152 | #include 153 | #endif 154 | #endif /* OPENBLAS_CONFIG_H */ 155 | -------------------------------------------------------------------------------- /include/ILP64/powerpc64le-linux-gnu/openblas_config.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENBLAS_CONFIG_H 2 | #define OPENBLAS_CONFIG_H 3 | #define OPENBLAS_OS_LINUX 1 4 | #define OPENBLAS_ARCH_POWER 1 5 | #define OPENBLAS_C_GCC 1 6 | #define OPENBLAS___64BIT__ 1 7 | #define OPENBLAS_PTHREAD_CREATE_FUNC pthread_create 8 | #define OPENBLAS_BUNDERSCORE _ 9 | #define OPENBLAS_NEEDBUNDERSCORE 1 10 | #define OPENBLAS_ZEN 11 | #define OPENBLAS_L1_CODE_SIZE 32768 12 | #define OPENBLAS_L1_CODE_ASSOCIATIVE 8 13 | #define OPENBLAS_L1_CODE_LINESIZE 64 14 | #define OPENBLAS_L1_DATA_SIZE 32768 15 | #define OPENBLAS_L1_DATA_ASSOCIATIVE 8 16 | #define OPENBLAS_L1_DATA_LINESIZE 64 17 | #define OPENBLAS_L2_SIZE 524288 18 | #define OPENBLAS_L2_ASSOCIATIVE 8 19 | #define OPENBLAS_L2_LINESIZE 64 20 | #define OPENBLAS_L3_SIZE 67108864 21 | #define OPENBLAS_L3_ASSOCIATIVE 9 22 | #define OPENBLAS_L3_LINESIZE 64 23 | #define OPENBLAS_ITB_SIZE 4096 24 | #define OPENBLAS_ITB_ASSOCIATIVE 0 25 | #define OPENBLAS_ITB_ENTRIES 64 26 | #define OPENBLAS_DTB_SIZE 4096 27 | #define OPENBLAS_DTB_ASSOCIATIVE 0 28 | #define OPENBLAS_DTB_DEFAULT_ENTRIES 64 29 | #define OPENBLAS_HAVE_CMOV 30 | #define OPENBLAS_HAVE_MMX 31 | #define OPENBLAS_HAVE_SSE 32 | #define OPENBLAS_HAVE_SSE2 33 | #define OPENBLAS_HAVE_SSE3 34 | #define OPENBLAS_HAVE_SSSE3 35 | #define OPENBLAS_HAVE_SSE4_1 36 | #define OPENBLAS_HAVE_SSE4_2 37 | #define OPENBLAS_HAVE_SSE4A 38 | #define OPENBLAS_HAVE_AVX 39 | #define OPENBLAS_HAVE_AVX2 40 | #define OPENBLAS_HAVE_FMA3 41 | #define OPENBLAS_HAVE_CFLUSH 42 | #define OPENBLAS_HAVE_MISALIGNSSE 43 | #define OPENBLAS_HAVE_FASTMOVU 44 | #define OPENBLAS_NUM_SHAREDCACHE 1 45 | #define OPENBLAS_NUM_CORES 1 46 | #define OPENBLAS_CORE_ZEN 47 | #define OPENBLAS_CHAR_CORENAME "ZEN" 48 | #define OPENBLAS_USE64BITINT 49 | #define OPENBLAS_GEMM_MULTITHREAD_THRESHOLD 4 50 | #define OPENBLAS_VERSION " OpenBLAS 0.3.13 " 51 | /*This is only for "make install" target.*/ 52 | 53 | #if defined(OPENBLAS_OS_WINNT) || defined(OPENBLAS_OS_CYGWIN_NT) || defined(OPENBLAS_OS_INTERIX) 54 | #define OPENBLAS_WINDOWS_ABI 55 | #define OPENBLAS_OS_WINDOWS 56 | 57 | #ifdef DOUBLE 58 | #define DOUBLE_DEFINED DOUBLE 59 | #undef DOUBLE 60 | #endif 61 | #endif 62 | 63 | #ifdef OPENBLAS_NEEDBUNDERSCORE 64 | #define BLASFUNC(FUNC) FUNC##_ 65 | #else 66 | #define BLASFUNC(FUNC) FUNC 67 | #endif 68 | 69 | #ifdef OPENBLAS_QUAD_PRECISION 70 | typedef struct { 71 | unsigned long x[2]; 72 | } xdouble; 73 | #elif defined OPENBLAS_EXPRECISION 74 | #define xdouble long double 75 | #else 76 | #define xdouble double 77 | #endif 78 | 79 | #if defined(OPENBLAS_OS_WINDOWS) && defined(OPENBLAS___64BIT__) 80 | typedef long long BLASLONG; 81 | typedef unsigned long long BLASULONG; 82 | #else 83 | typedef long BLASLONG; 84 | typedef unsigned long BLASULONG; 85 | #endif 86 | 87 | #ifndef BFLOAT16 88 | #include 89 | typedef uint16_t bfloat16; 90 | #endif 91 | 92 | #ifdef OPENBLAS_USE64BITINT 93 | typedef BLASLONG blasint; 94 | #else 95 | typedef int blasint; 96 | #endif 97 | 98 | #if defined(XDOUBLE) || defined(DOUBLE) 99 | #define FLOATRET FLOAT 100 | #else 101 | #ifdef NEED_F2CCONV 102 | #define FLOATRET double 103 | #else 104 | #define FLOATRET float 105 | #endif 106 | #endif 107 | 108 | /* Inclusion of a standard header file is needed for definition of __STDC_* 109 | predefined macros with some compilers (e.g. GCC 4.7 on Linux). This occurs 110 | as a side effect of including either or . */ 111 | #include 112 | 113 | /* C99 supports complex floating numbers natively, which GCC also offers as an 114 | extension since version 3.0. If neither are available, use a compatible 115 | structure as fallback (see Clause 6.2.5.13 of the C99 standard). */ 116 | #if ((defined(__STDC_IEC_559_COMPLEX__) || __STDC_VERSION__ >= 199901L || \ 117 | (__GNUC__ >= 3 && !defined(__cplusplus))) && !(defined(FORCE_OPENBLAS_COMPLEX_STRUCT))) && !defined(_MSC_VER) 118 | #define OPENBLAS_COMPLEX_C99 119 | #ifndef __cplusplus 120 | #include 121 | #endif 122 | typedef float _Complex openblas_complex_float; 123 | typedef double _Complex openblas_complex_double; 124 | typedef xdouble _Complex openblas_complex_xdouble; 125 | #define openblas_make_complex_float(real, imag) ((real) + ((imag) * _Complex_I)) 126 | #define openblas_make_complex_double(real, imag) ((real) + ((imag) * _Complex_I)) 127 | #define openblas_make_complex_xdouble(real, imag) ((real) + ((imag) * _Complex_I)) 128 | #define openblas_complex_float_real(z) (creal(z)) 129 | #define openblas_complex_float_imag(z) (cimag(z)) 130 | #define openblas_complex_double_real(z) (creal(z)) 131 | #define openblas_complex_double_imag(z) (cimag(z)) 132 | #define openblas_complex_xdouble_real(z) (creal(z)) 133 | #define openblas_complex_xdouble_imag(z) (cimag(z)) 134 | #else 135 | #define OPENBLAS_COMPLEX_STRUCT 136 | typedef struct { float real, imag; } openblas_complex_float; 137 | typedef struct { double real, imag; } openblas_complex_double; 138 | typedef struct { xdouble real, imag; } openblas_complex_xdouble; 139 | #define openblas_make_complex_float(real, imag) {(real), (imag)} 140 | #define openblas_make_complex_double(real, imag) {(real), (imag)} 141 | #define openblas_make_complex_xdouble(real, imag) {(real), (imag)} 142 | #define openblas_complex_float_real(z) ((z).real) 143 | #define openblas_complex_float_imag(z) ((z).imag) 144 | #define openblas_complex_double_real(z) ((z).real) 145 | #define openblas_complex_double_imag(z) ((z).imag) 146 | #define openblas_complex_xdouble_real(z) ((z).real) 147 | #define openblas_complex_xdouble_imag(z) ((z).imag) 148 | #endif 149 | 150 | /* Inclusion of Linux-specific header is needed for definition of cpu_set_t. */ 151 | #ifdef OPENBLAS_OS_LINUX 152 | #include 153 | #endif 154 | #endif /* OPENBLAS_CONFIG_H */ 155 | -------------------------------------------------------------------------------- /include/ILP64/riscv64-linux-gnu/openblas_config.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENBLAS_CONFIG_H 2 | #define OPENBLAS_CONFIG_H 3 | #define OPENBLAS_OS_LINUX 1 4 | #define OPENBLAS_ARCH_RISCV64 1 5 | #define OPENBLAS_C_GCC 1 6 | #define OPENBLAS___64BIT__ 1 7 | #define OPENBLAS_PTHREAD_CREATE_FUNC pthread_create 8 | #define OPENBLAS_BUNDERSCORE _ 9 | #define OPENBLAS_NEEDBUNDERSCORE 1 10 | #define OPENBLAS_ZEN 11 | #define OPENBLAS_L1_CODE_SIZE 32768 12 | #define OPENBLAS_L1_CODE_ASSOCIATIVE 8 13 | #define OPENBLAS_L1_CODE_LINESIZE 64 14 | #define OPENBLAS_L1_DATA_SIZE 32768 15 | #define OPENBLAS_L1_DATA_ASSOCIATIVE 8 16 | #define OPENBLAS_L1_DATA_LINESIZE 64 17 | #define OPENBLAS_L2_SIZE 524288 18 | #define OPENBLAS_L2_ASSOCIATIVE 8 19 | #define OPENBLAS_L2_LINESIZE 64 20 | #define OPENBLAS_L3_SIZE 67108864 21 | #define OPENBLAS_L3_ASSOCIATIVE 9 22 | #define OPENBLAS_L3_LINESIZE 64 23 | #define OPENBLAS_ITB_SIZE 4096 24 | #define OPENBLAS_ITB_ASSOCIATIVE 0 25 | #define OPENBLAS_ITB_ENTRIES 64 26 | #define OPENBLAS_DTB_SIZE 4096 27 | #define OPENBLAS_DTB_ASSOCIATIVE 0 28 | #define OPENBLAS_DTB_DEFAULT_ENTRIES 64 29 | #define OPENBLAS_HAVE_CMOV 30 | #define OPENBLAS_HAVE_MMX 31 | #define OPENBLAS_HAVE_SSE 32 | #define OPENBLAS_HAVE_SSE2 33 | #define OPENBLAS_HAVE_SSE3 34 | #define OPENBLAS_HAVE_SSSE3 35 | #define OPENBLAS_HAVE_SSE4_1 36 | #define OPENBLAS_HAVE_SSE4_2 37 | #define OPENBLAS_HAVE_SSE4A 38 | #define OPENBLAS_HAVE_AVX 39 | #define OPENBLAS_HAVE_AVX2 40 | #define OPENBLAS_HAVE_FMA3 41 | #define OPENBLAS_HAVE_CFLUSH 42 | #define OPENBLAS_HAVE_MISALIGNSSE 43 | #define OPENBLAS_HAVE_FASTMOVU 44 | #define OPENBLAS_NUM_SHAREDCACHE 1 45 | #define OPENBLAS_NUM_CORES 1 46 | #define OPENBLAS_CORE_ZEN 47 | #define OPENBLAS_CHAR_CORENAME "ZEN" 48 | #define OPENBLAS_USE64BITINT 49 | #define OPENBLAS_GEMM_MULTITHREAD_THRESHOLD 4 50 | #define OPENBLAS_VERSION " OpenBLAS 0.3.13 " 51 | /*This is only for "make install" target.*/ 52 | 53 | #if defined(OPENBLAS_OS_WINNT) || defined(OPENBLAS_OS_CYGWIN_NT) || defined(OPENBLAS_OS_INTERIX) 54 | #define OPENBLAS_WINDOWS_ABI 55 | #define OPENBLAS_OS_WINDOWS 56 | 57 | #ifdef DOUBLE 58 | #define DOUBLE_DEFINED DOUBLE 59 | #undef DOUBLE 60 | #endif 61 | #endif 62 | 63 | #ifdef OPENBLAS_NEEDBUNDERSCORE 64 | #define BLASFUNC(FUNC) FUNC##_ 65 | #else 66 | #define BLASFUNC(FUNC) FUNC 67 | #endif 68 | 69 | #ifdef OPENBLAS_QUAD_PRECISION 70 | typedef struct { 71 | unsigned long x[2]; 72 | } xdouble; 73 | #elif defined OPENBLAS_EXPRECISION 74 | #define xdouble long double 75 | #else 76 | #define xdouble double 77 | #endif 78 | 79 | #if defined(OPENBLAS_OS_WINDOWS) && defined(OPENBLAS___64BIT__) 80 | typedef long long BLASLONG; 81 | typedef unsigned long long BLASULONG; 82 | #else 83 | typedef long BLASLONG; 84 | typedef unsigned long BLASULONG; 85 | #endif 86 | 87 | #ifndef BFLOAT16 88 | #include 89 | typedef uint16_t bfloat16; 90 | #endif 91 | 92 | #ifdef OPENBLAS_USE64BITINT 93 | typedef BLASLONG blasint; 94 | #else 95 | typedef int blasint; 96 | #endif 97 | 98 | #if defined(XDOUBLE) || defined(DOUBLE) 99 | #define FLOATRET FLOAT 100 | #else 101 | #ifdef NEED_F2CCONV 102 | #define FLOATRET double 103 | #else 104 | #define FLOATRET float 105 | #endif 106 | #endif 107 | 108 | /* Inclusion of a standard header file is needed for definition of __STDC_* 109 | predefined macros with some compilers (e.g. GCC 4.7 on Linux). This occurs 110 | as a side effect of including either or . */ 111 | #include 112 | 113 | /* C99 supports complex floating numbers natively, which GCC also offers as an 114 | extension since version 3.0. If neither are available, use a compatible 115 | structure as fallback (see Clause 6.2.5.13 of the C99 standard). */ 116 | #if ((defined(__STDC_IEC_559_COMPLEX__) || __STDC_VERSION__ >= 199901L || \ 117 | (__GNUC__ >= 3 && !defined(__cplusplus))) && !(defined(FORCE_OPENBLAS_COMPLEX_STRUCT))) && !defined(_MSC_VER) 118 | #define OPENBLAS_COMPLEX_C99 119 | #ifndef __cplusplus 120 | #include 121 | #endif 122 | typedef float _Complex openblas_complex_float; 123 | typedef double _Complex openblas_complex_double; 124 | typedef xdouble _Complex openblas_complex_xdouble; 125 | #define openblas_make_complex_float(real, imag) ((real) + ((imag) * _Complex_I)) 126 | #define openblas_make_complex_double(real, imag) ((real) + ((imag) * _Complex_I)) 127 | #define openblas_make_complex_xdouble(real, imag) ((real) + ((imag) * _Complex_I)) 128 | #define openblas_complex_float_real(z) (creal(z)) 129 | #define openblas_complex_float_imag(z) (cimag(z)) 130 | #define openblas_complex_double_real(z) (creal(z)) 131 | #define openblas_complex_double_imag(z) (cimag(z)) 132 | #define openblas_complex_xdouble_real(z) (creal(z)) 133 | #define openblas_complex_xdouble_imag(z) (cimag(z)) 134 | #else 135 | #define OPENBLAS_COMPLEX_STRUCT 136 | typedef struct { float real, imag; } openblas_complex_float; 137 | typedef struct { double real, imag; } openblas_complex_double; 138 | typedef struct { xdouble real, imag; } openblas_complex_xdouble; 139 | #define openblas_make_complex_float(real, imag) {(real), (imag)} 140 | #define openblas_make_complex_double(real, imag) {(real), (imag)} 141 | #define openblas_make_complex_xdouble(real, imag) {(real), (imag)} 142 | #define openblas_complex_float_real(z) ((z).real) 143 | #define openblas_complex_float_imag(z) ((z).imag) 144 | #define openblas_complex_double_real(z) ((z).real) 145 | #define openblas_complex_double_imag(z) ((z).imag) 146 | #define openblas_complex_xdouble_real(z) ((z).real) 147 | #define openblas_complex_xdouble_imag(z) ((z).imag) 148 | #endif 149 | 150 | /* Inclusion of Linux-specific header is needed for definition of cpu_set_t. */ 151 | #ifdef OPENBLAS_OS_LINUX 152 | #include 153 | #endif 154 | #endif /* OPENBLAS_CONFIG_H */ 155 | -------------------------------------------------------------------------------- /include/ILP64/riscv64-linux-musl/openblas_config.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENBLAS_CONFIG_H 2 | #define OPENBLAS_CONFIG_H 3 | #define OPENBLAS_OS_LINUX 1 4 | #define OPENBLAS_ARCH_RISCV64 1 5 | #define OPENBLAS_C_GCC 1 6 | #define OPENBLAS___64BIT__ 1 7 | #define OPENBLAS_PTHREAD_CREATE_FUNC pthread_create 8 | #define OPENBLAS_BUNDERSCORE _ 9 | #define OPENBLAS_NEEDBUNDERSCORE 1 10 | #define OPENBLAS_ZEN 11 | #define OPENBLAS_L1_CODE_SIZE 32768 12 | #define OPENBLAS_L1_CODE_ASSOCIATIVE 8 13 | #define OPENBLAS_L1_CODE_LINESIZE 64 14 | #define OPENBLAS_L1_DATA_SIZE 32768 15 | #define OPENBLAS_L1_DATA_ASSOCIATIVE 8 16 | #define OPENBLAS_L1_DATA_LINESIZE 64 17 | #define OPENBLAS_L2_SIZE 524288 18 | #define OPENBLAS_L2_ASSOCIATIVE 8 19 | #define OPENBLAS_L2_LINESIZE 64 20 | #define OPENBLAS_L3_SIZE 67108864 21 | #define OPENBLAS_L3_ASSOCIATIVE 9 22 | #define OPENBLAS_L3_LINESIZE 64 23 | #define OPENBLAS_ITB_SIZE 4096 24 | #define OPENBLAS_ITB_ASSOCIATIVE 0 25 | #define OPENBLAS_ITB_ENTRIES 64 26 | #define OPENBLAS_DTB_SIZE 4096 27 | #define OPENBLAS_DTB_ASSOCIATIVE 0 28 | #define OPENBLAS_DTB_DEFAULT_ENTRIES 64 29 | #define OPENBLAS_HAVE_CMOV 30 | #define OPENBLAS_HAVE_MMX 31 | #define OPENBLAS_HAVE_SSE 32 | #define OPENBLAS_HAVE_SSE2 33 | #define OPENBLAS_HAVE_SSE3 34 | #define OPENBLAS_HAVE_SSSE3 35 | #define OPENBLAS_HAVE_SSE4_1 36 | #define OPENBLAS_HAVE_SSE4_2 37 | #define OPENBLAS_HAVE_SSE4A 38 | #define OPENBLAS_HAVE_AVX 39 | #define OPENBLAS_HAVE_AVX2 40 | #define OPENBLAS_HAVE_FMA3 41 | #define OPENBLAS_HAVE_CFLUSH 42 | #define OPENBLAS_HAVE_MISALIGNSSE 43 | #define OPENBLAS_HAVE_FASTMOVU 44 | #define OPENBLAS_NUM_SHAREDCACHE 1 45 | #define OPENBLAS_NUM_CORES 1 46 | #define OPENBLAS_CORE_ZEN 47 | #define OPENBLAS_CHAR_CORENAME "ZEN" 48 | #define OPENBLAS_USE64BITINT 49 | #define OPENBLAS_GEMM_MULTITHREAD_THRESHOLD 4 50 | #define OPENBLAS_VERSION " OpenBLAS 0.3.13 " 51 | /*This is only for "make install" target.*/ 52 | 53 | #if defined(OPENBLAS_OS_WINNT) || defined(OPENBLAS_OS_CYGWIN_NT) || defined(OPENBLAS_OS_INTERIX) 54 | #define OPENBLAS_WINDOWS_ABI 55 | #define OPENBLAS_OS_WINDOWS 56 | 57 | #ifdef DOUBLE 58 | #define DOUBLE_DEFINED DOUBLE 59 | #undef DOUBLE 60 | #endif 61 | #endif 62 | 63 | #ifdef OPENBLAS_NEEDBUNDERSCORE 64 | #define BLASFUNC(FUNC) FUNC##_ 65 | #else 66 | #define BLASFUNC(FUNC) FUNC 67 | #endif 68 | 69 | #ifdef OPENBLAS_QUAD_PRECISION 70 | typedef struct { 71 | unsigned long x[2]; 72 | } xdouble; 73 | #elif defined OPENBLAS_EXPRECISION 74 | #define xdouble long double 75 | #else 76 | #define xdouble double 77 | #endif 78 | 79 | #if defined(OPENBLAS_OS_WINDOWS) && defined(OPENBLAS___64BIT__) 80 | typedef long long BLASLONG; 81 | typedef unsigned long long BLASULONG; 82 | #else 83 | typedef long BLASLONG; 84 | typedef unsigned long BLASULONG; 85 | #endif 86 | 87 | #ifndef BFLOAT16 88 | #include 89 | typedef uint16_t bfloat16; 90 | #endif 91 | 92 | #ifdef OPENBLAS_USE64BITINT 93 | typedef BLASLONG blasint; 94 | #else 95 | typedef int blasint; 96 | #endif 97 | 98 | #if defined(XDOUBLE) || defined(DOUBLE) 99 | #define FLOATRET FLOAT 100 | #else 101 | #ifdef NEED_F2CCONV 102 | #define FLOATRET double 103 | #else 104 | #define FLOATRET float 105 | #endif 106 | #endif 107 | 108 | /* Inclusion of a standard header file is needed for definition of __STDC_* 109 | predefined macros with some compilers (e.g. GCC 4.7 on Linux). This occurs 110 | as a side effect of including either or . */ 111 | #include 112 | 113 | /* C99 supports complex floating numbers natively, which GCC also offers as an 114 | extension since version 3.0. If neither are available, use a compatible 115 | structure as fallback (see Clause 6.2.5.13 of the C99 standard). */ 116 | #if ((defined(__STDC_IEC_559_COMPLEX__) || __STDC_VERSION__ >= 199901L || \ 117 | (__GNUC__ >= 3 && !defined(__cplusplus))) && !(defined(FORCE_OPENBLAS_COMPLEX_STRUCT))) && !defined(_MSC_VER) 118 | #define OPENBLAS_COMPLEX_C99 119 | #ifndef __cplusplus 120 | #include 121 | #endif 122 | typedef float _Complex openblas_complex_float; 123 | typedef double _Complex openblas_complex_double; 124 | typedef xdouble _Complex openblas_complex_xdouble; 125 | #define openblas_make_complex_float(real, imag) ((real) + ((imag) * _Complex_I)) 126 | #define openblas_make_complex_double(real, imag) ((real) + ((imag) * _Complex_I)) 127 | #define openblas_make_complex_xdouble(real, imag) ((real) + ((imag) * _Complex_I)) 128 | #define openblas_complex_float_real(z) (creal(z)) 129 | #define openblas_complex_float_imag(z) (cimag(z)) 130 | #define openblas_complex_double_real(z) (creal(z)) 131 | #define openblas_complex_double_imag(z) (cimag(z)) 132 | #define openblas_complex_xdouble_real(z) (creal(z)) 133 | #define openblas_complex_xdouble_imag(z) (cimag(z)) 134 | #else 135 | #define OPENBLAS_COMPLEX_STRUCT 136 | typedef struct { float real, imag; } openblas_complex_float; 137 | typedef struct { double real, imag; } openblas_complex_double; 138 | typedef struct { xdouble real, imag; } openblas_complex_xdouble; 139 | #define openblas_make_complex_float(real, imag) {(real), (imag)} 140 | #define openblas_make_complex_double(real, imag) {(real), (imag)} 141 | #define openblas_make_complex_xdouble(real, imag) {(real), (imag)} 142 | #define openblas_complex_float_real(z) ((z).real) 143 | #define openblas_complex_float_imag(z) ((z).imag) 144 | #define openblas_complex_double_real(z) ((z).real) 145 | #define openblas_complex_double_imag(z) ((z).imag) 146 | #define openblas_complex_xdouble_real(z) ((z).real) 147 | #define openblas_complex_xdouble_imag(z) ((z).imag) 148 | #endif 149 | 150 | /* Inclusion of Linux-specific header is needed for definition of cpu_set_t. */ 151 | #ifdef OPENBLAS_OS_LINUX 152 | #include 153 | #endif 154 | #endif /* OPENBLAS_CONFIG_H */ 155 | -------------------------------------------------------------------------------- /include/LP64/powerpc64le-linux-gnu/openblas_config.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENBLAS_CONFIG_H 2 | #define OPENBLAS_CONFIG_H 3 | #define OPENBLAS_OS_LINUX 1 4 | #define OPENBLAS_ARCH_POWER 1 5 | #define OPENBLAS_C_GCC 1 6 | #define OPENBLAS___64BIT__ 1 7 | #define OPENBLAS_PTHREAD_CREATE_FUNC pthread_create 8 | #define OPENBLAS_BUNDERSCORE _ 9 | #define OPENBLAS_NEEDBUNDERSCORE 1 10 | #define OPENBLAS_ZEN 11 | #define OPENBLAS_L1_CODE_SIZE 32768 12 | #define OPENBLAS_L1_CODE_ASSOCIATIVE 8 13 | #define OPENBLAS_L1_CODE_LINESIZE 64 14 | #define OPENBLAS_L1_DATA_SIZE 32768 15 | #define OPENBLAS_L1_DATA_ASSOCIATIVE 8 16 | #define OPENBLAS_L1_DATA_LINESIZE 64 17 | #define OPENBLAS_L2_SIZE 524288 18 | #define OPENBLAS_L2_ASSOCIATIVE 8 19 | #define OPENBLAS_L2_LINESIZE 64 20 | #define OPENBLAS_L3_SIZE 67108864 21 | #define OPENBLAS_L3_ASSOCIATIVE 9 22 | #define OPENBLAS_L3_LINESIZE 64 23 | #define OPENBLAS_ITB_SIZE 4096 24 | #define OPENBLAS_ITB_ASSOCIATIVE 0 25 | #define OPENBLAS_ITB_ENTRIES 64 26 | #define OPENBLAS_DTB_SIZE 4096 27 | #define OPENBLAS_DTB_ASSOCIATIVE 0 28 | #define OPENBLAS_DTB_DEFAULT_ENTRIES 64 29 | #define OPENBLAS_HAVE_CMOV 30 | #define OPENBLAS_HAVE_MMX 31 | #define OPENBLAS_HAVE_SSE 32 | #define OPENBLAS_HAVE_SSE2 33 | #define OPENBLAS_HAVE_SSE3 34 | #define OPENBLAS_HAVE_SSSE3 35 | #define OPENBLAS_HAVE_SSE4_1 36 | #define OPENBLAS_HAVE_SSE4_2 37 | #define OPENBLAS_HAVE_SSE4A 38 | #define OPENBLAS_HAVE_AVX 39 | #define OPENBLAS_HAVE_AVX2 40 | #define OPENBLAS_HAVE_FMA3 41 | #define OPENBLAS_HAVE_CFLUSH 42 | #define OPENBLAS_HAVE_MISALIGNSSE 43 | #define OPENBLAS_HAVE_FASTMOVU 44 | #define OPENBLAS_NUM_SHAREDCACHE 1 45 | #define OPENBLAS_NUM_CORES 1 46 | #define OPENBLAS_CORE_ZEN 47 | #define OPENBLAS_CHAR_CORENAME "ZEN" 48 | #define OPENBLAS_USE64BITINT 49 | #define OPENBLAS_GEMM_MULTITHREAD_THRESHOLD 4 50 | #define OPENBLAS_VERSION " OpenBLAS 0.3.13 " 51 | /*This is only for "make install" target.*/ 52 | 53 | #if defined(OPENBLAS_OS_WINNT) || defined(OPENBLAS_OS_CYGWIN_NT) || defined(OPENBLAS_OS_INTERIX) 54 | #define OPENBLAS_WINDOWS_ABI 55 | #define OPENBLAS_OS_WINDOWS 56 | 57 | #ifdef DOUBLE 58 | #define DOUBLE_DEFINED DOUBLE 59 | #undef DOUBLE 60 | #endif 61 | #endif 62 | 63 | #ifdef OPENBLAS_NEEDBUNDERSCORE 64 | #define BLASFUNC(FUNC) FUNC##_ 65 | #else 66 | #define BLASFUNC(FUNC) FUNC 67 | #endif 68 | 69 | #ifdef OPENBLAS_QUAD_PRECISION 70 | typedef struct { 71 | unsigned long x[2]; 72 | } xdouble; 73 | #elif defined OPENBLAS_EXPRECISION 74 | #define xdouble long double 75 | #else 76 | #define xdouble double 77 | #endif 78 | 79 | #if defined(OPENBLAS_OS_WINDOWS) && defined(OPENBLAS___64BIT__) 80 | typedef long long BLASLONG; 81 | typedef unsigned long long BLASULONG; 82 | #else 83 | typedef long BLASLONG; 84 | typedef unsigned long BLASULONG; 85 | #endif 86 | 87 | #ifndef BFLOAT16 88 | #include 89 | typedef uint16_t bfloat16; 90 | #endif 91 | 92 | #ifdef OPENBLAS_USE64BITINT 93 | typedef BLASLONG blasint; 94 | #else 95 | typedef int blasint; 96 | #endif 97 | 98 | #if defined(XDOUBLE) || defined(DOUBLE) 99 | #define FLOATRET FLOAT 100 | #else 101 | #ifdef NEED_F2CCONV 102 | #define FLOATRET double 103 | #else 104 | #define FLOATRET float 105 | #endif 106 | #endif 107 | 108 | /* Inclusion of a standard header file is needed for definition of __STDC_* 109 | predefined macros with some compilers (e.g. GCC 4.7 on Linux). This occurs 110 | as a side effect of including either or . */ 111 | #include 112 | 113 | /* C99 supports complex floating numbers natively, which GCC also offers as an 114 | extension since version 3.0. If neither are available, use a compatible 115 | structure as fallback (see Clause 6.2.5.13 of the C99 standard). */ 116 | #if ((defined(__STDC_IEC_559_COMPLEX__) || __STDC_VERSION__ >= 199901L || \ 117 | (__GNUC__ >= 3 && !defined(__cplusplus))) && !(defined(FORCE_OPENBLAS_COMPLEX_STRUCT))) && !defined(_MSC_VER) 118 | #define OPENBLAS_COMPLEX_C99 119 | #ifndef __cplusplus 120 | #include 121 | #endif 122 | typedef float _Complex openblas_complex_float; 123 | typedef double _Complex openblas_complex_double; 124 | typedef xdouble _Complex openblas_complex_xdouble; 125 | #define openblas_make_complex_float(real, imag) ((real) + ((imag) * _Complex_I)) 126 | #define openblas_make_complex_double(real, imag) ((real) + ((imag) * _Complex_I)) 127 | #define openblas_make_complex_xdouble(real, imag) ((real) + ((imag) * _Complex_I)) 128 | #define openblas_complex_float_real(z) (creal(z)) 129 | #define openblas_complex_float_imag(z) (cimag(z)) 130 | #define openblas_complex_double_real(z) (creal(z)) 131 | #define openblas_complex_double_imag(z) (cimag(z)) 132 | #define openblas_complex_xdouble_real(z) (creal(z)) 133 | #define openblas_complex_xdouble_imag(z) (cimag(z)) 134 | #else 135 | #define OPENBLAS_COMPLEX_STRUCT 136 | typedef struct { float real, imag; } openblas_complex_float; 137 | typedef struct { double real, imag; } openblas_complex_double; 138 | typedef struct { xdouble real, imag; } openblas_complex_xdouble; 139 | #define openblas_make_complex_float(real, imag) {(real), (imag)} 140 | #define openblas_make_complex_double(real, imag) {(real), (imag)} 141 | #define openblas_make_complex_xdouble(real, imag) {(real), (imag)} 142 | #define openblas_complex_float_real(z) ((z).real) 143 | #define openblas_complex_float_imag(z) ((z).imag) 144 | #define openblas_complex_double_real(z) ((z).real) 145 | #define openblas_complex_double_imag(z) ((z).imag) 146 | #define openblas_complex_xdouble_real(z) ((z).real) 147 | #define openblas_complex_xdouble_imag(z) ((z).imag) 148 | #endif 149 | 150 | /* Inclusion of Linux-specific header is needed for definition of cpu_set_t. */ 151 | #ifdef OPENBLAS_OS_LINUX 152 | #include 153 | #endif 154 | #endif /* OPENBLAS_CONFIG_H */ 155 | --------------------------------------------------------------------------------