Skip to content
Snippets Groups Projects
Commit 5c962a9c authored by Daniel Maier's avatar Daniel Maier
Browse files

floyd-warshall: error checking

parent 300fd9f7
No related branches found
No related tags found
No related merge requests found
File added
File added
......@@ -57,13 +57,22 @@ void print_array(int n,
POLYBENCH_DUMP_FINISH;
}
extern int _binary_data_bin_start;
extern int _binary_data_bin_end;
static
void calc_error(int n,
DATA_TYPE POLYBENCH_2D(path,N,N,n,n))
{
double err = 0;
int *accurate = &_binary_data_bin_start;
int *test = &(path[0][0]);
for (int i = 0; i < n*n; i++) {
}
err += (accurate[i] - test[i]) * (accurate[i] - test[i]);
}
err /= n*n;
printf("error: %f\n", err);
}
......@@ -114,6 +123,8 @@ int main(int argc, char** argv)
by the function call in argument. */
polybench_prevent_dce(print_array(n, POLYBENCH_ARRAY(path)));
calc_error(n, POLYBENCH_ARRAY(path));
/* Be clean. */
POLYBENCH_FREE_ARRAY(path);
......
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