rocr: Make Open() and Close() virtual in Driver

Change-Id: Iac054c08383b080ca2b2ec6d65019bf2f083b763
This commit is contained in:
Tony Gutierrez
2024-11-08 16:40:21 -08:00
committed by David Yat Sin
parent 8bbc44d51b
commit 77fa5af618
7 changed files with 40 additions and 32 deletions
@@ -68,6 +68,8 @@ public:
hsa_status_t Init() override;
hsa_status_t QueryKernelModeDriver(core::DriverQuery query) override;
hsa_status_t Open() override;
hsa_status_t Close() override;
hsa_status_t GetAgentProperties(core::Agent &agent) const override;
hsa_status_t
GetMemoryProperties(uint32_t node_id,
@@ -142,6 +142,8 @@ public:
std::unordered_map<uint32_t, void*>& GetHandleMappings();
std::unordered_map<void*, uint32_t>& GetAddrMappings();
hsa_status_t Open() override;
hsa_status_t Close() override;
hsa_status_t GetAgentProperties(core::Agent &agent) const override;
hsa_status_t
GetMemoryProperties(uint32_t node_id,
+2 -2
View File
@@ -84,11 +84,11 @@ class Driver {
/// @brief Open a connection to the driver using name_.
/// @retval HSA_STATUS_SUCCESS if the driver was opened successfully.
hsa_status_t Open();
virtual hsa_status_t Open() = 0;
/// @brief Close a connection to the open driver using fd_.
/// @retval HSA_STATUS_SUCCESS if the driver was opened successfully.
hsa_status_t Close();
virtual hsa_status_t Close() = 0;
/// @brief Get driver version information.
/// @retval DriverVersionInfo containing the driver's version information.