SWDEV-315880 - Graph, added checks for memory kind

Change-Id: I9cd2b1ee58be60bebb41af6007b0ab25d2c98607
This commit is contained in:
Payam
2022-02-11 13:25:38 -05:00
committato da Ajay GunaShekar
parent ab8c30cf78
commit 11f5126d46
+8 -2
Vedi File
@@ -62,14 +62,20 @@ hipError_t hipGraphMemcpyNode1D::ValidateParams(void* dst, const void* src, size
size_t dOffset = 0;
amd::Memory* dstMemory = getMemoryObject(dst, dOffset);
if ((srcMemory == nullptr) && (dstMemory != nullptr)) {
if ((srcMemory == nullptr) && (dstMemory != nullptr)) { //host to device
if (origDstMemory->getContext().devices()[0] != dstMemory->getContext().devices()[0]) {
return hipErrorInvalidValue;
}
} else if ((srcMemory != nullptr) && (dstMemory == nullptr)) {
if (kind != hipMemcpyHostToDevice) {
return hipErrorInvalidValue;
}
} else if ((srcMemory != nullptr) && (dstMemory == nullptr)) { //device to host
if (origSrcMemory->getContext().devices()[0] != srcMemory->getContext().devices()[0]) {
return hipErrorInvalidValue;
}
if (kind != hipMemcpyDeviceToHost) {
return hipErrorInvalidValue;
}
} else if ((srcMemory != nullptr) && (dstMemory != nullptr)) {
if (origDstMemory->getContext().devices()[0] != dstMemory->getContext().devices()[0]) {
return hipErrorInvalidValue;