1
Fork 0
mirror of https://github.com/Steffo99/unimore-hpc-assignments.git synced 2024-11-26 18:14:23 +00:00
hpc-2022-g3/hls/lab1/exercise_0_testbench.cpp

29 lines
487 B
C++
Raw Normal View History

2021-05-13 20:03:14 +00:00
#include <stdio.h>
#include <stdlib.h>
#include "exercise_0.hpp"
int main(int argc, char ** argv) {
int * a = (int *)malloc(TEST_DATA_SIZE*sizeof(int));
int * b = (int *)malloc(TEST_DATA_SIZE*sizeof(int));
int * c = (int *)malloc(TEST_DATA_SIZE*sizeof(int));
for(int i = 0; i < TEST_DATA_SIZE; i++) {
a[i] = i*i;
b[i] = i;
}
vadd(a, b, c, TEST_DATA_SIZE);
for(int i = 0; i < TEST_DATA_SIZE; i++) {
printf("%d\n", c[i]);
}
free(a);
free(b);
free(c);
return 0;
}