SWDEV-374374 - memset memory mapping should not change

Signed-off-by: sdashmiz <shadi.dashmiz@amd.com>
Change-Id: I4cc3b1ac5a59fe5c9ae060f4d5d189dc63ca450c
이 커밋은 다음에 포함됨:
sdashmiz 작성하고 Shadi Dashmiz가 2023-01-17 14:41:24 -05:00를 커밋함
1 부모 39db0ec297
커밋 52bf09aac6
1 파일이 변경됨
+8
+8
파일 보기
@@ -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);