跳到主要内容

Eigen RVV

Eigen 简介

Eigen 是一个高性能的 C++ 模板库,专用于线性代数运算,涵盖矩阵、向量、数值求解及相关算法。它被广泛应用于机器人、计算机视觉、数值仿真等领域,是 ROS、OpenCV、PCL 等主流框架的核心依赖之一。

主要特点:

  • 纯头文件:无需编译,直接 #include 即可使用
  • 高性能:通过表达式模板(expression templates)消除临时变量,自动向量化(SIMD)
  • 功能丰富:支持稠密矩阵、稀疏矩阵、几何变换(旋转矩阵、四元数)、线性求解器等
  • 跨平台:支持 x86、ARM、RISC-V 等主流架构

RVV 加速

RVV(RISC-V Vector Extension)是 RISC-V 架构的向量扩展指令集,可对矩阵运算进行 SIMD 加速。K3 搭载的 SpacemiT X100 + A100 16 核处理器原生支持 RVV 1.0(含 zve64dzvfh 等向量子扩展)。

针对 K3 平台,我们提供了专为 RVV 优化的定制 Eigen 库 eigen-spacemit,相比系统默认的 Eigen 有显著差异:

对比项系统 Eigen(libeigen3-deveigen-spacemit
安装路径/usr/include/eigen3/opt/eigen-spacemit
RVV 加速未启用针对 RVV 1.0 优化
适用平台通用(x86/ARM/RISC-V)专为 SpacemiT X100 定制
安装方式apt install libeigen3-devapt install eigen-spacemit

在 K3 上进行高性能线性代数运算(如点云处理、SLAM、卡尔曼滤波)时,推荐优先使用 eigen-spacemit 以充分发挥 RVV 硬件能力。

使用示例

以下示例对比系统 Eigen 与 eigen-spacemit 在 512×512 矩阵乘法上的性能差异。

安装必要依赖

sudo apt update
sudo apt install eigen-spacemit libeigen3-dev

目录结构:

eigen_bench/
├── CMakeLists.txt
└── bench.cpp

CMakeLists.txt:

cmake_minimum_required(VERSION 3.16)
project(eigen_bench LANGUAGES CXX)

# OpenMP 让 Eigen 支持的单个算子(主要是大矩阵乘法)可以使用多线程。
option(EIGEN_BENCH_ENABLE_OPENMP "Enable OpenMP so Eigen can parallelize supported operators" ON)

# RVV 编译参数。
set(RVV_MARCH "rv64gcv_zvl256b" CACHE STRING "RISC-V architecture flags for RVV builds")
set(RVV_MABI "lp64d" CACHE STRING "RISC-V ABI flags for RVV builds")

# 系统 Eigen 对照组保持无 RVV,需显式指定标量目标架构和 ABI。
set(SCALAR_MARCH "rv64gc" CACHE STRING "RISC-V architecture flags for scalar non-RVV builds")
set(SCALAR_MABI "lp64d" CACHE STRING "RISC-V ABI flags for scalar non-RVV builds")

if(EIGEN_BENCH_ENABLE_OPENMP)
find_package(OpenMP)
endif()

# 统一创建 benchmark 目标:传入不同 Eigen include 路径即可对比不同实现。
function(add_bench target eigen_include)
add_executable(${target} bench.cpp)
target_include_directories(${target} PRIVATE "${eigen_include}")
target_compile_options(${target} PRIVATE -O3 -DNDEBUG -std=c++17)
if(EIGEN_BENCH_ENABLE_OPENMP AND OpenMP_CXX_FOUND)
target_link_libraries(${target} PRIVATE OpenMP::OpenMP_CXX)
endif()
endfunction()

# SpacemiT Eigen(RVV 加速)
add_bench(bench_spacemit /opt/eigen-spacemit/include/eigen3)
target_compile_options(bench_spacemit PRIVATE -march=${RVV_MARCH} -mabi=${RVV_MABI} -mrvv-vector-bits=zvl)
target_compile_definitions(bench_spacemit PRIVATE EIGEN_RISCV64_USE_RVV10)

# 系统 Eigen(无 RVV)
add_bench(bench_system /usr/include/eigen3)
target_compile_options(bench_system PRIVATE -march=${SCALAR_MARCH} -mabi=${SCALAR_MABI})

bench.cpp:

#include <Eigen/Dense>
#include <chrono>
#include <cstdlib>
#include <iostream>
#include <stdexcept>
#include <string>

namespace {

int parsePositiveInt(const char* value, const std::string& name) {
const int parsed = std::stoi(value);
if (parsed <= 0) {
throw std::runtime_error(name + " must be positive");
}
return parsed;
}

std::string envOrUnset(const char* name) {
const char* value = std::getenv(name);
return value ? value : "not_set";
}

} // namespace

int main(int argc, char** argv) {
try {
const int N = argc > 1 ? parsePositiveInt(argv[1], "matrix_size") : 512;
const int iters = argc > 2 ? parsePositiveInt(argv[2], "iterations") : 10;
const char* threads_env = std::getenv("EIGEN_BENCH_THREADS");
const int threads = argc > 3 ? parsePositiveInt(argv[3], "threads") : (threads_env ? parsePositiveInt(threads_env, "EIGEN_BENCH_THREADS") : 8);
Eigen::setNbThreads(threads);

Eigen::MatrixXf A = Eigen::MatrixXf::Random(N, N);
Eigen::MatrixXf B = Eigen::MatrixXf::Random(N, N);
Eigen::MatrixXf C(N, N);

C.noalias() = A * B; // warmup

auto t0 = std::chrono::high_resolution_clock::now();
for (int i = 0; i < iters; ++i)
C.noalias() = A * B;
auto t1 = std::chrono::high_resolution_clock::now();

double ms = std::chrono::duration<double, std::milli>(t1 - t0).count() / iters;
std::cout << "Eigen version: " << EIGEN_WORLD_VERSION << '.' << EIGEN_MAJOR_VERSION << '.' << EIGEN_MINOR_VERSION << '\n';
std::cout << "SimdInstructionSetsInUse(): " << Eigen::SimdInstructionSetsInUse() << '\n';
#ifdef EIGEN_HAS_OPENMP
std::cout << "EIGEN_HAS_OPENMP: defined\n";
#else
std::cout << "EIGEN_HAS_OPENMP: not_defined\n";
#endif
std::cout << "matrix_size: " << N << '\n';
std::cout << "iterations: " << iters << '\n';
std::cout << "requested_threads: " << threads << '\n';
std::cout << "Eigen nbThreads: " << Eigen::nbThreads() << '\n';
std::cout << "OMP_NUM_THREADS: " << envOrUnset("OMP_NUM_THREADS") << '\n';
std::cout << "EIGEN_BENCH_THREADS: " << envOrUnset("EIGEN_BENCH_THREADS") << '\n';
std::cout << N << "x" << N << " matmul avg: " << ms << " ms\n";
return 0;
} catch (const std::exception& error) {
std::cerr << "error: " << error.what() << '\n';
return 1;
}
}

编译与运行:

mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)

./bench_system # 系统 Eigen
./bench_spacemit # SpacemiT Eigen(RVV)

单核对比

可以看出,RVV加速后的矩阵乘法性能有明显提升(77 ms -> 22 ms)

八核对比

使用 openblas-spacemit 作为后端

Eigen 默认使用自身的模板实现完成矩阵运算,而 OpenBLAS 是一个经过高度优化的 BLAS(Basic Linear Algebra Subprograms)数值库。通过在编译时添加 -DEIGEN_USE_BLAS 宏,Eigen 会将底层的矩阵乘法(gemm)等关键运算委托给 OpenBLAS 执行,从而利用其针对特定硬件深度调优的实现。

openblas-spacemit 是专为 SpacemiT K3 平台定制的 OpenBLAS 版本,充分利用了 RVV 1.0 向量扩展及平台特性。与单独使用 eigen-spacemit(RVV 向量化)相比,通过 openblas-spacemit 后端可以进一步将大规模矩阵乘法性能提升。

安装必要依赖

sudo apt install openblas-spacemit

编译与运行

仍使用上一节的bench.cpp

export LD_LIBRARY_PATH=/opt/openblas-spacemit/lib:$LD_LIBRARY_PATH
g++ -O3 -DNDEBUG -std=c++17 \
-fopenmp \
-march=rv64gcv_zvl256b -mabi=lp64d -mrvv-vector-bits=zvl \
-DEIGEN_RISCV64_USE_RVV10 -DEIGEN_USE_BLAS \
-I"/opt/eigen-spacemit/include/eigen3" \
"bench.cpp" \
"/opt/openblas-spacemit/lib/libopenblas.so" -lpthread \
-o /tmp/eigen_bench_blas
/tmp/eigen_bench_blas

单核性能:

使用 openblas-spacemit 作为 eigen 后端,矩阵乘法的性能还有进一步的提升(22 ms -> 9.48 ms)

八核性能:

更多性能测试数据

测试环境

  • SpacemiT RISCV64 X100 CPU(2.4Ghz)
  • Bianbu 4.0.1 操作系统
  • 内存:32GB

多核测试说明

  • 多核测试编译需要 target_link_libraries(${target_name} PRIVATE OpenMP::OpenMP_CXX)
  • 多核测试代码需要 Eigen::setNbThreads(threads)threads 建议与测试时限制的核数一致
  • 以下测试 threads 与核数均取一致

性能下降情况说明

后续表格中 speedup 小于 1 或 improvement 为负数表示对比方案性能低于基准方案。需要注意的是,这类结果主要集中在以下几类场景:

  • 极小规模几何运算:如 Quaternion::inverse()Quaternion::normalize()Quaternion::toRotationMatrix()cross() 等输入规模仅为 3x1 或 3x3,单次耗时约 0.0001 ms,已经接近计时分辨率与函数调用开销,少量负收益更多体现为测试抖动或额外分支/向量化开销,不代表大规模计算性能退化。
  • 低计算密度或访存主导算子:如 trace()、部分 Identity()block()transpose()rowwise().sum() 等,计算量较小或内存访问占主导,RVV/BLAS 后端的调度、打包、线程同步等开销可能抵消向量化收益。
  • 使用 BLAS 后端时的非 GEMM 算子EIGEN_USE_BLAS 主要加速大矩阵乘法等 BLAS Level-3 操作;对于大量数组逐元素运算、标量运算、归约或小矩阵操作,调用 BLAS 后端并不会带来直接收益,部分场景会出现 1%~3% 左右的小幅下降,通常属于开销差异或测试波动。
  • 多核小算子并行开销:在四核、八核测试中,部分单次计算量较小的算子会受到线程调度、同步和缓存竞争影响,出现比单核更明显的负收益。例如 BLAS 后端对比中,matrix_gemvmatrix_identity 等在多核下存在下降,但大矩阵乘法仍保持显著提升。

因此,性能下降项应结合算子类型、输入规模与标准差一起判断。实际应用中,建议优先将 eigen-spacemitopenblas-spacemit 用于矩阵乘法、矩阵分解、求逆、归约等计算密集型任务;对于小尺寸几何操作或访存主导算子,可根据端到端业务耗时进行取舍。

eigen-spacemit VS libeigen3-dev

  • 使用 taskset -c 限制核数
  • 单次测试的计时策略是每个算子跑 50 次取平均值,预热10次。本测试重复10次单次测试,取其指标的平均值并计算标准差
  • mean 表示 10 次测试的均值,sd 为标准差

单核对比

taskset -c 0

threads:1

