compat.openblas
#includeOpenBLAS — optimized BLAS, built from source (BLAS-only, no Fortran/LAPACK)
#include <cblas.h>
人工维护在 .xpkgindex/interfaces.json。
mcpp add compat.openblas@0.3.33
用法
来自本仓库自己的测试项目 —— CI 真的编译并运行过,不是为了网站写的。
// On Windows the cfg-gated openblas dep + HAVE_OPENBLAS are active: cblas_dgemm
// asserting [19 22; 43 50]. Elsewhere a no-op (openblas is Windows-only).
#ifdef HAVE_OPENBLAS
#include <cblas.h>
int main() {
const double A[4] = {1, 2, 3, 4};
const double B[4] = {5, 6, 7, 8};
double C[4] = {0, 0, 0, 0};
cblas_dgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans, 2, 2, 2, 1.0, A, 2, B, 2, 0.0, C, 2);
const double expected[4] = {19, 22, 43, 50};
for (int i = 0; i < 4; ++i) if (C[i] != expected[i]) return 10 + i;
return 0;
}
#else
int main() { return 0; } // openblas is Windows-only; no-op elsewhere
#endif
tests/examples/openblas/tests/dgemm.cpp · 项目 tests/examples/openblas
构建
- targets
openblas (lib)- language
c++23- C standard
c11- import std
- no
- include dirs
include
源文件 (1)
mcpp_openblas_anchor.c