SWDEV-313867 - SWDEV-314101 - Address Negative scenarios with hipGraphAddMemcpyNode and hipGraphAddMemsetNode
Change-Id: I51527ce6953aee9a3ef7d821754819b6c8087939
This commit is contained in:
@@ -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.
|
||||
|
||||
مرجع در شماره جدید
Block a user