modulefunctionapidtypeinput_sizeoutput_sizelibeigen3-dev avg_ms mean±sdeigen-spacemit avg_ms mean±sdlibeigen3-dev avg_gflops mean±sdeigen-spacemit avg_gflops mean±sdspeedup mean±sdimprovement mean±sd
arrayvector_absabs(a - scalar)float32262144x1262144x10.6099 ± 0.01580.2440 ± 0.00560.4301 ± 0.01111.0751 ± 0.02452.50x ± 0.01x149.99% ± 1.37%
arrayvector_absabs(a - scalar)float64262144x1262144x10.8122 ± 0.02060.6826 ± 0.01230.3229 ± 0.00790.3842 ± 0.00691.19x ± 0.03x19.00% ± 2.58%
arrayvector_add_scalara + scalarfloat32262144x1262144x10.6101 ± 0.01490.1996 ± 0.00700.4299 ± 0.01041.3147 ± 0.04473.06x ± 0.05x205.77% ± 5.15%
arrayvector_add_scalara + scalarfloat64262144x1262144x10.7155 ± 0.01680.6065 ± 0.00990.3666 ± 0.00850.4324 ± 0.00701.18x ± 0.02x17.99% ± 2.41%
arrayvector_add_vectora + bfloat32262144x1262144x10.7388 ± 0.01910.2521 ± 0.01730.3550 ± 0.00911.0443 ± 0.07192.94x ± 0.21x194.30% ± 21.45%
arrayvector_add_vectora + bfloat64262144x1262144x11.0307 ± 0.03470.8972 ± 0.02150.2546 ± 0.00860.2923 ± 0.00691.15x ± 0.04x14.91% ± 4.05%
arrayvector_clampcwiseMax + cwiseMinfloat32262144x1262144x10.7360 ± 0.01750.4418 ± 0.01070.7127 ± 0.01681.1872 ± 0.02841.67x ± 0.00x66.58% ± 0.49%
arrayvector_clampcwiseMax + cwiseMinfloat64262144x1262144x10.8870 ± 0.01651.0334 ± 0.02010.5913 ± 0.01100.5075 ± 0.00980.86x ± 0.01x-14.17% ± 0.62%
arrayvector_coscos(a)float32262144x1262144x15.6887 ± 0.13692.0954 ± 0.05050.0461 ± 0.00110.1252 ± 0.00302.71x ± 0.01x171.49% ± 0.85%
arrayvector_coscos(a)float64262144x1262144x110.9408 ± 0.261010.7751 ± 0.25320.0240 ± 0.00060.0244 ± 0.00061.02x ± 0.00x1.54% ± 0.16%
arrayvector_div_scalara / scalarfloat32262144x1262144x11.5860 ± 0.03820.6609 ± 0.02430.1654 ± 0.00390.3972 ± 0.01422.40x ± 0.04x140.11% ± 4.25%
arrayvector_div_scalara / scalarfloat64262144x1262144x12.6190 ± 0.08212.3817 ± 0.05220.1002 ± 0.00310.1101 ± 0.00241.10x ± 0.02x9.95% ± 1.50%
arrayvector_div_vectora / (b + scalar)float32262144x1262144x11.5903 ± 0.03840.7656 ± 0.02790.3299 ± 0.00790.6856 ± 0.02432.08x ± 0.05x107.85% ± 5.38%
arrayvector_div_vectora / (b + scalar)float64262144x1262144x12.6453 ± 0.08502.6033 ± 0.05470.1984 ± 0.00630.2015 ± 0.00421.02x ± 0.02x1.60% ± 1.93%
arrayvector_dotdot()float32262144x11x10.3717 ± 0.01840.0981 ± 0.00951.4133 ± 0.06695.3871 ± 0.51203.82x ± 0.37x281.66% ± 37.21%
arrayvector_dotdot()float64262144x11x10.5054 ± 0.04020.4009 ± 0.01751.0430 ± 0.07861.3098 ± 0.05421.26x ± 0.10x26.15% ± 9.90%
arrayvector_expexp(a * scalar)float32262144x1262144x16.7104 ± 0.15832.1390 ± 0.07160.0782 ± 0.00180.2454 ± 0.00803.14x ± 0.05x213.83% ± 4.63%
arrayvector_expexp(a * scalar)float64262144x1262144x17.0105 ± 0.16696.8168 ± 0.15820.0748 ± 0.00180.0770 ± 0.00181.03x ± 0.00x2.84% ± 0.25%
arrayvector_fmaa * b + cfloat32262144x1262144x11.2195 ± 0.02690.4835 ± 0.01190.4301 ± 0.00941.0849 ± 0.02662.52x ± 0.08x152.33% ± 7.97%
arrayvector_fmaa * b + cfloat64262144x1262144x11.4908 ± 0.02321.2728 ± 0.02070.3518 ± 0.00560.4120 ± 0.00661.17x ± 0.03x17.16% ± 2.95%
arrayvector_loglog(a + scalar)float32262144x1262144x16.4867 ± 0.20512.0757 ± 0.07020.0809 ± 0.00250.2529 ± 0.00833.13x ± 0.06x212.58% ± 6.31%
arrayvector_loglog(a + scalar)float64262144x1262144x17.3730 ± 0.21696.1661 ± 0.14340.0712 ± 0.00200.0851 ± 0.00201.20x ± 0.01x19.56% ± 1.13%
arrayvector_maxmax(a, b)float32262144x1262144x10.7613 ± 0.04240.3161 ± 0.01430.3452 ± 0.01840.8309 ± 0.03822.41x ± 0.15x141.16% ± 15.07%
arrayvector_maxmax(a, b)float64262144x1262144x11.0221 ± 0.02520.9173 ± 0.02520.2566 ± 0.00610.2860 ± 0.00771.11x ± 0.04x11.49% ± 3.59%
arrayvector_minmin(a, b)float32262144x1262144x10.8580 ± 0.01960.3150 ± 0.01450.3057 ± 0.00700.8340 ± 0.03872.73x ± 0.10x172.79% ± 9.95%
arrayvector_minmin(a, b)float64262144x1262144x11.0048 ± 0.01850.9050 ± 0.02610.2610 ± 0.00480.2899 ± 0.00811.11x ± 0.03x11.08% ± 2.72%
arrayvector_mul_scalara * scalarfloat32262144x1262144x10.7347 ± 0.02130.2149 ± 0.00760.3571 ± 0.01011.2210 ± 0.04183.42x ± 0.07x241.96% ± 6.92%
arrayvector_mul_scalara * scalarfloat64262144x1262144x10.7132 ± 0.01630.6299 ± 0.01150.3678 ± 0.00830.4163 ± 0.00761.13x ± 0.02x13.22% ± 1.93%
arrayvector_mul_vectora * bfloat32262144x1262144x10.7392 ± 0.01860.2642 ± 0.01900.3548 ± 0.00890.9968 ± 0.07212.81x ± 0.21x181.07% ± 21.30%
arrayvector_mul_vectora * bfloat64262144x1262144x11.0304 ± 0.02530.9050 ± 0.03340.2546 ± 0.00630.2900 ± 0.01061.14x ± 0.05x13.99% ± 4.89%
arrayvector_normnorm()float32262144x11x10.3660 ± 0.00960.0841 ± 0.00231.4333 ± 0.03736.2364 ± 0.17134.35x ± 0.03x335.21% ± 2.91%
arrayvector_normnorm()float64262144x11x10.3664 ± 0.00910.1884 ± 0.00901.4316 ± 0.03512.7879 ± 0.13011.95x ± 0.06x94.68% ± 6.04%
arrayvector_normalizenormalize()float32262144x1262144x12.1937 ± 0.05340.8286 ± 0.02030.3587 ± 0.00860.9496 ± 0.02312.65x ± 0.01x164.76% ± 0.75%
arrayvector_normalizenormalize()float64262144x1262144x13.2807 ± 0.07312.7954 ± 0.10010.2398 ± 0.00530.2816 ± 0.00981.17x ± 0.02x17.42% ± 1.96%
arrayvector_segmentsegment()float32262144x1131072x10.3051 ± 0.00750.0634 ± 0.00160.0000 ± 0.00000.0000 ± 0.00004.81x ± 0.04x381.18% ± 3.64%
arrayvector_segmentsegment()float64262144x1131072x10.3085 ± 0.00870.1298 ± 0.00760.0000 ± 0.00000.0000 ± 0.00002.38x ± 0.08x138.05% ± 7.98%
arrayvector_selectmask.select(a, b)float32262144x1262144x10.8723 ± 0.05340.4859 ± 0.01460.3016 ± 0.01840.5400 ± 0.01621.80x ± 0.10x79.55% ± 9.87%
arrayvector_selectmask.select(a, b)float64262144x1262144x10.8716 ± 0.01601.1196 ± 0.02310.3009 ± 0.00560.2342 ± 0.00480.78x ± 0.01x-22.14% ± 1.45%
arrayvector_sinsin(a)float32262144x1262144x15.6152 ± 0.13742.1254 ± 0.05330.0467 ± 0.00110.1234 ± 0.00302.64x ± 0.01x164.20% ± 0.94%
arrayvector_sinsin(a)float64262144x1262144x111.1028 ± 0.266410.9457 ± 0.30470.0236 ± 0.00060.0240 ± 0.00071.01x ± 0.01x1.45% ± 0.77%
arrayvector_sqrt(a + scalar).sqrt()float32262144x1262144x15.3624 ± 0.13080.6281 ± 0.01890.0978 ± 0.00240.8354 ± 0.02478.54x ± 0.09x753.91% ± 8.62%
arrayvector_sqrt(a + scalar).sqrt()float64262144x1262144x16.4080 ± 0.17982.3226 ± 0.05050.0819 ± 0.00230.2258 ± 0.00492.76x ± 0.03x175.88% ± 2.78%
arrayvector_sub_scalara - scalarfloat32262144x1262144x10.6099 ± 0.01470.1990 ± 0.00700.4300 ± 0.01031.3190 ± 0.04503.07x ± 0.05x206.68% ± 4.71%
arrayvector_sub_scalara - scalarfloat64262144x1262144x10.7140 ± 0.01640.6069 ± 0.01200.3673 ± 0.00830.4321 ± 0.00851.18x ± 0.02x17.66% ± 2.20%
arrayvector_sub_vectora - bfloat32262144x1262144x10.7392 ± 0.01890.2508 ± 0.01810.3549 ± 0.00911.0504 ± 0.07652.96x ± 0.22x196.14% ± 22.40%
arrayvector_sub_vectora - bfloat64262144x1262144x11.0259 ± 0.02850.9138 ± 0.04880.2557 ± 0.00710.2876 ± 0.01471.13x ± 0.06x12.52% ± 6.01%
arrayvector_sumsum()float32262144x11x10.3661 ± 0.00850.0450 ± 0.00130.7163 ± 0.01665.8288 ± 0.16198.13x ± 0.10x713.41% ± 10.38%
arrayvector_sumsum()float64262144x11x10.3671 ± 0.00910.0918 ± 0.00400.7145 ± 0.01752.8612 ± 0.12074.00x ± 0.16x300.47% ± 15.59%
arrayvector_tanhtanh(a * scalar)float32262144x1262144x12.8000 ± 0.06781.2313 ± 0.03090.1873 ± 0.00450.4260 ± 0.01062.27x ± 0.00x127.40% ± 0.48%
arrayvector_tanhtanh(a * scalar)float64262144x1262144x115.6625 ± 0.416115.4361 ± 0.36280.0335 ± 0.00090.0340 ± 0.00081.01x ± 0.00x1.46% ± 0.48%
geometryquaternion_inverseQuaternion::inverse()float323x13x10.0001 ± 0.00000.0001 ± 0.00000.1083 ± 0.00780.0989 ± 0.00241.00x ± 0.00x0.00% ± 0.00%
geometryquaternion_inverseQuaternion::inverse()float643x13x10.0001 ± 0.00000.0001 ± 0.00000.0972 ± 0.00600.0699 ± 0.00530.85x ± 0.24x-15.00% ± 24.15%
geometryquaternion_normalizeQuaternion::normalize()float323x13x10.0001 ± 0.00000.0001 ± 0.00000.1261 ± 0.00470.1134 ± 0.00231.00x ± 0.00x0.00% ± 0.00%
geometryquaternion_normalizeQuaternion::normalize()float643x13x10.0001 ± 0.00000.0001 ± 0.00000.1074 ± 0.00400.0821 ± 0.00270.90x ± 0.21x-10.00% ± 21.08%
geometryquaternion_to_rotation_matrixQuaternion::toRotationMatrix()float323x13x30.0001 ± 0.00000.0001 ± 0.00000.3592 ± 0.01170.2732 ± 0.00861.00x ± 0.00x0.00% ± 0.00%
geometryquaternion_to_rotation_matrixQuaternion::toRotationMatrix()float643x13x30.0001 ± 0.00000.0001 ± 0.00000.3604 ± 0.01190.2669 ± 0.02381.00x ± 0.00x0.00% ± 0.00%
geometryvector_crosscross()float323x13x10.0001 ± 0.00000.0001 ± 0.00000.1288 ± 0.00430.1125 ± 0.00291.00x ± 0.00x0.00% ± 0.00%
geometryvector_crosscross()float643x13x10.0001 ± 0.00000.0001 ± 0.00000.1290 ± 0.00530.1104 ± 0.00471.00x ± 0.00x0.00% ± 0.00%
matrixmatrix_addA + Bfloat32512x512512x5120.7408 ± 0.01980.2449 ± 0.00920.3541 ± 0.00931.0717 ± 0.03933.03x ± 0.13x202.83% ± 13.27%
matrixmatrix_addA + Bfloat64512x512512x5121.0272 ± 0.02840.9091 ± 0.02110.2554 ± 0.00700.2885 ± 0.00661.13x ± 0.05x13.07% ± 5.01%
matrixmatrix_blockblock()float32512x512256x2560.1435 ± 0.00350.0338 ± 0.00090.0000 ± 0.00000.0000 ± 0.00004.24x ± 0.03x324.39% ± 2.75%
matrixmatrix_blockblock()float64512x512256x2560.1593 ± 0.00390.0640 ± 0.00130.0000 ± 0.00000.0000 ± 0.00002.49x ± 0.05x149.02% ± 4.70%
matrixmatrix_colwise_sumcolwise().sum()float32512x5121x5120.3701 ± 0.00920.0473 ± 0.00140.7074 ± 0.01745.5389 ± 0.16377.83x ± 0.09x683.04% ± 9.44%
matrixmatrix_colwise_sumcolwise().sum()float64512x5121x5120.3733 ± 0.00920.0945 ± 0.00480.7012 ± 0.01722.7750 ± 0.13133.96x ± 0.18x295.81% ± 18.29%
matrixmatrix_cwise_productcwiseProductfloat32512x512512x5120.6404 ± 0.01450.2580 ± 0.01070.4095 ± 0.00921.0177 ± 0.04132.49x ± 0.10x148.58% ± 10.46%
matrixmatrix_cwise_productcwiseProductfloat64512x512512x5121.0405 ± 0.02090.9080 ± 0.02740.2520 ± 0.00510.2889 ± 0.00851.15x ± 0.04x14.68% ± 4.11%
matrixmatrix_determinantdeterminant()float32512x5121x142.2178 ± 0.995114.7710 ± 0.43162.1205 ± 0.04966.0623 ± 0.17452.86x ± 0.02x185.86% ± 2.47%
matrixmatrix_determinantdeterminant()float64512x5121x153.0025 ± 1.570725.6416 ± 0.65061.6895 ± 0.05013.4916 ± 0.08772.07x ± 0.04x106.72% ± 4.05%
matrixmatrix_gemvA * xfloat32512x512512x10.1724 ± 0.00410.0818 ± 0.00173.0390 ± 0.07096.4019 ± 0.13282.11x ± 0.03x110.71% ± 2.56%
matrixmatrix_gemvA * xfloat64512x512512x10.3434 ± 0.02330.1834 ± 0.00701.5312 ± 0.09752.8592 ± 0.10581.87x ± 0.12x87.32% ± 12.38%
matrixmatrix_identityIdentity()float321x1512x5120.9450 ± 0.01870.3809 ± 0.00930.0000 ± 0.00000.0000 ± 0.00002.48x ± 0.05x148.18% ± 5.28%
matrixmatrix_identityIdentity()float641x1512x5120.6247 ± 0.01400.4294 ± 0.01150.0000 ± 0.00000.0000 ± 0.00001.46x ± 0.03x45.52% ± 3.29%
matrixmatrix_inverseinverse()float32512x512512x512217.4607 ± 5.464058.4411 ± 1.38551.2351 ± 0.03074.5956 ± 0.10793.72x ± 0.01x272.09% ± 1.43%
matrixmatrix_inverseinverse()float64512x512512x512224.3264 ± 6.5301100.5545 ± 2.47411.1976 ± 0.03512.6710 ± 0.06512.23x ± 0.05x123.11% ± 5.04%
matrixmatrix_ldlt_solveLDLT::solve(x)float32512x512512x10.2000 ± 0.00830.1439 ± 0.00332.6252 ± 0.10543.6446 ± 0.08371.39x ± 0.04x38.95% ± 3.52%
matrixmatrix_ldlt_solveLDLT::solve(x)float64512x512512x10.3129 ± 0.01160.2903 ± 0.00691.6778 ± 0.06051.8069 ± 0.04241.08x ± 0.03x7.77% ± 2.86%
matrixmatrix_llt_solveLLT::solve(x)float32512x512512x10.2019 ± 0.00700.1494 ± 0.00362.5991 ± 0.08703.5117 ± 0.08471.35x ± 0.03x35.18% ± 2.66%
matrixmatrix_llt_solveLLT::solve(x)float64512x512512x10.3126 ± 0.00780.2897 ± 0.00611.6782 ± 0.04211.8108 ± 0.03791.08x ± 0.02x7.93% ± 1.98%
matrixmatrix_matmulA * Bfloat32512x512512x51271.7630 ± 1.840222.4028 ± 0.51663.7391 ± 0.094911.9762 ± 0.27373.20x ± 0.01x220.31% ± 1.10%
matrixmatrix_matmulA * Bfloat64512x512512x51293.7697 ± 2.370646.0085 ± 1.05692.8616 ± 0.07235.8315 ± 0.13282.04x ± 0.03x103.82% ± 2.80%
matrixmatrix_rowwise_sumrowwise().sum()float32512x512512x11.8259 ± 0.04860.2395 ± 0.00560.1434 ± 0.00381.0928 ± 0.02547.62x ± 0.14x662.34% ± 13.72%
matrixmatrix_rowwise_sumrowwise().sum()float64512x512512x12.5977 ± 0.06870.6699 ± 0.07110.1008 ± 0.00270.3939 ± 0.03513.91x ± 0.35x291.00% ± 35.02%
matrixmatrix_subA - Bfloat32512x512512x5120.6398 ± 0.01570.2459 ± 0.00930.4100 ± 0.01001.0674 ± 0.03892.60x ± 0.10x160.45% ± 10.38%
matrixmatrix_subA - Bfloat64512x512512x5121.0246 ± 0.02910.9139 ± 0.03760.2560 ± 0.00710.2873 ± 0.01141.12x ± 0.06x12.31% ± 6.26%
matrixmatrix_tracetrace()float32512x5121x10.0008 ± 0.00010.0009 ± 0.00010.6096 ± 0.03630.5975 ± 0.05230.97x ± 0.08x-2.93% ± 8.27%
matrixmatrix_tracetrace()float64512x5121x10.0011 ± 0.00000.0011 ± 0.00000.4747 ± 0.01210.4709 ± 0.01350.96x ± 0.05x-3.56% ± 4.60%
matrixmatrix_transposetranspose()float32512x512512x5122.2251 ± 0.05311.8858 ± 0.04350.0000 ± 0.00000.0000 ± 0.00001.18x ± 0.01x17.99% ± 0.73%
matrixmatrix_transposetranspose()float64512x512512x5123.4085 ± 0.10703.5317 ± 0.17110.0000 ± 0.00000.0000 ± 0.00000.97x ± 0.04x-3.34% ± 4.33%
matrixmatrix_zeroZero()float321x1512x5120.4170 ± 0.01090.0926 ± 0.00200.0000 ± 0.00000.0000 ± 0.00004.50x ± 0.04x350.19% ± 3.56%
matrixmatrix_zeroZero()float641x1512x5120.4684 ± 0.01050.1874 ± 0.00650.0000 ± 0.00000.0000 ± 0.00002.50x ± 0.08x150.17% ± 8.28%

四核对比

taskset -c 0-3

threads:4

