Kokkos Core Kernels Package
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
core
src
Kokkos_hwloc.hpp
1
//@HEADER
2
// ************************************************************************
3
//
4
// Kokkos v. 4.0
5
// Copyright (2022) National Technology & Engineering
6
// Solutions of Sandia, LLC (NTESS).
7
//
8
// Under the terms of Contract DE-NA0003525 with NTESS,
9
// the U.S. Government retains certain rights in this software.
10
//
11
// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions.
12
// See https://kokkos.org/LICENSE for license information.
13
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
14
//
15
//@HEADER
16
17
#ifndef KOKKOS_IMPL_PUBLIC_INCLUDE
18
#include <Kokkos_Macros.hpp>
19
static_assert
(
false
,
20
"Including non-public Kokkos header files is not allowed."
);
21
#endif
22
#ifndef KOKKOS_HWLOC_HPP
23
#define KOKKOS_HWLOC_HPP
24
25
#include <Kokkos_Macros.hpp>
26
27
#include <utility>
28
29
namespace
Kokkos {
30
43
namespace
hwloc
{
44
46
bool
available
();
47
52
unsigned
get_available_numa_count
();
53
58
unsigned
get_available_cores_per_numa
();
59
62
unsigned
get_available_threads_per_core
();
63
64
}
/* namespace hwloc */
65
}
/* namespace Kokkos */
66
67
//----------------------------------------------------------------------------
68
//----------------------------------------------------------------------------
69
// Internal functions for binding persistent spawned threads.
70
71
namespace
Kokkos {
72
namespace
hwloc {
73
83
unsigned
thread_mapping
(
const
char
*
const
label,
const
bool
allow_async,
84
unsigned
& thread_count,
unsigned
& use_numa_count,
85
unsigned
& use_cores_per_numa,
86
std::pair<unsigned, unsigned> threads_coord[]);
87
97
std::pair<unsigned, unsigned>
get_this_thread_coordinate
();
98
100
bool
bind_this_thread
(
const
std::pair<unsigned, unsigned>);
101
103
bool
can_bind_threads
();
104
109
unsigned
bind_this_thread
(
const
unsigned
coordinate_count,
110
std::pair<unsigned, unsigned> coordinate[]);
111
113
bool
unbind_this_thread
();
114
115
}
/* namespace hwloc */
116
}
/* namespace Kokkos */
117
118
//----------------------------------------------------------------------------
119
//----------------------------------------------------------------------------
120
121
#endif
/* #define KOKKOS_HWLOC_HPP */
Kokkos::hwloc
Minimal subset of logical 'hwloc' functionality available from http://www.open-mpi....
Definition
Kokkos_hwloc.hpp:43
Kokkos::hwloc::bind_this_thread
bool bind_this_thread(const std::pair< unsigned, unsigned >)
Bind the current thread to a core.
Kokkos::hwloc::get_available_cores_per_numa
unsigned get_available_cores_per_numa()
Query number of available cores per NUMA regions. This will be less than the hardware capacity if the...
Kokkos::hwloc::get_available_numa_count
unsigned get_available_numa_count()
Query number of available NUMA regions. This will be less than the hardware capacity if the MPI proce...
Kokkos::hwloc::thread_mapping
unsigned thread_mapping(const char *const label, const bool allow_async, unsigned &thread_count, unsigned &use_numa_count, unsigned &use_cores_per_numa, std::pair< unsigned, unsigned > threads_coord[])
Recommend mapping of threads onto cores.
Kokkos::hwloc::unbind_this_thread
bool unbind_this_thread()
Unbind the current thread back to the original process binding.
Kokkos::hwloc::available
bool available()
Query if hwloc is available.
Kokkos::hwloc::get_this_thread_coordinate
std::pair< unsigned, unsigned > get_this_thread_coordinate()
Query core-coordinate of the current thread with respect to the core_topology.
Kokkos::hwloc::can_bind_threads
bool can_bind_threads()
Can hwloc bind threads?
Kokkos::hwloc::get_available_threads_per_core
unsigned get_available_threads_per_core()
Query number of available "hard" threads per core; i.e., hyperthreads.
Generated by
1.17.0