static void reciprocal (const RMV& R, const XMV& X) { static_assert (Kokkos::Impl::is_view<RMV>::value, "KokkosBlas::Impl::" "Reciprocal<1-D>: RMV is not a Kokkos::View."); static_assert (Kokkos::Impl::is_view<XMV>::value, "KokkosBlas::Impl::" "Reciprocal<1-D>: XMV is not a Kokkos::View."); static_assert (RMV::rank == 1, "KokkosBlas::Impl::Reciprocal<1-D>: " "RMV is not rank 1."); static_assert (XMV::rank == 1, "KokkosBlas::Impl::Reciprocal<1-D>: " "XMV is not rank 1."); Kokkos::Profiling::pushRegion(KOKKOSKERNELS_IMPL_COMPILE_LIBRARY?"KokkosBlas::reciprocal[ETI]":"KokkosBlas::reciprocal[noETI]"); #ifdef KOKKOSKERNELS_ENABLE_CHECK_SPECIALIZATION if(KOKKOSKERNELS_IMPL_COMPILE_LIBRARY) printf("KokkosBlas1::reciprocal<> ETI specialization for < %s , %s >\n",typeid(RMV).name(),typeid(XMV).name()); else { printf("KokkosBlas1::reciprocal<> non-ETI specialization for < %s , %s >\n",typeid(RMV).name(),typeid(XMV).name()); } #endif const size_type numRows = X.extent(0); if (numRows < static_cast<size_type> (INT_MAX)) { typedef int index_type; V_Reciprocal_Generic<RMV, XMV, index_type> (R, X); } else { typedef std::int64_t index_type; V_Reciprocal_Generic<RMV, XMV, index_type> (R, X); } Kokkos::Profiling::popRegion(); }
static void sum (const RMV& R, const XMV& X) { static_assert (Kokkos::Impl::is_view<RMV>::value, "KokkosBlas::Impl::" "Sum<1-D>: RMV is not a Kokkos::View."); static_assert (Kokkos::Impl::is_view<XMV>::value, "KokkosBlas::Impl::" "Sum<1-D>: XMV is not a Kokkos::View."); static_assert (RMV::rank == 0, "KokkosBlas::Impl::Sum<1-D>: " "RMV is not rank 0."); static_assert (XMV::rank == 1, "KokkosBlas::Impl::Sum<1-D>: " "XMV is not rank 1."); #ifdef KOKKOSKERNELS_ENABLE_CHECK_SPECIALIZATION if(KOKKOSKERNELS_IMPL_COMPILE_LIBRARY) printf("KokkosBlas1::sum<> ETI specialization for < %s , %s >\n",typeid(RMV).name(),typeid(XMV).name()); else { printf("KokkosBlas1::sum<> non-ETI specialization for < %s , %s >\n",typeid(RMV).name(),typeid(XMV).name()); } #endif const size_type numRows = X.extent(0); if (numRows < static_cast<size_type> (INT_MAX) ) { V_Sum_Invoke<RMV, XMV, int> (R, X); } else { typedef std::int64_t index_type; V_Sum_Invoke<RMV, XMV, index_type> (R, X); } }