modulefunctionapidtypeinput_sizeoutput_sizelibeigen3-dev avg_ms mean±sdeigen-spacemit avg_ms mean±sdlibeigen3-dev avg_gflops mean±sdeigen-spacemit avg_gflops mean±sdspeedup mean±sdimprovement mean±sd
arrayvector_absabs(a - scalar)float32262144x1262144x10.6274 ± 0.01430.2503 ± 0.00610.4180 ± 0.00961.0479 ± 0.02642.51x ± 0.06x150.71% ± 5.71%
arrayvector_absabs(a - scalar)float64262144x1262144x10.8665 ± 0.02510.6945 ± 0.00910.3028 ± 0.00890.3775 ± 0.00491.25x ± 0.04x24.79% ± 4.23%
arrayvector_add_scalara + scalarfloat32262144x1262144x10.6428 ± 0.02140.2105 ± 0.01010.4082 ± 0.01401.2479 ± 0.06133.06x ± 0.11x205.69% ± 10.72%
arrayvector_add_scalara + scalarfloat64262144x1262144x10.7743 ± 0.02150.6206 ± 0.01530.3388 ± 0.00960.4226 ± 0.01041.25x ± 0.04x24.82% ± 4.01%
arrayvector_add_vectora + bfloat32262144x1262144x10.7733 ± 0.02480.2626 ± 0.01460.3393 ± 0.01111.0011 ± 0.05712.95x ± 0.11x194.91% ± 10.77%
arrayvector_add_vectora + bfloat64262144x1262144x11.0735 ± 0.03060.8903 ± 0.02720.2444 ± 0.00710.2947 ± 0.00851.21x ± 0.04x20.64% ± 4.12%
arrayvector_clampcwiseMax + cwiseMinfloat32262144x1262144x10.7595 ± 0.01880.4512 ± 0.00950.6907 ± 0.01701.1626 ± 0.02511.68x ± 0.04x68.37% ± 4.04%
arrayvector_clampcwiseMax + cwiseMinfloat64262144x1262144x10.9385 ± 0.01691.0677 ± 0.02100.5588 ± 0.01000.4913 ± 0.00970.88x ± 0.02x-12.08% ± 1.81%
arrayvector_coscos(a)float32262144x1262144x15.8698 ± 0.13652.1296 ± 0.04220.0447 ± 0.00100.1231 ± 0.00252.76x ± 0.05x175.65% ± 5.05%
arrayvector_coscos(a)float64262144x1262144x111.2248 ± 0.183811.1351 ± 0.23610.0234 ± 0.00040.0235 ± 0.00051.01x ± 0.01x0.82% ± 1.18%
arrayvector_div_scalara / scalarfloat32262144x1262144x11.6620 ± 0.05520.6891 ± 0.02730.1579 ± 0.00530.3810 ± 0.01542.41x ± 0.07x141.31% ± 6.84%
arrayvector_div_scalara / scalarfloat64262144x1262144x12.7798 ± 0.08352.4699 ± 0.07620.0944 ± 0.00290.1062 ± 0.00331.13x ± 0.03x12.58% ± 3.03%
arrayvector_div_vectora / (b + scalar)float32262144x1262144x11.6439 ± 0.04290.7931 ± 0.03300.3191 ± 0.00830.6621 ± 0.02782.07x ± 0.06x107.47% ± 6.28%
arrayvector_div_vectora / (b + scalar)float64262144x1262144x12.7681 ± 0.10372.6653 ± 0.05620.1896 ± 0.00710.1968 ± 0.00411.04x ± 0.04x3.88% ± 4.09%
arrayvector_dotdot()float32262144x11x10.3929 ± 0.03340.1007 ± 0.01221.3422 ± 0.10315.2688 ± 0.59003.96x ± 0.65x296.11% ± 65.05%
arrayvector_dotdot()float64262144x11x10.5018 ± 0.04910.4140 ± 0.02181.0526 ± 0.08751.2696 ± 0.06661.22x ± 0.15x21.61% ± 15.03%
arrayvector_expexp(a * scalar)float32262144x1262144x16.9051 ± 0.14542.2167 ± 0.08520.0760 ± 0.00160.2368 ± 0.00933.12x ± 0.11x211.81% ± 10.69%
arrayvector_expexp(a * scalar)float64262144x1262144x17.2381 ± 0.09427.0569 ± 0.17520.0725 ± 0.00100.0743 ± 0.00191.03x ± 0.02x2.61% ± 1.94%
arrayvector_fmaa * b + cfloat32262144x1262144x11.2551 ± 0.02850.4861 ± 0.01100.4179 ± 0.00931.0791 ± 0.02452.58x ± 0.07x158.32% ± 7.42%
arrayvector_fmaa * b + cfloat64262144x1262144x11.4918 ± 0.02341.2963 ± 0.02730.3515 ± 0.00550.4046 ± 0.00841.15x ± 0.03x15.14% ± 3.41%
arrayvector_loglog(a + scalar)float32262144x1262144x16.6297 ± 0.12742.1498 ± 0.08040.0791 ± 0.00150.2442 ± 0.00933.09x ± 0.11x208.72% ± 11.28%
arrayvector_loglog(a + scalar)float64262144x1262144x17.5689 ± 0.13996.3410 ± 0.13170.0693 ± 0.00130.0827 ± 0.00171.19x ± 0.02x19.38% ± 1.84%
arrayvector_maxmax(a, b)float32262144x1262144x10.7821 ± 0.06900.3281 ± 0.01720.3372 ± 0.02620.8011 ± 0.04222.39x ± 0.24x138.94% ± 24.04%
arrayvector_maxmax(a, b)float64262144x1262144x11.0944 ± 0.05310.9409 ± 0.02790.2400 ± 0.01110.2788 ± 0.00841.16x ± 0.07x16.44% ± 7.38%
arrayvector_minmin(a, b)float32262144x1262144x10.8819 ± 0.02160.3255 ± 0.01570.2974 ± 0.00730.8069 ± 0.03782.71x ± 0.11x171.33% ± 11.42%
arrayvector_minmin(a, b)float64262144x1262144x11.0774 ± 0.04910.9156 ± 0.02240.2438 ± 0.01080.2864 ± 0.00701.18x ± 0.07x17.75% ± 6.54%
arrayvector_mul_scalara * scalarfloat32262144x1262144x10.7686 ± 0.02730.2254 ± 0.01070.3415 ± 0.01231.1652 ± 0.05703.41x ± 0.12x241.25% ± 12.24%
arrayvector_mul_scalara * scalarfloat64262144x1262144x10.7651 ± 0.01840.6495 ± 0.02140.3428 ± 0.00840.4040 ± 0.01301.18x ± 0.04x17.89% ± 4.20%
arrayvector_mul_vectora * bfloat32262144x1262144x10.7690 ± 0.02550.2754 ± 0.01390.3412 ± 0.01130.9540 ± 0.04992.80x ± 0.14x179.67% ± 13.87%
arrayvector_mul_vectora * bfloat64262144x1262144x11.0740 ± 0.03960.8982 ± 0.02830.2444 ± 0.00900.2921 ± 0.00891.20x ± 0.07x19.72% ± 6.77%
arrayvector_normnorm()float32262144x11x10.3798 ± 0.01180.0855 ± 0.00171.3816 ± 0.04286.1338 ± 0.12204.44x ± 0.12x344.27% ± 11.66%
arrayvector_normnorm()float64262144x11x10.3772 ± 0.00920.1904 ± 0.00551.3907 ± 0.03362.7558 ± 0.08011.98x ± 0.05x98.19% ± 5.16%
arrayvector_normalizenormalize()float32262144x1262144x12.2772 ± 0.06950.8451 ± 0.01770.3456 ± 0.01060.9309 ± 0.02002.69x ± 0.07x169.48% ± 6.68%
arrayvector_normalizenormalize()float64262144x1262144x13.3798 ± 0.08862.8385 ± 0.07060.2328 ± 0.00610.2772 ± 0.00691.19x ± 0.03x19.09% ± 2.70%
arrayvector_segmentsegment()float32262144x1131072x10.3164 ± 0.00980.0646 ± 0.00110.0000 ± 0.00000.0000 ± 0.00004.90x ± 0.11x389.82% ± 11.47%
arrayvector_segmentsegment()float64262144x1131072x10.3174 ± 0.01010.1354 ± 0.00550.0000 ± 0.00000.0000 ± 0.00002.35x ± 0.09x134.71% ± 8.73%
arrayvector_selectmask.select(a, b)float32262144x1262144x10.9031 ± 0.03610.4990 ± 0.01630.2907 ± 0.01190.5258 ± 0.01731.81x ± 0.09x81.12% ± 8.87%
arrayvector_selectmask.select(a, b)float64262144x1262144x10.9579 ± 0.03771.1470 ± 0.02420.2741 ± 0.01070.2286 ± 0.00480.84x ± 0.03x-16.46% ± 3.46%
arrayvector_sinsin(a)float32262144x1262144x15.7507 ± 0.09142.1754 ± 0.05790.0456 ± 0.00070.1206 ± 0.00322.64x ± 0.05x164.45% ± 5.10%
arrayvector_sinsin(a)float64262144x1262144x111.3619 ± 0.162911.3429 ± 0.29030.0231 ± 0.00030.0231 ± 0.00061.00x ± 0.02x0.20% ± 1.75%
arrayvector_sqrt(a + scalar).sqrt()float32262144x1262144x15.4976 ± 0.08810.6506 ± 0.02490.0954 ± 0.00160.8069 ± 0.03138.46x ± 0.27x745.83% ± 27.12%
arrayvector_sqrt(a + scalar).sqrt()float64262144x1262144x16.6503 ± 0.16652.4066 ± 0.06490.0789 ± 0.00200.2180 ± 0.00592.76x ± 0.09x176.46% ± 8.55%
arrayvector_sub_scalara - scalarfloat32262144x1262144x10.6421 ± 0.02080.2097 ± 0.01000.4087 ± 0.01361.2528 ± 0.06163.07x ± 0.11x206.55% ± 10.72%
arrayvector_sub_scalara - scalarfloat64262144x1262144x10.7746 ± 0.02350.6244 ± 0.01980.3387 ± 0.01040.4202 ± 0.01331.24x ± 0.05x24.14% ± 4.85%
arrayvector_sub_vectora - bfloat32262144x1262144x10.7705 ± 0.02440.2614 ± 0.01300.3406 ± 0.01081.0054 ± 0.05122.95x ± 0.13x195.25% ± 12.72%
arrayvector_sub_vectora - bfloat64262144x1262144x11.0788 ± 0.04560.8893 ± 0.02660.2434 ± 0.01020.2950 ± 0.00841.21x ± 0.07x21.42% ± 6.67%
arrayvector_sumsum()float32262144x11x10.3786 ± 0.01050.0458 ± 0.00100.6929 ± 0.01935.7290 ± 0.13268.27x ± 0.22x726.95% ± 22.18%
arrayvector_sumsum()float64262144x11x10.3775 ± 0.00910.0937 ± 0.00410.6947 ± 0.01672.8015 ± 0.11794.03x ± 0.17x303.33% ± 17.47%
arrayvector_tanhtanh(a * scalar)float32262144x1262144x12.9032 ± 0.08481.2529 ± 0.02470.1807 ± 0.00530.4186 ± 0.00852.32x ± 0.06x131.73% ± 5.53%
arrayvector_tanhtanh(a * scalar)float64262144x1262144x116.0917 ± 0.298515.9251 ± 0.34400.0326 ± 0.00060.0329 ± 0.00071.01x ± 0.01x1.06% ± 1.09%
geometryquaternion_inverseQuaternion::inverse()float323x13x10.0001 ± 0.00000.0001 ± 0.00000.1071 ± 0.00360.0947 ± 0.00571.00x ± 0.00x0.00% ± 0.00%
geometryquaternion_inverseQuaternion::inverse()float643x13x10.0001 ± 0.00010.0001 ± 0.00000.0864 ± 0.01930.0685 ± 0.00201.10x ± 0.70x10.00% ± 69.92%
geometryquaternion_normalizeQuaternion::normalize()float323x13x10.0001 ± 0.00000.0001 ± 0.00000.1231 ± 0.00970.1115 ± 0.00451.00x ± 0.00x0.00% ± 0.00%
geometryquaternion_normalizeQuaternion::normalize()float643x13x10.0001 ± 0.00000.0001 ± 0.00000.1029 ± 0.00370.0815 ± 0.00540.85x ± 0.24x-15.00% ± 24.15%
geometryquaternion_to_rotation_matrixQuaternion::toRotationMatrix()float323x13x30.0001 ± 0.00000.0001 ± 0.00000.3439 ± 0.01030.2628 ± 0.01151.00x ± 0.00x0.00% ± 0.00%
geometryquaternion_to_rotation_matrixQuaternion::toRotationMatrix()float643x13x30.0001 ± 0.00000.0001 ± 0.00000.3574 ± 0.03000.2560 ± 0.00851.00x ± 0.00x0.00% ± 0.00%
geometryvector_crosscross()float323x13x10.0001 ± 0.00000.0001 ± 0.00000.1241 ± 0.00370.1094 ± 0.00301.00x ± 0.00x0.00% ± 0.00%
geometryvector_crosscross()float643x13x10.0001 ± 0.00000.0001 ± 0.00000.1224 ± 0.00510.1076 ± 0.00311.00x ± 0.00x0.00% ± 0.00%
matrixmatrix_addA + Bfloat32512x512512x5120.7672 ± 0.02450.2550 ± 0.01460.3420 ± 0.01081.0312 ± 0.05873.02x ± 0.23x201.97% ± 22.84%
matrixmatrix_addA + Bfloat64512x512512x5121.0685 ± 0.03290.8896 ± 0.01940.2455 ± 0.00730.2948 ± 0.00621.20x ± 0.05x20.17% ± 4.96%
matrixmatrix_blockblock()float32512x512256x2560.1484 ± 0.00400.0352 ± 0.00110.0000 ± 0.00000.0000 ± 0.00004.22x ± 0.06x321.95% ± 6.38%
matrixmatrix_blockblock()float64512x512256x2560.1623 ± 0.00370.0664 ± 0.00190.0000 ± 0.00000.0000 ± 0.00002.45x ± 0.04x144.58% ± 4.16%
matrixmatrix_colwise_sumcolwise().sum()float32512x5121x5120.3820 ± 0.01030.0490 ± 0.00190.6855 ± 0.01855.3448 ± 0.20627.80x ± 0.29x679.92% ± 29.15%
matrixmatrix_colwise_sumcolwise().sum()float64512x5121x5120.3858 ± 0.01270.0969 ± 0.00380.6788 ± 0.02252.7027 ± 0.10673.98x ± 0.19x298.46% ± 18.86%
matrixmatrix_cwise_productcwiseProductfloat32512x512512x5120.6632 ± 0.02750.2684 ± 0.01280.3959 ± 0.01600.9784 ± 0.04362.47x ± 0.14x147.45% ± 13.65%
matrixmatrix_cwise_productcwiseProductfloat64512x512512x5121.0739 ± 0.03550.9244 ± 0.03240.2444 ± 0.00800.2839 ± 0.01001.16x ± 0.06x16.32% ± 6.20%
matrixmatrix_determinantdeterminant()float32512x5121x125.0644 ± 0.674211.0655 ± 0.33053.5724 ± 0.09978.0929 ± 0.24732.27x ± 0.06x126.60% ± 6.36%
matrixmatrix_determinantdeterminant()float64512x5121x130.3570 ± 0.779917.9423 ± 0.43282.9494 ± 0.07874.9897 ± 0.12301.69x ± 0.03x69.21% ± 3.09%
matrixmatrix_gemvA * xfloat32512x512512x10.1794 ± 0.00580.0856 ± 0.00372.9220 ± 0.09496.1306 ± 0.26702.10x ± 0.08x109.90% ± 8.43%
matrixmatrix_gemvA * xfloat64512x512512x10.3457 ± 0.00830.1925 ± 0.00651.5160 ± 0.03642.7236 ± 0.09461.80x ± 0.06x79.70% ± 6.35%
matrixmatrix_identityIdentity()float321x1512x5120.9681 ± 0.04810.3927 ± 0.01220.0000 ± 0.00000.0000 ± 0.00002.46x ± 0.07x146.44% ± 7.27%
matrixmatrix_identityIdentity()float641x1512x5120.6387 ± 0.01500.4434 ± 0.01260.0000 ± 0.00000.0000 ± 0.00001.44x ± 0.02x44.07% ± 2.35%
matrixmatrix_inverseinverse()float32512x512512x512205.4377 ± 3.843853.1489 ± 1.39581.3071 ± 0.02525.0538 ± 0.13573.87x ± 0.07x286.64% ± 6.58%
matrixmatrix_inverseinverse()float64512x512512x512195.1338 ± 4.909291.9283 ± 2.12621.3764 ± 0.03482.9215 ± 0.06822.12x ± 0.05x112.30% ± 4.64%
matrixmatrix_ldlt_solveLDLT::solve(x)float32512x512512x10.2127 ± 0.01140.1515 ± 0.00572.4712 ± 0.13383.4650 ± 0.13391.40x ± 0.06x40.44% ± 6.05%
matrixmatrix_ldlt_solveLDLT::solve(x)float64512x512512x10.3276 ± 0.01070.3058 ± 0.01031.6019 ± 0.05531.7160 ± 0.06001.07x ± 0.03x7.17% ± 3.26%
matrixmatrix_llt_solveLLT::solve(x)float32512x512512x10.2124 ± 0.00800.1570 ± 0.00532.4712 ± 0.09643.3415 ± 0.11621.35x ± 0.05x35.32% ± 4.64%
matrixmatrix_llt_solveLLT::solve(x)float64512x512512x10.3287 ± 0.01100.3079 ± 0.01141.5969 ± 0.05641.7051 ± 0.06591.07x ± 0.04x6.82% ± 3.72%
matrixmatrix_matmulA * Bfloat32512x512512x51221.2244 ± 0.63926.0132 ± 0.192612.6459 ± 0.398144.6392 ± 1.44283.53x ± 0.08x253.07% ± 8.25%
matrixmatrix_matmulA * Bfloat64512x512512x51235.5351 ± 1.124612.5752 ± 0.35027.5539 ± 0.253621.3411 ± 0.62072.83x ± 0.05x182.58% ± 4.51%
matrixmatrix_rowwise_sumrowwise().sum()float32512x512512x11.8989 ± 0.06160.2482 ± 0.01060.1379 ± 0.00451.0559 ± 0.04527.66x ± 0.33x666.04% ± 32.85%
matrixmatrix_rowwise_sumrowwise().sum()float64512x512512x12.6737 ± 0.08480.6785 ± 0.02650.0979 ± 0.00310.3862 ± 0.01543.94x ± 0.17x294.49% ± 17.24%
matrixmatrix_subA - Bfloat32512x512512x5120.6607 ± 0.03100.2564 ± 0.01270.3975 ± 0.01761.0244 ± 0.04822.58x ± 0.21x158.42% ± 20.88%
matrixmatrix_subA - Bfloat64512x512512x5121.0674 ± 0.05740.9165 ± 0.04180.2462 ± 0.01280.2866 ± 0.01291.17x ± 0.09x16.74% ± 9.15%
matrixmatrix_tracetrace()float32512x5121x10.0008 ± 0.00000.0009 ± 0.00020.6024 ± 0.01800.5690 ± 0.08770.93x ± 0.17x-7.08% ± 16.75%
matrixmatrix_tracetrace()float64512x5121x10.0011 ± 0.00010.0011 ± 0.00010.4578 ± 0.01640.4521 ± 0.01710.98x ± 0.07x-2.42% ± 7.20%
matrixmatrix_transposetranspose()float32512x512512x5122.2959 ± 0.05721.9306 ± 0.05220.0000 ± 0.00000.0000 ± 0.00001.19x ± 0.02x18.94% ± 2.22%
matrixmatrix_transposetranspose()float64512x512512x5123.4579 ± 0.07863.5339 ± 0.07950.0000 ± 0.00000.0000 ± 0.00000.98x ± 0.02x-2.13% ± 2.14%
matrixmatrix_zeroZero()float321x1512x5120.4422 ± 0.01220.0951 ± 0.00300.0000 ± 0.00000.0000 ± 0.00004.65x ± 0.07x364.90% ± 7.12%
matrixmatrix_zeroZero()float641x1512x5120.4998 ± 0.01050.1928 ± 0.00680.0000 ± 0.00000.0000 ± 0.00002.59x ± 0.07x159.39% ± 7.43%

