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

Этот коммит содержится в:
Betigeri, Sourabh
2025-07-15 09:10:26 -07:00
коммит произвёл GitHub
родитель 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;