Instrumentation() { // Phase description" set_phase_name("Nanos 4 OpenMP Instrumentation"); set_phase_description("This phase adds instrumentation to either " "function calls or function definitions using Nanos4 instrumentation interface"); // Phase parameters register_parameter("instrument", "If set to '1' enables instrumentation, otherwise it is disabled", instrument_enabled_str, "0"); register_parameter("instrument_mode", "It sets the kind of instrumentation done. Valid values are 'calls' or 'functions'. Currently only 'calls' is valid", instrument_mode, "calls"); register_parameter("instrument_file_name", "Sets the filtering file for instrumentation. This file contains a of functions to " "be instrumented or not, depending on 'instrument_filter_mode'", instrument_file_name, "./filter_instrument"); register_parameter("instrument_filter_mode", "Sets the filtering mode. It can be either 'normal' or 'inverted'. " "A function is instrumented only if 'instrument_filter_mode' is 'normal' and the function name " "is listed in the file of option 'instrument_file_name' or if 'instrument_filter_mode' is 'inverted' " "and the function is not listed in that file'", instrument_filter_mode, "normal"); }
Simd::Simd() : PragmaCustomCompilerPhase("omp-simd"), _simd_enabled(false), _svml_enabled(false), _ffast_math_enabled(false), _mic_enabled(false) { set_phase_name("Vectorize OpenMP SIMD parallel IR"); set_phase_description("This phase vectorize the OpenMP SIMD parallel IR"); register_parameter("simd_enabled", "If set to '1' enables simd constructs, otherwise it is disabled", _simd_enabled_str, "0").connect(functor(&Simd::set_simd, *this)); register_parameter("svml_enabled", "If set to '1' enables svml math library, otherwise it is disabled", _svml_enabled_str, "0").connect(functor(&Simd::set_svml, *this)); register_parameter("ffast_math_enabled", "If set to '1' enables ffast_math operations, otherwise it is disabled", _ffast_math_enabled_str, "0").connect(functor(&Simd::set_ffast_math, *this)); register_parameter("mic_enabled", "If set to '1' enables compilation for MIC architecture, otherwise it is disabled", _mic_enabled_str, "0").connect(functor(&Simd::set_mic, *this)); }
Lowering::Lowering() { // In the constructor the phase self-describes. This information is used in --help set_phase_name("OpenMP Lowering Example phase"); set_phase_description("This phase showcases how to lower from Mercurium parallel IR"); // Parameters of the phase may also be registered here, but in this // example we do not register any }
Lowering::Lowering() { set_phase_name("Intel OpenMP RTL lowering"); set_phase_description("This phase lowers from Mercurium parallel IR into real code involving Intel OpenMP RTL"); register_parameter("omp_dry_run", "Disables OpenMP transformation", _openmp_dry_run, "0"); }
ExampleParameters::ExampleParameters() { // Parameters are registered in the constructor of the phase set_phase_name("Example phase with parameters"); set_phase_description("This phase does nothing but registering some parameters and printing them"); register_parameter("param1", "This is the parameter number one", _parameter_1_value, "val1"); register_parameter("param2", "This is the parameter number two", _parameter_2_value, "val2").connect(functor(&ExampleParameters::check_param2, *this)); }
Interface::Interface() : PragmaCustomCompilerPhase("nanos") { set_phase_name("Nanos Runtime Source-Compiler Versioning Interface"); set_phase_description("This phase enables support for '#pragma nanos', the interface for versioning runtime and compiler for Nanos"); register_directive("interface"); on_directive_pre["interface"].connect(functor(&Interface::interface_preorder, *this)); on_directive_post["interface"].connect(functor(&Interface::interface_postorder, *this)); register_directive("instrument|declare"); on_directive_pre["instrument|declare"].connect(functor(&Interface::instrument_declare_pre, *this)); on_directive_post["instrument|declare"].connect(functor(&Interface::instrument_declare_post, *this)); register_directive("instrument|emit"); on_directive_pre["instrument|emit"].connect(functor(&Interface::instrument_emit_pre, *this)); on_directive_post["instrument|emit"].connect(functor(&Interface::instrument_emit_post, *this)); }
NanosMain::NanosMain() : PragmaCustomCompilerPhase(), _nanos_main_enabled(false), _instrumentation_enabled(false) { set_phase_name("Call nanos main prior to user main"); set_phase_description("This phase modifies main to initialize Nanos++ and perform early instrumentation"); register_parameter("nanos_main_enabled", "If set to '1' nanos main will be called before main, otherwise it is disabled", _nanos_main_enabled_str, "0").connect(std::bind(&NanosMain::set_nanos_main, this, std::placeholders::_1)); register_parameter("instrument", "If set to '1' enable instrumentation of main entry point", _instrumentation_enabled_str, "0").connect(std::bind(&NanosMain::set_instrumentation, this, std::placeholders::_1)); }