From 6f1fb47792061aa9f46e7ab6c498827cae70096b Mon Sep 17 00:00:00 2001 From: pv3e4i5aj Date: Sat, 23 Nov 2024 18:11:03 +0800 Subject: [PATCH] Add task7.cpp --- task7.cpp | 179 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 task7.cpp diff --git a/task7.cpp b/task7.cpp new file mode 100644 index 0000000..0adf254 --- /dev/null +++ b/task7.cpp @@ -0,0 +1,179 @@ +#include +#include +#include +#include //启用 NEON 指令 + +#define SIZE 102400000 + +// 基础向量加法函数 +void vector_add(float* A, float* B, float* C, int size) +{ + for (int i = 0; i < size; ++i) + { + C[i] = A[i] + B[i]; + } +} +//优化的向量加法函数 +void vector_add_optimized(float* A, float* B, float* C, int size) +{ + for(int i=0;i