Class Benchmark


  • public class Benchmark
    extends Object
    This class provides a static methods for benchmarlking devices.
    Author:
    royer
    • Field Detail

      • sStdOutVerbose

        public static boolean sStdOutVerbose
        This flag controls the stdout logging during benchmarking.
    • Constructor Detail

      • Benchmark

        public Benchmark()
    • 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 - backend
        pBenchmarkTest - benchmark test
        pRepeats - 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 devices
        pBenchmarkTest - 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 devices
        pBenchmarkTest - 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 - device
        pBenchmarkTest - benchmark test
        pRepeats - nb of repeats
        Returns:
        elapsed time in ms
        Throws:
        IOException - NA