blob: b9044bb63e73688477540cb0958e36c00605da52 [file] [log] [blame]
package org.linaro.iasenov.benchmarkframework;
import android.util.Log;
/**
* Created by iasenov on 8/22/16.
*/
public class Test2 extends BaseBenchmark{
public native String stringFromJNI(int size1);
private int runs = 10; // 2 * 4 DP MW arrays = 2 * 32 MB
private String TAG = "RandMem";
static boolean isJNICanceled = false;
public String startBenchmark(int count)
{
isJNICanceled = false;
version = " Android RandMem Benchmark 1.1 ";
benchmarkName = "Test2";
integrationType = "SL";
chartName = "RandMem";
clear();
xout[2] = " MBytes/Second Transferring 4 Byte Words \n";
xout[3] = " Memory Serial....... Random.......\n";
xout[4] = " KBytes Read Rd/Wrt Read Rd/Wrt\n";
startTest = System.currentTimeMillis();
for (int size1=0; size1<runs; size1++)
{
if(isJNICanceled){
break;
}
xout[size1+5] = stringFromJNI(size1);
}
endTest = System.currentTimeMillis();
sendElapsedTimeToChart();
submitElapsedTime(endTest-startTest);
return benchmarkName + ":" + getBenchmarkResult(-1, integrationType);
}
public boolean stopBenchmark(){
isJNICanceled = true;
Log.i(TAG,"stopBenchmark: isJNICanceled");
return true;
}
}