Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explore header vs implementation separation options for CXXNaiveIco #1045

Open
Stagno opened this issue Oct 20, 2020 · 0 comments
Open

Explore header vs implementation separation options for CXXNaiveIco #1045

Stagno opened this issue Oct 20, 2020 · 0 comments
Labels

Comments

@Stagno
Copy link
Contributor

Stagno commented Oct 20, 2020

Central problem is that the stencil class is templated wrt LibTag, thus making it very hard to separate declaration and definition.

A possibility is generating an implementation (.cpp) such as

#include "interface/atlas_interface.hpp" // Necessary for instantiation of template

namespace dawn_generated {
namespace cxxnaiveico {
template<typename LibTag>
class ICON_laplacian_diamond {
	// Makes use of functions/classes that require the tag, e.g. getCells(LibTag, ...)
	...
}

void run_ICON_laplacian_diamond_with_atlas(...) {
	// This would select a specific instance
	ICON_laplacian_diamond<atlasInterface::atlasTag> s(...).run(); 
}
}
}

and exporting only run_ICON_laplacian_diamond_with_atlas(...) in the header file.
However this solution requires including the (atlas) implementation of the unstructured interface in the generated code, breaking the strict separation policy followed so far.

Another viable way is to get rid of the need for interfaces (and templates) by committing to only one library for the naive backend.

@Stagno Stagno added enhancement backend dawn related labels Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant