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

Merge trilinos/develop into e3sm-project/develop #106

Merged
merged 3 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@

namespace Amesos2 {

template <class S, class LO, class GO, class D>
template <class S, class LO, class GO, class NO>
typename Sacado::UQ::PCE<S>::cijk_type
get_pce_cijk(
const Teuchos::RCP<const Tpetra::CrsMatrix<Sacado::UQ::PCE<S>, LO, GO, Tpetra::KokkosCompat::KokkosDeviceWrapperNode<D> > >& A = Teuchos::null,
const Teuchos::RCP<Tpetra::MultiVector<Sacado::UQ::PCE<S>, LO, GO, Tpetra::KokkosCompat::KokkosDeviceWrapperNode<D> > >& X = Teuchos::null,
const Teuchos::RCP<const Tpetra::MultiVector<Sacado::UQ::PCE<S>, LO, GO, Tpetra::KokkosCompat::KokkosDeviceWrapperNode<D> > >& B = Teuchos::null)
const Teuchos::RCP<const Tpetra::CrsMatrix<Sacado::UQ::PCE<S>, LO, GO, NO > >& A = Teuchos::null,
const Teuchos::RCP<Tpetra::MultiVector<Sacado::UQ::PCE<S>, LO, GO, NO > >& X = Teuchos::null,
const Teuchos::RCP<const Tpetra::MultiVector<Sacado::UQ::PCE<S>, LO, GO, NO > >& B = Teuchos::null)
{
if (A != Teuchos::null) {
return Kokkos::cijk(A->getLocalValuesDevice(Tpetra::Access::ReadOnly));
Expand All @@ -75,22 +75,21 @@ namespace Amesos2 {
/// these matrices and vectors into ones with a standard (e.g., double)
/// scalar type.
template <class Storage, class LocalOrdinal, class GlobalOrdinal,
class Device, template<class,class> class ConcreteSolver>
class Node, template<class,class> class ConcreteSolver>
class PCESolverAdapter :
public Solver< Tpetra::CrsMatrix<Sacado::UQ::PCE<Storage>,
LocalOrdinal,
GlobalOrdinal,
Tpetra::KokkosCompat::KokkosDeviceWrapperNode<Device> >,
Node >,
Tpetra::MultiVector<Sacado::UQ::PCE<Storage>,
LocalOrdinal,
GlobalOrdinal,
Tpetra::KokkosCompat::KokkosDeviceWrapperNode<Device> >
Node >
>
{
public:

typedef Sacado::UQ::PCE<Storage> Scalar;
typedef Tpetra::KokkosCompat::KokkosDeviceWrapperNode<Device> Node;
typedef Tpetra::CrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> Matrix;
typedef Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> Vector;

Expand Down Expand Up @@ -509,13 +508,12 @@ namespace Amesos2 {
// Sacado::UQ::PCE where we create PCESolverAdapter wrapping
// each solver
template < template <class,class> class ConcreteSolver,
class ST, class LO, class GO, class D >
class ST, class LO, class GO, class NO >
struct create_solver_with_supported_type<
ConcreteSolver,
Tpetra::CrsMatrix<Sacado::UQ::PCE<ST>,LO,GO,Tpetra::KokkosCompat::KokkosDeviceWrapperNode<D> >,
Tpetra::MultiVector<Sacado::UQ::PCE<ST>,LO,GO,Tpetra::KokkosCompat::KokkosDeviceWrapperNode<D> > > {
Tpetra::CrsMatrix<Sacado::UQ::PCE<ST>,LO,GO,NO >,
Tpetra::MultiVector<Sacado::UQ::PCE<ST>,LO,GO,NO > > {
typedef Sacado::UQ::PCE<ST> SC;
typedef Tpetra::KokkosCompat::KokkosDeviceWrapperNode<D> NO;
typedef Tpetra::CrsMatrix<SC,LO,GO,NO> Matrix;
typedef Tpetra::MultiVector<SC,LO,GO,NO> Vector;
static Teuchos::RCP<Solver<Matrix,Vector> >
Expand All @@ -532,7 +530,7 @@ namespace Amesos2 {
(void)same_scalar_assertion; // This stops the compiler from warning about unused declared variables

// If our assertion did not fail, then create and return a new solver
return Teuchos::rcp( new PCESolverAdapter<ST,LO,GO,D,ConcreteSolver>(A, X, B) );
return Teuchos::rcp( new PCESolverAdapter<ST,LO,GO,NO,ConcreteSolver>(A, X, B) );
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ struct DeviceForNode2 {
#endif // defined(KOKKOS_ENABLE_SERIAL)
};

template <typename Device>
struct DeviceForNode2< Tpetra::KokkosCompat::KokkosDeviceWrapperNode<Device> > {
typedef Device type;
template <typename ExecSpace, typename MemSpace>
struct DeviceForNode2< Tpetra::KokkosCompat::KokkosDeviceWrapperNode<ExecSpace, MemSpace> > {
typedef typename Tpetra::KokkosCompat::KokkosDeviceWrapperNode<ExecSpace, MemSpace>::device_type type;
};

}
Expand Down
Loading
Loading