test_options.h 1.0 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
#pragma once

#include <iostream>
#include <thread>
#include "../load_and_run/src/strategys/strategy.h"
#include "../load_and_run/src/strategys/strategy_normal.h"
#include "megbrain/common.h"
#include "megbrain/utils/timer.h"
#include "megbrain/version.h"
#include "megdnn/version.h"
#include "misc.h"

namespace lar {

//! run load_and_run NormalStrategy to test different options

void run_NormalStrategy(std::string model_path);

}  // namespace lar
#define BOOL_OPTION_WRAP(option)                               \
    struct BoolOptionWrap_##option {                           \
        BoolOptionWrap_##option() { FLAGS_##option = true; }   \
        ~BoolOptionWrap_##option() { FLAGS_##option = false; } \
    };

#define DEFINE_WRAP(option) BoolOptionWrap_##option flags_##option;

28 29 30 31
#define TEST_BOOL_OPTION(option)        \
    {                                   \
        DEFINE_WRAP(option);            \
        run_NormalStrategy(model_path); \
32 33
    }
// vim: syntax=cpp.doxygen foldmethod=marker foldmarker=f{{{,f}}}