SWDEV-540629 - Update the current device ID (#699)
[ROCm/clr commit: 0313e20706]
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
680c7fbf64
Коммит
52363f797e
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Ссылка в новой задаче
Block a user