Skip to content

Commit 9ecae26

Browse files
committed
Fixed minor calculation error in gain charting, modified default kernel
1 parent bf613e3 commit 9ecae26

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

demo/playground.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ $(function() {
366366
"function kernel(A,B) {\n"+
367367
" var sum = 0;\n"+
368368
" for (var i=0; i<512; i++) {\n"+
369-
" sum = (sum*A[this.thread.x] + i)/B[this.thread.x];\n"+
369+
" sum = Math.pow((A[this.thread.x]-sum)/B[this.thread.x],2);\n"+
370370
" }\n"+
371371
" return sum;\n"+
372372
"}";
@@ -563,9 +563,9 @@ $(function() {
563563
if( cpu_time == gpu_time ) {
564564
gain_per = 0;
565565
} else if( gpu_time < cpu_time ) {
566-
gain_per = cpu_time / gpu_time * 100.0;
566+
gain_per = cpu_time / gpu_time * 100.0 - 100.0;
567567
} else {
568-
gain_per = -(gpu_time / cpu_time * 100.0);
568+
gain_per = -(gpu_time / cpu_time * 100.0) + 100.0;
569569
}
570570

571571
bench_labels.push( sampleSize );

0 commit comments

Comments
 (0)