mcpp index

compat.xsimd

#include

C++ wrappers for SIMD intrinsics with runtime architecture selection (header-only)

#include <xsimd/xsimd.hpp>
mcpp add compat.xsimd@14.3.0

用法

來自本倉庫自己的測試專案 —— CI 真的編譯並執行過,不是為了網站寫的。

// compat.xsimd — assert architecture discovery, unaligned load/store, batch
// arithmetic, math functions and horizontal reduction through the public API.
#include <xsimd/xsimd.hpp>

#include <array>
#include <cmath>
#include <cstddef>
#include <cstdio>

int main() {
    using batch_type = xsimd::batch<float>;
    constexpr std::size_t width = batch_type::size;

    std::array<float, width> left{};
    std::array<float, width> right{};
    std::array<float, width> sum{};
    for (std::size_t i = 0; i < width; ++i) {
        left[i] = static_cast<float>(i + 1);
        right[i] = static_cast<float>(2 * i + 2);
    }

    bool ok = true;
// …

tests/examples/xsimd/tests/xsimd.cpp · 專案 tests/examples/xsimd

建置

targets
xsimd (lib)
language
c++23
C standard
c11
import std
no
include dirs
*/include

原始檔 (1)

  • mcpp_generated/xsimd_anchor.c

產生的檔案

  • mcpp_generated/xsimd_anchor.c

版本

版本平台 鏡像sha256
14.3.0 最新 LinuxWindowsmacOS 來源 b3d50e7a73fb…