Open mhoemmen opened 6 years ago
This issue has had no activity for 365 days and is marked for closure. It will be closed after an additional 30 days of inactivity.
If you would like to keep this issue open please add a comment and/or remove the MARKED_FOR_CLOSURE
label.
If this issue should be kept open even with no activity beyond the time limits you can add the label DO_NOT_AUTOCLOSE
.
If it is ok for this issue to be closed, feel free to go ahead and close it. Please do not add any comments or change any labels or otherwise touch this issue unless your intention is to reset the inactivity counter for an additional year.
@csiefer2
@trilinos/tpetra
Tpetra currently requires that its explicit template instantiation (ETI) macros be used inside the Tpetra namespace. For example:
This hinders moving Tpetra classes around and hiding this from users with aliases.
Motivation and Context
I'm working on #2548 and #57. As part of that, I've been applying the following procedure to Tpetra classes:
For all Tpetra classes
CLASS
that take 3 or 4 template parameters:${CLASS}
fromTpetra
namespace toTpetra::Classes
namespace.Tpetra_${CLASS}_fwd.hpp
, that forward-declaresTpetra::Class::${CLASS}
, and adds a template alias to that class in theTpetra
namespace.${CLASS}
, to put the instantiation in the Classes namespace (Tpetra expects the macros to be used in the Tpetra namespace).This was going fine, until I got to
Tpetra::CrsMatrix
. The problem is that Stokhos actually specializes CrsMatrix for various Scalar types. That was working fine for MultiVector, but not for CrsMatrix. As I looked through Stokhos' ETI macros for its specializations of Tpetra classes (for its own Scalar types, specifically UQ PCE), I noticed that they all had to be used inside the Tpetra namespace. Some macros actually needed to be used in the Tpetra::Classes namespace, and others just in the Tpetra namespace. It was a mess that I eventually was able to work around, but it showed how requiring macros to be used in a particular namespace was leading to trouble.Possible Solution
Put the namespaces themselves in the macro definition: