source: libcfa/src/device/cpu.hfa@ b200492

ADT ast-experimental enum forall-pointer-decay pthread-emulation qualifiedEnum
Last change on this file since b200492 was 07a1e7a, checked in by Thierry Delisle <tdelisle@…>, 4 years ago

Added cpu info for which cache the map referes to.

  • Property mode set to 100644
File size: 1.1 KB
Line 
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
16#include <stddef.h>
17
18// Map from cpu entry to a structure detailling cpus with common topologies
19// Note that the cpu-groups are contiguous so the indexing is different from
20// the cpu indexing
21struct cpu_map_entry_t {
22 // Where this particular cpu is in the group
23 unsigned self;
24
25 // Starting index of the cpus with the same topology
26 unsigned start;
27
28 // Number of cpus with the same topology
29 unsigned count;
30
31 // Index of the cache this entry describes
32 unsigned cache;
33};
34
35struct cpu_info_t {
36 // Array of size [hthrd_count]
37 const cpu_map_entry_t * llc_map;
38
39 // Number of _hardware_ threads present in the system
40 size_t hthrd_count;
41
42 // Number of distinct last level caches
43 size_t llc_count;
44};
45
46extern cpu_info_t cpu_info;
Note: See TracBrowser for help on using the repository browser.