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:
committed by
Maneesh Gupta
parent
a2e1a1b4aa
commit
90a00bc681
@@ -1479,7 +1479,7 @@ hipError_t hipGraphExecMemsetNodeSetParams(hipGraphExec_t hGraphExec, hipGraphNo
|
|||||||
if (clonedNode == nullptr) {
|
if (clonedNode == nullptr) {
|
||||||
HIP_RETURN(hipErrorInvalidValue);
|
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,
|
hipError_t hipGraphAddDependencies(hipGraph_t graph, const hipGraphNode_t* from,
|
||||||
|
|||||||
@@ -1626,7 +1626,7 @@ class hipGraphMemsetNode : public hipGraphNode {
|
|||||||
std::memcpy(params, pMemsetParams_, sizeof(hipMemsetParams));
|
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;
|
hipError_t hip_error = hipSuccess;
|
||||||
hipMemsetParams origParams = {};
|
hipMemsetParams origParams = {};
|
||||||
GetParams(&origParams);
|
GetParams(&origParams);
|
||||||
@@ -1634,6 +1634,18 @@ class hipGraphMemsetNode : public hipGraphNode {
|
|||||||
if (hip_error != hipSuccess) {
|
if (hip_error != hipSuccess) {
|
||||||
return hip_error;
|
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;
|
size_t sizeBytes;
|
||||||
if (params->height == 1) {
|
if (params->height == 1) {
|
||||||
sizeBytes = params->width * params->elementSize;
|
sizeBytes = params->width * params->elementSize;
|
||||||
|
|||||||
Reference in New Issue
Block a user