
// isip include files
//
#include "isip_benchmarks.h"

// main program starts here:
//
int main(int argc, const char** argv) {

  // create command line
  //
  CommandLine cmdl;

  // set help message
  //
  cmdl.setHelp(
    #include "isip_benchmarks_help.text"
  );

  // declare variables for debug_level command line
  //
  String debug_opt;
  String debug_param(L"debug");
  String debug_def(L"BRIEF");
  cmdl.addOptionParam(debug_opt, debug_param, debug_def);
  
  // get the bechmarking option command line
  //
  String bench_opt;
  String bench_param;
  String bench_def;
  bench_param.assign(L"bench");
  bench_def.assign(L"fft");
  cmdl.addOptionParam(bench_opt, bench_param, bench_def);

  // get the bechmarking algorithm command line
  //
  String algo_opt;
  String algo_param;
  String algo_def;
  algo_param.assign(L"algo");
  algo_def.assign(L"sr");
  cmdl.addOptionParam(algo_opt, algo_param, algo_def);

  // get the bechmarking order command line
  //
  String order_opt;
  String order_param;
  String order_def;
  order_param.assign(L"order");
  order_def.assign((long)1024);
  cmdl.addOptionParam(order_opt, order_param, order_def);    
  
  // parse the command line
  //
  cmdl.parse(argc, argv);

  // set the debug level
  //
  DebugLevel level;
  if (!level.assign(debug_opt)) {
    Console::put(L"invalid debug level, it should be NONE, BRIEF, DETAILED, or ALL.");
    cmdl.printUsage();
  }

  // set the order
  //
  Long order;
  order.assign(order_opt);

  // branch on benchmarking option
  //
  if (bench_opt.eq(L"fft")) {
    bench_fft(level, order, algo_opt);
  }

  // unknown option
  //
  else {
    Console::put(L"invalid benchmarking option, it should be fft.");
    cmdl.printUsage();
  }
  
  return true;
}
