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

STEllAR-GROUP / hpx / #882

31 Aug 2023 07:44PM UTC coverage: 41.798% (-44.7%) from 86.546%
#882

push

19442 of 46514 relevant lines covered (41.8%)

126375.38 hits per line

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

60.0
/libs/core/execution/src/execution_parameter_callbacks.cpp
1
//  Copyright (c) 2020 ETH Zurich
2
//  Copyright (c) 2017-2025 Hartmut Kaiser
3
//  Copyright (c) 2017 Google
4
//
5
//  SPDX-License-Identifier: BSL-1.0
6
//  Distributed under the Boost Software License, Version 1.0. (See accompanying
7
//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8

9
#include <hpx/config.hpp>
10
#include <hpx/execution/detail/execution_parameter_callbacks.hpp>
11
#include <hpx/modules/errors.hpp>
12

13
#include <cstddef>
14
#include <type_traits>
15
#include <utility>
16

17
///////////////////////////////////////////////////////////////////////////////
18
namespace hpx::parallel::execution::detail {
19

64✔
20
    get_os_thread_count_type& get_get_os_thread_count()
21
    {
64✔
22
        static get_os_thread_count_type f;
64✔
23
        return f;
24
    }
25

64✔
26
    void set_get_os_thread_count(get_os_thread_count_type f)
27
    {
64✔
28
        get_get_os_thread_count() = HPX_MOVE(f);
64✔
29
    }
30

×
31
    std::size_t get_os_thread_count()
32
    {
×
33
        if (get_get_os_thread_count())
34
        {
×
35
            return get_get_os_thread_count()();
36
        }
37

38
        HPX_THROW_EXCEPTION(hpx::error::invalid_status,
×
39
            "hpx::parallel::execution::detail::get_os_thread_count",
40
            "No fallback handler for get_os_thread_count is installed. "
41
            "Please start the runtime if you haven't done so. If you "
42
            "intended to not use the runtime make sure you have "
43
            "implemented get_os_thread_count for your executor or install "
44
            "a fallback handler with "
45
            "hpx::parallel::execution::detail::set_get_os_thread_count.");
46
    }
47

48
    get_pu_mask_type& get_get_pu_mask()
49
    {
50
        static get_pu_mask_type f;
64✔
51
        return f;
52
    }
64✔
53

64✔
54
    void set_get_pu_mask(get_pu_mask_type f)
55
    {
56
        get_get_pu_mask() = HPX_MOVE(f);
64✔
57
    }
58

64✔
59
    threads::mask_type get_pu_mask(
64✔
60
        threads::topology& topo, std::size_t thread_num)
61
    {
×
62
        if (get_get_pu_mask())
63
        {
64
            return get_get_pu_mask()(topo, thread_num);
×
65
        }
66

×
67
        HPX_THROW_EXCEPTION(hpx::error::invalid_status,
68
            "hpx::parallel::execution::detail::get_pu_mask",
69
            "No fallback handler for get_pu_mask is installed. Please "
70
            "start the runtime if you haven't done so. If you intended "
×
71
            "to not use the runtime make sure you have implemented "
72
            "get_pu_mask for your executor or install a fallback "
73
            "handler with "
74
            "hpx::parallel::execution::detail::set_get_pu_mask.");
75
    }
76
}    // namespace hpx::parallel::execution::detail
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