From 67bcd5038fb00131badd60399b86d5e33dea9e62 Mon Sep 17 00:00:00 2001 From: svkurowski Date: Thu, 27 Nov 2014 10:15:30 +0100 Subject: [PATCH] Add general setting to enable CUDA on runtime Former-commit-id: 15328c576eb4fbe182d6d486c59ddb11a21e6962 --- src/settings/modules/GeneralSettings.cpp | 6 ++++++ src/settings/modules/GeneralSettings.h | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/src/settings/modules/GeneralSettings.cpp b/src/settings/modules/GeneralSettings.cpp index ece0d9a00..691eabaac 100644 --- a/src/settings/modules/GeneralSettings.cpp +++ b/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) @@ -96,6 +97,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 { @@ -297,6 +299,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 diff --git a/src/settings/modules/GeneralSettings.h b/src/settings/modules/GeneralSettings.h index 22f8fe58f..e60aa8342 100644 --- a/src/settings/modules/GeneralSettings.h +++ b/src/settings/modules/GeneralSettings.h @@ -341,6 +341,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; @@ -385,6 +392,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