rocr/aie: Remove redundant and unused functions.

[ROCm/ROCR-Runtime commit: 2ca4d8f6d4]
Bu işleme şunda yer alıyor:
Yiannis Papadopoulos
2025-06-24 16:06:46 -04:00
işlemeyi yapan: Papadopoulos, Yiannis
ebeveyn 9ca5405b74
işleme 47093a7f73
7 değiştirilmiş dosya ile 4 ekleme ve 65 silme
-4
Dosyayı Görüntüle
@@ -174,10 +174,6 @@ hsa_status_t KfdDriver::GetEdgeProperties(std::vector<HsaIoLinkProperties>& io_l
return HSA_STATUS_SUCCESS;
}
hsa_status_t KfdDriver::GetAgentProperties(core::Agent &agent) const {
return HSA_STATUS_SUCCESS;
}
hsa_status_t KfdDriver::GetMemoryProperties(uint32_t node_id,
std::vector<HsaMemoryProperties>& mem_props) const {
if (!mem_props.data()) return HSA_STATUS_ERROR_INVALID_ARGUMENT;
-25
Dosyayı Görüntüle
@@ -197,31 +197,6 @@ hsa_status_t XdnaDriver::GetEdgeProperties(std::vector<HsaIoLinkProperties>& io_
return HSA_STATUS_SUCCESS;
}
hsa_status_t XdnaDriver::GetAgentProperties(core::Agent &agent) const {
if (agent.device_type() != core::Agent::DeviceType::kAmdAieDevice) {
return HSA_STATUS_ERROR_INVALID_AGENT;
}
auto& aie_agent = static_cast<AieAgent&>(agent);
amdxdna_drm_query_aie_metadata aie_metadata = {};
amdxdna_drm_get_info get_info_args = {};
get_info_args.param = DRM_AMDXDNA_QUERY_AIE_METADATA;
get_info_args.buffer_size = sizeof(aie_metadata);
get_info_args.buffer = reinterpret_cast<uintptr_t>(&aie_metadata);
if (ioctl(fd_, DRM_IOCTL_AMDXDNA_GET_INFO, &get_info_args) < 0) {
return HSA_STATUS_ERROR;
}
// Right now can only target N-1 columns as that is the
// number of shim DMAs in npu1 devices.
aie_agent.SetNumCols(aie_metadata.cols - 1);
aie_agent.SetNumCoreRows(aie_metadata.core.row_count);
return HSA_STATUS_SUCCESS;
}
hsa_status_t XdnaDriver::GetMemoryProperties(uint32_t node_id,
std::vector<HsaMemoryProperties>& mem_props) const {
return HSA_STATUS_SUCCESS;
+4 -21
Dosyayı Görüntüle
@@ -53,11 +53,11 @@ namespace AMD {
class AieAgent : public core::Agent {
public:
/// @brief AIE agent constructor.
/// @param [in] node Node id.
/// @brief AIE agent constructor.
/// @param [in] node Node id.
/// @param [in] node_props Node properties.
AieAgent(uint32_t node, const HsaNodeProperties& node_props);
// @brief AIE agent destructor.
~AieAgent();
hsa_status_t VisitRegion(bool include_peer,
@@ -79,7 +79,7 @@ public:
uint32_t private_segment_size, uint32_t group_segment_size,
core::Queue** queue) override;
// @brief Override from core::Agent.
/// @brief Override from core::Agent.
const std::vector<const core::Isa*>& supported_isas() const override { return supported_isas_; }
const std::vector<const core::MemoryRegion*>& regions() const override { return regions_; }
@@ -94,15 +94,6 @@ public:
const std::function<void(void*)>& system_deallocator() const { return system_deallocator_; }
const HsaNodeProperties& properties() const { return node_props_; }
// AIE agent methods.
/// @brief Get the number of columns on this AIE agent.
uint32_t GetNumCols() const { return num_cols_; }
void SetNumCols(uint32_t num_cols) { num_cols_ = num_cols; }
/// @brief Get the number of core tile rows on this AIE agent.
uint32_t GetNumCoreRows() const { return num_core_rows_; }
void SetNumCoreRows(uint32_t num_core_rows) { num_core_rows_ = num_core_rows; }
/// @brief Get the number of core tiles on this AIE agent.
uint32_t GetNumCores() const { return num_cols_ * num_core_rows_; }
private:
/// @brief Query the driver to get the region list owned by this agent.
@@ -110,9 +101,6 @@ private:
/// @brief Setup the memory allocators used by this agent.
void InitAllocators();
/// @brief Query the driver to get properties for this AIE agent.
void GetAgentProperties();
std::vector<const core::MemoryRegion *> regions_;
std::function<void *(size_t size, size_t align,
core::MemoryRegion::AllocateFlags flags)>
@@ -127,11 +115,6 @@ private:
const uint32_t max_queues_ = 1;
const HsaNodeProperties node_props_;
/// @brief Number of columns in the AIE array.
uint32_t num_cols_ = 0;
/// @brief Number of rows of core tiles in the AIE array. Not all rows in a
/// column are cores. Some can be memory or shim tiles.
uint32_t num_core_rows_ = 0;
};
} // namespace AMD
-1
Dosyayı Görüntüle
@@ -87,7 +87,6 @@ public:
hsa_status_t GetNodeProperties(HsaNodeProperties& node_props, uint32_t node_id) const override;
hsa_status_t GetEdgeProperties(std::vector<HsaIoLinkProperties>& io_link_props,
uint32_t node_id) const override;
hsa_status_t GetAgentProperties(core::Agent &agent) const override;
hsa_status_t GetMemoryProperties(uint32_t node_id,
std::vector<HsaMemoryProperties>& mem_props) const override;
hsa_status_t GetCacheProperties(uint32_t node_id, uint32_t processor_id,
-1
Dosyayı Görüntüle
@@ -197,7 +197,6 @@ public:
hsa_status_t GetNodeProperties(HsaNodeProperties& node_props, uint32_t node_id) const override;
hsa_status_t GetEdgeProperties(std::vector<HsaIoLinkProperties>& io_link_props,
uint32_t node_id) const override;
hsa_status_t GetAgentProperties(core::Agent &agent) const override;
hsa_status_t GetMemoryProperties(uint32_t node_id,
std::vector<HsaMemoryProperties>& mem_props) const override;
hsa_status_t GetCacheProperties(uint32_t node_id, uint32_t processor_id,
-7
Dosyayı Görüntüle
@@ -114,13 +114,6 @@ public:
virtual hsa_status_t GetEdgeProperties(std::vector<HsaIoLinkProperties>& io_link_props,
uint32_t node_id) const = 0;
/// @brief Get the properties of a specific agent and initialize the agent
/// object.
/// @param agent Agent whose properties we're getting.
/// @retval HSA_STATUS_SUCCESS if the driver successfully returns the agent's
/// properties.
virtual hsa_status_t GetAgentProperties(Agent &agent) const = 0;
/// @brief Get the memory properties of a specific node.
/// @param[in] node_id Node ID of the agent.
/// @param[out] mem_props Memory properties of the node specified by @p node_id.
-6
Dosyayı Görüntüle
@@ -61,7 +61,6 @@ AieAgent::AieAgent(uint32_t node, const HsaNodeProperties& node_props)
node_props_(node_props) {
InitRegionList();
InitAllocators();
GetAgentProperties();
}
AieAgent::~AieAgent() {
@@ -334,11 +333,6 @@ void AieAgent::InitRegionList() {
other_mem_props));
}
void AieAgent::GetAgentProperties() {
auto &drv = static_cast<XdnaDriver &>(driver());
drv.GetAgentProperties(*this);
}
void AieAgent::InitAllocators() {
for (const auto *region : regions()) {
const MemoryRegion *amd_mem_region(