From 4c0ad7c41d75438283fb9e10119a4a66cef1894c Mon Sep 17 00:00:00 2001 From: Pierre Pebay Date: Fri, 8 Nov 2024 17:31:36 +0100 Subject: [PATCH] Fix ifdefs for kokkos --- include/pressio/type_traits.hpp | 4 ---- include/pressio/type_traits/native_kokkos_dense_matrix.hpp | 6 ++++++ include/pressio/type_traits/native_kokkos_vector.hpp | 6 ++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/include/pressio/type_traits.hpp b/include/pressio/type_traits.hpp index 4a4176f..5b830e3 100644 --- a/include/pressio/type_traits.hpp +++ b/include/pressio/type_traits.hpp @@ -62,9 +62,7 @@ template struct Traits; #ifdef PRESSIO_ENABLE_TPL_EIGEN #include "type_traits/native_eigen_vector.hpp" #endif -#ifdef PRESSIO_ENABLE_TPL_KOKKOS #include "type_traits/native_kokkos_vector.hpp" -#endif #ifdef PRESSIO_ENABLE_TPL_TRILINOS #include "type_traits/native_teuchos_vector.hpp" #include "type_traits/native_tpetra_block_vector.hpp" @@ -75,9 +73,7 @@ template struct Traits; #endif // PRSSIO_ENABLE_TPL_TRILINOS //*** matrix **** -#ifdef PRESSIO_ENABLE_TPL_KOKKOS #include "type_traits/native_kokkos_dense_matrix.hpp" -#endif #ifdef PRESSIO_ENABLE_TPL_TRILINOS #include "type_traits/native_teuchos_dense_matrix.hpp" #endif diff --git a/include/pressio/type_traits/native_kokkos_dense_matrix.hpp b/include/pressio/type_traits/native_kokkos_dense_matrix.hpp index c1dfafd..2649d5f 100644 --- a/include/pressio/type_traits/native_kokkos_dense_matrix.hpp +++ b/include/pressio/type_traits/native_kokkos_dense_matrix.hpp @@ -49,7 +49,9 @@ #ifndef PRESSIOOPS_TYPE_TRAITS_NATIVE_KOKKOS_DENSE_MATRIX_HPP_ #define PRESSIOOPS_TYPE_TRAITS_NATIVE_KOKKOS_DENSE_MATRIX_HPP_ +#ifdef PRESSIO_ENABLE_TPL_KOKKOS #include +#endif namespace pressio{ @@ -61,6 +63,7 @@ struct is_static_dense_matrix_kokkos{ static constexpr bool value = false; }; +#ifdef PRESSIO_ENABLE_TPL_KOKKOS template struct is_static_dense_matrix_kokkos< Kokkos::View > { @@ -68,6 +71,7 @@ struct is_static_dense_matrix_kokkos< Kokkos::View > static constexpr bool value = view_type::traits::rank==2 && view_type::traits::rank_dynamic==0; }; +#endif // ------------------------------------------------- template @@ -75,6 +79,7 @@ struct is_dynamic_dense_matrix_kokkos{ static constexpr bool value = false; }; +#ifdef PRESSIO_ENABLE_TPL_KOKKOS template struct is_dynamic_dense_matrix_kokkos< Kokkos::View > { @@ -82,6 +87,7 @@ struct is_dynamic_dense_matrix_kokkos< Kokkos::View > static constexpr bool value = view_type::traits::rank==2 && view_type::traits::rank_dynamic!=0; }; +#endif // ------------------------------------------------- template diff --git a/include/pressio/type_traits/native_kokkos_vector.hpp b/include/pressio/type_traits/native_kokkos_vector.hpp index 8da7c04..e429671 100644 --- a/include/pressio/type_traits/native_kokkos_vector.hpp +++ b/include/pressio/type_traits/native_kokkos_vector.hpp @@ -49,7 +49,9 @@ #ifndef PRESSIOOPS_TYPE_TRAITS_NATIVE_KOKKOS_VECTOR_HPP_ #define PRESSIOOPS_TYPE_TRAITS_NATIVE_KOKKOS_VECTOR_HPP_ +#ifdef PRESSIO_ENABLE_TPL_KOKKOS #include "Kokkos_Core.hpp" +#endif namespace pressio{ @@ -64,6 +66,7 @@ struct is_static_vector_kokkos{ static constexpr bool value = false; }; +#ifdef PRESSIO_ENABLE_TPL_KOKKOS template struct is_static_vector_kokkos< Kokkos::View > { @@ -71,6 +74,7 @@ struct is_static_vector_kokkos< Kokkos::View > static constexpr bool value = view_type::traits::rank==1 && view_type::traits::rank_dynamic==0; }; +#endif template struct is_static_vector_kokkos: public is_static_vector_kokkos {}; @@ -85,6 +89,7 @@ struct is_dynamic_vector_kokkos{ static constexpr bool value = false; }; +#ifdef PRESSIO_ENABLE_TPL_KOKKOS template struct is_dynamic_vector_kokkos< Kokkos::View > { @@ -92,6 +97,7 @@ struct is_dynamic_vector_kokkos< Kokkos::View > static constexpr bool value = view_type::traits::rank==1 && view_type::traits::rank_dynamic!=0; }; +#endif template struct is_dynamic_vector_kokkos: public is_dynamic_vector_kokkos {};