SWDEV-313082 - hipGraphMemsetNodeSetParams invalid params

Change-Id: Ibe57df8d7d583daf9ba9c7a86863eacca4868f3a
This commit is contained in:
Ajay
2022-01-21 23:50:18 +00:00
کامیت شده توسط Ajay GunaShekar
والد 0440d945e8
کامیت cb79dc7486
4فایلهای تغییر یافته به همراه35 افزوده شده و 2 حذف شده
+14
مشاهده پرونده
@@ -2276,6 +2276,20 @@ hipError_t ihipMemset_validate(void* dst, int64_t value, size_t valueSize,
return hipSuccess;
}
hipError_t ihipGraphMemsetParams_validate(const hipMemsetParams* pNodeParams) {
if (pNodeParams == nullptr) {
return hipErrorInvalidValue;
}
if (pNodeParams->elementSize != 1 && pNodeParams->elementSize != 2 && pNodeParams->elementSize != 4) {
return hipErrorInvalidValue;
}
if (pNodeParams->height <= 0) {
return hipErrorInvalidValue;
}
return hipSuccess;
}
hipError_t ihipMemsetCommand(std::vector<amd::Command*>& commands, void* dst, int64_t value,
size_t valueSize, size_t sizeBytes, amd::HostQueue* queue) {
hipError_t hip_error = hipSuccess;