GHOST  1.1.2
General, Hybrid, and Optimized Sparse Toolkit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
machine.h
Go to the documentation of this file.
1 
6 #ifndef GHOST_MACHINE_H
7 #define GHOST_MACHINE_H
8 
9 #include <stddef.h>
10 #include <stdbool.h>
11 #include <hwloc.h>
12 #include "error.h"
13 #include "types.h"
14 
15 #define GHOST_NUMANODE_ANY -1
16 
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
41  ghost_error ghost_topology_get(hwloc_topology_t *topo);
84  ghost_error ghost_machine_ncore(int *nCores, int numaNode);
92  ghost_error ghost_machine_nsmt(int *nLevels);
102  ghost_error ghost_machine_npu(int *nPUs, int numaNode);
110  ghost_error ghost_machine_nnuma(int *nNodes);
111  ghost_error ghost_machine_nnuma_in_cpuset(int *nNodes, hwloc_const_cpuset_t set);
112  ghost_error ghost_machine_npu_in_cpuset(int *nPUs, hwloc_const_cpuset_t set);
113  ghost_error ghost_machine_ncore_in_cpuset(int *nCores, hwloc_const_cpuset_t set);
114  ghost_error ghost_machine_numanode(hwloc_obj_t *node, int idx);
130  ghost_error ghost_machine_string(char **str);
131 
138 
147 #ifdef __cplusplus
148 }
149 #endif
150 
151 #endif
152 
ghost_implementation
Possible implementations of a CPU function.
Definition: types.h:323
Header file for type definitions.
ghost_error ghost_machine_nnuma(int *nNodes)
Get the number of NUMA nodes in the machine.
Definition: machine.c:260
ghost_error ghost_topology_create()
Initialize and load the topology object (of type hwloc_topology_t).
Definition: machine.c:19
int ghost_implementation_alignment(ghost_implementation impl)
Definition: machine.c:592
bool ghost_machine_bigendian()
Check whether machine is big endian.
Definition: machine.c:280
void ghost_topology_destroy()
Destroy and free the topology object.
Definition: machine.c:45
ghost_error ghost_machine_nsmt(int *nLevels)
Get the number of SMT threads per core in the machine.
Definition: machine.c:223
ghost_error ghost_machine_innercache_size(uint64_t *size)
Get the size of the first level cache.
Definition: machine.c:74
Types, functions and macros for error handling.
ghost_error ghost_machine_outercache_size(uint64_t *size)
Get the size of the last level cache.
Definition: machine.c:94
ghost_error
Error return type.
Definition: error.h:23
ghost_implementation ghost_get_best_implementation_for_bytesize(int bytes)
Definition: machine.c:547
int ghost_machine_simd_width()
Get the machine's SIMD width.
Definition: machine.c:408
ghost_error ghost_machine_ncore(int *nCores, int numaNode)
Get the number of (physical) cores in the machine.
Definition: machine.c:141
ghost_error ghost_machine_npu(int *nPUs, int numaNode)
Get the number of available hardware threads (= physical cores times SMT level) or processing units i...
Definition: machine.c:165
int ghost_machine_alignment()
Get the machine's alignment restriction for aligned stores/loads.
Definition: machine.c:294
ghost_error ghost_machine_cacheline_size(unsigned *size)
Get the cache line siye.
Definition: machine.c:120
ghost_error ghost_machine_ncore_in_cpuset(int *nCores, hwloc_const_cpuset_t set)
Definition: machine.c:204
ghost_error ghost_machine_string(char **str)
Get a string of the machine information.
Definition: machine.c:446
ghost_error ghost_machine_npu_in_cpuset(int *nPUs, hwloc_const_cpuset_t set)
Definition: machine.c:185
ghost_error ghost_machine_numanode(hwloc_obj_t *node, int idx)
Definition: machine.c:416
ghost_error ghost_machine_nnuma_in_cpuset(int *nNodes, hwloc_const_cpuset_t set)
Definition: machine.c:241
ghost_error ghost_topology_get(hwloc_topology_t *topo)
Get to topology object.
Definition: machine.c:54