amd-smi: fix cpu specific apis and header

1. provide prototype and documentation for esmi specific api.
   define structures and update classes as required
2. update cmake files as required and add esmi api to the
   amdsmi esmi integration example.

Change-Id: I753ec176f9b381e74c9646525dfd9075237bf8d9
Bu işleme şunda yer alıyor:
Naveen Krishna Chatradhi
2023-12-07 06:46:48 -08:00
işlemeyi yapan: khashaik
ebeveyn 8f3861e1d9
işleme 65eed73f4d
12 değiştirilmiş dosya ile 752 ekleme ve 1470 silme
+33 -1
Dosyayı Görüntüle
@@ -56,14 +56,46 @@ namespace smi {
class AMDSmiSocket {
public:
explicit AMDSmiSocket(const std::string& id) : socket_identifier_(id) {}
explicit AMDSmiSocket(uint32_t index) : sindex_(index) {}
~AMDSmiSocket();
const std::string& get_socket_id() const { return socket_identifier_;}
void add_processor(AMDSmiProcessor* processor) { processors_.push_back(processor); }
uint32_t get_socket_index() { return sindex_;}
void add_processor(AMDSmiProcessor* processor) {
switch (processor->get_processor_type()) {
case AMD_GPU:
processors_.push_back(processor);
break;
case AMD_CPU:
cpu_processors_.push_back(processor);
break;
case AMD_CPU_CORE:
cpu_core_processors_.push_back(processor);
break;
default:
break;
}
}
std::vector<AMDSmiProcessor*>& get_processors() { return processors_;}
std::vector<AMDSmiProcessor*>& get_processors(processor_type_t type) {
switch (type) {
case AMD_GPU:
return processors_;
case AMD_CPU:
return cpu_processors_;
case AMD_CPU_CORE:
return cpu_core_processors_;
default:
return processors_;
}
}
amdsmi_status_t get_processor_count(uint32_t* processor_count) const;
amdsmi_status_t get_processor_count(processor_type_t type, uint32_t* processor_count) const;
private:
uint32_t sindex_;
std::string socket_identifier_;
std::vector<AMDSmiProcessor*> processors_;
std::vector<AMDSmiProcessor*> cpu_processors_;
std::vector<AMDSmiProcessor*> cpu_core_processors_;
};
} // namespace smi