RAJA
RAJA provides a collection of platform portability abstractions for C++ HPC applications.
reduce.hpp
Go to the documentation of this file.
1 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
2 // Copyright (c) Lawrence Livermore National Security, LLC and other
3 // RAJA Project Developers. See top-level LICENSE and COPYRIGHT
4 // files for dates and other details. No copyright assignment is required
5 // to contribute to RAJA.
6 //
7 // SPDX-License-Identifier: (BSD-3-Clause)
8 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
9 
10 #ifndef NEW_REDUCE_SIMD_REDUCE_HPP
11 #define NEW_REDUCE_SIMD_REDUCE_HPP
12 
14 
15 namespace RAJA
16 {
17 namespace expt
18 {
19 namespace detail
20 {
21 
22 // Init
23 template<typename EXEC_POL, typename OP, typename T, typename VOp>
24 camp::concepts::enable_if<std::is_same<EXEC_POL, RAJA::simd_exec>> param_init(
25  EXEC_POL const&,
27 {
28  red.m_valop.val = OP::identity();
29 }
30 
31 // Combine
32 template<typename EXEC_POL, typename OP, typename T, typename VOp>
33 camp::concepts::enable_if<std::is_same<EXEC_POL, RAJA::simd_exec>>
34 param_combine(EXEC_POL const&,
36  const Reducer<OP, T, VOp>& in)
37 {
38  out.m_valop.val = OP {}(out.m_valop.val, in.m_valop.val);
39 }
40 
41 // Resolve
42 template<typename EXEC_POL, typename OP, typename T, typename VOp>
43 camp::concepts::enable_if<std::is_same<EXEC_POL, RAJA::simd_exec>>
44 param_resolve(EXEC_POL const&, Reducer<OP, T, VOp>& red)
45 {
46  red.combineTarget(red.m_valop.val);
47 }
48 
49 } // namespace detail
50 } // namespace expt
51 } // namespace RAJA
52 
53 #endif // NEW_REDUCE_SIMD_REDUCE_HPP
camp::concepts::enable_if< std::is_same< EXEC_POL, RAJA::seq_exec > > param_init(EXEC_POL const &, RAJA::detail::Name &)
Definition: kernel_name.hpp:24
camp::concepts::enable_if< concepts::negate< is_instance_of_Reducer< camp::decay< T > > >, concepts::negate< std::is_same< T, RAJA::detail::Name > > > param_combine(EXEC_POL const &, T &, const T &)
Definition: forall.hpp:97
camp::concepts::enable_if< std::is_same< EXEC_POL, RAJA::seq_exec > > param_resolve(EXEC_POL const &, RAJA::detail::Name &)
Definition: kernel_name.hpp:40
Definition: AlignedRangeIndexSetBuilders.cpp:35
Definition: reducer.hpp:80
VOp m_valop
Definition: reducer.hpp:98
RAJA_HOST_DEVICE void combineTarget(value_type in)
Definition: reducer.hpp:105