mcpp index

compat.openblas

#include

OpenBLAS — 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

版本

版本平台 鏡像sha256
0.3.33 最新 LinuxWindowsmacOS CN GLOBAL 6761af1d9f5d…