SWDEV-388926 - Original and new memory should be from same device for hipGraphExecMemsetNodeSetParams.

Change-Id: I32bd56db0b80d748e3ae0737a38ea975738bdab7


[ROCm/clr commit: ec227d560a]
This commit is contained in:
Jaydeep Patel
2023-03-20 09:26:16 +00:00
committed by Maneesh Gupta
parent a2e1a1b4aa
commit 90a00bc681
2 changed files with 14 additions and 2 deletions
+1 -1
View File
@@ -1479,7 +1479,7 @@ hipError_t hipGraphExecMemsetNodeSetParams(hipGraphExec_t hGraphExec, hipGraphNo
if (clonedNode == nullptr) {
HIP_RETURN(hipErrorInvalidValue);
}
HIP_RETURN(reinterpret_cast<hipGraphMemsetNode*>(clonedNode)->SetParams(pNodeParams));
HIP_RETURN(reinterpret_cast<hipGraphMemsetNode*>(clonedNode)->SetParams(pNodeParams, true));
}
hipError_t hipGraphAddDependencies(hipGraph_t graph, const hipGraphNode_t* from,
+13 -1
View File
@@ -1626,7 +1626,7 @@ class hipGraphMemsetNode : public hipGraphNode {
std::memcpy(params, pMemsetParams_, sizeof(hipMemsetParams));
}
hipError_t SetParams(const hipMemsetParams* params) {
hipError_t SetParams(const hipMemsetParams* params, bool isExec = false) {
hipError_t hip_error = hipSuccess;
hipMemsetParams origParams = {};
GetParams(&origParams);
@@ -1634,6 +1634,18 @@ class hipGraphMemsetNode : public hipGraphNode {
if (hip_error != hipSuccess) {
return hip_error;
}
if (isExec) {
size_t discardOffset = 0;
amd::Memory *memObj = getMemoryObject(params->dst, discardOffset);
if (memObj != nullptr) {
amd::Memory *memObjOri = getMemoryObject(pMemsetParams_->dst, discardOffset);
if (memObjOri != nullptr) {
if (memObjOri->getUserData().deviceId != memObj->getUserData().deviceId) {
return hipErrorInvalidValue;
}
}
}
}
size_t sizeBytes;
if (params->height == 1) {
sizeBytes = params->width * params->elementSize;