Loading tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java +9 −5 Original line number Diff line number Diff line Loading @@ -280,14 +280,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(); Loading @@ -303,14 +303,18 @@ public class ImageProcessingActivity extends Activity Log.v(TAG, "Benchmarking"); t = java.lang.System.currentTimeMillis(); 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; } } tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -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"); Loading tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/convolve3x3.rs +2 −2 Original line number Diff line number Diff line Loading @@ -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]); Loading Loading
tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java +9 −5 Original line number Diff line number Diff line Loading @@ -280,14 +280,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(); Loading @@ -303,14 +303,18 @@ public class ImageProcessingActivity extends Activity Log.v(TAG, "Benchmarking"); t = java.lang.System.currentTimeMillis(); 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; } }
tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/ImageProcessingTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -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"); Loading
tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/convolve3x3.rs +2 −2 Original line number Diff line number Diff line Loading @@ -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]); Loading