More efficient Example compilation; Rewrite of CLI handling; Addition of CompilerTuningComponent - #75
Open
Petronous wants to merge 22 commits into
Open
More efficient Example compilation; Rewrite of CLI handling; Addition of CompilerTuningComponent#75Petronous wants to merge 22 commits into
Petronous wants to merge 22 commits into
Conversation
Formerly each Example had to compile the same Examples/*.cpp files, this should speed up compilation. Further refactoring possible: Creating three different versions based on cuda/opencl/cpp usage is somewhat ugly. Could try to find a way around this, or at least parametrize the project declaration so there's no copied code.
The .hpp format was chosen because the class is tiny and there would be no benefit in splitting into .h and .cpp
Intended to provide a generic implementation for the comp. tuning functionality currently in CoulombSum2d.
These did not change their CLI behavior so the update was very simple, most could be done with find-and-replace. Tested to compile, a few randomly verified to still match the legacy versions.
Formerly each Example had to compile the same Examples/*.cpp files, this should speed up compilation. Further refactoring possible: Creating three different versions based on cuda/opencl/cpp usage is somewhat ugly. Could try to find a way around this, or at least parametrize the project declaration so there's no copied code.
Previously: All Examples showed the option to use separate compiler tuning, even if they never set any compiler parameters Now: An Example must explicitly enable the use of compiler tuning. This presently only affected CoulombSum3d
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Example compilation
Modifies premake5.lua to compile common Example/*.cpp sources into a static library that it then links to each Example. Currently has to be copied for each supported compute API because of necessary changes to preprocessor defines.
CLI handling rewrite
ExampleConfigurator replaced with the more flexible CliComponent. Changes touched mainly CoulombSum3d and RodiniaHotspot, which are now much more elegant. Will enable further individual Example CLI modifications without pain.
ExampleBase now contains virtual InitCLI. Do not forget to call ExampleBase::InitCLI when overriding. Changes to each Example were necessary because of switching Tuner to a smart pointer and changes to ExampleBase constructor signature.
CompilerTuningComponent
By default ExampleBase contains NoCompilerTuning, which does nothing. The developer may call
UseCompilerTuning()to activate the feature. When activated the component automatically adds a CLI option for separate compiler tuning, which then determines if all compiler parameters should be tuned with the other parameters, or separately. Usem_compilerTuning->AddCompilerParameter(...). Usage demonstrated in CoulombSum3d.