Browse Source

Add general setting to enable CUDA on runtime

Former-commit-id: fc2c8e8d0c
tempestpy_adaptions
svkurowski 10 years ago
parent
commit
a4a15dd774
  1. 6
      src/settings/modules/GeneralSettings.cpp
  2. 8
      src/settings/modules/GeneralSettings.h

6
src/settings/modules/GeneralSettings.cpp

@ -45,6 +45,7 @@ namespace storm {
const std::string GeneralSettings::statisticsOptionShortName = "stats"; const std::string GeneralSettings::statisticsOptionShortName = "stats";
const std::string GeneralSettings::bisimulationOptionName = "bisimulation"; const std::string GeneralSettings::bisimulationOptionName = "bisimulation";
const std::string GeneralSettings::bisimulationOptionShortName = "bisim"; const std::string GeneralSettings::bisimulationOptionShortName = "bisim";
const std::string GeneralSettings::cudaOptionName = "cuda";
GeneralSettings::GeneralSettings(storm::settings::SettingsManager& settingsManager) : ModuleSettings(settingsManager, moduleName) { GeneralSettings::GeneralSettings(storm::settings::SettingsManager& settingsManager) : ModuleSettings(settingsManager, moduleName) {
this->addOption(storm::settings::OptionBuilder(moduleName, helpOptionName, false, "Shows all available options, arguments and descriptions.").setShortName(helpOptionShortName) this->addOption(storm::settings::OptionBuilder(moduleName, helpOptionName, false, "Shows all available options, arguments and descriptions.").setShortName(helpOptionShortName)
@ -95,6 +96,7 @@ namespace storm {
this->addOption(storm::settings::OptionBuilder(moduleName, constantsOptionName, false, "Specifies the constant replacements to use in symbolic models. Note that Note that this requires the model to be given as an symbolic model (i.e., via --" + symbolicOptionName + ").").setShortName(constantsOptionShortName) this->addOption(storm::settings::OptionBuilder(moduleName, constantsOptionName, false, "Specifies the constant replacements to use in symbolic models. Note that Note that this requires the model to be given as an symbolic model (i.e., via --" + symbolicOptionName + ").").setShortName(constantsOptionShortName)
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("values", "A comma separated list of constants and their value, e.g. a=1,b=2,c=3.").setDefaultValueString("").build()).build()); .addArgument(storm::settings::ArgumentBuilder::createStringArgument("values", "A comma separated list of constants and their value, e.g. a=1,b=2,c=3.").setDefaultValueString("").build()).build());
this->addOption(storm::settings::OptionBuilder(moduleName, statisticsOptionName, false, "Sets whether to display statistics if available.").setShortName(statisticsOptionShortName).build()); this->addOption(storm::settings::OptionBuilder(moduleName, statisticsOptionName, false, "Sets whether to display statistics if available.").setShortName(statisticsOptionShortName).build());
this->addOption(storm::settings::OptionBuilder(moduleName, cudaOptionName, false, "Sets whether to use CUDA to speed up computation time.").build());
} }
bool GeneralSettings::isHelpSet() const { bool GeneralSettings::isHelpSet() const {
@ -289,6 +291,10 @@ namespace storm {
return this->getOption(bisimulationOptionName).getHasOptionBeenSet(); return this->getOption(bisimulationOptionName).getHasOptionBeenSet();
} }
bool GeneralSettings::isCudaSet() const {
return this->getOption(cudaOptionName).getHasOptionBeenSet();
}
} // namespace modules } // namespace modules
} // namespace settings } // namespace settings
} // namespace storm } // namespace storm

8
src/settings/modules/GeneralSettings.h

@ -329,6 +329,13 @@ namespace storm {
*/ */
bool isBisimulationSet() const; bool isBisimulationSet() const;
/*!
* Retrieves whether the option to use CUDA is set.
*
* @return True iff the option was set.
*/
bool isCudaSet() const;
bool check() const override; bool check() const override;
// The name of the module. // The name of the module.
@ -372,6 +379,7 @@ namespace storm {
static const std::string statisticsOptionShortName; static const std::string statisticsOptionShortName;
static const std::string bisimulationOptionName; static const std::string bisimulationOptionName;
static const std::string bisimulationOptionShortName; static const std::string bisimulationOptionShortName;
static const std::string cudaOptionName;
}; };
} // namespace modules } // namespace modules

Loading…
Cancel
Save