fix code issues reported by clang 14

Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
This commit is contained in:
Artur Harasimiuk
2022-04-28 16:43:27 +02:00
committed by Compute-Runtime-Automation
parent 96dd1de20c
commit a6490062a9
17 changed files with 23 additions and 50 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -107,23 +107,19 @@ HWTEST_P(AUBCopyBufferRect, WhenCopyingThenExpectationsMet) {
uint8_t src[rowPitch * slicePitch];
memset(src, 0, sizeof(src));
auto tDst = pDestMemory;
auto tSrc = ptrOffset(pSrcMemory, srcOrigin[0] + srcOrigin[1] * rowPitch + srcOrigin[2] * slicePitch);
auto tRef = ptrOffset(src, dstOrigin[0] + dstOrigin[1] * rowPitch + dstOrigin[2] * slicePitch);
for (unsigned int z = 0; z < regionZ; z++) {
auto pDst = tDst;
auto pSrc = tSrc;
auto pRef = tRef;
for (unsigned int y = 0; y < regionY; y++) {
memcpy(pRef, pSrc, region[0]);
pDst += rowPitch;
pSrc += rowPitch;
pRef += rowPitch;
}
tDst += slicePitch;
tSrc += slicePitch;
tRef += slicePitch;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2021 Intel Corporation
* Copyright (C) 2019-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -65,9 +65,6 @@ HWTEST_F(UnifiedMemoryAubTest, givenSharedMemoryAllocWhenWriteIntoGPUPartThenVal
expectNotEqualMemory<FamilyType>(unifiedMemoryPtr, unifiedMemoryPtr, dataSize);
expectMemory<FamilyType>(unifiedMemoryPtr, input.data(), dataSize);
auto mockRead = reinterpret_cast<char *>(unifiedMemoryPtr)[0];
mockRead = 0;
expectMemory<FamilyType>(unifiedMemoryPtr, unifiedMemoryPtr, dataSize);
freeUSM(unifiedMemoryPtr, unifiedMemoryType);

View File

@@ -1727,11 +1727,9 @@ TEST_F(VmeBuiltInTests, WhenValidatingImagesThenCorrectResponses) {
std::unique_ptr<Image> image1(ImageHelper<ImageVmeValidFormat>::create(pContext));
cl_mem srcImgMem = 0;
cl_mem refImgMem = 0;
EXPECT_EQ(CL_INVALID_KERNEL_ARGS, vmeBuilder.validateImages(Vec3<size_t>{3, 3, 0}, Vec3<size_t>{0, 0, 0}));
srcImgMem = image1.get();
refImgMem = 0;
vmeBuilder.setExplicitArg(srcImgArgNum, sizeof(srcImgMem), &srcImgMem, err);
EXPECT_EQ(CL_INVALID_KERNEL_ARGS, vmeBuilder.validateImages(Vec3<size_t>{3, 3, 0}, Vec3<size_t>{0, 0, 0}));
}

View File

@@ -1081,15 +1081,18 @@ HWTEST_F(EnqueueKernelTest, givenCsrInBatchingModeWhenCommandIsFlushedThenFlushS
auto status = clWaitForEvents(1, &event);
EXPECT_EQ(CL_SUCCESS, status);
EXPECT_EQ(1, neoEvent->getRefInternalCount());
EXPECT_EQ(1u, mockCsr->flushStamp->peekStamp());
EXPECT_EQ(1u, neoEvent->flushStamp->peekStamp());
EXPECT_EQ(1u, pCmdQ->flushStamp->peekStamp());
status = clFinish(pCmdQ);
EXPECT_EQ(CL_SUCCESS, status);
EXPECT_EQ(1u, pCmdQ->flushStamp->peekStamp());
status = clReleaseEvent(event);
EXPECT_EQ(CL_SUCCESS, status);
}
HWTEST_F(EnqueueKernelTest, givenCsrInBatchingModeWhenNonBlockingMapFollowsNdrCallThenFlushStampIsUpdatedProperly) {
@@ -1133,15 +1136,18 @@ HWTEST_F(EnqueueKernelTest, givenCsrInBatchingModeWhenCommandWithEventIsFollowed
auto status = clWaitForEvents(1, &event);
EXPECT_EQ(CL_SUCCESS, status);
EXPECT_EQ(1, neoEvent->getRefInternalCount());
EXPECT_EQ(1u, mockCsr->flushStamp->peekStamp());
EXPECT_EQ(1u, neoEvent->flushStamp->peekStamp());
EXPECT_EQ(1u, pCmdQ->flushStamp->peekStamp());
status = clFinish(pCmdQ);
EXPECT_EQ(CL_SUCCESS, status);
EXPECT_EQ(1u, pCmdQ->flushStamp->peekStamp());
status = clReleaseEvent(event);
EXPECT_EQ(CL_SUCCESS, status);
}
HWTEST_F(EnqueueKernelTest, givenCsrInBatchingModeWhenClFlushIsCalledThenQueueFlushStampIsUpdated) {

View File

@@ -425,10 +425,6 @@ HWTEST_F(DispatchFlagsTests, givenCommandComputeKernelWhenSubmitThenPassCorrectD
bool flushDC = false;
bool slmUsed = false;
bool ndRangeKernel = false;
bool requiresCoherency = false;
for (auto &surface : surfaces) {
requiresCoherency |= surface->IsCoherent;
}
std::unique_ptr<Command> command(new CommandComputeKernel(*mockCmdQ, kernelOperation, surfaces, flushDC, slmUsed, ndRangeKernel, nullptr, preemptionMode, kernel, 1));
command->submit(20, false);