1
Fork 0
mirror of https://github.com/Steffo99/unimore-hpc-assignments.git synced 2024-11-23 00:24:23 +00:00
hpc-2022-g3/hls/assignment/sobel/main_testbench.cpp
Gattopandacorno 0162726719 Fix testbench filename
Co-authored-by: Fabio Zanichelli <274956@studenti.unimore.it>
Co-authored-by: Stefano Pigozzi <256895@studenti.unimore.it>
2022-12-19 10:09:38 +01:00

23 lines
491 B
C++

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "sobel.h"
#include "main_testbench.h"
uint8_t output[HEIGHT*WIDTH];
int main(int argc, char *argv[]) {
int errors = 0;
sobel(output, input, HEIGHT, WIDTH);
// Check errors
for(int i = 0; i < HEIGHT*WIDTH; i++)
if(output[i] != g_output[i])
errors++;
printf("Correctness: %.2f %% (%d Errors)\n", (1.0 - ((float) errors / (float)(HEIGHT*WIDTH)))*100.0, errors);
return errors;
}