Skip to content
Snippets Groups Projects
Commit 83eff10f authored by Milo Craun's avatar Milo Craun
Browse files

merge conflict

parents d6044813 d6ed1aaf
No related branches found
No related tags found
No related merge requests found
......@@ -80,3 +80,10 @@ Found an old and freely available benchmark suite [Livermore Loops](https://en.w
It looks like a good choice for some numerical algorithms.
Some of the loops can be vectorized and others cannot.
The source code in c can be found [here](https://www.netlib.org/benchmark/livermorec)
# 2024-04-16 Davis
## second workload
I created a vector addition file called `vecAddProj.c` and added it to the repo. My thought is that
since it simply adds two vectors, there should be singificant imporvement
in speedup between runs with and without vectors. This should serve as a proof of concept.
/* Vector addition */
#include <stdio.h>
#include <stdlib.h>
#define NUM 10
int main ()
{
int vect1[NUM], vect2[NUM]; /* two vectors */
int result[NUM]; /* result vector */
int n=NUM, i;
int upper = 100;
int lower = 0;
//fill vector 1
for (i = 0; i < n; i++){
vect1[i] = (rand() %
(upper - lower + 1)) + lower;
}
//fill vector 2
for (i = 0; i < n; i++){
vect2[i] = (rand() %
(upper - lower + 1)) + lower;
}
/* perform vector addition */
for (i = 0; i < n; i++)
result[i] = vect1[i] + vect2[i];
//print vector 1
printf ("vector 2:\n");
for (i = 0; i < n; i++)
printf ("%d ", vect1[i]);
//print vector 2
printf ("\nvector 1:\n");
for (i = 0; i < n; i++)
printf ("%d ", vect2[i]);
/* print addition vector C */
printf ("\nAddition vector:\n");
for (i = 0; i < n; i++)
printf ("%d ", result[i]);
printf("\n");
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment