Skip to content

Commit

Permalink
fixup! Change namespace to pika::detail
Browse files Browse the repository at this point in the history
  • Loading branch information
aurianer committed Apr 11, 2024
1 parent c20cb6e commit f8e19f3
Show file tree
Hide file tree
Showing 58 changed files with 450 additions and 432 deletions.
2 changes: 1 addition & 1 deletion examples/quickstart/customize_async.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void run_with_large_stack()
std::fill(large_array, &large_array[array_size], '\0');

std::cout << "This thread runs with a "
<< pika::threads::get_stack_size_name(pika::this_thread::get_stack_size())
<< pika::detail::threads::get_stack_size_name(pika::this_thread::get_stack_size())
<< " stack and "
<< pika::execution::detail::get_thread_priority_name(
pika::this_thread::get_priority())
Expand Down
12 changes: 6 additions & 6 deletions libs/pika/async_cuda/src/cuda_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ namespace pika::cuda::experimental {
cuda_pool::streams_holder::streams_holder(int device, std::size_t num_streams_per_thread,
pika::execution::thread_priority priority, unsigned int flags)
: num_streams_per_thread(num_streams_per_thread)
, concurrency(pika::get_runtime_ptr() ? pika::get_num_worker_threads() :
pika::threads::detail::hardware_concurrency())
, concurrency(pika::detail::get_runtime_ptr() ? pika::get_num_worker_threads() :
pika::threads::detail::hardware_concurrency())
, streams()
, active_stream_indices(concurrency, {0})
{
Expand All @@ -49,8 +49,8 @@ namespace pika::cuda::experimental {
}

cuda_pool::cublas_handles_holder::cublas_handles_holder()
: concurrency(pika::get_runtime_ptr() ? pika::get_num_worker_threads() :
pika::threads::detail::hardware_concurrency())
: concurrency(pika::detail::get_runtime_ptr() ? pika::get_num_worker_threads() :
pika::threads::detail::hardware_concurrency())
, unsynchronized_handles()
, synchronized_handle_index{0}
, synchronized_handles()
Expand Down Expand Up @@ -105,8 +105,8 @@ namespace pika::cuda::experimental {
}

cuda_pool::cusolver_handles_holder::cusolver_handles_holder()
: concurrency(pika::get_runtime_ptr() ? pika::get_num_worker_threads() :
pika::threads::detail::hardware_concurrency())
: concurrency(pika::detail::get_runtime_ptr() ? pika::get_num_worker_threads() :
pika::threads::detail::hardware_concurrency())
, unsynchronized_handles()
, synchronized_handle_index{0}
, synchronized_handles()
Expand Down
2 changes: 1 addition & 1 deletion libs/pika/async_mpi/tests/unit/mpi_async_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ int pika_main(pika::program_options::variables_map& vm)
pika::threads::remove_scheduler_mode(::pika::threads::scheduler_mode::enable_idle_backoff);

pika::util::mpi_environment mpi_env;
pika::runtime* rt = pika::get_runtime_ptr();
pika::detail::runtime* rt = pika::detail::get_runtime_ptr();
pika::util::runtime_configuration cfg = rt->get_config();
mpi_env.init(nullptr, nullptr, cfg);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <cstddef>

namespace pika::detail {
int handle_late_commandline_options(util::runtime_configuration& ini,
int handle_late_commandline_options(pika::util::runtime_configuration& ini,
pika::program_options::options_description const& options,
void (*handle_print_bind)(std::size_t));
} // namespace pika::detail
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace pika::detail {
return str;
}

int handle_late_commandline_options(util::runtime_configuration& ini,
int handle_late_commandline_options(pika::util::runtime_configuration& ini,
pika::program_options::options_description const& options,
void (*handle_print_bind)(std::size_t))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace pika::threads::coroutines::detail {
using thread_id_type = context_base::thread_id_type;

using result_type = std::pair<threads::detail::thread_schedule_state, thread_id_type>;
using arg_type = threads::detail::thread_restart_state;
using arg_type = pika::threads::detail::thread_restart_state;

using functor_type = util::detail::unique_function<result_type(arg_type)>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace pika::threads::coroutines::detail {
using thread_id_type = pika::threads::detail::thread_id;

using result_type = std::pair<threads::detail::thread_schedule_state, thread_id_type>;
using arg_type = threads::detail::thread_restart_state;
using arg_type = pika::threads::detail::thread_restart_state;

using yield_decorator_type = util::detail::function<arg_type(result_type)>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace pika::threads::coroutines::detail {
{
// stackless coroutines don't support suspension
PIKA_ASSERT(false);
return threads::detail::thread_restart_state::abort;
return pika::threads::detail::thread_restart_state::abort;
}

thread_id_type get_thread_id() const override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace pika::threads::coroutines::detail {
using thread_id_type = pika::threads::detail::thread_id;

using result_type = std::pair<threads::detail::thread_schedule_state, thread_id_type>;
using arg_type = threads::detail::thread_restart_state;
using arg_type = pika::threads::detail::thread_restart_state;

using functor_type = util::detail::unique_function<result_type(arg_type)>;

Expand Down
10 changes: 5 additions & 5 deletions libs/pika/errors/include/pika/errors/exception.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ namespace pika {
///
/// \throws std#bad_alloc (if one of the required allocations fails)
///
/// \see \a pika::diagnostic_information(), \a pika::get_error_host_name(),
/// \see \a pika::detail::diagnostic_information(), \a pika::get_error_host_name(),
/// \a pika::get_error_process_id(), \a pika::get_error_function_name(),
/// \a pika::get_error_file_name(), \a pika::get_error_line_number(),
/// \a pika::get_error_os_thread(), \a pika::get_error_thread_id(),
Expand Down Expand Up @@ -360,7 +360,7 @@ namespace pika {
///
/// \throws nothing
///
/// \see \a pika::diagnostic_information(), \a pika::get_error_host_name(),
/// \see \a pika::detail::diagnostic_information(), \a pika::get_error_host_name(),
/// \a pika::get_error_process_id(), \a pika::get_error_function_name(),
/// \a pika::get_error_file_name(), \a pika::get_error_line_number(),
/// \a pika::get_error_os_thread(), \a pika::get_error_thread_id(),
Expand Down Expand Up @@ -397,7 +397,7 @@ namespace pika {
///
/// \throws std#bad_alloc (if one of the required allocations fails)
///
/// \see \a pika::diagnostic_information(), \a pika::get_error_host_name(),
/// \see \a pika::detail::diagnostic_information(), \a pika::get_error_host_name(),
/// \a pika::get_error_process_id()
/// \a pika::get_error_file_name(), \a pika::get_error_line_number(),
/// \a pika::get_error_os_thread(), \a pika::get_error_thread_id(),
Expand Down Expand Up @@ -439,7 +439,7 @@ namespace pika {
///
/// \throws std#bad_alloc (if one of the required allocations fails)
///
/// \see \a pika::diagnostic_information(), \a pika::get_error_host_name(),
/// \see \a pika::detail::diagnostic_information(), \a pika::get_error_host_name(),
/// \a pika::get_error_process_id(), \a pika::get_error_function_name(),
/// \a pika::get_error_line_number(),
/// \a pika::get_error_os_thread(), \a pika::get_error_thread_id(),
Expand Down Expand Up @@ -480,7 +480,7 @@ namespace pika {
///
/// \throws nothing
///
/// \see \a pika::diagnostic_information(), \a pika::get_error_host_name(),
/// \see \a pika::detail::diagnostic_information(), \a pika::get_error_host_name(),
/// \a pika::get_error_process_id(), \a pika::get_error_function_name(),
/// \a pika::get_error_file_name()
/// \a pika::get_error_os_thread(), \a pika::get_error_thread_id(),
Expand Down
14 changes: 7 additions & 7 deletions libs/pika/functional/include/pika/functional/bind.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,36 +205,36 @@ namespace pika::util::detail {

namespace pika::detail {
template <typename F, typename... Ts>
struct is_bind_expression<util::detail::bound<F, Ts...>> : std::true_type
struct is_bind_expression<pika::util::detail::bound<F, Ts...>> : std::true_type
{
};

///////////////////////////////////////////////////////////////////////////
#if defined(PIKA_HAVE_THREAD_DESCRIPTION)
template <typename F, typename... Ts>
struct get_function_address<util::detail::bound<F, Ts...>>
struct get_function_address<pika::util::detail::bound<F, Ts...>>
{
static constexpr std::size_t call(util::detail::bound<F, Ts...> const& f) noexcept
static constexpr std::size_t call(pika::util::detail::bound<F, Ts...> const& f) noexcept
{
return f.get_function_address();
}
};

///////////////////////////////////////////////////////////////////////////
template <typename F, typename... Ts>
struct get_function_annotation<util::detail::bound<F, Ts...>>
struct get_function_annotation<pika::util::detail::bound<F, Ts...>>
{
static constexpr char const* call(util::detail::bound<F, Ts...> const& f) noexcept
static constexpr char const* call(pika::util::detail::bound<F, Ts...> const& f) noexcept
{
return f.get_function_annotation();
}
};

# if PIKA_HAVE_ITTNOTIFY != 0 && !defined(PIKA_HAVE_APEX)
template <typename F, typename... Ts>
struct get_function_annotation_itt<util::detail::bound<F, Ts...>>
struct get_function_annotation_itt<pika::util::detail::bound<F, Ts...>>
{
static util::itt::string_handle call(util::detail::bound<F, Ts...> const& f) noexcept
static util::itt::string_handle call(pika::util::detail::bound<F, Ts...> const& f) noexcept
{
return f.get_function_annotation_itt();
}
Expand Down
15 changes: 9 additions & 6 deletions libs/pika/functional/include/pika/functional/bind_back.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,29 +158,32 @@ namespace pika::util::detail {
namespace pika::detail {
#if defined(PIKA_HAVE_THREAD_DESCRIPTION)
template <typename F, typename... Ts>
struct get_function_address<util::detail::bound_back<F, Ts...>>
struct get_function_address<pika::util::detail::bound_back<F, Ts...>>
{
static constexpr std::size_t call(util::detail::bound_back<F, Ts...> const& f) noexcept
static constexpr std::size_t call(
pika::util::detail::bound_back<F, Ts...> const& f) noexcept
{
return f.get_function_address();
}
};

///////////////////////////////////////////////////////////////////////////
template <typename F, typename... Ts>
struct get_function_annotation<util::detail::bound_back<F, Ts...>>
struct get_function_annotation<pika::util::detail::bound_back<F, Ts...>>
{
static constexpr char const* call(util::detail::bound_back<F, Ts...> const& f) noexcept
static constexpr char const* call(
pika::util::detail::bound_back<F, Ts...> const& f) noexcept
{
return f.get_function_annotation();
}
};

# if PIKA_HAVE_ITTNOTIFY != 0 && !defined(PIKA_HAVE_APEX)
template <typename F, typename... Ts>
struct get_function_annotation_itt<util::detail::bound_back<F, Ts...>>
struct get_function_annotation_itt<pika::util::detail::bound_back<F, Ts...>>
{
static util::itt::string_handle call(util::detail::bound_back<F, Ts...> const& f) noexcept
static util::itt::string_handle call(
pika::util::detail::bound_back<F, Ts...> const& f) noexcept
{
return f.get_function_annotation_itt();
}
Expand Down
15 changes: 9 additions & 6 deletions libs/pika/functional/include/pika/functional/bind_front.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,29 +158,32 @@ namespace pika::util::detail {
namespace pika::detail {
#if defined(PIKA_HAVE_THREAD_DESCRIPTION)
template <typename F, typename... Ts>
struct get_function_address<util::detail::bound_front<F, Ts...>>
struct get_function_address<pika::util::detail::bound_front<F, Ts...>>
{
static constexpr std::size_t call(util::detail::bound_front<F, Ts...> const& f) noexcept
static constexpr std::size_t call(
pika::util::detail::bound_front<F, Ts...> const& f) noexcept
{
return f.get_function_address();
}
};

///////////////////////////////////////////////////////////////////////////
template <typename F, typename... Ts>
struct get_function_annotation<util::detail::bound_front<F, Ts...>>
struct get_function_annotation<pika::util::detail::bound_front<F, Ts...>>
{
static constexpr char const* call(util::detail::bound_front<F, Ts...> const& f) noexcept
static constexpr char const* call(
pika::util::detail::bound_front<F, Ts...> const& f) noexcept
{
return f.get_function_annotation();
}
};

# if PIKA_HAVE_ITTNOTIFY != 0 && !defined(PIKA_HAVE_APEX)
template <typename F, typename... Ts>
struct get_function_annotation_itt<util::detail::bound_front<F, Ts...>>
struct get_function_annotation_itt<pika::util::detail::bound_front<F, Ts...>>
{
static util::itt::string_handle call(util::detail::bound_front<F, Ts...> const& f) noexcept
static util::itt::string_handle call(
pika::util::detail::bound_front<F, Ts...> const& f) noexcept
{
return f.get_function_annotation_itt();
}
Expand Down
13 changes: 7 additions & 6 deletions libs/pika/functional/include/pika/functional/deferred_call.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,29 +135,30 @@ namespace pika::util::detail {
namespace pika::detail {
///////////////////////////////////////////////////////////////////////////
template <typename F, typename... Ts>
struct get_function_address<util::detail::deferred<F, Ts...>>
struct get_function_address<pika::util::detail::deferred<F, Ts...>>
{
static constexpr std::size_t call(util::detail::deferred<F, Ts...> const& f) noexcept
static constexpr std::size_t call(pika::util::detail::deferred<F, Ts...> const& f) noexcept
{
return f.get_function_address();
}
};

///////////////////////////////////////////////////////////////////////////
template <typename F, typename... Ts>
struct get_function_annotation<util::detail::deferred<F, Ts...>>
struct get_function_annotation<pika::util::detail::deferred<F, Ts...>>
{
static constexpr char const* call(util::detail::deferred<F, Ts...> const& f) noexcept
static constexpr char const* call(pika::util::detail::deferred<F, Ts...> const& f) noexcept
{
return f.get_function_annotation();
}
};

# if PIKA_HAVE_ITTNOTIFY != 0 && !defined(PIKA_HAVE_APEX)
template <typename F, typename... Ts>
struct get_function_annotation_itt<util::detail::deferred<F, Ts...>>
struct get_function_annotation_itt<pika::util::detail::deferred<F, Ts...>>
{
static util::itt::string_handle call(util::detail::deferred<F, Ts...> const& f) noexcept
static util::itt::string_handle call(
pika::util::detail::deferred<F, Ts...> const& f) noexcept
{
return f.get_function_annotation_itt();
}
Expand Down
2 changes: 1 addition & 1 deletion libs/pika/init_runtime/src/init_logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace pika::detail {
if (nullptr != self)
{
// called from inside a pika thread
threads::detail::thread_id_type id = threads::detail::get_self_id();
threads::detail::thread_id_type id = pika::threads::detail::get_self_id();
if (id != threads::detail::invalid_thread_id)
{
std::ptrdiff_t value = reinterpret_cast<std::ptrdiff_t>(id.get());
Expand Down
Loading

0 comments on commit f8e19f3

Please sign in to comment.