Change device to processor in API names and variable names
Change-Id: Ide71fabeaa837f2035dc9726162cc537e40b4a57
This commit is contained in:
committed by
Naveen Krishna Chatradhi
parent
dd00a16124
commit
ae39d9707d
@@ -51,7 +51,7 @@ namespace smi {
|
||||
|
||||
class AMDSmiProcessor {
|
||||
public:
|
||||
explicit AMDSmiProcessor(processor_type_t device) : processor_type_(device) {}
|
||||
explicit AMDSmiProcessor(processor_type_t processor) : processor_type_(processor) {}
|
||||
virtual ~AMDSmiProcessor() {}
|
||||
processor_type_t get_processor_type() const { return processor_type_;}
|
||||
private:
|
||||
|
||||
@@ -58,12 +58,12 @@ class AMDSmiSocket {
|
||||
explicit AMDSmiSocket(const std::string& id) : socket_identifier_(id) {}
|
||||
~AMDSmiSocket();
|
||||
const std::string& get_socket_id() const { return socket_identifier_;}
|
||||
void add_device(AMDSmiProcessor* device) { devices_.push_back(device); }
|
||||
std::vector<AMDSmiProcessor*>& get_devices() { return devices_;}
|
||||
amdsmi_status_t get_device_count(uint32_t* device_count) const;
|
||||
void add_processor(AMDSmiProcessor* processor) { processors_.push_back(processor); }
|
||||
std::vector<AMDSmiProcessor*>& get_processors() { return processors_;}
|
||||
amdsmi_status_t get_processor_count(uint32_t* processor_count) const;
|
||||
private:
|
||||
std::string socket_identifier_;
|
||||
std::vector<AMDSmiProcessor*> devices_;
|
||||
std::vector<AMDSmiProcessor*> processors_;
|
||||
};
|
||||
|
||||
} // namespace smi
|
||||
|
||||
@@ -230,7 +230,7 @@ amdsmi_status_t amdsmi_get_processor_handles(amdsmi_socket_handle socket_handle,
|
||||
if (r != AMDSMI_STATUS_SUCCESS) return r;
|
||||
|
||||
|
||||
std::vector<amd::smi::AMDSmiProcessor*>& devices = socket->get_devices();
|
||||
std::vector<amd::smi::AMDSmiProcessor*>& devices = socket->get_processors();
|
||||
uint32_t device_size = static_cast<uint32_t>(devices.size());
|
||||
// Get the device count only
|
||||
if (processor_handles == nullptr) {
|
||||
|
||||
@@ -49,14 +49,14 @@ namespace amd {
|
||||
namespace smi {
|
||||
|
||||
AMDSmiSocket::~AMDSmiSocket() {
|
||||
for (uint32_t i = 0; i < devices_.size(); i++) {
|
||||
delete devices_[i];
|
||||
for (uint32_t i = 0; i < processors_.size(); i++) {
|
||||
delete processors_[i];
|
||||
}
|
||||
devices_.clear();
|
||||
processors_.clear();
|
||||
}
|
||||
|
||||
amdsmi_status_t AMDSmiSocket::get_device_count(uint32_t* device_count) const {
|
||||
*device_count = static_cast<uint32_t>(devices_.size());
|
||||
amdsmi_status_t AMDSmiSocket::get_processor_count(uint32_t* processor_count) const {
|
||||
*processor_count = static_cast<uint32_t>(processors_.size());
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ amdsmi_status_t AMDSmiSystem::populate_amd_gpu_devices() {
|
||||
}
|
||||
|
||||
AMDSmiProcessor* device = new AMDSmiGPUDevice(i, drm_);
|
||||
socket->add_device(device);
|
||||
socket->add_processor(device);
|
||||
devices_.insert(device);
|
||||
}
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user