八核对比

taskset -c 0-7

threads:8

modulefunctionapidtypeinput_sizeoutput_sizelibeigen3-dev avg_ms mean±sdeigen-spacemit avg_ms mean±sdlibeigen3-dev avg_gflops mean±sdeigen-spacemit avg_gflops mean±sdspeedup mean±sdimprovement mean±sd
arrayvector_absabs(a - scalar)float32262144x1262144x10.6158 ± 0.02020.2466 ± 0.00460.4261 ± 0.01351.0633 ± 0.02002.50x ± 0.07x149.72% ± 6.83%
arrayvector_absabs(a - scalar)float64262144x1262144x10.8182 ± 0.03140.6886 ± 0.01190.3208 ± 0.01180.3808 ± 0.00661.19x ± 0.04x18.80% ± 3.51%
arrayvector_add_scalara + scalarfloat32262144x1262144x10.6149 ± 0.01600.2031 ± 0.00500.4266 ± 0.01101.2917 ± 0.03173.03x ± 0.08x202.85% ± 7.68%
arrayvector_add_scalara + scalarfloat64262144x1262144x10.7339 ± 0.03230.6193 ± 0.01950.3578 ± 0.01500.4237 ± 0.01331.19x ± 0.05x18.55% ± 5.13%
arrayvector_add_vectora + bfloat32262144x1262144x10.7493 ± 0.02420.2465 ± 0.01510.3502 ± 0.01121.0671 ± 0.06963.05x ± 0.26x205.27% ± 26.00%
arrayvector_add_vectora + bfloat64262144x1262144x11.0344 ± 0.02280.8399 ± 0.09700.2535 ± 0.00550.3163 ± 0.04041.25x ± 0.17x24.93% ± 17.30%
arrayvector_clampcwiseMax + cwiseMinfloat32262144x1262144x10.7434 ± 0.02480.4459 ± 0.00920.7060 ± 0.02291.1763 ± 0.02451.67x ± 0.04x66.71% ± 3.76%
arrayvector_clampcwiseMax + cwiseMinfloat64262144x1262144x10.8968 ± 0.03201.0468 ± 0.03100.5853 ± 0.02020.5012 ± 0.01470.86x ± 0.02x-14.32% ± 2.06%
arrayvector_coscos(a)float32262144x1262144x15.7194 ± 0.11732.1087 ± 0.04740.0458 ± 0.00090.1244 ± 0.00282.71x ± 0.03x171.26% ± 3.44%
arrayvector_coscos(a)float64262144x1262144x111.0917 ± 0.319810.8393 ± 0.34600.0237 ± 0.00070.0242 ± 0.00071.02x ± 0.02x2.36% ± 2.10%
arrayvector_div_scalara / scalarfloat32262144x1262144x11.6055 ± 0.04890.6647 ± 0.01410.1634 ± 0.00490.3945 ± 0.00842.42x ± 0.06x141.54% ± 6.24%
arrayvector_div_scalara / scalarfloat64262144x1262144x12.6389 ± 0.05982.4164 ± 0.09880.0994 ± 0.00230.1086 ± 0.00441.09x ± 0.04x9.31% ± 3.52%
arrayvector_div_vectora / (b + scalar)float32262144x1262144x11.5999 ± 0.03510.7725 ± 0.01350.3278 ± 0.00720.6789 ± 0.01202.07x ± 0.03x107.11% ± 3.21%
arrayvector_div_vectora / (b + scalar)float64262144x1262144x12.6680 ± 0.08272.6169 ± 0.07490.1967 ± 0.00630.2005 ± 0.00571.02x ± 0.04x2.02% ± 3.99%
arrayvector_dotdot()float32262144x11x10.3711 ± 0.01220.1016 ± 0.00961.4142 ± 0.04535.2031 ± 0.48403.68x ± 0.35x268.14% ± 34.66%
arrayvector_dotdot()float64262144x11x10.4870 ± 0.02460.3998 ± 0.01691.0788 ± 0.05121.3134 ± 0.05321.22x ± 0.08x22.04% ± 8.39%
arrayvector_expexp(a * scalar)float32262144x1262144x16.7447 ± 0.13682.1485 ± 0.04600.0778 ± 0.00160.2441 ± 0.00533.14x ± 0.06x213.98% ± 5.78%
arrayvector_expexp(a * scalar)float64262144x1262144x17.1180 ± 0.14976.8649 ± 0.18920.0737 ± 0.00160.0764 ± 0.00211.04x ± 0.02x3.72% ± 1.87%
arrayvector_fmaa * b + cfloat32262144x1262144x11.2301 ± 0.02390.4826 ± 0.01210.4264 ± 0.00831.0871 ± 0.02812.55x ± 0.06x155.00% ± 6.02%
arrayvector_fmaa * b + cfloat64262144x1262144x11.5160 ± 0.03871.2732 ± 0.02450.3460 ± 0.00890.4119 ± 0.00791.19x ± 0.04x19.11% ± 3.82%
arrayvector_loglog(a + scalar)float32262144x1262144x16.4831 ± 0.13752.0885 ± 0.04230.0809 ± 0.00170.2511 ± 0.00513.10x ± 0.05x210.45% ± 4.70%
arrayvector_loglog(a + scalar)float64262144x1262144x17.4521 ± 0.20676.2224 ± 0.20270.0704 ± 0.00200.0843 ± 0.00271.20x ± 0.04x19.82% ± 3.55%
arrayvector_maxmax(a, b)float32262144x1262144x10.7674 ± 0.06240.3113 ± 0.00950.3434 ± 0.02480.8428 ± 0.02622.47x ± 0.20x146.62% ± 20.31%
arrayvector_maxmax(a, b)float64262144x1262144x11.0518 ± 0.06810.9136 ± 0.02860.2503 ± 0.01760.2872 ± 0.00881.15x ± 0.08x15.19% ± 7.85%
arrayvector_minmin(a, b)float32262144x1262144x10.8658 ± 0.02620.3097 ± 0.01290.3030 ± 0.00890.8477 ± 0.03702.80x ± 0.10x179.79% ± 9.59%
arrayvector_minmin(a, b)float64262144x1262144x11.0125 ± 0.06430.9064 ± 0.01850.2599 ± 0.01750.2893 ± 0.00581.12x ± 0.06x11.68% ± 6.48%
arrayvector_mul_scalara * scalarfloat32262144x1262144x10.7404 ± 0.02420.2193 ± 0.00420.3544 ± 0.01141.1957 ± 0.02213.38x ± 0.11x237.68% ± 11.15%
arrayvector_mul_scalara * scalarfloat64262144x1262144x10.7241 ± 0.01680.6447 ± 0.02300.3622 ± 0.00840.4071 ± 0.01421.12x ± 0.04x12.42% ± 3.86%
arrayvector_mul_vectora * bfloat32262144x1262144x10.7539 ± 0.01560.2589 ± 0.01560.3479 ± 0.00731.0159 ± 0.06562.92x ± 0.23x192.35% ± 22.93%
arrayvector_mul_vectora * bfloat64262144x1262144x11.0405 ± 0.02910.8708 ± 0.10080.2521 ± 0.00710.3055 ± 0.04351.21x ± 0.19x21.42% ± 18.95%
arrayvector_normnorm()float32262144x11x10.3704 ± 0.01100.0847 ± 0.00191.4167 ± 0.04126.1915 ± 0.13784.37x ± 0.11x337.10% ± 10.94%
arrayvector_normnorm()float64262144x11x10.3744 ± 0.01630.1925 ± 0.01211.4027 ± 0.06012.7332 ± 0.16911.95x ± 0.08x94.85% ± 8.40%
arrayvector_normalizenormalize()float32262144x1262144x12.2142 ± 0.05160.8405 ± 0.01290.3553 ± 0.00820.9359 ± 0.01442.63x ± 0.04x163.44% ± 4.08%
arrayvector_normalizenormalize()float64262144x1262144x13.3215 ± 0.11062.7936 ± 0.06230.2370 ± 0.00780.2816 ± 0.00631.19x ± 0.02x18.89% ± 2.44%
arrayvector_segmentsegment()float32262144x1131072x10.3072 ± 0.00980.0636 ± 0.00160.0000 ± 0.00000.0000 ± 0.00004.83x ± 0.10x382.57% ± 10.03%
arrayvector_segmentsegment()float64262144x1131072x10.3107 ± 0.01050.1337 ± 0.00660.0000 ± 0.00000.0000 ± 0.00002.33x ± 0.09x132.68% ± 9.05%
arrayvector_selectmask.select(a, b)float32262144x1262144x10.8753 ± 0.03840.4883 ± 0.01000.3001 ± 0.01420.5371 ± 0.01111.79x ± 0.08x79.29% ± 8.17%
arrayvector_selectmask.select(a, b)float64262144x1262144x10.8822 ± 0.03471.1391 ± 0.02980.2975 ± 0.01190.2303 ± 0.00590.77x ± 0.03x-22.54% ± 2.65%
arrayvector_sinsin(a)float32262144x1262144x15.6462 ± 0.11282.1422 ± 0.04470.0464 ± 0.00090.1224 ± 0.00262.64x ± 0.03x163.59% ± 2.99%
arrayvector_sinsin(a)float64262144x1262144x111.2308 ± 0.255910.9707 ± 0.27450.0233 ± 0.00050.0239 ± 0.00061.02x ± 0.02x2.39% ± 2.12%
arrayvector_sqrt(a + scalar).sqrt()float32262144x1262144x15.3944 ± 0.12290.6349 ± 0.01060.0973 ± 0.00220.8260 ± 0.01398.50x ± 0.16x749.68% ± 16.11%
arrayvector_sqrt(a + scalar).sqrt()float64262144x1262144x16.4811 ± 0.16752.3448 ± 0.07040.0809 ± 0.00210.2238 ± 0.00662.77x ± 0.07x176.50% ± 6.77%
arrayvector_sub_scalara - scalarfloat32262144x1262144x10.6170 ± 0.01970.2059 ± 0.00320.4252 ± 0.01331.2733 ± 0.01963.00x ± 0.11x199.72% ± 11.04%
arrayvector_sub_scalara - scalarfloat64262144x1262144x10.7278 ± 0.02390.6184 ± 0.02010.3605 ± 0.01160.4243 ± 0.01371.18x ± 0.03x17.73% ± 3.23%
arrayvector_sub_vectora - bfloat32262144x1262144x10.7498 ± 0.02300.2463 ± 0.01530.3499 ± 0.01071.0683 ± 0.07233.06x ± 0.25x205.68% ± 24.89%
arrayvector_sub_vectora - bfloat64262144x1262144x11.0351 ± 0.02360.8779 ± 0.08790.2534 ± 0.00580.3017 ± 0.03441.19x ± 0.13x19.08% ± 13.33%
arrayvector_sumsum()float32262144x11x10.3722 ± 0.01470.0454 ± 0.00120.7052 ± 0.02705.7789 ± 0.15218.20x ± 0.23x719.87% ± 22.77%
arrayvector_sumsum()float64262144x11x10.3743 ± 0.01620.0946 ± 0.00740.7015 ± 0.02992.7866 ± 0.20523.97x ± 0.27x297.27% ± 26.68%
arrayvector_tanhtanh(a * scalar)float32262144x1262144x12.8239 ± 0.07741.2404 ± 0.02580.1858 ± 0.00500.4229 ± 0.00882.28x ± 0.04x127.66% ± 4.03%
arrayvector_tanhtanh(a * scalar)float64262144x1262144x115.8625 ± 0.549415.4945 ± 0.36130.0331 ± 0.00110.0339 ± 0.00081.02x ± 0.02x2.36% ± 1.73%
geometryquaternion_inverseQuaternion::inverse()float323x13x10.0001 ± 0.00000.0001 ± 0.00000.1102 ± 0.00390.0972 ± 0.00221.00x ± 0.00x0.00% ± 0.00%
geometryquaternion_inverseQuaternion::inverse()float643x13x10.0001 ± 0.00000.0001 ± 0.00000.0943 ± 0.00200.0729 ± 0.00580.95x ± 0.16x-5.00% ± 15.81%
geometryquaternion_normalizeQuaternion::normalize()float323x13x10.0001 ± 0.00000.0001 ± 0.00000.1243 ± 0.01170.1137 ± 0.00301.00x ± 0.00x0.00% ± 0.00%
geometryquaternion_normalizeQuaternion::normalize()float643x13x10.0001 ± 0.00000.0001 ± 0.00000.1063 ± 0.00290.0827 ± 0.00300.95x ± 0.16x-5.00% ± 15.81%
geometryquaternion_to_rotation_matrixQuaternion::toRotationMatrix()float323x13x30.0001 ± 0.00000.0001 ± 0.00000.3538 ± 0.01400.2728 ± 0.01831.00x ± 0.00x0.00% ± 0.00%
geometryquaternion_to_rotation_matrixQuaternion::toRotationMatrix()float643x13x30.0001 ± 0.00000.0001 ± 0.00000.3566 ± 0.01390.2691 ± 0.02121.00x ± 0.00x0.00% ± 0.00%
geometryvector_crosscross()float323x13x10.0001 ± 0.00000.0001 ± 0.00000.1278 ± 0.00370.1104 ± 0.00251.00x ± 0.00x0.00% ± 0.00%
geometryvector_crosscross()float643x13x10.0001 ± 0.00000.0001 ± 0.00000.1268 ± 0.00280.1098 ± 0.00421.00x ± 0.00x0.00% ± 0.00%
matrixmatrix_addA + Bfloat32512x512512x5120.7502 ± 0.02020.2510 ± 0.01290.3496 ± 0.00931.0465 ± 0.05012.99x ± 0.10x199.25% ± 10.20%
matrixmatrix_addA + Bfloat64512x512512x5121.0258 ± 0.02120.8888 ± 0.07270.2556 ± 0.00530.2970 ± 0.02811.16x ± 0.13x16.30% ± 12.53%
matrixmatrix_blockblock()float32512x512256x2560.1442 ± 0.00340.0348 ± 0.00140.0000 ± 0.00000.0000 ± 0.00004.14x ± 0.10x314.48% ± 9.75%
matrixmatrix_blockblock()float64512x512256x2560.1601 ± 0.00620.0645 ± 0.00210.0000 ± 0.00000.0000 ± 0.00002.48x ± 0.04x148.12% ± 4.44%
matrixmatrix_colwise_sumcolwise().sum()float32512x5121x5120.3769 ± 0.01370.0493 ± 0.00390.6950 ± 0.02475.3323 ± 0.38367.68x ± 0.52x667.54% ± 51.54%
matrixmatrix_colwise_sumcolwise().sum()float64512x5121x5120.3780 ± 0.01630.1002 ± 0.00690.6933 ± 0.02932.6234 ± 0.18383.79x ± 0.32x279.00% ± 31.64%
matrixmatrix_cwise_productcwiseProductfloat32512x512512x5120.6582 ± 0.02790.2629 ± 0.01110.3990 ± 0.01660.9989 ± 0.04072.51x ± 0.16x150.84% ± 15.94%
matrixmatrix_cwise_productcwiseProductfloat64512x512512x5121.0043 ± 0.06630.8983 ± 0.08400.2622 ± 0.01910.2945 ± 0.03241.13x ± 0.14x12.75% ± 13.71%
matrixmatrix_determinantdeterminant()float32512x5121x125.0008 ± 1.730915.2198 ± 0.52863.5940 ± 0.24025.8855 ± 0.20421.64x ± 0.11x64.31% ± 10.50%
matrixmatrix_determinantdeterminant()float64512x5121x132.1621 ± 4.266821.2876 ± 0.64202.8195 ± 0.31654.2067 ± 0.12551.51x ± 0.19x51.04% ± 18.80%
matrixmatrix_gemvA * xfloat32512x512512x10.1753 ± 0.00620.0889 ± 0.02152.9914 ± 0.10356.0938 ± 0.92412.04x ± 0.31x103.93% ± 31.24%
matrixmatrix_gemvA * xfloat64512x512512x10.3356 ± 0.01520.1887 ± 0.00931.5633 ± 0.06932.7823 ± 0.13711.78x ± 0.11x78.21% ± 10.87%
matrixmatrix_identityIdentity()float321x1512x5120.9374 ± 0.03480.3871 ± 0.01550.0000 ± 0.00000.0000 ± 0.00002.42x ± 0.07x142.31% ± 7.00%
matrixmatrix_identityIdentity()float641x1512x5120.6304 ± 0.02500.4298 ± 0.01440.0000 ± 0.00000.0000 ± 0.00001.47x ± 0.03x46.68% ± 3.37%
matrixmatrix_inverseinverse()float32512x512512x512205.2442 ± 8.274157.1382 ± 2.02091.3098 ± 0.05194.7033 ± 0.16503.59x ± 0.08x259.22% ± 7.83%
matrixmatrix_inverseinverse()float64512x512512x512198.7883 ± 13.729893.3451 ± 2.32361.3559 ± 0.09002.8773 ± 0.07112.13x ± 0.13x112.90% ± 12.73%
matrixmatrix_ldlt_solveLDLT::solve(x)float32512x512512x10.2052 ± 0.00770.1477 ± 0.00672.5588 ± 0.09553.5560 ± 0.15921.39x ± 0.06x39.04% ± 6.14%
matrixmatrix_ldlt_solveLDLT::solve(x)float64512x512512x10.3569 ± 0.02350.3023 ± 0.01911.4748 ± 0.10141.7408 ± 0.10931.18x ± 0.09x18.38% ± 8.92%
matrixmatrix_llt_solveLLT::solve(x)float32512x512512x10.2087 ± 0.00770.1535 ± 0.00732.5145 ± 0.09373.4225 ± 0.16101.36x ± 0.06x36.18% ± 6.38%
matrixmatrix_llt_solveLLT::solve(x)float64512x512512x10.3555 ± 0.02370.3027 ± 0.01851.4810 ± 0.10241.7374 ± 0.10331.18x ± 0.06x17.50% ± 5.90%
matrixmatrix_matmulA * Bfloat32512x512512x51211.9369 ± 0.60033.6781 ± 0.659322.5172 ± 1.134674.5816 ± 10.49203.32x ± 0.48x231.97% ± 47.54%
matrixmatrix_matmulA * Bfloat64512x512512x51217.4131 ± 1.28416.8375 ± 0.613915.4721 ± 1.080439.4869 ± 3.29922.55x ± 0.17x155.47% ± 17.31%
matrixmatrix_rowwise_sumrowwise().sum()float32512x512512x11.8579 ± 0.07710.2662 ± 0.08010.1411 ± 0.00571.0312 ± 0.17917.32x ± 1.28x632.25% ± 128.15%
matrixmatrix_rowwise_sumrowwise().sum()float64512x512512x12.6229 ± 0.11160.7331 ± 0.10110.0999 ± 0.00410.3626 ± 0.04623.64x ± 0.53x263.98% ± 53.09%
matrixmatrix_subA - Bfloat32512x512512x5120.6553 ± 0.01880.2529 ± 0.00990.4003 ± 0.01161.0379 ± 0.03912.59x ± 0.09x159.33% ± 9.39%
matrixmatrix_subA - Bfloat64512x512512x5121.0116 ± 0.04190.8950 ± 0.06260.2596 ± 0.01170.2943 ± 0.02271.14x ± 0.10x13.60% ± 10.48%
matrixmatrix_tracetrace()float32512x5121x10.0008 ± 0.00010.0009 ± 0.00010.6028 ± 0.02390.6019 ± 0.02620.99x ± 0.09x-0.83% ± 8.67%
matrixmatrix_tracetrace()float64512x5121x10.0011 ± 0.00010.0011 ± 0.00010.4644 ± 0.01890.4643 ± 0.02490.99x ± 0.07x-0.63% ± 7.31%
matrixmatrix_transposetranspose()float32512x512512x5122.2642 ± 0.10531.9411 ± 0.07440.0000 ± 0.00000.0000 ± 0.00001.17x ± 0.04x16.67% ± 3.86%
matrixmatrix_transposetranspose()float64512x512512x5123.4664 ± 0.07213.6390 ± 0.30190.0000 ± 0.00000.0000 ± 0.00000.96x ± 0.08x-4.17% ± 8.09%
matrixmatrix_zeroZero()float321x1512x5120.4281 ± 0.00880.0940 ± 0.00360.0000 ± 0.00000.0000 ± 0.00004.56x ± 0.10x355.52% ± 10.11%
matrixmatrix_zeroZero()float641x1512x5120.4941 ± 0.01790.1869 ± 0.00640.0000 ± 0.00000.0000 ± 0.00002.64x ± 0.07x164.44% ± 6.96%

