diff --git a/kokkos_tree/kokkos_core/README.md b/kokkos_tree/kokkos_core/README.md new file mode 100644 index 0000000..e69de29 diff --git a/kokkos_tree/kokkos_core/View_data_analysis_kokkos_investigation.hpp b/kokkos_tree/kokkos_core/View_data_analysis_kokkos_investigation.hpp new file mode 100644 index 0000000..4fca69e --- /dev/null +++ b/kokkos_tree/kokkos_core/View_data_analysis_kokkos_investigation.hpp @@ -0,0 +1,57 @@ +#include +#include +//#include + +namespace Test{ + +TEST(ViewDataType,ViewDataType_linefrom251){ + static_assert(std::is_same_v>::type, double>, "ViewDataType>::type should be double"); + static_assert(std::is_same_v>::type, double*>, "ViewDataType>::type should be double*"); + static_assert(std::is_same_v>::type, double**>, "ViewDataType>::type should be double**"); + static_assert(std::is_same_v>::type, double**[5]>, "ViewDataType>::type should be double**[5]"); +} +TEST(ViewArrayAnalysis,ViewArrayAnalysis_line_289){ + static_assert(std::is_same_v::value_type, double>, "ViewArrayAnalysis::value_type should be double"); + static_assert(std::is_same_v::const_value_type, const double>, "ViewArrayAnalysis::const_value_type should be const double"); + static_assert(std::is_same_v::non_const_value_type, double>, "ViewArrayAnalysis::non_const_value_type should be double"); + static_assert(std::is_same_v::static_dimension, Kokkos::Impl::ViewDimension<>>, "ViewArrayAnalysis::static_dimension should be Kokkos::Impl::ViewDimension<>"); + static_assert(std::is_same_v::dynamic_dimension, Kokkos::Impl::ViewDimension<>>, "ViewArrayAnalysis::dynamic_dimension should be Kokkos::Impl::ViewDimension<>"); + static_assert(std::is_same_v::dimension, Kokkos::Impl::ViewDimension<>>, "ViewArrayAnalysis::dimension should be Kokkos::Impl::ViewDimension<>"); + //static_assert(std::is_same_v::nested,Kokkos::Impl::ViewArrayAnalysis>, "ViewArrayAnalysis::nested should be Kokkos::Impl::ViewArrayAnalysis"); this is private can't invoke. + static_assert(std::is_same_v::value_type, double>, "ViewArrayAnalysis::value_type should be double"); + static_assert(std::is_same_v::const_value_type, const double>, "ViewArrayAnalysis::const_value_type should be const double"); + static_assert(std::is_same_v::non_const_value_type, double>, "ViewArrayAnalysis::non_const_value_type should be double"); + static_assert(std::is_same_v::static_dimension, Kokkos::Impl::ViewDimension<5>>, "ViewArrayAnalysis::static_dimension should be Kokkos::Impl::ViewDimension<5>"); + //static_assert(std::is_same_v::dynamic_dimension, Kokkos::Impl::ViewDimension<>>, "ViewArrayAnalysis::dynamic_dimension should be Kokkos::Impl::ViewDimension<>"); + static_assert(Kokkos::Impl::ViewArrayAnalysis::static_dimension::ArgN0 == 5, "ViewArrayAnalysis::static_dimension::ArgN0 should be 5"); + static_assert(std::is_same_v::value_type,double>, "ViewArrayAnalysis::value_type should bematch"); + auto constexpr argn0 = Kokkos::Impl::ViewArrayAnalysis::static_dimension::ArgN0; + auto constexpr argn1 = Kokkos::Impl::ViewArrayAnalysis::static_dimension::ArgN1; + auto constexpr argn2 = Kokkos::Impl::ViewArrayAnalysis::static_dimension::ArgN2; + auto constexpr rank = Kokkos::Impl::ViewArrayAnalysis::static_dimension::rank; + auto constexpr rank_dyn = Kokkos::Impl::ViewArrayAnalysis::static_dimension::rank_dynamic; + std::cout<<"ArgN0 " <; + auto constexpr dargn0 = vaa::dynamic_dimension::ArgN0; + std::cout<<"Dynamic argn0 "<; + auto constexpr mdargn0 = mvaa::dynamic_dimension::ArgN0; + auto constexpr mdargn1 = mvaa::dynamic_dimension::ArgN1; + auto constexpr mdargn2 = mvaa::dynamic_dimension::ArgN2; + auto constexpr mdrank = mvaa::dynamic_dimension::rank; + auto constexpr mdrankdyn = mvaa::dynamic_dimension::rank_dynamic; + std::cout<<"mdArgN0 " <::dynamic_dimension,Kokkos::Impl::ViewDimension<0,0,0>>, "ViewArrayAnalysis::dynamic_dimension should be Kokkos::Impl::ViewDimension<0,0,0>"); + static_assert(std::is_same_v::dynamic_dimension,Kokkos::Impl::ViewArrayAnalysis::dimension>, "ViewArrayAnalysis::dynamic_dimension should be Kokkos::Impl::ViewArrayAnalysis::dimension"); + +} +} \ No newline at end of file diff --git a/kokkos_tree/mdspan/README.md b/kokkos_tree/mdspan/README.md new file mode 100644 index 0000000..e69de29 diff --git a/kokkos_tree/mdspan/kokkos_extent_inv.hpp b/kokkos_tree/mdspan/kokkos_extent_inv.hpp new file mode 100644 index 0000000..4e563ca --- /dev/null +++ b/kokkos_tree/mdspan/kokkos_extent_inv.hpp @@ -0,0 +1,43 @@ +#include + + +using ext = MDSPAN_IMPL_STANDARD_NAMESPACE::extents; +namespace Test { + +TEST(extent_inv, extent_line_376){ + static_assert(std::is_same_v,"index_type is not int"); + static_assert(std::is_same_v,"rank_type is not size_t"); + auto constexpr rank = ext::rank(); + static_assert(rank == 3,"rank is not 3"); + auto constexpr drank = ext::rank_dynamic(); + static_assert(drank == 0,"dynamic rank is not 0"); + using dext = MDSPAN_IMPL_STANDARD_NAMESPACE::extents; + auto constexpr drank2 = dext::rank_dynamic(); + static_assert(drank2 == 1,"dynamic rank is not 1"); + using msa = MDSPAN_IMPL_STANDARD_NAMESPACE::detail::maybe_static_array; + static_assert(std::is_same_v,"value_type is not int"); + static_assert(std::is_same_v,"static_value_type is not size_t"); + static_assert(msa::tag_value == MDSPAN_IMPL_STANDARD_NAMESPACE::dynamic_extent,"tag_value is not dynamic_extent"); + msa m1(23); + std::array d_rank = {4}; + msa m2(d_rank); + auto m1_static = m1.static_value(0); + EXPECT_EQ(m1_static,2); + auto m2_dynamic = m2.value(3); + std::cout<<"m2_dynamic: "<; + static_assert(extent::rank() == 4,"rank is not 4"); + static_assert(extent::rank_dynamic() == 1,"dynamic rank is not 1"); + //static_assert(extent::extent(0) == 2,"extent(0) is not 2"); + ///static_assert(extent::extent(3) == 0,"extent(3) is not 3"); as non static; + extent ex; + EXPECT_EQ(ex.extent(0),2); + EXPECT_EQ(ex.extent(1),3); + EXPECT_EQ(ex.extent(2),4); + EXPECT_EQ(ex.extent(3),0); + static_assert(extent::static_extent(0) == 2,"extent(0) is not 2"); +} +} \ No newline at end of file diff --git a/kokkos_tree/test_dyn_rank.cpp b/kokkos_tree/test_dyn_rank.cpp index bd3afae..54965f8 100644 --- a/kokkos_tree/test_dyn_rank.cpp +++ b/kokkos_tree/test_dyn_rank.cpp @@ -2,6 +2,8 @@ #include "kokkos_core/kokkos_pair_investigation.hpp" #include "mdspan/kokkos_raw_mdspan.hpp" #include "kokkos_core/test_drank.hpp" +#include "kokkos_core/View_data_analysis_kokkos_investigation.hpp" +#include "mdspan/kokkos_extent_inv.hpp" #include #include int main(int argc, char **argv) {