Skip to content

Commit

Permalink
CPUTopology: do not use designated initializers for HardwareThreadsInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
marenz2569 committed Nov 22, 2024
1 parent d577edf commit a839c00
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions include/firestarter/Environment/CPUTopology.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ namespace firestarter::environment {
/// This struct describes properties of the threads which are used in the Environment class to assign a specific number
/// of threads and/or use it for cpu binding.
struct HardwareThreadsInfo {
HardwareThreadsInfo() = default;

/// The number of hardware threads on this system.
unsigned MaxNumThreads;
unsigned MaxNumThreads = 0;
/// The highest physical index on a hardware thread in the system.
unsigned MaxPhysicalIndex;
unsigned MaxPhysicalIndex = 0;
};

/// This class models the properties of a processor.
Expand Down
2 changes: 1 addition & 1 deletion src/firestarter/Environment/CPUTopology.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ auto CPUTopology::getPkgIdFromPU(unsigned Pu) const -> std::optional<unsigned> {
}

auto CPUTopology::hardwareThreadsInfo() const -> HardwareThreadsInfo {
HardwareThreadsInfo Infos = {.MaxNumThreads = 0, .MaxPhysicalIndex = 0};
HardwareThreadsInfo Infos;

// Get the number of different kinds of CPUs
const auto NrCpukinds = hwloc_cpukinds_get_nr(Topology, 0);
Expand Down

0 comments on commit a839c00

Please sign in to comment.