eigen-sapcemit USE BLAS VS Without BLAS

  • 对比 eigen-sapcemit 使用 openblas-spacemit 作为后端和不使用之间的性能差异
  • 使用 taskset -c 限制核数
  • 单次测试的计时策略是每个算子跑 50 次取平均值,预热10次。本测试重复10次单次测试,取其指标的平均值并计算标准差
  • no_blas 表示直接使用 eigen-spacemit 的 API
  • blas 表示 eigen-spacemit 使用 openblas-spacemit 作为后端
  • mean 表示 10 次测试的均值,sd 为标准差

单核对比

taskset -c 0

threads:1

modulefunctionapidtypeinput_sizeoutput_sizeno_blas avg_ms mean±sdblas avg_ms mean±sdno_blas avg_gflops mean±sdblas avg_gflops mean±sdspeedup mean±sdimprovement mean±sd
arrayvector_absabs(a - scalar)float32262144x1262144x10.2426 ± 0.00600.2457 ± 0.00881.0810 ± 0.02631.0679 ± 0.03740.99x ± 0.03x-1.21% ± 2.74%
arrayvector_absabs(a - scalar)float64262144x1262144x10.6786 ± 0.00920.6801 ± 0.01480.3864 ± 0.00530.3856 ± 0.00831.00x ± 0.02x-0.19% ± 1.58%
arrayvector_add_scalara + scalarfloat32262144x1262144x10.1986 ± 0.00740.2023 ± 0.00971.3213 ± 0.04721.2982 ± 0.06080.98x ± 0.03x-1.74% ± 3.14%
arrayvector_add_scalara + scalarfloat64262144x1262144x10.6039 ± 0.00790.6084 ± 0.02520.4342 ± 0.00560.4315 ± 0.01740.99x ± 0.03x-0.63% ± 3.43%
arrayvector_add_vectora + bfloat32262144x1262144x10.2458 ± 0.01500.2509 ± 0.02051.0700 ± 0.06401.0515 ± 0.09280.99x ± 0.11x-1.31% ± 11.42%
arrayvector_add_vectora + bfloat64262144x1262144x10.9074 ± 0.03000.9024 ± 0.03190.2892 ± 0.00930.2908 ± 0.01001.01x ± 0.04x0.63% ± 3.81%
arrayvector_clampcwiseMax + cwiseMinfloat32262144x1262144x10.4406 ± 0.01040.4427 ± 0.01481.1905 ± 0.02771.1855 ± 0.03781.00x ± 0.02x-0.41% ± 2.16%
arrayvector_clampcwiseMax + cwiseMinfloat64262144x1262144x11.0264 ± 0.01821.0284 ± 0.02400.5110 ± 0.00900.5101 ± 0.01181.00x ± 0.01x-0.18% ± 0.95%
arrayvector_coscos(a)float32262144x1262144x12.0988 ± 0.04782.0865 ± 0.06960.1250 ± 0.00280.1258 ± 0.00401.01x ± 0.02x0.63% ± 2.16%
arrayvector_coscos(a)float64262144x1262144x110.7241 ± 0.239610.7488 ± 0.30310.0244 ± 0.00050.0244 ± 0.00071.00x ± 0.01x-0.21% ± 0.79%
arrayvector_div_scalara / scalarfloat32262144x1262144x10.6508 ± 0.02120.6610 ± 0.02620.4032 ± 0.01260.3972 ± 0.01500.99x ± 0.02x-1.50% ± 2.19%
arrayvector_div_scalara / scalarfloat64262144x1262144x12.3885 ± 0.08652.3830 ± 0.09690.1099 ± 0.00380.1102 ± 0.00431.00x ± 0.01x0.25% ± 0.67%
arrayvector_div_vectora / (b + scalar)float32262144x1262144x10.7589 ± 0.02310.7706 ± 0.03250.6914 ± 0.02040.6815 ± 0.02800.99x ± 0.03x-1.44% ± 3.00%
arrayvector_div_vectora / (b + scalar)float64262144x1262144x12.5917 ± 0.08382.5770 ± 0.06740.2025 ± 0.00630.2036 ± 0.00521.01x ± 0.01x0.56% ± 1.03%
arrayvector_dotdot()float32262144x11x10.0960 ± 0.01010.0929 ± 0.00735.5139 ± 0.54205.6720 ± 0.41221.04x ± 0.11x3.61% ± 11.22%
arrayvector_dotdot()float64262144x11x10.4065 ± 0.03380.4005 ± 0.01661.2974 ± 0.10111.3110 ± 0.05391.02x ± 0.09x1.63% ± 9.43%
arrayvector_expexp(a * scalar)float32262144x1262144x12.1141 ± 0.04822.1223 ± 0.07150.2481 ± 0.00550.2473 ± 0.00781.00x ± 0.02x-0.33% ± 2.39%
arrayvector_expexp(a * scalar)float64262144x1262144x16.8590 ± 0.16866.8094 ± 0.19050.0765 ± 0.00180.0770 ± 0.00211.01x ± 0.01x0.74% ± 0.86%
arrayvector_fmaa * b + cfloat32262144x1262144x10.4823 ± 0.01190.4822 ± 0.02091.0876 ± 0.02571.0891 ± 0.04511.00x ± 0.05x0.20% ± 5.18%
arrayvector_fmaa * b + cfloat64262144x1262144x11.2767 ± 0.01741.2782 ± 0.02660.4107 ± 0.00560.4103 ± 0.00841.00x ± 0.02x-0.09% ± 2.23%
arrayvector_loglog(a + scalar)float32262144x1262144x12.0563 ± 0.04792.0593 ± 0.06790.2551 ± 0.00580.2548 ± 0.00791.00x ± 0.02x-0.10% ± 2.24%
arrayvector_loglog(a + scalar)float64262144x1262144x16.1495 ± 0.15276.1545 ± 0.17030.0853 ± 0.00210.0852 ± 0.00231.00x ± 0.01x-0.07% ± 1.07%
arrayvector_maxmax(a, b)float32262144x1262144x10.3110 ± 0.01290.3166 ± 0.02350.8443 ± 0.03530.8321 ± 0.06130.99x ± 0.09x-1.25% ± 8.76%
arrayvector_maxmax(a, b)float64262144x1262144x10.9116 ± 0.03930.9189 ± 0.03630.2880 ± 0.01180.2857 ± 0.01100.99x ± 0.07x-0.61% ± 6.75%
arrayvector_minmin(a, b)float32262144x1262144x10.3086 ± 0.01190.3159 ± 0.02210.8506 ± 0.03250.8336 ± 0.05810.98x ± 0.09x-1.81% ± 8.52%
arrayvector_minmin(a, b)float64262144x1262144x10.9000 ± 0.02110.8979 ± 0.01780.2914 ± 0.00660.2920 ± 0.00571.00x ± 0.03x0.27% ± 3.25%
arrayvector_mul_scalara * scalarfloat32262144x1262144x10.2132 ± 0.00750.2175 ± 0.00911.2307 ± 0.04091.2070 ± 0.05000.98x ± 0.03x-1.91% ± 3.00%
arrayvector_mul_scalara * scalarfloat64262144x1262144x10.6311 ± 0.01140.6329 ± 0.02530.4155 ± 0.00740.4148 ± 0.01611.00x ± 0.03x-0.19% ± 3.03%
arrayvector_mul_vectora * bfloat32262144x1262144x10.2604 ± 0.01700.2647 ± 0.02011.0104 ± 0.06530.9960 ± 0.08170.99x ± 0.10x-1.07% ± 10.06%
arrayvector_mul_vectora * bfloat64262144x1262144x10.9002 ± 0.03820.9071 ± 0.03410.2916 ± 0.01170.2893 ± 0.01050.99x ± 0.06x-0.62% ± 5.91%
arrayvector_normnorm()float32262144x11x10.0841 ± 0.00290.0837 ± 0.00276.2425 ± 0.20416.2732 ± 0.19491.01x ± 0.03x0.54% ± 2.81%
arrayvector_normnorm()float64262144x11x10.1858 ± 0.00720.1859 ± 0.00832.8251 ± 0.10382.8258 ± 0.12271.00x ± 0.03x0.05% ± 3.12%
arrayvector_normalizenormalize()float32262144x1262144x10.8263 ± 0.03010.8253 ± 0.02420.9529 ± 0.03310.9536 ± 0.02701.00x ± 0.03x0.12% ± 2.56%
arrayvector_normalizenormalize()float64262144x1262144x12.7610 ± 0.05192.7621 ± 0.08440.2849 ± 0.00530.2850 ± 0.00841.00x ± 0.01x-0.01% ± 1.45%
arrayvector_segmentsegment()float32262144x1131072x10.0636 ± 0.00200.0626 ± 0.00130.0000 ± 0.00000.0000 ± 0.00001.02x ± 0.02x1.65% ± 1.87%
arrayvector_segmentsegment()float64262144x1131072x10.1294 ± 0.00670.1276 ± 0.00390.0000 ± 0.00000.0000 ± 0.00001.01x ± 0.06x1.45% ± 6.00%
arrayvector_selectmask.select(a, b)float32262144x1262144x10.4872 ± 0.01680.4854 ± 0.02100.5387 ± 0.01840.5409 ± 0.02321.01x ± 0.05x0.51% ± 5.00%
arrayvector_selectmask.select(a, b)float64262144x1262144x11.1199 ± 0.01731.1256 ± 0.02310.2341 ± 0.00360.2330 ± 0.00471.00x ± 0.01x-0.49% ± 1.32%
arrayvector_sinsin(a)float32262144x1262144x12.0844 ± 0.04532.1151 ± 0.06760.1258 ± 0.00270.1240 ± 0.00370.99x ± 0.02x-1.41% ± 2.09%
arrayvector_sinsin(a)float64262144x1262144x110.9153 ± 0.322410.9188 ± 0.34610.0240 ± 0.00070.0240 ± 0.00071.00x ± 0.01x-0.02% ± 0.91%
arrayvector_sqrt(a + scalar).sqrt()float32262144x1262144x10.6227 ± 0.01370.6263 ± 0.02160.8423 ± 0.01820.8380 ± 0.02750.99x ± 0.02x-0.52% ± 2.16%
arrayvector_sqrt(a + scalar).sqrt()float64262144x1262144x12.3245 ± 0.07332.3158 ± 0.05650.2258 ± 0.00680.2265 ± 0.00541.00x ± 0.02x0.37% ± 1.53%
arrayvector_sub_scalara - scalarfloat32262144x1262144x10.1983 ± 0.00640.2024 ± 0.00871.3230 ± 0.04131.2975 ± 0.05460.98x ± 0.03x-1.92% ± 2.97%
arrayvector_sub_scalara - scalarfloat64262144x1262144x10.6066 ± 0.00980.6093 ± 0.02580.4323 ± 0.00690.4309 ± 0.01781.00x ± 0.04x-0.30% ± 3.76%
arrayvector_sub_vectora - bfloat32262144x1262144x10.2453 ± 0.01490.2508 ± 0.02071.0722 ± 0.06401.0523 ± 0.09420.99x ± 0.12x-1.47% ± 11.50%
arrayvector_sub_vectora - bfloat64262144x1262144x10.8995 ± 0.02000.9162 ± 0.03590.2916 ± 0.00640.2866 ± 0.01120.98x ± 0.03x-1.73% ± 3.19%
arrayvector_sumsum()float32262144x11x10.0454 ± 0.00170.0446 ± 0.00165.7800 ± 0.20115.8800 ± 0.19621.02x ± 0.03x1.78% ± 2.88%
arrayvector_sumsum()float64262144x11x10.0920 ± 0.00540.0924 ± 0.00532.8561 ± 0.15512.8450 ± 0.15721.00x ± 0.06x-0.22% ± 5.88%
arrayvector_tanhtanh(a * scalar)float32262144x1262144x11.2219 ± 0.02831.2256 ± 0.04030.4293 ± 0.00980.4282 ± 0.01341.00x ± 0.02x-0.26% ± 2.17%
arrayvector_tanhtanh(a * scalar)float64262144x1262144x115.4090 ± 0.446615.4376 ± 0.49390.0340 ± 0.00100.0340 ± 0.00101.00x ± 0.01x-0.18% ± 0.64%
geometryquaternion_inverseQuaternion::inverse()float323x13x10.0001 ± 0.00000.0001 ± 0.00000.0990 ± 0.00440.1104 ± 0.00381.00x ± 0.00x0.00% ± 0.00%
geometryquaternion_inverseQuaternion::inverse()float643x13x10.0001 ± 0.00000.0001 ± 0.00000.0717 ± 0.00250.0735 ± 0.00340.95x ± 0.16x-5.00% ± 15.81%
geometryquaternion_normalizeQuaternion::normalize()float323x13x10.0001 ± 0.00000.0001 ± 0.00000.1138 ± 0.00480.1290 ± 0.00541.00x ± 0.00x0.00% ± 0.00%
geometryquaternion_normalizeQuaternion::normalize()float643x13x10.0001 ± 0.00000.0001 ± 0.00000.0833 ± 0.00250.0868 ± 0.00311.10x ± 0.32x10.00% ± 31.62%
geometryquaternion_to_rotation_matrixQuaternion::toRotationMatrix()float323x13x30.0001 ± 0.00000.0001 ± 0.00000.2749 ± 0.01200.2995 ± 0.01401.00x ± 0.00x0.00% ± 0.00%
geometryquaternion_to_rotation_matrixQuaternion::toRotationMatrix()float643x13x30.0001 ± 0.00000.0001 ± 0.00000.2697 ± 0.01370.2985 ± 0.01201.00x ± 0.00x0.00% ± 0.00%
geometryvector_crosscross()float323x13x10.0001 ± 0.00000.0001 ± 0.00000.1120 ± 0.00510.1296 ± 0.00331.00x ± 0.00x0.00% ± 0.00%
geometryvector_crosscross()float643x13x10.0001 ± 0.00000.0001 ± 0.00000.1140 ± 0.00360.1295 ± 0.00511.00x ± 0.00x0.00% ± 0.00%
matrixmatrix_addA + Bfloat32512x512512x5120.2503 ± 0.01100.2512 ± 0.01311.0492 ± 0.04511.0459 ± 0.05291.00x ± 0.06x-0.20% ± 5.60%
matrixmatrix_addA + Bfloat64512x512512x5120.9127 ± 0.04270.9066 ± 0.03510.2877 ± 0.01300.2895 ± 0.01091.01x ± 0.06x0.80% ± 5.88%
matrixmatrix_blockblock()float32512x512256x2560.0337 ± 0.00110.0341 ± 0.00150.0000 ± 0.00000.0000 ± 0.00000.99x ± 0.02x-1.09% ± 1.86%
matrixmatrix_blockblock()float64512x512256x2560.0642 ± 0.00200.0646 ± 0.00250.0000 ± 0.00000.0000 ± 0.00000.99x ± 0.02x-0.59% ± 2.04%
matrixmatrix_colwise_sumcolwise().sum()float32512x5121x5120.0472 ± 0.00160.0469 ± 0.00125.5489 ± 0.17865.5816 ± 0.13471.01x ± 0.02x0.63% ± 1.58%
matrixmatrix_colwise_sumcolwise().sum()float64512x5121x5120.0940 ± 0.00450.0938 ± 0.00482.7882 ± 0.12992.7949 ± 0.13571.00x ± 0.07x0.44% ± 6.69%
matrixmatrix_cwise_productcwiseProductfloat32512x512512x5120.2626 ± 0.01110.2622 ± 0.01051.0001 ± 0.04231.0013 ± 0.03981.00x ± 0.05x0.23% ± 4.62%
matrixmatrix_cwise_productcwiseProductfloat64512x512512x5120.8996 ± 0.03180.9034 ± 0.03850.2917 ± 0.01020.2906 ± 0.01191.00x ± 0.06x-0.27% ± 5.56%
matrixmatrix_determinantdeterminant()float32512x5121x114.6256 ± 0.40438.9489 ± 0.26596.1220 ± 0.165110.0065 ± 0.28661.63x ± 0.02x63.45% ± 1.83%
matrixmatrix_determinantdeterminant()float64512x5121x125.5483 ± 0.761014.4550 ± 0.52343.5051 ± 0.10186.1972 ± 0.21691.77x ± 0.02x76.79% ± 1.89%
matrixmatrix_gemvA * xfloat32512x512512x10.0796 ± 0.00270.1093 ± 0.00246.5897 ± 0.21404.7949 ± 0.10430.73x ± 0.01x-27.21% ± 1.24%
matrixmatrix_gemvA * xfloat64512x512512x10.1840 ± 0.00830.2257 ± 0.01582.8515 ± 0.12352.3304 ± 0.15770.82x ± 0.05x-18.24% ± 4.86%
matrixmatrix_identityIdentity()float321x1512x5120.3504 ± 0.01190.3808 ± 0.01230.0000 ± 0.00000.0000 ± 0.00000.92x ± 0.02x-7.98% ± 2.21%
matrixmatrix_identityIdentity()float641x1512x5120.3988 ± 0.01480.4305 ± 0.01880.0000 ± 0.00000.0000 ± 0.00000.93x ± 0.02x-7.33% ± 1.66%
matrixmatrix_inverseinverse()float32512x512512x51258.6058 ± 1.609735.6504 ± 0.84094.5834 ± 0.12257.5333 ± 0.17171.64x ± 0.02x64.39% ± 2.29%
matrixmatrix_inverseinverse()float64512x512512x512102.4444 ± 2.841452.7110 ± 1.66492.6221 ± 0.07075.0970 ± 0.15571.94x ± 0.01x94.37% ± 1.36%
matrixmatrix_ldlt_solveLDLT::solve(x)float32512x512512x10.1428 ± 0.00410.1392 ± 0.00673.6731 ± 0.10373.7733 ± 0.17421.03x ± 0.02x2.70% ± 2.44%
matrixmatrix_ldlt_solveLDLT::solve(x)float64512x512512x10.2893 ± 0.01040.2291 ± 0.00481.8146 ± 0.06352.2898 ± 0.04691.26x ± 0.03x26.26% ± 2.50%
matrixmatrix_llt_solveLLT::solve(x)float32512x512512x10.1477 ± 0.00320.1441 ± 0.00713.5506 ± 0.07593.6474 ± 0.17381.03x ± 0.03x2.67% ± 2.82%
matrixmatrix_llt_solveLLT::solve(x)float64512x512512x10.2913 ± 0.01110.2313 ± 0.00511.8022 ± 0.06532.2674 ± 0.04981.26x ± 0.03x25.90% ± 3.10%
matrixmatrix_matmulA * Bfloat32512x512512x51222.2456 ± 0.52369.3863 ± 0.339412.0610 ± 0.278728.6032 ± 1.00112.37x ± 0.03x137.10% ± 3.41%
matrixmatrix_matmulA * Bfloat64512x512512x51248.6433 ± 1.385324.6871 ± 0.68135.5170 ± 0.152810.8702 ± 0.29331.97x ± 0.01x97.04% ± 1.34%
matrixmatrix_rowwise_sumrowwise().sum()float32512x512512x10.2364 ± 0.00760.2372 ± 0.00621.1077 ± 0.03431.1035 ± 0.02831.00x ± 0.02x-0.35% ± 1.93%
matrixmatrix_rowwise_sumrowwise().sum()float64512x512512x10.6596 ± 0.04820.6753 ± 0.07920.3983 ± 0.02640.3914 ± 0.03760.99x ± 0.12x-1.27% ± 12.09%
matrixmatrix_subA - Bfloat32512x512512x5120.2532 ± 0.01140.2513 ± 0.01031.0372 ± 0.04541.0447 ± 0.04251.01x ± 0.05x0.86% ± 5.46%
matrixmatrix_subA - Bfloat64512x512512x5120.9192 ± 0.04400.9067 ± 0.04320.2858 ± 0.01360.2897 ± 0.01351.02x ± 0.09x1.70% ± 8.57%
matrixmatrix_tracetrace()float32512x5121x10.0008 ± 0.00000.0008 ± 0.00000.6114 ± 0.02140.6266 ± 0.01491.04x ± 0.06x3.75% ± 6.04%
matrixmatrix_tracetrace()float64512x5121x10.0011 ± 0.00000.0011 ± 0.00010.4692 ± 0.01920.4796 ± 0.01161.06x ± 0.05x5.82% ± 5.02%
matrixmatrix_transposetranspose()float32512x512512x5121.9027 ± 0.06761.8776 ± 0.05080.0000 ± 0.00000.0000 ± 0.00001.01x ± 0.02x1.33% ± 1.91%
matrixmatrix_transposetranspose()float64512x512512x5123.4747 ± 0.13413.5373 ± 0.20390.0000 ± 0.00000.0000 ± 0.00000.98x ± 0.06x-1.52% ± 5.97%
matrixmatrix_zeroZero()float321x1512x5120.0925 ± 0.00320.0923 ± 0.00310.0000 ± 0.00000.0000 ± 0.00001.00x ± 0.03x0.25% ± 2.73%
matrixmatrix_zeroZero()float641x1512x5120.1882 ± 0.00950.1882 ± 0.01060.0000 ± 0.00000.0000 ± 0.00001.00x ± 0.05x0.14% ± 5.10%

