1
Fork 0
mirror of https://github.com/Steffo99/unimore-hpc-assignments.git synced 2024-11-25 17:44:23 +00:00
hpc-2022-g3/hls/lab1/exercise_0_testbench.cpp
Gianluca Brilli 515ca52cc9 HLS lab 1
2021-05-13 22:03:14 +02:00

28 lines
487 B
C++

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