source:
libcfa/src/device/cpu.hfa
@
ad47ec4
Last change on this file since ad47ec4 was 8f01ad71, checked in by , 3 years ago | |
---|---|
|
|
File size: 1.1 KB |
Rev | Line | |
---|---|---|
[96f002c1] | 1 | // |
2 | // Cforall Version 1.0.0 Copyright (C) 2021 University of Waterloo | |
3 | // | |
4 | // The contents of this file are covered under the licence agreement in the | |
5 | // file "LICENCE" distributed with Cforall. | |
6 | // | |
7 | // cpu.hfa -- read the data structure | |
8 | // | |
9 | // Author : Thierry Delisle | |
10 | // Created On : Fri Jun 11 15:22:23 2021 | |
11 | // Last Modified By : | |
12 | // Last Modified On : | |
13 | // Update Count : | |
14 | // | |
15 | ||
[8f01ad71] | 16 | #pragma once |
17 | ||
[96f002c1] | 18 | #include <stddef.h> |
19 | ||
[07a1e7a] | 20 | // Map from cpu entry to a structure detailling cpus with common topologies |
21 | // Note that the cpu-groups are contiguous so the indexing is different from | |
22 | // the cpu indexing | |
[96f002c1] | 23 | struct cpu_map_entry_t { |
[07a1e7a] | 24 | // Where this particular cpu is in the group |
[cf85f96] | 25 | unsigned self; |
[07a1e7a] | 26 | |
27 | // Starting index of the cpus with the same topology | |
[96f002c1] | 28 | unsigned start; |
[07a1e7a] | 29 | |
30 | // Number of cpus with the same topology | |
[96f002c1] | 31 | unsigned count; |
[07a1e7a] | 32 | |
33 | // Index of the cache this entry describes | |
34 | unsigned cache; | |
[96f002c1] | 35 | }; |
36 | ||
37 | struct cpu_info_t { | |
[8157bde] | 38 | // Array of size [hthrd_count] |
[96f002c1] | 39 | const cpu_map_entry_t * llc_map; |
[4d865ca7] | 40 | |
[8157bde] | 41 | // Number of _hardware_ threads present in the system |
[96f002c1] | 42 | size_t hthrd_count; |
[8157bde] | 43 | |
44 | // Number of distinct last level caches | |
45 | size_t llc_count; | |
[96f002c1] | 46 | }; |
47 | ||
[72bd9cd] | 48 | extern cpu_info_t cpu_info; |
Note: See TracBrowser
for help on using the repository browser.