RAJA
RAJA provides a collection of platform portability abstractions for C++ HPC applications.
Reduce.hpp
Go to the documentation of this file.
1 
11 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
12 // Copyright (c) Lawrence Livermore National Security, LLC and other
13 // RAJA Project Developers. See top-level LICENSE and COPYRIGHT
14 // files for dates and other details. No copyright assignment is required
15 // to contribute to RAJA.
16 //
17 // SPDX-License-Identifier: (BSD-3-Clause)
18 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
19 
20 #ifndef RAJA_policy_sequential_kernel_Reduce_HPP
21 #define RAJA_policy_sequential_kernel_Reduce_HPP
22 
23 #include "RAJA/pattern/kernel.hpp"
24 
25 namespace RAJA
26 {
27 
28 namespace internal
29 {
30 
31 //
32 // Executor that handles reductions for
33 //
34 template<template<typename...> class ReduceOperator,
35  typename ParamId,
36  typename... EnclosedStmts,
37  typename Types>
39  statement::Reduce<seq_reduce, ReduceOperator, ParamId, EnclosedStmts...>,
40  Types>
41 {
42 
43  template<typename Data>
44  static RAJA_INLINE void exec(Data&& data)
45  {
46  // since a sequential reduction is a NOP, and the single thread always
47  // has the reduced value, this is just a passthrough to the enclosed
48  // statements
49  execute_statement_list<camp::list<EnclosedStmts...>, Types>(data);
50  }
51 };
52 
53 
54 } // namespace internal
55 
56 } // end namespace RAJA
57 
58 
59 #endif /* RAJA_policy_sequential_kernel_Reduce_HPP */
constexpr auto Reduce(T *target)
Definition: reducer.hpp:231
RAJA_INLINE void execute_statement_list(Data &&data)
Definition: StatementList.hpp:84
Definition: AlignedRangeIndexSetBuilders.cpp:35
RAJA header file containing user interface for RAJA::kernel.
Definition: Statement.hpp:48