四核对比

taskset -c 0-3

threads:4

modulefunctionapidtypeinput_sizeoutput_sizeno_blas avg_ms mean±sdblas avg_ms mean±sdno_blas avg_gflops mean±sdblas avg_gflops mean±sdspeedup mean±sdimprovement mean±sd
arrayvector_absabs(a - scalar)float32262144x1262144x10.2416 ± 0.00510.2392 ± 0.00111.0857 ± 0.02241.0958 ± 0.00501.01x ± 0.02x0.98% ± 2.31%
arrayvector_absabs(a - scalar)float64262144x1262144x10.6711 ± 0.00860.6737 ± 0.00870.3907 ± 0.00500.3891 ± 0.00491.00x ± 0.01x-0.39% ± 0.93%
arrayvector_add_scalara + scalarfloat32262144x1262144x10.1981 ± 0.00600.1955 ± 0.00391.3242 ± 0.03871.3413 ± 0.02581.01x ± 0.04x1.37% ± 3.89%
arrayvector_add_scalara + scalarfloat64262144x1262144x10.5992 ± 0.01140.6036 ± 0.01290.4376 ± 0.00830.4345 ± 0.00920.99x ± 0.02x-0.71% ± 2.05%
arrayvector_add_vectora + bfloat32262144x1262144x10.2482 ± 0.01620.2472 ± 0.01721.0601 ± 0.06951.0652 ± 0.07351.01x ± 0.09x0.81% ± 8.91%
arrayvector_add_vectora + bfloat64262144x1262144x10.8884 ± 0.03040.9132 ± 0.03340.2954 ± 0.00970.2874 ± 0.01060.97x ± 0.05x-2.60% ± 4.79%
arrayvector_clampcwiseMax + cwiseMinfloat32262144x1262144x10.4353 ± 0.00440.4329 ± 0.00111.2044 ± 0.01221.2110 ± 0.00301.01x ± 0.01x0.55% ± 1.06%
arrayvector_clampcwiseMax + cwiseMinfloat64262144x1262144x11.0154 ± 0.00891.0145 ± 0.01010.5164 ± 0.00450.5168 ± 0.00511.00x ± 0.01x0.10% ± 0.88%
arrayvector_coscos(a)float32262144x1262144x12.0710 ± 0.00572.0510 ± 0.00470.1266 ± 0.00040.1278 ± 0.00031.01x ± 0.00x0.98% ± 0.32%
arrayvector_coscos(a)float64262144x1262144x110.5539 ± 0.018910.5530 ± 0.01360.0248 ± 0.00000.0248 ± 0.00001.00x ± 0.00x0.01% ± 0.19%
arrayvector_div_scalara / scalarfloat32262144x1262144x10.6404 ± 0.00430.6442 ± 0.00840.4094 ± 0.00270.4070 ± 0.00520.99x ± 0.02x-0.57% ± 1.66%
arrayvector_div_scalara / scalarfloat64262144x1262144x12.3229 ± 0.01102.3314 ± 0.01460.1129 ± 0.00050.1124 ± 0.00071.00x ± 0.00x-0.36% ± 0.48%
arrayvector_div_vectora / (b + scalar)float32262144x1262144x10.7443 ± 0.00950.7498 ± 0.01100.7045 ± 0.00900.6994 ± 0.01030.99x ± 0.02x-0.71% ± 1.78%
arrayvector_div_vectora / (b + scalar)float64262144x1262144x12.5419 ± 0.01662.5347 ± 0.00940.2063 ± 0.00140.2069 ± 0.00081.00x ± 0.01x0.29% ± 0.52%
arrayvector_dotdot()float32262144x11x10.0937 ± 0.00900.0959 ± 0.01095.6377 ± 0.50525.5242 ± 0.57560.99x ± 0.14x-1.20% ± 14.36%
arrayvector_dotdot()float64262144x11x10.4170 ± 0.02020.3983 ± 0.01251.2601 ± 0.06171.3175 ± 0.04111.05x ± 0.08x4.88% ± 7.62%
arrayvector_expexp(a * scalar)float32262144x1262144x12.0859 ± 0.00492.0883 ± 0.00970.2513 ± 0.00060.2511 ± 0.00121.00x ± 0.01x-0.11% ± 0.64%
arrayvector_expexp(a * scalar)float64262144x1262144x16.7441 ± 0.00916.6802 ± 0.00970.0777 ± 0.00010.0785 ± 0.00011.01x ± 0.00x0.96% ± 0.16%
arrayvector_fmaa * b + cfloat32262144x1262144x10.4809 ± 0.01200.4727 ± 0.01911.0909 ± 0.02761.1106 ± 0.04421.02x ± 0.05x1.86% ± 4.59%
arrayvector_fmaa * b + cfloat64262144x1262144x11.3205 ± 0.02671.2779 ± 0.02660.3972 ± 0.00820.4104 ± 0.00831.03x ± 0.03x3.39% ± 3.49%
arrayvector_loglog(a + scalar)float32262144x1262144x12.0275 ± 0.00352.0242 ± 0.00180.2586 ± 0.00040.2590 ± 0.00021.00x ± 0.00x0.16% ± 0.24%
arrayvector_loglog(a + scalar)float64262144x1262144x16.0402 ± 0.01106.0428 ± 0.00420.0868 ± 0.00020.0867 ± 0.00011.00x ± 0.00x-0.04% ± 0.18%
arrayvector_maxmax(a, b)float32262144x1262144x10.3140 ± 0.01560.3132 ± 0.01260.8368 ± 0.04130.8381 ± 0.03271.00x ± 0.06x0.38% ± 6.43%
arrayvector_maxmax(a, b)float64262144x1262144x10.9226 ± 0.03920.9106 ± 0.03270.2846 ± 0.01190.2882 ± 0.01021.02x ± 0.07x1.52% ± 7.27%
arrayvector_minmin(a, b)float32262144x1262144x10.3115 ± 0.01340.3140 ± 0.01600.8430 ± 0.03590.8369 ± 0.04220.99x ± 0.06x-0.60% ± 5.86%
arrayvector_minmin(a, b)float64262144x1262144x10.9007 ± 0.02350.8977 ± 0.02000.2912 ± 0.00730.2921 ± 0.00631.00x ± 0.04x0.38% ± 3.61%
arrayvector_mul_scalara * scalarfloat32262144x1262144x10.2125 ± 0.00570.2087 ± 0.00051.2342 ± 0.03241.2560 ± 0.00321.02x ± 0.03x1.84% ± 2.85%
arrayvector_mul_scalara * scalarfloat64262144x1262144x10.6229 ± 0.00960.6244 ± 0.01170.4210 ± 0.00650.4200 ± 0.00781.00x ± 0.02x-0.22% ± 1.89%
arrayvector_mul_vectora * bfloat32262144x1262144x10.2597 ± 0.01430.2584 ± 0.01641.0121 ± 0.05621.0180 ± 0.06401.01x ± 0.08x0.83% ± 7.96%
arrayvector_mul_vectora * bfloat64262144x1262144x10.9140 ± 0.03640.9077 ± 0.03350.2872 ± 0.01140.2892 ± 0.01061.01x ± 0.06x0.83% ± 5.81%
arrayvector_normnorm()float32262144x11x10.0824 ± 0.00020.0823 ± 0.00016.3630 ± 0.01726.3693 ± 0.00961.00x ± 0.00x0.07% ± 0.33%
arrayvector_normnorm()float64262144x11x10.1824 ± 0.00560.1816 ± 0.00462.8773 ± 0.08372.8883 ± 0.06911.00x ± 0.04x0.48% ± 4.17%
arrayvector_normalizenormalize()float32262144x1262144x10.8117 ± 0.00620.8099 ± 0.00190.9690 ± 0.00730.9711 ± 0.00221.00x ± 0.01x0.22% ± 0.89%
arrayvector_normalizenormalize()float64262144x1262144x12.7192 ± 0.00942.7161 ± 0.00830.2892 ± 0.00100.2895 ± 0.00091.00x ± 0.00x0.11% ± 0.45%
arrayvector_segmentsegment()float32262144x1131072x10.0624 ± 0.00040.0623 ± 0.00020.0000 ± 0.00000.0000 ± 0.00001.00x ± 0.01x0.13% ± 0.75%
arrayvector_segmentsegment()float64262144x1131072x10.1268 ± 0.00500.1264 ± 0.00470.0000 ± 0.00000.0000 ± 0.00001.01x ± 0.06x0.50% ± 5.83%
arrayvector_selectmask.select(a, b)float32262144x1262144x10.4819 ± 0.01900.4808 ± 0.01300.5447 ± 0.02050.5456 ± 0.01451.00x ± 0.05x0.29% ± 4.98%
arrayvector_selectmask.select(a, b)float64262144x1262144x11.1194 ± 0.01521.1066 ± 0.01020.2342 ± 0.00320.2369 ± 0.00211.01x ± 0.02x1.17% ± 2.05%
arrayvector_sinsin(a)float32262144x1262144x12.0531 ± 0.00532.0818 ± 0.00520.1277 ± 0.00030.1259 ± 0.00030.99x ± 0.00x-1.38% ± 0.41%
arrayvector_sinsin(a)float64262144x1262144x110.7043 ± 0.013810.7054 ± 0.00900.0245 ± 0.00000.0245 ± 0.00001.00x ± 0.00x-0.01% ± 0.15%
arrayvector_sqrt(a + scalar).sqrt()float32262144x1262144x10.6149 ± 0.00450.6135 ± 0.00180.8527 ± 0.00610.8546 ± 0.00251.00x ± 0.01x0.23% ± 0.85%
arrayvector_sqrt(a + scalar).sqrt()float64262144x1262144x12.2786 ± 0.00862.2822 ± 0.00730.2301 ± 0.00090.2298 ± 0.00071.00x ± 0.00x-0.16% ± 0.41%
arrayvector_sub_scalara - scalarfloat32262144x1262144x10.1981 ± 0.00550.1943 ± 0.00131.3245 ± 0.03591.3489 ± 0.00901.02x ± 0.03x1.92% ± 3.18%
arrayvector_sub_scalara - scalarfloat64262144x1262144x10.6015 ± 0.01220.6018 ± 0.01370.4360 ± 0.00880.4358 ± 0.00971.00x ± 0.02x-0.02% ± 2.36%
arrayvector_sub_vectora - bfloat32262144x1262144x10.2478 ± 0.01460.2471 ± 0.01701.0612 ± 0.06331.0653 ± 0.07341.01x ± 0.09x0.67% ± 8.65%
arrayvector_sub_vectora - bfloat64262144x1262144x10.9075 ± 0.03810.9062 ± 0.03610.2893 ± 0.01200.2897 ± 0.01151.00x ± 0.07x0.34% ± 6.70%
arrayvector_sumsum()float32262144x11x10.0440 ± 0.00030.0440 ± 0.00045.9621 ± 0.03915.9556 ± 0.04761.00x ± 0.01x-0.16% ± 0.78%
arrayvector_sumsum()float64262144x11x10.0901 ± 0.00540.0896 ± 0.00432.9172 ± 0.15652.9326 ± 0.12691.01x ± 0.08x0.85% ± 7.77%
arrayvector_tanhtanh(a * scalar)float32262144x1262144x11.2058 ± 0.00581.1980 ± 0.00200.4348 ± 0.00210.4376 ± 0.00071.01x ± 0.01x0.65% ± 0.61%
arrayvector_tanhtanh(a * scalar)float64262144x1262144x115.1154 ± 0.012415.1210 ± 0.01720.0347 ± 0.00000.0347 ± 0.00001.00x ± 0.00x-0.04% ± 0.12%
geometryquaternion_inverseQuaternion::inverse()float323x13x10.0001 ± 0.00000.0001 ± 0.00000.1016 ± 0.00190.1128 ± 0.00261.00x ± 0.00x0.00% ± 0.00%
geometryquaternion_inverseQuaternion::inverse()float643x13x10.0001 ± 0.00000.0001 ± 0.00000.0733 ± 0.00070.0749 ± 0.00051.00x ± 0.00x0.00% ± 0.00%
geometryquaternion_normalizeQuaternion::normalize()float323x13x10.0001 ± 0.00000.0001 ± 0.00000.1156 ± 0.00150.1277 ± 0.00411.00x ± 0.00x0.00% ± 0.00%
geometryquaternion_normalizeQuaternion::normalize()float643x13x10.0001 ± 0.00000.0001 ± 0.00000.0843 ± 0.00200.0888 ± 0.00131.00x ± 0.00x0.00% ± 0.00%
geometryquaternion_to_rotation_matrixQuaternion::toRotationMatrix()float323x13x30.0001 ± 0.00000.0001 ± 0.00000.2782 ± 0.00960.3108 ± 0.00621.00x ± 0.00x0.00% ± 0.00%
geometryquaternion_to_rotation_matrixQuaternion::toRotationMatrix()float643x13x30.0001 ± 0.00000.0001 ± 0.00000.2822 ± 0.02590.3023 ± 0.00511.00x ± 0.00x0.00% ± 0.00%
geometryvector_crosscross()float323x13x10.0001 ± 0.00000.0001 ± 0.00000.1125 ± 0.00210.1302 ± 0.00221.00x ± 0.00x0.00% ± 0.00%
geometryvector_crosscross()float643x13x10.0001 ± 0.00000.0001 ± 0.00000.1142 ± 0.00350.1315 ± 0.00351.00x ± 0.00x0.00% ± 0.00%
matrixmatrix_addA + Bfloat32512x512512x5120.2496 ± 0.01680.2487 ± 0.01521.0548 ± 0.07531.0573 ± 0.06311.01x ± 0.08x0.56% ± 7.64%
matrixmatrix_addA + Bfloat64512x512512x5120.8835 ± 0.02660.8924 ± 0.02570.2969 ± 0.00870.2940 ± 0.00820.99x ± 0.04x-0.94% ± 3.62%
matrixmatrix_blockblock()float32512x512256x2560.0334 ± 0.00030.0333 ± 0.00040.0000 ± 0.00000.0000 ± 0.00001.00x ± 0.01x0.49% ± 1.17%
matrixmatrix_blockblock()float64512x512256x2560.0630 ± 0.00020.0631 ± 0.00050.0000 ± 0.00000.0000 ± 0.00001.00x ± 0.01x-0.08% ± 0.65%
matrixmatrix_colwise_sumcolwise().sum()float32512x5121x5120.0463 ± 0.00020.0462 ± 0.00025.6552 ± 0.02325.6621 ± 0.01871.00x ± 0.00x0.15% ± 0.45%
matrixmatrix_colwise_sumcolwise().sum()float64512x5121x5120.0928 ± 0.00320.0929 ± 0.00412.8215 ± 0.09532.8198 ± 0.11701.00x ± 0.06x0.10% ± 6.48%
matrixmatrix_cwise_productcwiseProductfloat32512x512512x5120.2625 ± 0.01480.2615 ± 0.01441.0016 ± 0.05841.0053 ± 0.05371.01x ± 0.06x0.55% ± 6.04%
matrixmatrix_cwise_productcwiseProductfloat64512x512512x5120.8918 ± 0.04230.8939 ± 0.02530.2945 ± 0.01350.2935 ± 0.00801.00x ± 0.05x-0.20% ± 4.65%
matrixmatrix_determinantdeterminant()float32512x5121x110.5614 ± 0.07475.5022 ± 0.01318.4726 ± 0.059316.2622 ± 0.03861.92x ± 0.01x91.95% ± 1.39%
matrixmatrix_determinantdeterminant()float64512x5121x117.0516 ± 0.15399.4279 ± 0.10195.2479 ± 0.04749.4918 ± 0.10231.81x ± 0.03x80.88% ± 2.54%
matrixmatrix_gemvA * xfloat32512x512512x10.0784 ± 0.00070.1082 ± 0.00046.6805 ± 0.05944.8415 ± 0.01700.72x ± 0.01x-27.52% ± 0.55%
matrixmatrix_gemvA * xfloat64512x512512x10.1802 ± 0.00330.2180 ± 0.01062.9076 ± 0.05152.4073 ± 0.10920.83x ± 0.04x-17.17% ± 4.31%
matrixmatrix_identityIdentity()float321x1512x5120.3432 ± 0.00050.3741 ± 0.00060.0000 ± 0.00000.0000 ± 0.00000.92x ± 0.00x-8.25% ± 0.23%
matrixmatrix_identityIdentity()float641x1512x5120.3904 ± 0.00600.4230 ± 0.00470.0000 ± 0.00000.0000 ± 0.00000.92x ± 0.02x-7.71% ± 1.63%
matrixmatrix_inverseinverse()float32512x512512x51251.1701 ± 0.081417.7917 ± 0.07135.2460 ± 0.008315.0879 ± 0.06032.88x ± 0.01x187.61% ± 1.33%
matrixmatrix_inverseinverse()float64512x512512x51289.4104 ± 0.189528.1555 ± 0.12743.0023 ± 0.00649.5342 ± 0.04313.18x ± 0.01x217.56% ± 1.30%
matrixmatrix_ldlt_solveLDLT::solve(x)float32512x512512x10.1406 ± 0.00070.1352 ± 0.00103.7295 ± 0.01723.8787 ± 0.02881.04x ± 0.01x4.01% ± 1.09%
matrixmatrix_ldlt_solveLDLT::solve(x)float64512x512512x10.2820 ± 0.00190.2273 ± 0.00101.8591 ± 0.01222.3067 ± 0.01031.24x ± 0.01x24.09% ± 0.95%
matrixmatrix_llt_solveLLT::solve(x)float32512x512512x10.1459 ± 0.00140.1401 ± 0.00093.5931 ± 0.03313.7411 ± 0.02331.04x ± 0.01x4.12% ± 1.13%
matrixmatrix_llt_solveLLT::solve(x)float64512x512512x10.2869 ± 0.00220.2304 ± 0.00221.8277 ± 0.01372.2758 ± 0.02181.25x ± 0.02x24.52% ± 1.68%
matrixmatrix_matmulA * Bfloat32512x512512x5125.6547 ± 0.03073.1467 ± 0.036247.4266 ± 0.258085.2327 ± 0.96931.80x ± 0.02x79.72% ± 2.27%
matrixmatrix_matmulA * Bfloat64512x512512x51212.3670 ± 0.07747.0604 ± 0.041121.6854 ± 0.135337.9837 ± 0.22031.75x ± 0.01x75.16% ± 1.40%
matrixmatrix_rowwise_sumrowwise().sum()float32512x512512x10.2312 ± 0.00130.2334 ± 0.00121.1316 ± 0.00621.1208 ± 0.00560.99x ± 0.01x-0.94% ± 0.85%
matrixmatrix_rowwise_sumrowwise().sum()float64512x512512x10.6573 ± 0.05520.6698 ± 0.07890.4003 ± 0.03000.3948 ± 0.03960.99x ± 0.15x-0.58% ± 14.87%
matrixmatrix_subA - Bfloat32512x512512x5120.2495 ± 0.01440.2498 ± 0.01531.0540 ± 0.06361.0526 ± 0.06251.00x ± 0.06x0.05% ± 6.31%
matrixmatrix_subA - Bfloat64512x512512x5120.8966 ± 0.04760.8820 ± 0.01100.2931 ± 0.01460.2972 ± 0.00371.02x ± 0.06x1.67% ± 5.66%
matrixmatrix_tracetrace()float32512x5121x10.0008 ± 0.00000.0008 ± 0.00000.6198 ± 0.00580.6326 ± 0.00751.00x ± 0.00x0.00% ± 0.00%
matrixmatrix_tracetrace()float64512x5121x10.0011 ± 0.00000.0011 ± 0.00010.4794 ± 0.00540.4864 ± 0.00321.04x ± 0.05x4.00% ± 5.16%
matrixmatrix_transposetranspose()float32512x512512x5121.8550 ± 0.01611.8488 ± 0.01180.0000 ± 0.00000.0000 ± 0.00001.00x ± 0.01x0.34% ± 1.21%
matrixmatrix_transposetranspose()float64512x512512x5123.4719 ± 0.14583.4733 ± 0.16620.0000 ± 0.00000.0000 ± 0.00001.00x ± 0.07x0.21% ± 7.01%
matrixmatrix_zeroZero()float321x1512x5120.0907 ± 0.00020.0910 ± 0.00030.0000 ± 0.00000.0000 ± 0.00001.00x ± 0.00x-0.26% ± 0.36%
matrixmatrix_zeroZero()float641x1512x5120.1859 ± 0.00720.1858 ± 0.00510.0000 ± 0.00000.0000 ± 0.00001.00x ± 0.04x0.07% ± 4.06%

