Exemplo n.º 1
0
        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));
        }
            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");
            }
Exemplo n.º 3
0
// class constructor
Resound::BPhasor::BPhasor(std::string name) :
Resound::Behaviour(name),
m_amp(new BehaviourParameter("amp", this)),
m_freq(new BehaviourParameter("freq", this))
{
	register_parameter(m_amp);
	register_parameter(m_freq);
}
Exemplo n.º 4
0
// class constructor
Resound::BMultiCrossfade::BMultiCrossfade(std::string name) :
Resound::Behaviour(name),
m_amp(new BehaviourParameter("amp", this)),
m_pos(new BehaviourParameter("pos", this)),
m_offset(new BehaviourParameter("offset", this))
{
	register_parameter(m_amp);
	register_parameter(m_pos);
	register_parameter(m_offset);
	// this 
}
Exemplo n.º 5
0
// class constructor
Resound::BRandom::BRandom(std::string name) :
Resound::Behaviour(name),
m_amp(new BehaviourParameter("amp", this)),
m_freq(new BehaviourParameter("freq", this)),
m_offset(new BehaviourParameter("offset", this))
{
	register_parameter(m_amp);
	register_parameter(m_freq);
	register_parameter(m_offset);
	m_edgeTrigger = true;
}
Exemplo n.º 6
0
// class constructor
Resound::BWave::BWave(std::string name) :
Resound::Behaviour(name),
m_amp(new BehaviourParameter("amp", this)),
m_freq(new BehaviourParameter("freq", this)),
//m_phase(new BehaviourParameter("phase", this)),
m_offset(new BehaviourParameter("offset", this))
{
	register_parameter(m_amp);
	register_parameter(m_freq);
	//register_parameter(m_phase);
	register_parameter(m_offset);
}
    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));
    }
Exemplo n.º 8
0
void create_thinkpad_fan(void)
{
	char filename[4096];
	class thinkpad_fan *fan;

	strcpy(filename, "/sys/devices/platform/thinkpad_hwmon/fan1_input");

	if (access(filename, R_OK) !=0)
		return;

	register_parameter("thinkpad-fan", 10);
	register_parameter("thinkpad-fan-sqr", 5);
	register_parameter("thinkpad-fan-cub", 10);

	fan = new class thinkpad_fan();
	all_devices.push_back(fan);
}
Exemplo n.º 9
0
        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));
        }
Exemplo n.º 10
0
static void powertop_init(void)
{
	static char initialized = 0;
	int ret;
	struct statfs st_fs;
	struct rlimit rlmt;

	if (initialized)
		return;

	checkroot();

	rlmt.rlim_cur = rlmt.rlim_max = get_nr_open();
	setrlimit (RLIMIT_NOFILE, &rlmt);

	ret = system("/sbin/modprobe cpufreq_stats > /dev/null 2>&1");
	ret = system("/sbin/modprobe msr > /dev/null 2>&1");
	statfs("/sys/kernel/debug", &st_fs);

	if (st_fs.f_type != (long) DEBUGFS_MAGIC) {
		if (access("/bin/mount", X_OK) == 0) {
			ret = system("/bin/mount -t debugfs debugfs /sys/kernel/debug > /dev/null 2>&1");
		} else {
			ret = system("mount -t debugfs debugfs /sys/kernel/debug > /dev/null 2>&1");
		}
		if (ret != 0) {
			printf(_("Failed to mount debugfs!\n"));
			printf(_("exiting...\n"));
			exit(EXIT_FAILURE);
		}
	}

	srand(time(NULL));

	if (access("/var/cache/", W_OK) == 0)
		mkdir("/var/cache/powertop", 0600);
	else
		mkdir("/data/local/powertop", 0600);

	load_results("saved_results.powertop");
	load_parameters("saved_parameters.powertop");

	enumerate_cpus();
	create_all_devices();
	detect_power_meters();

	register_parameter("base power", 100, 0.5);
	register_parameter("cpu-wakeups", 39.5);
	register_parameter("cpu-consumption", 1.56);
	register_parameter("gpu-operations", 0.5576);
	register_parameter("disk-operations-hard", 0.2);
	register_parameter("disk-operations", 0.0);
	register_parameter("xwakes", 0.1);

        load_parameters("saved_parameters.powertop");

	initialized = 1;
}
Exemplo n.º 11
0
    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");
    }
Exemplo n.º 12
0
void Embedding::reset() {
  table_ = register_parameter("table", torch::empty({count_, dimension_}));
  table_.data().normal_(0, 1);
}