Clean up canonical mt benchmarks and reorganize extra versions in /mt. All versions...
[riscv-tests.git] / mt / vvadd4.c
diff --git a/mt/vvadd4.c b/mt/vvadd4.c
new file mode 100644 (file)
index 0000000..8f4d43f
--- /dev/null
@@ -0,0 +1,16 @@
+#include "stdlib.h"
+#include "dataset.h"
+
+//--------------------------------------------------------------------------
+// vvadd function
+
+void __attribute__((noinline)) vvadd(int coreid, int ncores, size_t n, const data_t* x, const data_t* y, data_t* z)
+{
+   size_t i;
+
+   // interleave accesses
+   for (i = coreid; i < n; i+=ncores)
+   {
+      z[i] = x[i] + y[i];
+   }
+}