SWDEV-374374 - memset memory mapping should not change

Signed-off-by: sdashmiz <shadi.dashmiz@amd.com>
Change-Id: I4cc3b1ac5a59fe5c9ae060f4d5d189dc63ca450c


[ROCm/clr commit: 52bf09aac6]
This commit is contained in:
sdashmiz
2023-01-09 10:54:08 -05:00
committed by Shadi Dashmiz
parent 36d240ff89
commit 11f97823cd
@@ -1578,6 +1578,8 @@ class hipGraphMemsetNode : public hipGraphNode {
hipError_t SetParams(const hipMemsetParams* params) {
hipError_t hip_error = hipSuccess;
hipMemsetParams origParams = {};
GetParams(&origParams);
hip_error = ihipGraphMemsetParams_validate(params);
if (hip_error != hipSuccess) {
return hip_error;
@@ -1585,9 +1587,15 @@ class hipGraphMemsetNode : public hipGraphNode {
size_t sizeBytes;
if (params->height == 1) {
sizeBytes = params->width * params->elementSize;
if (sizeBytes != origParams.width * origParams.elementSize) {
return hipErrorInvalidValue;
}
hip_error = ihipMemset_validate(params->dst, params->value, params->elementSize, sizeBytes);
} else {
sizeBytes = params->width * params->height * 1;
if (sizeBytes != origParams.width * origParams.height * 1) {
return hipErrorInvalidValue;
}
hip_error =
ihipMemset3D_validate({params->dst, params->pitch, params->width * params->elementSize, params->height},
params->value, {params->width * params->elementSize, params->height, 1}, sizeBytes);