aboutsummaryrefslogtreecommitdiff
path: root/benchmarks/mt-vvadd/vvadd.c
blob: 5b74dd0f3b798db4c97bb93c89af70ead0243637 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// See LICENSE for license details.

#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];
   }
}