topology_info.h 816 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef __TOPOLOGY_INFO_H
  2. #define __TOPOLOGY_INFO_H
  3. #include "fixed_types.h"
  4. class TopologyInfo
  5. {
  6. public:
  7. TopologyInfo(core_id_t _core_id)
  8. : core_id(_core_id)
  9. , apic_id(-1)
  10. , smt_index(-1)
  11. , smt_count(-1)
  12. , core_index(-1)
  13. , core_count(-1)
  14. , package(-1)
  15. {}
  16. void setup(UInt32 smt_cores, UInt32 llc_sharers);
  17. static const UInt32 SMT_SHIFT_BITS = 4; // Up to 16 threads per core
  18. static const UInt32 PACKAGE_SHIFT_BITS = 16; // Up to 16384 threads / 1024 cores per package
  19. core_id_t core_id;
  20. SInt32 apic_id;
  21. SInt32 smt_index, smt_count;
  22. SInt32 core_index, core_count;
  23. SInt32 package;
  24. static SInt32 s_package, s_cores_this_package, s_core_id_last;
  25. };
  26. #endif // __TOPOLOGY_INFO_H