![]() |
GHOST
1.1.2
General, Hybrid, and Optimized Sparse Toolkit
|
#include "ghost/machine.h"
#include "ghost/log.h"
#include "ghost/util.h"
#include "ghost/locality.h"
#include "ghost/omp.h"
#include "ghost/core.h"
#include <cpuid.h>
#include <strings.h>
Functions | |
ghost_error | ghost_topology_create () |
Initialize and load the topology object (of type hwloc_topology_t). More... | |
void | ghost_topology_destroy () |
Destroy and free the topology object. More... | |
ghost_error | ghost_topology_get (hwloc_topology_t *topo) |
Get to topology object. More... | |
ghost_error | ghost_machine_innercache_size (uint64_t *size) |
Get the size of the first level cache. More... | |
ghost_error | ghost_machine_outercache_size (uint64_t *size) |
Get the size of the last level cache. More... | |
ghost_error | ghost_machine_cacheline_size (unsigned *size) |
Get the cache line siye. More... | |
ghost_error | ghost_machine_ncore (int *ncore, int numanode) |
Get the number of (physical) cores in the machine. More... | |
ghost_error | ghost_machine_npu (int *nPUs, int numanode) |
Get the number of available hardware threads (= physical cores times SMT level) or processing units in the machine. More... | |
ghost_error | ghost_machine_npu_in_cpuset (int *nPUs, hwloc_const_cpuset_t set) |
ghost_error | ghost_machine_ncore_in_cpuset (int *nCores, hwloc_const_cpuset_t set) |
ghost_error | ghost_machine_nsmt (int *nLevels) |
Get the number of SMT threads per core in the machine. More... | |
ghost_error | ghost_machine_nnuma_in_cpuset (int *nNodes, hwloc_const_cpuset_t set) |
ghost_error | ghost_machine_nnuma (int *nNodes) |
Get the number of NUMA nodes in the machine. More... | |
bool | ghost_machine_bigendian () |
Check whether machine is big endian. More... | |
static void | cpuid (int info[4], int InfoType) |
int | ghost_machine_alignment () |
Get the machine's alignment restriction for aligned stores/loads. More... | |
int | ghost_machine_simd_width () |
Get the machine's SIMD width. More... | |
ghost_error | ghost_machine_numanode (hwloc_obj_t *node, int idx) |
ghost_error | ghost_machine_string (char **str) |
Get a string of the machine information. More... | |
ghost_implementation | ghost_get_best_implementation_for_bytesize (int bytes) |
int | ghost_implementation_alignment (ghost_implementation impl) |
Variables | |
static hwloc_topology_t | ghost_topology = NULL |
|
static |
ghost_implementation ghost_get_best_implementation_for_bytesize | ( | int | bytes | ) |
int ghost_implementation_alignment | ( | ghost_implementation | impl | ) |
int ghost_machine_alignment | ( | ) |
Get the machine's alignment restriction for aligned stores/loads.
bool ghost_machine_bigendian | ( | ) |
Check whether machine is big endian.
ghost_error ghost_machine_cacheline_size | ( | unsigned * | size | ) |
Get the cache line siye.
size | Where to store the size. |
This information may be useful in situations where false sharing has to be avoided.
ghost_error ghost_machine_ncore | ( | int * | nCores, |
int | numaNode | ||
) |
Get the number of (physical) cores in the machine.
nCores | Where to store the number of cores. |
numaNode | Only look for PUs inside this NUMA node. |
ghost_error ghost_machine_ncore_in_cpuset | ( | int * | nCores, |
hwloc_const_cpuset_t | set | ||
) |
ghost_error ghost_machine_nnuma | ( | int * | nNodes | ) |
Get the number of NUMA nodes in the machine.
nNodes | Where to store the number. |
ghost_error ghost_machine_nnuma_in_cpuset | ( | int * | nNodes, |
hwloc_const_cpuset_t | set | ||
) |
ghost_error ghost_machine_npu | ( | int * | nPUs, |
int | numaNode | ||
) |
Get the number of available hardware threads (= physical cores times SMT level) or processing units in the machine.
nPUs | Where to store the number. |
numaNode | Only look for PUs inside this NUMA node. |
ghost_error ghost_machine_npu_in_cpuset | ( | int * | nPUs, |
hwloc_const_cpuset_t | set | ||
) |
ghost_error ghost_machine_nsmt | ( | int * | nLevels | ) |
Get the number of SMT threads per core in the machine.
nLevels | Where to store the number. |
ghost_error ghost_machine_numanode | ( | hwloc_obj_t * | node, |
int | idx | ||
) |
int ghost_machine_simd_width | ( | ) |
Get the machine's SIMD width.
ghost_error ghost_topology_create | ( | ) |
Initialize and load the topology object (of type hwloc_topology_t).
If the topology has been created before, this function returns immediately.
void ghost_topology_destroy | ( | ) |
Destroy and free the topology object.
ghost_error ghost_topology_get | ( | hwloc_topology_t * | topo | ) |
Get to topology object.
topo | Where to store the topology. |
|
static |