Skip to content

Commit

Permalink
Merge pull request #25 from Pressio/baseline_trilinos_traits_always_c…
Browse files Browse the repository at this point in the history
…ompile

trilinos baseline traits cases always are false  if PRESSIO_ENABLE_TPL_TRILINOS off
  • Loading branch information
fnrizzi authored Nov 10, 2024
2 parents f9720d7 + efca0d1 commit 4d0dd62
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 17 deletions.
10 changes: 0 additions & 10 deletions include/pressio/type_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,31 +61,21 @@ template<class T, class Enable = void> struct Traits;
//*** vector ****
#include "type_traits/native_eigen_vector.hpp"
#include "type_traits/native_kokkos_vector.hpp"
#ifdef PRESSIO_ENABLE_TPL_TRILINOS
#include "type_traits/native_teuchos_vector.hpp"
#include "type_traits/native_tpetra_block_vector.hpp"
#include "type_traits/native_tpetra_vector.hpp"
#ifdef PRESSIO_ENABLE_EPETRA
#include "type_traits/native_epetra_vector.hpp"
#endif // PRESSIO_ENABLE_EPETRA
#endif // PRSSIO_ENABLE_TPL_TRILINOS

//*** matrix ****
#include "type_traits/native_kokkos_dense_matrix.hpp"
#ifdef PRESSIO_ENABLE_TPL_TRILINOS
#include "type_traits/native_teuchos_dense_matrix.hpp"
#endif
#include "type_traits/native_eigen_dense_matrix.hpp"
#include "type_traits/native_eigen_sparse_matrix.hpp"

//*** multi vector ****
#ifdef PRESSIO_ENABLE_TPL_TRILINOS
#include "type_traits/native_tpetra_block_multi_vector.hpp"
#include "type_traits/native_tpetra_multi_vector.hpp"
#ifdef PRESSIO_ENABLE_EPETRA
#include "type_traits/native_epetra_multi_vector.hpp"
#endif // PRESSIO_ENABLE_EPETRA
#endif // PRSSIO_ENABLE_TPL_TRILINOS

#include "type_traits/traits_tpl.hpp"

Expand Down
4 changes: 4 additions & 0 deletions include/pressio/type_traits/native_epetra_multi_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,24 @@
#ifndef PRESSIOOPS_TYPE_TRAITS_NATIVE_EPETRA_MULTI_VECTOR_HPP_
#define PRESSIOOPS_TYPE_TRAITS_NATIVE_EPETRA_MULTI_VECTOR_HPP_

#ifdef PRESSIO_ENABLE_EPETRA
#include "Epetra_MultiVector.h"
#endif

namespace pressio{

template <typename T, typename enable = void>
struct is_multi_vector_epetra : std::false_type {};

#ifdef PRESSIO_ENABLE_EPETRA
template <typename T>
struct is_multi_vector_epetra<T,
typename
std::enable_if<
std::is_same<T,Epetra_MultiVector>::value
>::type
> : std::true_type{};
#endif

}//end namespace
#endif // PRESSIOOPS_TYPE_TRAITS_NATIVE_EPETRA_MULTI_VECTOR_HPP_
4 changes: 4 additions & 0 deletions include/pressio/type_traits/native_epetra_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,25 @@
#ifndef PRESSIOOPS_TYPE_TRAITS_NATIVE_EPETRA_VECTOR_HPP_
#define PRESSIOOPS_TYPE_TRAITS_NATIVE_EPETRA_VECTOR_HPP_

#ifdef PRESSIO_ENABLE_TPL_TRILINOS
#include "Epetra_Vector.h"
#include "Epetra_MultiVector.h"
#endif

namespace pressio{

template <typename T, typename enable = void>
struct is_vector_epetra : std::false_type {};

#ifdef PRESSIO_ENABLE_TPL_TRILINOS
template <typename T>
struct is_vector_epetra<T,
typename
std::enable_if<
std::is_same<T,Epetra_Vector>::value
>::type
> : std::true_type{};
#endif

}//end namespace
#endif // PRESSIOOPS_TYPE_TRAITS_NATIVE_EPETRA_VECTOR_HPP_
8 changes: 6 additions & 2 deletions include/pressio/type_traits/native_teuchos_dense_matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,16 @@
#ifndef PRESSIOOPS_TYPE_TRAITS_NATIVE_TEUCHOS_DENSE_MATRIX_HPP_
#define PRESSIOOPS_TYPE_TRAITS_NATIVE_TEUCHOS_DENSE_MATRIX_HPP_

#ifdef PRESSIO_ENABLE_TPL_TRILINOS
#include <Teuchos_SerialDenseMatrix.hpp>
#endif

namespace pressio{

template <typename T, typename enable = void>
struct is_dense_matrix_teuchos : std::false_type {};

#ifdef PRESSIO_ENABLE_TPL_TRILINOS
template <typename T>
struct is_dense_matrix_teuchos<
T,
Expand All @@ -66,11 +69,12 @@ struct is_dense_matrix_teuchos<
>::value
>::type
> : std::true_type{};
//-------------------------------------------------
#endif

template <typename T, typename enable = void>
struct is_dense_matrix_teuchos_rcp : std::false_type {};

#ifdef PRESSIO_ENABLE_TPL_TRILINOS
template <typename T>
struct is_dense_matrix_teuchos_rcp<
T,
Expand All @@ -79,7 +83,7 @@ struct is_dense_matrix_teuchos_rcp<
is_dense_matrix_teuchos<typename T::element_type>::value
>::type
> : std::true_type{};

#endif

}//end namespace
#endif // PRESSIOOPS_TYPE_TRAITS_NATIVE_TEUCHOS_DENSE_MATRIX_HPP_
4 changes: 4 additions & 0 deletions include/pressio/type_traits/native_teuchos_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,16 @@
#ifndef PRESSIOOPS_TYPE_TRAITS_NATIVE_TEUCHOS_VECTOR_HPP_
#define PRESSIOOPS_TYPE_TRAITS_NATIVE_TEUCHOS_VECTOR_HPP_

