@@ -54,7 +54,7 @@ int main(int argc, char **argv)
5454 const int streamSize = n / nStreams;
5555 const int streamBytes = streamSize * sizeof (float );
5656 const int bytes = n * sizeof (float );
57-
57+
5858 int devId = 0 ;
5959 if (argc > 1 ) devId = atoi (argv[1 ]);
6060
@@ -89,7 +89,7 @@ int main(int argc, char **argv)
8989 checkCuda ( cudaEventSynchronize (stopEvent) );
9090 checkCuda ( cudaEventElapsedTime (&ms, startEvent, stopEvent) );
9191 printf (" Time for sequential transfer and execute (ms): %f\n " , ms);
92- printf (" max error: %f \n " , maxError (a, n));
92+ printf (" max error: %e \n " , maxError (a, n));
9393
9494 // asynchronous version 1: loop over {copy, kernel, copy}
9595 memset (a, 0 , bytes);
@@ -108,7 +108,7 @@ int main(int argc, char **argv)
108108 checkCuda ( cudaEventSynchronize (stopEvent) );
109109 checkCuda ( cudaEventElapsedTime (&ms, startEvent, stopEvent) );
110110 printf (" Time for asynchronous V1 transfer and execute (ms): %f\n " , ms);
111- printf (" max error: %f \n " , maxError (a, n));
111+ printf (" max error: %e \n " , maxError (a, n));
112112
113113 // asynchronous version 2:
114114 // loop over copy, loop over kernel, loop over copy
@@ -137,7 +137,7 @@ int main(int argc, char **argv)
137137 checkCuda ( cudaEventSynchronize (stopEvent) );
138138 checkCuda ( cudaEventElapsedTime (&ms, startEvent, stopEvent) );
139139 printf (" Time for asynchronous V2 transfer and execute (ms): %f\n " , ms);
140- printf (" max error: %f \n " , maxError (a, n));
140+ printf (" max error: %e \n " , maxError (a, n));
141141
142142 // cleanup
143143 checkCuda ( cudaEventDestroy (startEvent) );
0 commit comments