From a4a15dd7748fde2272c4d4a1cfbdf5da1ea96757 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: fc2c8e8d0c9f2b0816e269fd07c288c8765beb49 --- 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 d04ec0d25..6ec11df68 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) @@ -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 diff --git a/src/settings/modules/GeneralSettings.h b/src/settings/modules/GeneralSettings.h index c65ab57a2..9281d2b57 100644 --- a/src/settings/modules/GeneralSettings.h +++ b/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