八核对比

taskset -c 0-7

threads:8

modulefunctionapidtypeinput_sizeoutput_sizeno_blas avg_ms mean±sdblas avg_ms mean±sdno_blas avg_gflops mean±sdblas avg_gflops mean±sdspeedup mean±sdimprovement mean±sd
arrayvector_absabs(a - scalar)float32262144x1262144x10.2215 ± 0.00440.2218 ± 0.00421.1841 ± 0.02261.1821 ± 0.02201.00x ± 0.03x-0.13% ± 3.27%
arrayvector_absabs(a - scalar)float64262144x1262144x10.6470 ± 0.01270.6327 ± 0.00880.4053 ± 0.00790.4144 ± 0.00571.02x ± 0.02x2.26% ± 1.68%
arrayvector_add_scalara + scalarfloat32262144x1262144x10.1839 ± 0.00620.1838 ± 0.00721.4268 ± 0.04761.4283 ± 0.05481.00x ± 0.05x0.21% ± 5.11%
arrayvector_add_scalara + scalarfloat64262144x1262144x10.5746 ± 0.01760.5733 ± 0.01650.4566 ± 0.01340.4576 ± 0.01261.00x ± 0.04x0.30% ± 4.11%
arrayvector_add_vectora + bfloat32262144x1262144x10.2411 ± 0.01530.2343 ± 0.01451.0912 ± 0.06911.1227 ± 0.07031.03x ± 0.07x3.09% ± 6.68%
arrayvector_add_vectora + bfloat64262144x1262144x10.8765 ± 0.01900.8773 ± 0.03270.2992 ± 0.00630.2992 ± 0.01061.00x ± 0.05x0.04% ± 4.65%
arrayvector_clampcwiseMax + cwiseMinfloat32262144x1262144x10.4023 ± 0.00920.4031 ± 0.01061.3038 ± 0.02851.3013 ± 0.03281.00x ± 0.03x-0.16% ± 3.15%
arrayvector_clampcwiseMax + cwiseMinfloat64262144x1262144x10.9576 ± 0.01400.9420 ± 0.00960.5476 ± 0.00800.5566 ± 0.00571.02x ± 0.02x1.66% ± 1.52%
arrayvector_coscos(a)float32262144x1262144x11.9118 ± 0.02271.8944 ± 0.02240.1371 ± 0.00160.1384 ± 0.00161.01x ± 0.01x0.93% ± 1.28%
arrayvector_coscos(a)float64262144x1262144x19.7176 ± 0.06529.6950 ± 0.01250.0270 ± 0.00020.0270 ± 0.00001.00x ± 0.01x0.23% ± 0.67%
arrayvector_div_scalara / scalarfloat32262144x1262144x10.5916 ± 0.00840.5913 ± 0.00350.4432 ± 0.00630.4433 ± 0.00261.00x ± 0.01x0.04% ± 1.16%
arrayvector_div_scalara / scalarfloat64262144x1262144x12.1528 ± 0.01412.1794 ± 0.04460.1217 ± 0.00080.1203 ± 0.00240.99x ± 0.02x-1.17% ± 2.47%
arrayvector_div_vectora / (b + scalar)float32262144x1262144x10.6959 ± 0.01730.6939 ± 0.01650.7538 ± 0.01850.7559 ± 0.01751.00x ± 0.03x0.32% ± 2.56%
arrayvector_div_vectora / (b + scalar)float64262144x1262144x12.3395 ± 0.02032.3372 ± 0.01720.2241 ± 0.00190.2243 ± 0.00161.00x ± 0.01x0.10% ± 1.34%
arrayvector_dotdot()float32262144x11x10.0888 ± 0.00980.0872 ± 0.01125.9631 ± 0.60886.0899 ± 0.68291.03x ± 0.16x3.11% ± 16.47%
arrayvector_dotdot()float64262144x11x10.4038 ± 0.02220.3922 ± 0.01461.3019 ± 0.07241.3384 ± 0.04781.03x ± 0.04x2.97% ± 4.46%
arrayvector_expexp(a * scalar)float32262144x1262144x11.9252 ± 0.01911.9539 ± 0.08240.2724 ± 0.00270.2687 ± 0.01040.99x ± 0.03x-1.35% ± 3.20%
arrayvector_expexp(a * scalar)float64262144x1262144x16.2123 ± 0.04636.1377 ± 0.00680.0844 ± 0.00060.0854 ± 0.00011.01x ± 0.01x1.22% ± 0.79%
arrayvector_fmaa * b + cfloat32262144x1262144x10.4734 ± 0.01560.4852 ± 0.02541.1085 ± 0.03641.0831 ± 0.05640.98x ± 0.05x-2.26% ± 4.70%
arrayvector_fmaa * b + cfloat64262144x1262144x11.2533 ± 0.02971.2412 ± 0.01960.4185 ± 0.00990.4225 ± 0.00651.01x ± 0.03x1.01% ± 3.19%
arrayvector_loglog(a + scalar)float32262144x1262144x11.8750 ± 0.02891.8875 ± 0.05610.2797 ± 0.00420.2780 ± 0.00780.99x ± 0.01x-0.62% ± 1.47%
arrayvector_loglog(a + scalar)float64262144x1262144x15.5634 ± 0.03245.5517 ± 0.01010.0942 ± 0.00050.0944 ± 0.00021.00x ± 0.01x0.21% ± 0.64%
arrayvector_maxmax(a, b)float32262144x1262144x10.2948 ± 0.00960.2913 ± 0.01250.8900 ± 0.02960.9015 ± 0.03911.01x ± 0.06x1.40% ± 5.62%
arrayvector_maxmax(a, b)float64262144x1262144x10.8995 ± 0.02500.8867 ± 0.03690.2916 ± 0.00810.2961 ± 0.01171.02x ± 0.04x1.57% ± 4.16%
arrayvector_minmin(a, b)float32262144x1262144x10.2958 ± 0.01190.2900 ± 0.01120.8876 ± 0.03550.9052 ± 0.03531.02x ± 0.05x2.10% ± 5.13%
arrayvector_minmin(a, b)float64262144x1262144x10.8940 ± 0.01650.8842 ± 0.02350.2933 ± 0.00540.2967 ± 0.00761.01x ± 0.02x1.16% ± 2.47%
arrayvector_mul_scalara * scalarfloat32262144x1262144x10.1970 ± 0.00550.1955 ± 0.00441.3317 ± 0.03671.3414 ± 0.02941.01x ± 0.04x0.80% ± 3.68%
arrayvector_mul_scalara * scalarfloat64262144x1262144x10.5933 ± 0.01140.6234 ± 0.05830.4420 ± 0.00850.4234 ± 0.03470.96x ± 0.07x-4.23% ± 7.32%
arrayvector_mul_vectora * bfloat32262144x1262144x10.2523 ± 0.01690.2513 ± 0.01801.0431 ± 0.06831.0479 ± 0.07611.01x ± 0.06x0.58% ± 6.05%
arrayvector_mul_vectora * bfloat64262144x1262144x10.8744 ± 0.02600.8814 ± 0.02770.3000 ± 0.00850.2977 ± 0.00920.99x ± 0.04x-0.71% ± 4.15%
arrayvector_normnorm()float32262144x11x10.0766 ± 0.00250.0759 ± 0.00086.8540 ± 0.21276.9066 ± 0.07371.01x ± 0.03x0.88% ± 3.41%
arrayvector_normnorm()float64262144x11x10.1679 ± 0.00660.1707 ± 0.00893.1263 ± 0.11583.0791 ± 0.15230.99x ± 0.07x-1.32% ± 7.21%
arrayvector_normalizenormalize()float32262144x1262144x10.7610 ± 0.02600.7496 ± 0.00741.0345 ± 0.03381.0492 ± 0.01031.02x ± 0.04x1.53% ± 3.65%
arrayvector_normalizenormalize()float64262144x1262144x12.5184 ± 0.02352.5160 ± 0.01160.3123 ± 0.00290.3126 ± 0.00141.00x ± 0.01x0.10% ± 1.01%
arrayvector_segmentsegment()float32262144x1131072x10.0586 ± 0.00260.0588 ± 0.00300.0000 ± 0.00000.0000 ± 0.00001.00x ± 0.07x-0.20% ± 6.67%
arrayvector_segmentsegment()float64262144x1131072x10.1173 ± 0.00580.1183 ± 0.00720.0000 ± 0.00000.0000 ± 0.00000.99x ± 0.07x-0.54% ± 7.38%
arrayvector_selectmask.select(a, b)float32262144x1262144x10.4471 ± 0.01030.4443 ± 0.01650.5865 ± 0.01330.5908 ± 0.02151.01x ± 0.05x0.78% ± 4.58%
arrayvector_selectmask.select(a, b)float64262144x1262144x11.0560 ± 0.01771.0460 ± 0.00930.2483 ± 0.00410.2506 ± 0.00221.01x ± 0.02x0.96% ± 1.68%
arrayvector_sinsin(a)float32262144x1262144x11.9014 ± 0.03121.9291 ± 0.03120.1379 ± 0.00220.1359 ± 0.00220.99x ± 0.01x-1.43% ± 0.74%
arrayvector_sinsin(a)float64262144x1262144x19.8594 ± 0.09479.8342 ± 0.01290.0266 ± 0.00030.0267 ± 0.00011.00x ± 0.01x0.26% ± 0.94%
arrayvector_sqrt(a + scalar).sqrt()float32262144x1262144x10.5683 ± 0.00990.5801 ± 0.02990.9228 ± 0.01570.9057 ± 0.04320.98x ± 0.05x-1.83% ± 4.73%
arrayvector_sqrt(a + scalar).sqrt()float64262144x1262144x12.1125 ± 0.01472.1021 ± 0.00690.2482 ± 0.00170.2494 ± 0.00081.00x ± 0.01x0.50% ± 0.83%
arrayvector_sub_scalara - scalarfloat32262144x1262144x10.1826 ± 0.00620.1828 ± 0.00761.4372 ± 0.04721.4364 ± 0.05671.00x ± 0.04x-0.02% ± 3.94%
arrayvector_sub_scalara - scalarfloat64262144x1262144x10.5716 ± 0.00950.6237 ± 0.16190.4587 ± 0.00770.4365 ± 0.06950.95x ± 0.15x-4.94% ± 14.69%
arrayvector_sub_vectora - bfloat32262144x1262144x10.2433 ± 0.01610.2384 ± 0.02231.0818 ± 0.07181.1080 ± 0.09821.03x ± 0.09x2.63% ± 9.26%
arrayvector_sub_vectora - bfloat64262144x1262144x10.8753 ± 0.02310.8923 ± 0.04640.2997 ± 0.00770.2944 ± 0.01460.98x ± 0.06x-1.64% ± 6.23%
arrayvector_sumsum()float32262144x11x10.0405 ± 0.00060.0402 ± 0.00016.4745 ± 0.10266.5170 ± 0.02131.01x ± 0.01x0.67% ± 1.41%
arrayvector_sumsum()float64262144x11x10.0823 ± 0.00380.0875 ± 0.01163.1913 ± 0.13293.0371 ± 0.35000.95x ± 0.13x-4.54% ± 12.79%
arrayvector_tanhtanh(a * scalar)float32262144x1262144x11.1129 ± 0.01151.1068 ± 0.01620.4712 ± 0.00480.4738 ± 0.00681.01x ± 0.01x0.56% ± 1.10%
arrayvector_tanhtanh(a * scalar)float64262144x1262144x113.9063 ± 0.115713.8740 ± 0.01130.0377 ± 0.00030.0378 ± 0.00001.00x ± 0.01x0.23% ± 0.81%
geometryquaternion_inverseQuaternion::inverse()float323x13x10.0001 ± 0.00000.0001 ± 0.00000.1102 ± 0.00120.1240 ± 0.01111.00x ± 0.00x0.00% ± 0.00%
geometryquaternion_inverseQuaternion::inverse()float643x13x10.0001 ± 0.00000.0001 ± 0.00000.0798 ± 0.00040.0816 ± 0.00101.00x ± 0.00x0.00% ± 0.00%
geometryquaternion_normalizeQuaternion::normalize()float323x13x10.0001 ± 0.00000.0001 ± 0.00000.1261 ± 0.00210.1372 ± 0.00551.00x ± 0.00x0.00% ± 0.00%
geometryquaternion_normalizeQuaternion::normalize()float643x13x10.0001 ± 0.00000.0001 ± 0.00000.0926 ± 0.00100.0963 ± 0.00161.00x ± 0.00x0.00% ± 0.00%
geometryquaternion_to_rotation_matrixQuaternion::toRotationMatrix()float323x13x30.0001 ± 0.00000.0001 ± 0.00000.3043 ± 0.00250.3390 ± 0.00561.00x ± 0.00x0.00% ± 0.00%
geometryquaternion_to_rotation_matrixQuaternion::toRotationMatrix()float643x13x30.0001 ± 0.00000.0001 ± 0.00000.2987 ± 0.00480.3307 ± 0.00361.00x ± 0.00x0.00% ± 0.00%
geometryvector_crosscross()float323x13x10.0001 ± 0.00000.0001 ± 0.00000.1232 ± 0.00180.1422 ± 0.00431.00x ± 0.00x0.00% ± 0.00%
geometryvector_crosscross()float643x13x10.0001 ± 0.00000.0001 ± 0.00000.1248 ± 0.00190.1533 ± 0.01481.00x ± 0.00x0.00% ± 0.00%
matrixmatrix_addA + Bfloat32512x512512x5120.2444 ± 0.01620.2363 ± 0.01511.0768 ± 0.06901.1134 ± 0.07311.04x ± 0.11x3.90% ± 10.64%
matrixmatrix_addA + Bfloat64512x512512x5120.8806 ± 0.02140.8841 ± 0.03310.2979 ± 0.00720.2969 ± 0.01081.00x ± 0.04x-0.30% ± 3.90%
matrixmatrix_blockblock()float32512x512256x2560.0307 ± 0.00040.0306 ± 0.00030.0000 ± 0.00000.0000 ± 0.00001.01x ± 0.02x0.60% ± 2.13%
matrixmatrix_blockblock()float64512x512256x2560.0577 ± 0.00030.0579 ± 0.00100.0000 ± 0.00000.0000 ± 0.00001.00x ± 0.02x-0.42% ± 1.83%
matrixmatrix_colwise_sumcolwise().sum()float32512x5121x5120.0428 ± 0.00080.0426 ± 0.00076.1163 ± 0.11476.1366 ± 0.08961.00x ± 0.03x0.40% ± 2.56%
matrixmatrix_colwise_sumcolwise().sum()float64512x5121x5120.0878 ± 0.00770.0848 ± 0.00362.9994 ± 0.23393.0920 ± 0.12141.04x ± 0.09x3.65% ± 8.98%
matrixmatrix_cwise_productcwiseProductfloat32512x512512x5120.2589 ± 0.01700.2466 ± 0.01361.0166 ± 0.06551.0661 ± 0.06181.05x ± 0.09x5.23% ± 8.60%
matrixmatrix_cwise_productcwiseProductfloat64512x512512x5120.8840 ± 0.03000.8962 ± 0.03690.2968 ± 0.00970.2929 ± 0.01210.99x ± 0.03x-1.29% ± 3.10%
matrixmatrix_determinantdeterminant()float32512x5121x112.1405 ± 1.00305.2100 ± 0.12217.4167 ± 0.627517.1831 ± 0.41042.33x ± 0.21x133.20% ± 20.93%
matrixmatrix_determinantdeterminant()float64512x5121x117.5771 ± 1.14079.4609 ± 1.02665.1098 ± 0.32959.5376 ± 0.81771.87x ± 0.19x87.22% ± 19.18%
matrixmatrix_gemvA * xfloat32512x512512x10.0728 ± 0.00240.0998 ± 0.00117.2020 ± 0.23875.2476 ± 0.05860.73x ± 0.02x-27.08% ± 2.31%
matrixmatrix_gemvA * xfloat64512x512512x10.1675 ± 0.00500.2008 ± 0.00993.1296 ± 0.09112.6139 ± 0.12150.84x ± 0.05x-16.39% ± 4.98%
matrixmatrix_identityIdentity()float321x1512x5120.3157 ± 0.00350.3437 ± 0.00310.0000 ± 0.00000.0000 ± 0.00000.92x ± 0.01x-8.14% ± 1.38%
matrixmatrix_identityIdentity()float641x1512x5120.3610 ± 0.00940.3946 ± 0.01770.0000 ± 0.00000.0000 ± 0.00000.92x ± 0.04x-8.38% ± 4.02%
matrixmatrix_inverseinverse()float32512x512512x51250.5584 ± 0.901015.5381 ± 1.36235.3109 ± 0.095217.3835 ± 1.36333.27x ± 0.24x227.24% ± 24.16%
matrixmatrix_inverseinverse()float64512x512512x51285.6748 ± 0.632625.2014 ± 1.86963.1333 ± 0.023010.7039 ± 0.78303.42x ± 0.26x241.66% ± 25.55%
matrixmatrix_ldlt_solveLDLT::solve(x)float32512x512512x10.1301 ± 0.00410.1256 ± 0.00234.0339 ± 0.11874.1760 ± 0.07381.04x ± 0.05x3.64% ± 4.56%
matrixmatrix_ldlt_solveLDLT::solve(x)float64512x512512x10.2601 ± 0.00300.2116 ± 0.00292.0160 ± 0.02262.4787 ± 0.03281.23x ± 0.02x22.96% ± 1.98%
matrixmatrix_llt_solveLLT::solve(x)float32512x512512x10.1339 ± 0.00070.1297 ± 0.00103.9156 ± 0.02014.0419 ± 0.03031.03x ± 0.01x3.24% ± 1.20%
matrixmatrix_llt_solveLLT::solve(x)float64512x512512x10.2642 ± 0.00400.2143 ± 0.00281.9848 ± 0.02962.4463 ± 0.03141.23x ± 0.03x23.29% ± 3.13%
matrixmatrix_matmulA * Bfloat32512x512512x5123.0865 ± 0.47861.7980 ± 0.550988.2614 ± 9.8672158.5934 ± 34.63021.84x ± 0.55x83.85% ± 54.82%
matrixmatrix_matmulA * Bfloat64512x512512x5126.3781 ± 0.71703.9874 ± 1.134942.4325 ± 3.830870.3070 ± 12.00511.67x ± 0.35x67.29% ± 35.34%
matrixmatrix_rowwise_sumrowwise().sum()float32512x512512x10.2161 ± 0.00750.2155 ± 0.00261.2117 ± 0.03971.2145 ± 0.01461.00x ± 0.04x0.34% ± 4.24%
matrixmatrix_rowwise_sumrowwise().sum()float64512x512512x10.6470 ± 0.11520.6061 ± 0.06170.4141 ± 0.06090.4350 ± 0.03691.08x ± 0.22x7.55% ± 21.61%
matrixmatrix_subA - Bfloat32512x512512x5120.2458 ± 0.01750.2370 ± 0.01481.0712 ± 0.07301.1103 ± 0.07351.04x ± 0.11x4.21% ± 11.15%
matrixmatrix_subA - Bfloat64512x512512x5120.8784 ± 0.01950.8945 ± 0.04020.2986 ± 0.00650.2936 ± 0.01300.98x ± 0.04x-1.65% ± 4.48%
matrixmatrix_tracetrace()float32512x5121x10.0008 ± 0.00000.0007 ± 0.00000.6784 ± 0.00450.6900 ± 0.00811.10x ± 0.07x10.00% ± 6.90%
matrixmatrix_tracetrace()float64512x5121x10.0010 ± 0.00000.0011 ± 0.00040.5202 ± 0.00680.4994 ± 0.09660.95x ± 0.19x-4.54% ± 18.59%
matrixmatrix_transposetranspose()float32512x512512x5121.7316 ± 0.02691.7152 ± 0.02360.0000 ± 0.00000.0000 ± 0.00001.01x ± 0.01x0.96% ± 1.26%
matrixmatrix_transposetranspose()float64512x512512x5123.3745 ± 0.27313.2961 ± 0.12310.0000 ± 0.00000.0000 ± 0.00001.02x ± 0.08x2.41% ± 7.99%
matrixmatrix_zeroZero()float321x1512x5120.0841 ± 0.00180.0838 ± 0.00090.0000 ± 0.00000.0000 ± 0.00001.00x ± 0.03x0.41% ± 2.68%
matrixmatrix_zeroZero()float641x1512x5120.1706 ± 0.00860.1716 ± 0.00480.0000 ± 0.00000.0000 ± 0.00000.99x ± 0.05x-0.56% ± 4.75%