Skip to content

More efficient Example compilation; Rewrite of CLI handling; Addition of CompilerTuningComponent - #75

Open
Petronous wants to merge 22 commits into
HiPerCoRe:developmentfrom
Petronous:examples-refactor
Open

More efficient Example compilation; Rewrite of CLI handling; Addition of CompilerTuningComponent#75
Petronous wants to merge 22 commits into
HiPerCoRe:developmentfrom
Petronous:examples-refactor

Conversation

@Petronous

Copy link
Copy Markdown

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. Use m_compilerTuning->AddCompilerParameter(...). Usage demonstrated in CoulombSum3d.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant