• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

STEllAR-GROUP / hpx / #856

28 Dec 2022 02:00AM UTC coverage: 86.602% (+0.05%) from 86.55%
#856

push

StellarBot
Merge #6119

6119: Update CMakeLists.txt r=hkaiser a=khuck

updating the default APEX version


Co-authored-by: Kevin Huck <khuck@cs.uoregon.edu>

174566 of 201573 relevant lines covered (86.6%)

1876093.78 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.71
/libs/core/async_base/include/hpx/async_base/dataflow.hpp
1
//  Copyright (c) 2007-2022 Hartmut Kaiser
2
//
3
//  SPDX-License-Identifier: BSL-1.0
4
//  Distributed under the Boost Software License, Version 1.0. (See accompanying
5
//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6

7
/// \file dataflow.hpp
8

9
#pragma once
10

11
#if defined(DOXYGEN)
12

13
namespace hpx {
14

15
    /// The function template \a dataflow runs the function f asynchronously
16
    /// (potentially in a separate thread which might be a part of a thread
17
    /// pool) and returns a \c hpx::future that will eventually hold the result
18
    /// of that function call. Its behavior is similar to \c hpx::async with the
19
    /// exception that if one of the arguments is a \a future, then
20
    /// \c hpx::dataflow will wait for the \a future to be ready to launch the
21
    /// thread. Hence, the operation is delayed until all the arguments are
22
    /// ready.
23
    template <typename F, typename... Ts>
24
    decltype(auto) dataflow(F&& f, Ts&&... ts);
25
}    // namespace hpx
26

27
#else
28

29
#include <hpx/config.hpp>
30
#include <hpx/modules/allocator_support.hpp>
31
#include <hpx/modules/concepts.hpp>
32
#include <hpx/modules/tag_invoke.hpp>
33

34
#include <type_traits>
35
#include <utility>
36

37
///////////////////////////////////////////////////////////////////////////////
38
namespace hpx {
39

40
    namespace detail {
41

42
        // This CPO must live in hpx::detail for now as the dataflow function
43
        // supports being invoked in two forms: dataflow<Action>(...) and
44
        // dataflow(Action{}, ...). The only way to support both syntaxes (for
45
        // the time being, we will deprecate dataflow<Action>()) is to have a
46
        // real function based API that dispatches to the CPO. Once
47
        // dataflow<Action>(...) has been removed, this CPO can be moved to
48
        // namespace hpx.
49
        inline constexpr struct dataflow_t final
50
          : hpx::functional::detail::tag_fallback<dataflow_t>
51
        {
52
        private:
53
            // clang-format off
54
            template <typename F, typename... Ts,
55
                HPX_CONCEPT_REQUIRES_(
56
                    !hpx::traits::is_allocator_v<std::decay_t<F>>
57
                )>
58
            // clang-format on
59
            friend constexpr HPX_FORCEINLINE auto tag_fallback_invoke(
28,194✔
60
                dataflow_t tag, F&& f, Ts&&... ts)
61
                -> decltype(tag(hpx::util::internal_allocator<>{},
62
                    HPX_FORWARD(F, f), HPX_FORWARD(Ts, ts)...))
63
            {
64
                return hpx::functional::tag_invoke(tag,
28,194✔
65
                    hpx::util::internal_allocator<>{}, HPX_FORWARD(F, f),
28,194✔
66
                    HPX_FORWARD(Ts, ts)...);
28,194✔
67
            }
×
68
        } dataflow{};
69
    }    // namespace detail
70

71
    template <typename F, typename... Ts>
72
    HPX_FORCEINLINE decltype(auto) dataflow(F&& f, Ts&&... ts)
28,203✔
73
    {
74
        return hpx::detail::dataflow(HPX_FORWARD(F, f), HPX_FORWARD(Ts, ts)...);
28,203✔
75
    }
76

77
    template <typename Allocator, typename... Ts>
78
    HPX_DEPRECATED_V(
79
        1, 9, "hpx::dataflow_alloc is deprecated, use hpx::dataflow instead")
80
    decltype(auto) dataflow_alloc(Allocator const& alloc, Ts&&... ts)
81
    {
82
        return hpx::detail::dataflow(alloc, HPX_FORWARD(Ts, ts)...);
83
    }
84
}    // namespace hpx
85

86
#endif
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc