diff options
author | Jason Sams <jsams@google.com> | 2012-09-05 13:50:36 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-09-05 13:50:36 -0700 |
commit | 6d617c2ddd848985fb98e0e54dc7f6234d814b7c (patch) | |
tree | 8eac4d22e3157b260f53baaa2a7d72356815b409 /tests | |
parent | 3e777c79707d6c65e41ecd5a9b0e8f252ceafc90 (diff) | |
parent | 76fb2973b988b150ed4b62611dc41c2658eeb892 (diff) | |
download | frameworks_base-6d617c2ddd848985fb98e0e54dc7f6234d814b7c.zip frameworks_base-6d617c2ddd848985fb98e0e54dc7f6234d814b7c.tar.gz frameworks_base-6d617c2ddd848985fb98e0e54dc7f6234d814b7c.tar.bz2 |
Merge "Stabilize perf data." into jb-mr1-dev
Diffstat (limited to 'tests')
3 files changed, 12 insertions, 8 deletions
diff --git a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java index 3f34128..001dea8 100644 --- a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java +++ b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java @@ -296,14 +296,14 @@ public class ImageProcessingActivity extends Activity // button hook public void benchmark(View v) { - long t = getBenchmark(); + float t = getBenchmark(); //long javaTime = javaFilter(); //mBenchmarkResult.setText("RS: " + t + " ms Java: " + javaTime + " ms"); mBenchmarkResult.setText("Result: " + t + " ms"); } // For benchmark test - public long getBenchmark() { + public float getBenchmark() { mDoingBenchmark = true; mTest.setupBenchmark(); @@ -319,14 +319,18 @@ public class ImageProcessingActivity extends Activity Log.v(TAG, "Benchmarking"); t = java.lang.System.currentTimeMillis(); - mTest.runTest(); + for (int i=0; i<10; i++) { + mTest.runTest(); + } mTest.finish(); t = java.lang.System.currentTimeMillis() - t; + float ft = (float)t; + ft /= 10; - Log.v(TAG, "getBenchmark: Renderscript frame time core ms " + t); + Log.v(TAG, "getBenchmark: Renderscript frame time core ms " + ft); mTest.exitBenchmark(); mDoingBenchmark = false; - return t; + return ft; } } diff --git a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingTest.java b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingTest.java index 912d863..f995437 100644 --- a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingTest.java +++ b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingTest.java @@ -78,7 +78,7 @@ public class ImageProcessingTest extends ActivityInstrumentationTestCase2<ImageP BufferedWriter rsWriter = new BufferedWriter(new FileWriter(resultFile)); Log.v(TAG, "Saved results in: " + resultFile.getAbsolutePath()); for (int i = 0; i < ITERATION; i++ ) { - t = mAct.getBenchmark(); + t = (long)mAct.getBenchmark(); sum += t; rsWriter.write("Renderscript frame time core: " + t + " ms\n"); Log.v(TAG, "RenderScript framew time core: " + t + " ms"); diff --git a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/convolve3x3.rs b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/convolve3x3.rs index b6b4a0f..455fcc2 100644 --- a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/convolve3x3.rs +++ b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/convolve3x3.rs @@ -25,9 +25,9 @@ rs_allocation gIn; float gCoeffs[9]; void root(uchar4 *out, uint32_t x, uint32_t y) { - uint32_t x1 = min((int32_t)x+1, gWidth); + uint32_t x1 = min((int32_t)x+1, gWidth-1); uint32_t x2 = max((int32_t)x-1, 0); - uint32_t y1 = min((int32_t)y+1, gHeight); + uint32_t y1 = min((int32_t)y+1, gHeight-1); uint32_t y2 = max((int32_t)y-1, 0); float4 p00 = convert_float4(((uchar4 *)rsGetElementAt(gIn, x1, y1))[0]); |