SWDEV-540629 - Update the current device ID (#699)

这个提交包含在:
Betigeri, Sourabh 编写, GitHub 于 2025-07-15 21:40:26 +05:30 提交
1 父节点 a1f056bd11
当前提交 0313e20706
2 个文件已更改
+4 -2

没有与搜索条件相匹配的文件

-2
查看文件
@@ -271,10 +271,8 @@ bool Graph::TopologicalOrder(std::vector<Node>& TopoOrder) {
// ================================================================================================
void Graph::clone(Graph* newGraph, bool cloneNodes) const {
newGraph->pOriginalGraph_ = this;
auto curDevId = ihipGetDevice();
for (hip::GraphNode* entry : vertices_) {
GraphNode* node = entry->clone();
node->SetDeviceId(curDevId);
node->SetParentGraph(newGraph);
newGraph->vertices_.push_back(node);
newGraph->clonedNodes_[entry] = node;
+4
查看文件
@@ -1200,6 +1200,8 @@ class GraphKernelNode : public GraphNode {
void GetParams(hipKernelNodeParams* params) { *params = kernelParams_; }
hipError_t SetParams(const hipKernelNodeParams* params) {
// Update device ID since new params may require validation for the current device.
dev_id_ = ihipGetDevice();
hipFunction_t func = getFunc(kernelParams_, dev_id_);
if (!func) {
return hipErrorInvalidDeviceFunction;
@@ -1226,6 +1228,8 @@ class GraphKernelNode : public GraphNode {
hipError_t SetAttrParams(hipKernelNodeAttrID attr, const hipKernelNodeAttrValue* params) {
hipDeviceProp_t prop = {0};
// Update device ID since new params may require validation for the current device.
dev_id_ = ihipGetDevice();
hipError_t status = ihipGetDeviceProperties(&prop, dev_id_);
if (hipSuccess != status){
return status;