Interface Documentation
Version: invalid
policy.hh
Go to the documentation of this file.
1 /*
2  @@@@@@@@ @@ @@@@@@ @@@@@@@@ @@
3  /@@///// /@@ @@////@@ @@////// /@@
4  /@@ /@@ @@@@@ @@ // /@@ /@@
5  /@@@@@@@ /@@ @@///@@/@@ /@@@@@@@@@/@@
6  /@@//// /@@/@@@@@@@/@@ ////////@@/@@
7  /@@ /@@/@@//// //@@ @@ /@@/@@
8  /@@ @@@//@@@@@@ //@@@@@@ @@@@@@@@ /@@
9  // /// ////// ////// //////// //
10 
11  Copyright (c) 2016, Triad National Security, LLC
12  All rights reserved.
13  */
14 #pragma once
15 
18 #if !defined(__FLECSI_PRIVATE__)
19 #error Do not include this file directly!
20 #endif
21 
24 #include "future.hh"
25 #include <flecsi/flog.hh>
26 
27 #include <type_traits>
28 #include <utility> // forward
29 
30 namespace flecsi {
31 
32 template<auto & F,
33  const exec::launch_domain & LAUNCH_DOMAIN,
34  class REDUCTION,
35  size_t ATTRIBUTES,
36  typename... ARGS>
37 decltype(auto)
38 reduce(ARGS &&... args) {
39  using R = typename util::function_traits<decltype(F)>::return_type;
40  if constexpr(std::is_void_v<R>) {
41  F(std::forward<ARGS>(args)...);
42  return future<void>{};
43  }
44  else
45  return future<R>{F(std::forward<ARGS>(args)...)};
46 }
47 
48 } // namespace flecsi
decltype(auto) reduce(ARGS &&... args)
Definition: policy.hh:90
Definition: control.hh:31