//@HEADER // ************************************************************************ // // Kokkos v. 4.0 // Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // the U.S. Government retains certain rights in this software. // // Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. // See https://kokkos.org/LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //@HEADER #include namespace { struct TestReducerCTADS { using execspace = TEST_EXECSPACE; using scalar_type = double; using index_type = int; using memspace = execspace::memory_space; struct CustomComparator { bool operator()(scalar_type, scalar_type) const; }; static CustomComparator comparator; struct TestSum { static Kokkos::View view; static Kokkos::View> unmanaged; static Kokkos::Sum rt; static_assert(std::is_same_v); static_assert(std::is_same_v); static_assert( std::is_same_v); static_assert( std::is_same_v); }; struct TestProd { static Kokkos::View view; static Kokkos::View> unmanaged; static Kokkos::Prod rt; static_assert(std::is_same_v); static_assert(std::is_same_v); static_assert( std::is_same_v); static_assert( std::is_same_v); }; struct TestMin { static Kokkos::View view; static Kokkos::View> unmanaged; static Kokkos::Min rt; static_assert(std::is_same_v); static_assert(std::is_same_v); static_assert( std::is_same_v); static_assert( std::is_same_v); }; struct TestMax { static Kokkos::View view; static Kokkos::View> unmanaged; static Kokkos::Max rt; static_assert(std::is_same_v); static_assert(std::is_same_v); static_assert( std::is_same_v); static_assert( std::is_same_v); }; struct TestLAnd { static Kokkos::View view; static Kokkos::View> unmanaged; static Kokkos::LAnd rt; static_assert(std::is_same_v); static_assert(std::is_same_v); static_assert( std::is_same_v); static_assert( std::is_same_v); }; struct TestLOr { static Kokkos::View view; static Kokkos::View> unmanaged; static Kokkos::LOr rt; static_assert(std::is_same_v); static_assert(std::is_same_v); static_assert( std::is_same_v); static_assert( std::is_same_v); }; struct TestBAnd { static Kokkos::View view; static Kokkos::View> unmanaged; static Kokkos::BAnd rt; static_assert(std::is_same_v); static_assert(std::is_same_v); static_assert( std::is_same_v); static_assert( std::is_same_v); }; struct TestBOr { static Kokkos::View view; static Kokkos::View> unmanaged; static Kokkos::BOr rt; static_assert(std::is_same_v); static_assert(std::is_same_v); static_assert( std::is_same_v); static_assert( std::is_same_v); }; struct TestMinLoc { static Kokkos::View, memspace> view; static Kokkos::View, memspace, Kokkos::MemoryTraits> unmanaged; static Kokkos::MinLoc rt; static_assert(std::is_same_v); static_assert(std::is_same_v); static_assert( std::is_same_v); static_assert( std::is_same_v); }; struct TestMaxLoc { static Kokkos::View, memspace> view; static Kokkos::View, memspace, Kokkos::MemoryTraits> unmanaged; static Kokkos::MaxLoc rt; static_assert(std::is_same_v); static_assert(std::is_same_v); static_assert( std::is_same_v); static_assert( std::is_same_v); }; struct TestMinMax { static Kokkos::View, memspace> view; static Kokkos::View, memspace, Kokkos::MemoryTraits> unmanaged; static Kokkos::MinMax rt; static_assert(std::is_same_v); static_assert(std::is_same_v); static_assert( std::is_same_v); static_assert( std::is_same_v); }; struct TestMinMaxLoc { static Kokkos::View, memspace> view; static Kokkos::View, memspace, Kokkos::MemoryTraits> unmanaged; static Kokkos::MinMaxLoc rt; static_assert( std::is_same_v); static_assert( std::is_same_v); static_assert(std::is_same_v); static_assert( std::is_same_v); }; struct TestMaxFirstLoc { static Kokkos::View, memspace> view; static Kokkos::View, memspace, Kokkos::MemoryTraits> unmanaged; static Kokkos::MaxFirstLoc rt; static_assert( std::is_same_v); static_assert( std::is_same_v); static_assert(std::is_same_v); static_assert( std::is_same_v); }; struct TestMaxFirstLocCustomComparator { static Kokkos::View, memspace> view; static Kokkos::View, memspace, Kokkos::MemoryTraits> unmanaged; static Kokkos::MaxFirstLocCustomComparator rt; static_assert(std::is_same_v); static_assert( std::is_same_v); static_assert(std::is_same_v); static_assert(std::is_same_v); }; struct TestMinFirstLoc { static Kokkos::View, memspace> view; static Kokkos::View, memspace, Kokkos::MemoryTraits> unmanaged; static Kokkos::MinFirstLoc rt; static_assert( std::is_same_v); static_assert( std::is_same_v); static_assert(std::is_same_v); static_assert( std::is_same_v); }; struct TestMinFirstLocCustomComparator { static Kokkos::View, memspace> view; static Kokkos::View, memspace, Kokkos::MemoryTraits> unmanaged; static Kokkos::MinFirstLocCustomComparator rt; static_assert(std::is_same_v); static_assert( std::is_same_v); static_assert(std::is_same_v); static_assert(std::is_same_v); }; struct TestMinMaxFirstLastLoc { static Kokkos::View, memspace> view; static Kokkos::View, memspace, Kokkos::MemoryTraits> unmanaged; static Kokkos::MinMaxFirstLastLoc rt; static_assert(std::is_same_v); static_assert( std::is_same_v); static_assert( std::is_same_v); static_assert( std::is_same_v); }; struct TestMinMaxFirstLastLocCustomComparator { static Kokkos::View, memspace> view; static Kokkos::View, memspace, Kokkos::MemoryTraits> unmanaged; static Kokkos::MinMaxFirstLastLocCustomComparator< scalar_type, index_type, CustomComparator, memspace> rt; static_assert( std::is_same_v); static_assert(std::is_same_v< decltype(rt), decltype(Kokkos::MinMaxFirstLastLocCustomComparator(rt))>); static_assert( std::is_same_v); static_assert( std::is_same_v); }; struct TestFirstLoc { static Kokkos::View, memspace> view; static Kokkos::View, memspace, Kokkos::MemoryTraits> unmanaged; static Kokkos::FirstLoc rt; static_assert( std::is_same_v); static_assert(std::is_same_v); static_assert(std::is_same_v); static_assert( std::is_same_v); }; struct TestLastLoc { static Kokkos::View, memspace> view; static Kokkos::View, memspace, Kokkos::MemoryTraits> unmanaged; static Kokkos::LastLoc rt; static_assert( std::is_same_v); static_assert(std::is_same_v); static_assert( std::is_same_v); static_assert( std::is_same_v); }; struct TestStdIsPartitioned { static Kokkos::View, memspace> view; static Kokkos::View, memspace, Kokkos::MemoryTraits> unmanaged; static Kokkos::StdIsPartitioned rt; static_assert( std::is_same_v); static_assert( std::is_same_v); static_assert( std::is_same_v); static_assert(std::is_same_v< decltype(rt), decltype(Kokkos::StdIsPartitioned(unmanaged))>); }; struct TestStdPartitionPoint { static Kokkos::View, memspace> view; static Kokkos::View, memspace, Kokkos::MemoryTraits> unmanaged; static Kokkos::StdPartitionPoint rt; static_assert(std::is_same_v); static_assert( std::is_same_v); static_assert( std::is_same_v); static_assert( std::is_same_v); }; }; } // namespace