SWDEV-313867 - SWDEV-314101 - Address Negative scenarios with hipGraphAddMemcpyNode and hipGraphAddMemsetNode

Change-Id: I51527ce6953aee9a3ef7d821754819b6c8087939
This commit is contained in:
Satyanvesh Dittakavi
2022-01-11 15:49:48 +00:00
والد de28c4467f
کامیت c58ba64a0b
2فایلهای تغییر یافته به همراه15 افزوده شده و 4 حذف شده
+7 -2
مشاهده پرونده
@@ -2168,13 +2168,18 @@ hipError_t hipMemcpyAtoH(void* dstHost,
}
hipError_t ihipMemcpy3D_validate(const hipMemcpy3DParms* p) {
// The struct passed to hipMemcpy3D() must specify one of srcArray or srcPtr and one of dstArray
// or dstPtr. Passing more than one non-zero source or destination will cause hipMemcpy3D() to
// Passing more than one non-zero source or destination will cause hipMemcpy3D() to
// return an error.
if (p == nullptr || ((p->srcArray != nullptr) && (p->srcPtr.ptr != nullptr)) ||
((p->dstArray != nullptr) && (p->dstPtr.ptr != nullptr))) {
return hipErrorInvalidValue;
}
// The struct passed to hipMemcpy3D() must specify one of srcArray or srcPtr and one of dstArray
// or dstPtr.
if (((p->srcArray == nullptr) && (p->srcPtr.ptr == nullptr)) ||
((p->dstArray == nullptr) && (p->dstPtr.ptr == nullptr))) {
return hipErrorInvalidValue;
}
// If the source and destination are both arrays, hipMemcpy3D() will return an error if they do
// not have the same element size.