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::bisimulationOptionName = "bisimulation";
const std::string GeneralSettings::bisimulationOptionShortName = "bisim";
const std::string GeneralSettings::cudaOptionName = "cuda";
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)
@ -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)
.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, cudaOptionName, false, "Sets whether to use CUDA to speed up computation time.").build());
}
bool GeneralSettings::isHelpSet() const {
@ -288,6 +290,10 @@ namespace storm {
bool GeneralSettings::isBisimulationSet() const {
return this->getOption(bisimulationOptionName).getHasOptionBeenSet();
}
bool GeneralSettings::isCudaSet() const {
return this->getOption(cudaOptionName).getHasOptionBeenSet();
}
} // namespace modules
} // namespace settings

8
src/settings/modules/GeneralSettings.h

@ -328,6 +328,13 @@ namespace storm {
* @return True iff the option was set.
*/
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;
@ -372,6 +379,7 @@ namespace storm {
static const std::string statisticsOptionShortName;
static const std::string bisimulationOptionName;
static const std::string bisimulationOptionShortName;
static const std::string cudaOptionName;
};
} // namespace modules
Loading…
Cancel
Save