SWDEV-389647 - SWDEV-388950 - Check device id same while set params.
GraphMemcpyNodeSetParamsFrom/ToSymbol APIs neew to check device id for original src/dst is same as what is passed in while set. Change-Id: If0b610808223dce9115562bb5e9b31c8eaa2df22
Этот коммит содержится в:
коммит произвёл
Jaydeepkumar Patel
родитель
650b6767c4
Коммит
b6aa27d4a3
@@ -1932,8 +1932,9 @@ hipError_t hipGraphExecMemcpyNodeSetParamsFromSymbol(hipGraphExec_t hGraphExec,
|
||||
if (clonedNode == nullptr) {
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
constexpr bool kCheckDeviceIsSame = true;
|
||||
HIP_RETURN(reinterpret_cast<hipGraphMemcpyNodeFromSymbol*>(clonedNode)
|
||||
->SetParams(dst, symbol, count, offset, kind));
|
||||
->SetParams(dst, symbol, count, offset, kind, kCheckDeviceIsSame));
|
||||
}
|
||||
|
||||
hipError_t hipGraphAddMemcpyNodeToSymbol(hipGraphNode_t* pGraphNode, hipGraph_t graph,
|
||||
@@ -1994,8 +1995,9 @@ hipError_t hipGraphExecMemcpyNodeSetParamsToSymbol(hipGraphExec_t hGraphExec, hi
|
||||
if (clonedNode == nullptr) {
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
constexpr bool kCheckDeviceIsSame = true;
|
||||
HIP_RETURN(reinterpret_cast<hipGraphMemcpyNodeToSymbol*>(clonedNode)
|
||||
->SetParams(symbol, src, count, offset, kind));
|
||||
->SetParams(symbol, src, count, offset, kind, kCheckDeviceIsSame));
|
||||
}
|
||||
|
||||
hipError_t hipGraphAddEventRecordNode(hipGraphNode_t* pGraphNode, hipGraph_t graph,
|
||||
|
||||
@@ -1441,7 +1441,19 @@ class hipGraphMemcpyNodeFromSymbol : public hipGraphMemcpyNode1D {
|
||||
}
|
||||
|
||||
hipError_t SetParams(void* dst, const void* symbol, size_t count, size_t offset,
|
||||
hipMemcpyKind kind) {
|
||||
hipMemcpyKind kind, bool isExec = false) {
|
||||
if (isExec) {
|
||||
size_t discardOffset = 0;
|
||||
amd::Memory *memObj = getMemoryObject(dst, discardOffset);
|
||||
if (memObj != nullptr) {
|
||||
amd::Memory *memObjOri = getMemoryObject(dst_, discardOffset);
|
||||
if (memObjOri != nullptr) {
|
||||
if (memObjOri->getUserData().deviceId != memObj->getUserData().deviceId) {
|
||||
return hipErrorInvalidValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
size_t sym_size = 0;
|
||||
hipDeviceptr_t device_ptr = nullptr;
|
||||
// check to see if dst is also a symbol (hip negative test case)
|
||||
@@ -1520,7 +1532,19 @@ class hipGraphMemcpyNodeToSymbol : public hipGraphMemcpyNode1D {
|
||||
}
|
||||
|
||||
hipError_t SetParams(const void* symbol, const void* src, size_t count, size_t offset,
|
||||
hipMemcpyKind kind) {
|
||||
hipMemcpyKind kind, bool isExec = false) {
|
||||
if (isExec) {
|
||||
size_t discardOffset = 0;
|
||||
amd::Memory *memObj = getMemoryObject(src, discardOffset);
|
||||
if (memObj != nullptr) {
|
||||
amd::Memory *memObjOri = getMemoryObject(src_, discardOffset);
|
||||
if (memObjOri != nullptr) {
|
||||
if (memObjOri->getUserData().deviceId != memObj->getUserData().deviceId) {
|
||||
return hipErrorInvalidValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
size_t sym_size = 0;
|
||||
hipDeviceptr_t device_ptr = nullptr;
|
||||
// check to see if src is also a symbol (hip negative test case)
|
||||
|
||||
Ссылка в новой задаче
Block a user