From a509e933937906db70987d1e66ec2f52eae7299d Mon Sep 17 00:00:00 2001 From: Honglei Huang Date: Fri, 4 Jul 2025 10:21:22 +0800 Subject: [PATCH] rocr: add const version of driver() method to Agent class This change adds a const-qualified version of the driver() method to the Agent class, allowing const Agent objects to access their associated driver without modifying the object's state. Signed-off-by: Honglei Huang [ROCm/ROCR-Runtime commit: 9c18618847868449158b43a7f30ee58c42a92494] --- projects/rocr-runtime/runtime/hsa-runtime/core/inc/agent.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/inc/agent.h b/projects/rocr-runtime/runtime/hsa-runtime/core/inc/agent.h index a157fbf252..fb8f89c118 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/inc/agent.h +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/inc/agent.h @@ -313,7 +313,8 @@ class Agent : public Checked<0xF6BC25EB17E6F917> { __forceinline uint32_t node_id() const { return node_id_; } // @brief Returns the driver associated with this agent. - __forceinline Driver& driver() const { return *driver_; } + __forceinline Driver& driver() { return *driver_; } + __forceinline const Driver& driver() const { return *driver_; } // @brief Getter for profiling_enabled_. __forceinline bool profiling_enabled() const { return profiling_enabled_; }