Skip to content

Add a new variant of an existing binary

sf-wind edited this page Jul 27, 2018 · 1 revision

The harness supports a number of commonly used building scripts of the benchmarking binaries for your favorite framework. The building scripts are organized in the following convention:

All building scripts are placed under specifications/frameworks directory. Each framework is placed under its own directory (e.g. specifications/frameworks/caffe2). The subdirectory names are different supported platforms: android, host, windows etc. (The directory name must match the return value from the getName() method of the platform class.) There is a shell script called build.sh (build.bat for windows platform). This script is called by the harness by default to build the binary for the platform specified using --platform argument.

In some cases, however, you may want to build the binary using different flags from the default script. For example, you may want to use clang to build the binary instead of using gcc. In this case, you create a new directory under the platform directory, and add a script build.sh (build.bat for windows) with your custom build commands. Then, when you launch the benchmark runs, use argument --platform <platform>/<your directory name>. Then your custom build script is invoked. For example, if you want to use clang to build the caffe2 benchmark binary on android platform, you can specify --platform android/clang in your command line.