SWDEV-315880 - Graph, added checks for memory kind
Change-Id: I9cd2b1ee58be60bebb41af6007b0ab25d2c98607
This commit is contained in:
@@ -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;
|
||||
|
||||
Fai riferimento in un nuovo problema
Block a user