Class Benchmark
- java.lang.Object
-
- net.haesleinhuepf.clij.clearcl.benchmark.Benchmark
-
public class Benchmark extends Object
This class provides a static methods for benchmarlking devices.- Author:
- royer
-
-
Field Summary
Fields Modifier and Type Field Description static booleansStdOutVerboseThis flag controls the stdout logging during benchmarking.
-
Constructor Summary
Constructors Constructor Description Benchmark()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doubleexecuteBenchmarkOnDevice(ClearCLDevice pClearClDevice, BenchmarkTest pBenchmarkTest, int pRepeats)Computes the time needed to execute a given bencmark test on a particular device with a given number of repetitions.static ClearCLDevicegetFastestDevice(ArrayList<ClearCLDevice> pDevices, BenchmarkTest pBenchmarkTest)Returns the fastest device for a given benchmark test.static ClearCLDevicegetFastestDevice(ArrayList<ClearCLDevice> pDevices, BenchmarkTest pBenchmarkTest, int pRepeats)Returns the fastest device for a given benchmark test.static StringgetFastestDevice(ClearCLBackendInterface pClearCLBackend, BenchmarkTest pBenchmarkTest, int pRepeats)Returns the fastest device available for a given backend and benchmark test.
-
-
-
Method Detail
-
getFastestDevice
public static String getFastestDevice(ClearCLBackendInterface pClearCLBackend, BenchmarkTest pBenchmarkTest, int pRepeats)
Returns the fastest device available for a given backend and benchmark test.- Parameters:
pClearCLBackend- backendpBenchmarkTest- benchmark testpRepeats- nb of repeats- Returns:
- name of device, null if any error occured.
-
getFastestDevice
public static ClearCLDevice getFastestDevice(ArrayList<ClearCLDevice> pDevices, BenchmarkTest pBenchmarkTest)
Returns the fastest device for a given benchmark test.- Parameters:
pDevices- list of devicespBenchmarkTest- benchmark type.- Returns:
- device
-
getFastestDevice
public static ClearCLDevice getFastestDevice(ArrayList<ClearCLDevice> pDevices, BenchmarkTest pBenchmarkTest, int pRepeats)
Returns the fastest device for a given benchmark test.- Parameters:
pDevices- list of devicespBenchmarkTest- benchmark type.pRepeats- number of repeats (for high accuracy larger than 1000)- Returns:
- fastest device
-
executeBenchmarkOnDevice
public static double executeBenchmarkOnDevice(ClearCLDevice pClearClDevice, BenchmarkTest pBenchmarkTest, int pRepeats) throws IOException
Computes the time needed to execute a given bencmark test on a particular device with a given number of repetitions.- Parameters:
pClearClDevice- devicepBenchmarkTest- benchmark testpRepeats- nb of repeats- Returns:
- elapsed time in ms
- Throws:
IOException- NA
-
-