#ifdef PRESSIO_ENABLE_TPL_TRILINOS
#include "Teuchos_SerialDenseVector.hpp"
#endif

namespace pressio{

template <typename T, typename enable = void>
struct is_dense_vector_teuchos : std::false_type {};

#ifdef PRESSIO_ENABLE_TPL_TRILINOS
template <typename T>
struct is_dense_vector_teuchos<
T,
Expand All @@ -66,6 +69,7 @@ struct is_dense_vector_teuchos<
>::value
>
> : std::true_type{};
#endif

}//end namespace
#endif // PRESSIOOPS_TYPE_TRAITS_NATIVE_TEUCHOS_VECTOR_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,16 @@
#ifndef PRESSIOOPS_TYPE_TRAITS_NATIVE_TPETRA_BLOCK_MULTI_VECTOR_HPP_
#define PRESSIOOPS_TYPE_TRAITS_NATIVE_TPETRA_BLOCK_MULTI_VECTOR_HPP_

#ifdef PRESSIO_ENABLE_TPL_TRILINOS
#include <Tpetra_BlockMultiVector_decl.hpp>
#endif

namespace pressio{
namespace pressio{

template <typename T, typename enable = void>
struct is_multi_vector_tpetra_block : std::false_type {};

#ifdef PRESSIO_ENABLE_TPL_TRILINOS
template <typename T>
struct is_multi_vector_tpetra_block<
T,
Expand All @@ -71,6 +74,7 @@ struct is_multi_vector_tpetra_block<
>::value
>
> : std::true_type{};
#endif

}//end namespace
}//end namespace
#endif // PRESSIOOPS_TYPE_TRAITS_NATIVE_TPETRA_BLOCK_MULTI_VECTOR_HPP_
8 changes: 6 additions & 2 deletions include/pressio/type_traits/native_tpetra_block_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,16 @@
#ifndef PRESSIOOPS_TYPE_TRAITS_NATIVE_TPETRA_BLOCK_VECTOR_HPP_
#define PRESSIOOPS_TYPE_TRAITS_NATIVE_TPETRA_BLOCK_VECTOR_HPP_

#ifdef PRESSIO_ENABLE_TPL_TRILINOS
#include <Tpetra_BlockVector_decl.hpp>
#endif

namespace pressio{
namespace pressio{

template <typename T, typename enable = void>
struct is_vector_tpetra_block : std::false_type {};

#ifdef PRESSIO_ENABLE_TPL_TRILINOS
template <typename T>
struct is_vector_tpetra_block<
T,
Expand All @@ -72,6 +75,7 @@ struct is_vector_tpetra_block<
>::value
>::type
> : std::true_type{};
#endif

}//end namespace
}//end namespace
#endif // PRESSIOOPS_TYPE_TRAITS_NATIVE_TPETRA_BLOCK_VECTOR_HPP_
6 changes: 5 additions & 1 deletion include/pressio/type_traits/native_tpetra_multi_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,16 @@
#ifndef PRESSIOOPS_TYPE_TRAITS_NATIVE_TPETRA_MULTI_VECTOR_HPP_
#define PRESSIOOPS_TYPE_TRAITS_NATIVE_TPETRA_MULTI_VECTOR_HPP_

#ifdef PRESSIO_ENABLE_TPL_TRILINOS
#include <Tpetra_MultiVector_decl.hpp>
#endif

namespace pressio{

template <typename T, typename enable = void>
struct is_multi_vector_tpetra : std::false_type {};

#ifdef PRESSIO_ENABLE_TPL_TRILINOS
template <typename T>
struct is_multi_vector_tpetra<
T,
Expand All @@ -72,6 +75,7 @@ struct is_multi_vector_tpetra<
>::value
>::type
> : std::true_type{};
#endif

}//end namespace
}//end namespace
#endif // PRESSIOOPS_TYPE_TRAITS_NATIVE_TPETRA_MULTI_VECTOR_HPP_
4 changes: 4 additions & 0 deletions include/pressio/type_traits/native_tpetra_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,16 @@
#ifndef PRESSIOOPS_TYPE_TRAITS_NATIVE_TPETRA_VECTOR_HPP_
#define PRESSIOOPS_TYPE_TRAITS_NATIVE_TPETRA_VECTOR_HPP_

#ifdef PRESSIO_ENABLE_TPL_TRILINOS
#include "Tpetra_Vector.hpp"
#endif

namespace pressio{

template <typename T, typename enable = void>
struct is_vector_tpetra : std::false_type {};

#ifdef PRESSIO_ENABLE_TPL_TRILINOS
template <typename T>
struct is_vector_tpetra<
T,
Expand All @@ -72,6 +75,7 @@ struct is_vector_tpetra<
>::value
>::type
> : std::true_type{};
#endif

}
#endif // PRESSIOOPS_TYPE_TRAITS_NATIVE_TPETRA_VECTOR_HPP_

0 comments on commit 4d0dd62

Please sign in to comment.