diff --git a/.clang-tidy b/.clang-tidy index f2347e529b..b68dda93cd 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,7 +1,7 @@ --- Checks: 'clang-diagnostic-*,clang-analyzer-*,google-default-arguments,readability-identifier-naming,modernize-use-override,modernize-use-default-member-init,-clang-analyzer-alpha*' -# WarningsAsErrors: '.*' -HeaderFilterRegex: '^((?!^third_party\/).+)\.(h|hpp|inl)$' +WarningsAsErrors: '.*' +HeaderFilterRegex: '(shared|opencl|level_zero).+\.(h|hpp|inl)$' AnalyzeTemporaryDtors: false CheckOptions: - key: google-readability-braces-around-statements.ShortStatementLines @@ -16,8 +16,6 @@ CheckOptions: value: camelBack - key: readability-identifier-naming.ParameterCase value: camelBack - - key: readability-identifier-naming.StructMemberCase - value: camelBack - key: readability-identifier-naming.ClassMemberCase value: camelBack - key: readability-identifier-naming.ClassMethodCase diff --git a/level_zero/core/source/context/context.h b/level_zero/core/source/context/context.h index 64396901f0..678e7b10d5 100644 --- a/level_zero/core/source/context/context.h +++ b/level_zero/core/source/context/context.h @@ -35,7 +35,7 @@ struct Context : _ze_context_handle_t { return ZE_MEMORY_TYPE_UNKNOWN; } - virtual ~Context() = default; + ~Context() override = default; virtual ze_result_t destroy() = 0; virtual ze_result_t getStatus() = 0; virtual DriverHandle *getDriverHandle() = 0; diff --git a/level_zero/core/source/device/device_imp.cpp b/level_zero/core/source/device/device_imp.cpp index f2548a8843..e63f7eb279 100644 --- a/level_zero/core/source/device/device_imp.cpp +++ b/level_zero/core/source/device/device_imp.cpp @@ -414,10 +414,10 @@ ze_result_t DeviceImp::getPciProperties(ze_pci_ext_properties_t *pPciProperties) } auto pciBusInfo = driverInfo->getPciBusInfo(); auto isPciValid = [&](auto pci) -> bool { - return (pci.pciDomain != NEO::PhysicalDevicePciBusInfo::InvalidValue && - pci.pciBus != NEO::PhysicalDevicePciBusInfo::InvalidValue && - pci.pciDevice != NEO::PhysicalDevicePciBusInfo::InvalidValue && - pci.pciFunction != NEO::PhysicalDevicePciBusInfo::InvalidValue); + return (pci.pciDomain != NEO::PhysicalDevicePciBusInfo::invalidValue && + pci.pciBus != NEO::PhysicalDevicePciBusInfo::invalidValue && + pci.pciDevice != NEO::PhysicalDevicePciBusInfo::invalidValue && + pci.pciFunction != NEO::PhysicalDevicePciBusInfo::invalidValue); }; if (!isPciValid(pciBusInfo)) { return ZE_RESULT_ERROR_UNINITIALIZED; diff --git a/level_zero/core/source/driver/driver_handle_imp.h b/level_zero/core/source/driver/driver_handle_imp.h index 87f50c4dfc..23241cf794 100644 --- a/level_zero/core/source/driver/driver_handle_imp.h +++ b/level_zero/core/source/driver/driver_handle_imp.h @@ -57,11 +57,11 @@ struct DriverHandleImp : public DriverHandle { ze_result_t releaseImportedPointer(void *ptr) override; ze_result_t getHostPointerBaseAddress(void *ptr, void **baseAddress) override; - virtual NEO::GraphicsAllocation *findHostPointerAllocation(void *ptr, size_t size, uint32_t rootDeviceIndex) override; - virtual NEO::GraphicsAllocation *getDriverSystemMemoryAllocation(void *ptr, - size_t size, - uint32_t rootDeviceIndex, - uintptr_t *gpuAddress) override; + NEO::GraphicsAllocation *findHostPointerAllocation(void *ptr, size_t size, uint32_t rootDeviceIndex) override; + NEO::GraphicsAllocation *getDriverSystemMemoryAllocation(void *ptr, + size_t size, + uint32_t rootDeviceIndex, + uintptr_t *gpuAddress) override; NEO::GraphicsAllocation *getPeerAllocation(Device *device, NEO::SvmAllocationData *allocData, void *basePtr, diff --git a/level_zero/core/source/event/event.h b/level_zero/core/source/event/event.h index 506f24277e..f597517000 100644 --- a/level_zero/core/source/event/event.h +++ b/level_zero/core/source/event/event.h @@ -248,7 +248,7 @@ struct EventPoolImp : public EventPool { ze_result_t initialize(DriverHandle *driver, Context *context, uint32_t numDevices, ze_device_handle_t *phDevices); - ~EventPoolImp(); + ~EventPoolImp() override; ze_result_t destroy() override; diff --git a/level_zero/core/test/.clang-tidy b/level_zero/core/test/.clang-tidy deleted file mode 100644 index c288dff55d..0000000000 --- a/level_zero/core/test/.clang-tidy +++ /dev/null @@ -1,34 +0,0 @@ ---- -Checks: 'clang-diagnostic-*,clang-analyzer-*,google-default-arguments,modernize-use-override,modernize-use-default-member-init,-clang-analyzer-alpha*,readability-identifier-naming,-clang-analyzer-optin.performance.Padding,-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-cplusplus.NewDeleteLeaks,-clang-analyzer-core.CallAndMessage,-clang-analyzer-unix.MismatchedDeallocator,-clang-analyzer-core.NullDereference,-clang-analyzer-cplusplus.NewDelete,-clang-analyzer-optin.cplusplus.VirtualCall' -# WarningsAsErrors: '.*' -HeaderFilterRegex: '^((?!^third_party\/).+)\.(h|hpp|inl)$' -AnalyzeTemporaryDtors: false -CheckOptions: - - key: google-readability-braces-around-statements.ShortStatementLines - value: '1' - - key: google-readability-function-size.StatementThreshold - value: '800' - - key: google-readability-namespace-comments.ShortNamespaceLines - value: '10' - - key: google-readability-namespace-comments.SpacesBeforeComments - value: '2' - - key: readability-identifier-naming.ParameterCase - value: camelBack - - key: readability-identifier-naming.StructMemberCase - value: camelBack - - key: modernize-loop-convert.MaxCopySize - value: '16' - - key: modernize-loop-convert.MinConfidence - value: reasonable - - key: modernize-loop-convert.NamingStyle - value: CamelCase - - key: modernize-pass-by-value.IncludeStyle - value: llvm - - key: modernize-replace-auto-ptr.IncludeStyle - value: llvm - - key: modernize-use-nullptr.NullMacros - value: 'NULL' - - key: modernize-use-default-member-init.UseAssignment - value: '1' -... - diff --git a/level_zero/core/test/aub_tests/fixtures/aub_fixture.h b/level_zero/core/test/aub_tests/fixtures/aub_fixture.h index 311ed79430..dfa66cb379 100644 --- a/level_zero/core/test/aub_tests/fixtures/aub_fixture.h +++ b/level_zero/core/test/aub_tests/fixtures/aub_fixture.h @@ -41,9 +41,9 @@ class AUBFixtureL0 { public: AUBFixtureL0(); virtual ~AUBFixtureL0(); - void SetUp(); - void SetUp(const NEO::HardwareInfo *hardwareInfo, bool debuggingEnabled); - void TearDown(); + void SetUp(); // NOLINT(readability-identifier-naming) + void SetUp(const NEO::HardwareInfo *hardwareInfo, bool debuggingEnabled); // NOLINT(readability-identifier-naming) + void TearDown(); // NOLINT(readability-identifier-naming) static void prepareCopyEngines(NEO::MockDevice &device, const std::string &filename); template @@ -110,4 +110,4 @@ class AUBFixtureL0 { NEO::CommandStreamReceiver *csr = nullptr; }; -} // namespace L0 \ No newline at end of file +} // namespace L0 diff --git a/level_zero/core/test/black_box_tests/zello_copy_only.cpp b/level_zero/core/test/black_box_tests/zello_copy_only.cpp index 8bc3bf05b4..bfaa544b7e 100644 --- a/level_zero/core/test/black_box_tests/zello_copy_only.cpp +++ b/level_zero/core/test/black_box_tests/zello_copy_only.cpp @@ -30,7 +30,7 @@ void testCopyBetweenHeapDeviceAndStack(ze_context_handle_t &context, ze_device_h ze_command_queue_desc_t cmdQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC}; int32_t copyQueueGroup = getCopyOnlyCommandQueueOrdinal(device); if (copyQueueGroup < 0) { - std::cout << "No Copy queue group found. Skipping test run\n"; + std::cout << "No Copy queue group found. Skipping test run\n"; // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) validRet = true; return; } @@ -105,7 +105,7 @@ void testCopyBetweenHostMemAndDeviceMem(ze_context_handle_t &context, ze_device_ ze_command_queue_desc_t cmdQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC}; int32_t copyQueueGroup = getCopyOnlyCommandQueueOrdinal(device); if (copyQueueGroup < 0) { - std::cout << "No Copy queue group found. Skipping test run\n"; + std::cout << "No Copy queue group found. Skipping test run\n"; // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) validRet = true; return; } @@ -310,7 +310,7 @@ void testSharedMemDataAccessWithoutCopy(ze_context_handle_t &context, ze_device_ ze_command_queue_desc_t cmdQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC}; int32_t copyQueueGroup = getCopyOnlyCommandQueueOrdinal(device); if (copyQueueGroup < 0) { - std::cout << "No Copy queue group found. Skipping test run\n"; + std::cout << "No Copy queue group found. Skipping test run\n"; // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) validRet = true; return; } diff --git a/level_zero/core/test/black_box_tests/zello_ipc_copy_dma_buf.cpp b/level_zero/core/test/black_box_tests/zello_ipc_copy_dma_buf.cpp index 00224240b5..9eff33c736 100644 --- a/level_zero/core/test/black_box_tests/zello_ipc_copy_dma_buf.cpp +++ b/level_zero/core/test/black_box_tests/zello_ipc_copy_dma_buf.cpp @@ -64,7 +64,7 @@ static int recvmsgForIpcHandle(int socket, char *payload) { return -1; } struct cmsghdr *controlHeader = CMSG_FIRSTHDR(&msgHeader); - memmove(&fd, CMSG_DATA(controlHeader), sizeof(int)); + memmove(&fd, CMSG_DATA(controlHeader), sizeof(int)); // NOLINT(clang-analyzer-core.NonNullParamChecker) memmove(payload, recvBuf, sizeof(recvBuf)); return fd; } diff --git a/level_zero/core/test/unit_tests/fixtures/aub_csr_fixture.h b/level_zero/core/test/unit_tests/fixtures/aub_csr_fixture.h index ff907e1b1e..dce5bdeb2b 100644 --- a/level_zero/core/test/unit_tests/fixtures/aub_csr_fixture.h +++ b/level_zero/core/test/unit_tests/fixtures/aub_csr_fixture.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -20,14 +20,14 @@ namespace L0 { namespace ult { struct AubCsrFixture : public ContextFixture { template - void SetUpT() { + void setUpT() { auto csrCreateFcn = &commandStreamReceiverFactory[IGFX_MAX_CORE + NEO::defaultHwInfo->platform.eRenderCoreFamily]; variableBackup = std::make_unique>(csrCreateFcn); *csrCreateFcn = UltAubCommandStreamReceiver::create; ContextFixture::SetUp(); } template - void TearDownT() { + void tearDownT() { ContextFixture::TearDown(); } diff --git a/level_zero/core/test/unit_tests/fixtures/device_fixture.cpp b/level_zero/core/test/unit_tests/fixtures/device_fixture.cpp index 5742b4b2c6..7d1d4ee709 100644 --- a/level_zero/core/test/unit_tests/fixtures/device_fixture.cpp +++ b/level_zero/core/test/unit_tests/fixtures/device_fixture.cpp @@ -18,7 +18,7 @@ namespace L0 { namespace ult { -void DeviceFixture::SetUp() { // NOLINT(readability-identifier-naming) +void DeviceFixture::SetUp() { auto executionEnvironment = MockDevice::prepareExecutionEnvironment(NEO::defaultHwInfo.get(), 0u); setupWithExecutionEnvironment(*executionEnvironment); } @@ -39,11 +39,11 @@ void DeviceFixture::setupWithExecutionEnvironment(NEO::ExecutionEnvironment &exe context = static_cast(Context::fromHandle(hContext)); } -void DeviceFixture::TearDown() { // NOLINT(readability-identifier-naming) +void DeviceFixture::TearDown() { context->destroy(); } -void PageFaultDeviceFixture::SetUp() { // NOLINT(readability-identifier-naming) +void PageFaultDeviceFixture::SetUp() { neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get()); auto mockBuiltIns = new MockBuiltins(); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(mockBuiltIns); @@ -65,12 +65,12 @@ void PageFaultDeviceFixture::SetUp() { // NOLINT(readability-identifier-naming) device->getDriverHandle()->setMemoryManager(mockMemoryManager.get()); } -void PageFaultDeviceFixture::TearDown() { // NOLINT(readability-identifier-naming) +void PageFaultDeviceFixture::TearDown() { device->getDriverHandle()->setMemoryManager(memoryManager); context->destroy(); } -void MultiDeviceFixture::SetUp() { // NOLINT(readability-identifier-naming) +void MultiDeviceFixture::SetUp() { DebugManager.flags.CreateMultipleRootDevices.set(numRootDevices); DebugManager.flags.CreateMultipleSubDevices.set(numSubDevices); auto executionEnvironment = new NEO::ExecutionEnvironment; @@ -86,7 +86,7 @@ void MultiDeviceFixture::SetUp() { // NOLINT(readability-identifier-naming) context = static_cast(Context::fromHandle(hContext)); } -void MultiDeviceFixture::TearDown() { // NOLINT(readability-identifier-naming) +void MultiDeviceFixture::TearDown() { context->destroy(); } diff --git a/level_zero/core/test/unit_tests/fixtures/device_fixture.h b/level_zero/core/test/unit_tests/fixtures/device_fixture.h index 34a3efdd0a..37118df6aa 100644 --- a/level_zero/core/test/unit_tests/fixtures/device_fixture.h +++ b/level_zero/core/test/unit_tests/fixtures/device_fixture.h @@ -183,8 +183,8 @@ struct ContextFixture : DeviceFixture { }; struct MultipleDevicesWithCustomHwInfo { - void SetUp(); - void TearDown() {} + void SetUp(); // NOLINT(readability-identifier-naming) + void TearDown() {} // NOLINT(readability-identifier-naming) NEO::HardwareInfo hwInfo; const uint32_t numSubslicesPerSlice = 4; const uint32_t numEuPerSubslice = 8; @@ -222,7 +222,7 @@ struct SingleRootMultiSubDeviceFixtureWithImplicitScaling : public MultiDeviceFi uint32_t numEngineGroups = 0; uint32_t subDeviceNumEngineGroups = 0; - void SetUp() { // NOLINT(readability-identifier-naming) + void SetUp() { DebugManagerStateRestore restorer; DebugManager.flags.EnableImplicitScaling.set(implicitScaling); DebugManager.flags.CreateMultipleRootDevices.set(numRootDevices); @@ -283,7 +283,7 @@ struct SingleRootMultiSubDeviceFixtureWithImplicitScaling : public MultiDeviceFi } } - void TearDown() { // NOLINT(readability-identifier-naming) + void TearDown() { context->destroy(); } }; diff --git a/level_zero/core/test/unit_tests/fixtures/host_pointer_manager_fixture.h b/level_zero/core/test/unit_tests/fixtures/host_pointer_manager_fixture.h index 38628f1b7c..0518dcaa6f 100644 --- a/level_zero/core/test/unit_tests/fixtures/host_pointer_manager_fixture.h +++ b/level_zero/core/test/unit_tests/fixtures/host_pointer_manager_fixture.h @@ -25,7 +25,7 @@ namespace L0 { namespace ult { struct HostPointerManagerFixure { - void SetUp() { + void SetUp() { // NOLINT(readability-identifier-naming) NEO::MockCompilerEnableGuard mock(true); NEO::DeviceVector devices; neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get()); @@ -51,7 +51,7 @@ struct HostPointerManagerFixure { context = L0::Context::fromHandle(hContext); } - void TearDown() { + void TearDown() { // NOLINT(readability-identifier-naming) context->destroy(); hostDriverHandle->getMemoryManager()->freeSystemMemory(heapPointer); diff --git a/level_zero/core/test/unit_tests/fixtures/module_fixture.h b/level_zero/core/test/unit_tests/fixtures/module_fixture.h index 928c276c96..ddd56fc093 100644 --- a/level_zero/core/test/unit_tests/fixtures/module_fixture.h +++ b/level_zero/core/test/unit_tests/fixtures/module_fixture.h @@ -103,7 +103,7 @@ struct ModuleImmutableDataFixture : public DeviceFixture { mockKernelImmData->setDevice(device); } - ~MockModule() { + ~MockModule() override { } const KernelImmutableData *getKernelImmutableData(const char *functionName) const override { @@ -317,7 +317,7 @@ struct ModuleWithZebinFixture : public DeviceFixture { MemoryPool::System4KBPages)); } - ~MockImmutableData() { + ~MockImmutableData() override { delete kernelDescriptor; } }; @@ -363,7 +363,7 @@ struct ModuleWithZebinFixture : public DeviceFixture { zebin.storage.data(), zebin.storage.size()); } - ~MockModuleWithZebin() { + ~MockModuleWithZebin() override { } const char strings[12] = "Hello olleH"; diff --git a/level_zero/core/test/unit_tests/gen12lp/test_cmdlist_gen12lp.cpp b/level_zero/core/test/unit_tests/gen12lp/test_cmdlist_gen12lp.cpp index 24d7f91a2c..635ef3e62a 100644 --- a/level_zero/core/test/unit_tests/gen12lp/test_cmdlist_gen12lp.cpp +++ b/level_zero/core/test/unit_tests/gen12lp/test_cmdlist_gen12lp.cpp @@ -306,7 +306,7 @@ HWTEST2_F(CommandListCreate, givenAllocationsWhenApplyRangesBarrierWithInvalidAd EXPECT_EQ(ZE_RESULT_SUCCESS, result); auto commandList = new CommandListAdjustStateComputeMode(); - ASSERT_NE(nullptr, commandList); + ASSERT_NE(nullptr, commandList); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) bool ret = commandList->initialize(device, NEO::EngineGroupType::RenderCompute, 0u); ASSERT_FALSE(ret); @@ -339,7 +339,7 @@ HWTEST2_F(CommandListCreate, givenAllocationsWhenApplyRangesBarrierWithInvalidAd EXPECT_EQ(ZE_RESULT_SUCCESS, result); auto commandList = new CommandListAdjustStateComputeMode(); - ASSERT_NE(nullptr, commandList); + ASSERT_NE(nullptr, commandList); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) bool ret = commandList->initialize(device, NEO::EngineGroupType::RenderCompute, 0u); ASSERT_FALSE(ret); diff --git a/level_zero/core/test/unit_tests/mocks/mock_builtin_functions_lib_impl_timestamps.h b/level_zero/core/test/unit_tests/mocks/mock_builtin_functions_lib_impl_timestamps.h index 5bd0f9268e..28f7f582ca 100644 --- a/level_zero/core/test/unit_tests/mocks/mock_builtin_functions_lib_impl_timestamps.h +++ b/level_zero/core/test/unit_tests/mocks/mock_builtin_functions_lib_impl_timestamps.h @@ -15,7 +15,7 @@ namespace ult { struct MockBuiltinDataTimestamp : BuiltinFunctionsLibImpl::BuiltinData { using BuiltinFunctionsLibImpl::BuiltinData::BuiltinData; - ~MockBuiltinDataTimestamp() { + ~MockBuiltinDataTimestamp() override { module.release(); } }; @@ -53,7 +53,7 @@ struct MockBuiltinFunctionsLibImplTimestamps : BuiltinFunctionsLibImpl { auto builtInCodeType = NEO::DebugManager.flags.RebuildPrecompiledKernels.get() ? BuiltInCodeType::Intermediate : BuiltInCodeType::Binary; auto builtInCode = builtInsLib->getBuiltinsLib().getBuiltinCode(builtin, builtInCodeType, *device->getNEODevice()); - ze_result_t res; + [[maybe_unused]] ze_result_t res; std::unique_ptr module; ze_module_handle_t moduleHandle; ze_module_desc_t moduleDesc = {}; diff --git a/level_zero/core/test/unit_tests/mocks/mock_device_for_spirv.h b/level_zero/core/test/unit_tests/mocks/mock_device_for_spirv.h index 448d768806..ef2bfd90c2 100644 --- a/level_zero/core/test/unit_tests/mocks/mock_device_for_spirv.h +++ b/level_zero/core/test/unit_tests/mocks/mock_device_for_spirv.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -27,9 +27,9 @@ class MockDeviceForSpv : public Mock { } ze_result_t createModule(const ze_module_desc_t *desc, ze_module_handle_t *module, ze_module_build_log_handle_t *buildLog, ModuleType type) override; - ~MockDeviceForSpv() { + ~MockDeviceForSpv() override { } }; } // namespace ult -} // namespace L0 \ No newline at end of file +} // namespace L0 diff --git a/level_zero/core/test/unit_tests/mocks/mock_module.h b/level_zero/core/test/unit_tests/mocks/mock_module.h index 2a9f7328d8..f66a4a9567 100644 --- a/level_zero/core/test/unit_tests/mocks/mock_module.h +++ b/level_zero/core/test/unit_tests/mocks/mock_module.h @@ -87,7 +87,7 @@ struct MockModule : public L0::ModuleImp { maxGroupSize = 32; }; - ~MockModule() = default; + ~MockModule() override = default; const KernelImmutableData *getKernelImmutableData(const char *functionName) const override { return kernelImmData; diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp index afc4e6aaaf..19d16db3c1 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp @@ -407,7 +407,7 @@ HWTEST2_F(CommandListCreate, givenCommandListAndHostPointersWhenMemoryCopyCalled cmd = genCmdCast(*itor); itor = find(++itor, genCmdList.end()); } - EXPECT_EQ(MemorySynchronizationCommands::getDcFlushEnable(true, *defaultHwInfo), cmd->getDcFlushEnable()); + EXPECT_EQ(MemorySynchronizationCommands::getDcFlushEnable(true, *defaultHwInfo), cmd->getDcFlushEnable()); // NOLINT(clang-analyzer-core.CallAndMessage) } HWTEST2_F(CommandListCreate, givenCommandListAnd2DWhbufferenMemoryCopyRegionCalledThenCopyKernel2DCalled, IsAtLeastSkl) { diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_memory.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_memory.cpp index 3664778f42..a50be3420e 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_memory.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_memory.cpp @@ -113,7 +113,7 @@ HWTEST2_F(AppendMemoryCopy, givenCommandListAndHostPointersWhenMemoryCopyRegionC cmd = genCmdCast(*itor); itor = find(++itor, genCmdList.end()); } - EXPECT_EQ(MemorySynchronizationCommands::getDcFlushEnable(true, *defaultHwInfo), cmd->getDcFlushEnable()); + EXPECT_EQ(MemorySynchronizationCommands::getDcFlushEnable(true, *defaultHwInfo), cmd->getDcFlushEnable()); // NOLINT(clang-analyzer-core.CallAndMessage) } HWTEST2_F(AppendMemoryCopy, givenImmediateCommandListWhenAppendingMemoryCopyThenSuccessIsReturned, IsAtLeastSkl) { @@ -222,7 +222,7 @@ HWTEST2_F(AppendMemoryCopy, givenCommandListAndHostPointersWhenMemoryCopyCalledT cmd = genCmdCast(*itor); itor = find(++itor, genCmdList.end()); } - EXPECT_EQ(MemorySynchronizationCommands::getDcFlushEnable(true, *defaultHwInfo), cmd->getDcFlushEnable()); + EXPECT_EQ(MemorySynchronizationCommands::getDcFlushEnable(true, *defaultHwInfo), cmd->getDcFlushEnable()); // NOLINT(clang-analyzer-core.CallAndMessage) } HWTEST2_F(AppendMemoryCopy, givenCopyCommandListWhenTimestampPassedToMemoryCopyThenAppendProfilingCalledOnceBeforeAndAfterCommand, IsAtLeastSkl) { diff --git a/level_zero/core/test/unit_tests/sources/debugger/l0_debugger_fixture.h b/level_zero/core/test/unit_tests/sources/debugger/l0_debugger_fixture.h index 75b967db14..f4a9bbba20 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/l0_debugger_fixture.h +++ b/level_zero/core/test/unit_tests/sources/debugger/l0_debugger_fixture.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -19,7 +19,7 @@ namespace L0 { namespace ult { struct L0DebuggerFixture { - void SetUp() { + void SetUp() { // NOLINT(readability-identifier-naming) NEO::MockCompilerEnableGuard mock(true); auto executionEnvironment = new NEO::ExecutionEnvironment(); auto mockBuiltIns = new MockBuiltins(); @@ -51,7 +51,7 @@ struct L0DebuggerFixture { device = driverHandle->devices[0]; } - void TearDown() { + void TearDown() { // NOLINT(readability-identifier-naming) } std::unique_ptr> driverHandle; diff --git a/level_zero/core/test/unit_tests/sources/debugger/linux/test_l0_debugger_linux.cpp b/level_zero/core/test/unit_tests/sources/debugger/linux/test_l0_debugger_linux.cpp index 3c43bd3ee3..6a433973f9 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/linux/test_l0_debugger_linux.cpp +++ b/level_zero/core/test/unit_tests/sources/debugger/linux/test_l0_debugger_linux.cpp @@ -24,7 +24,7 @@ namespace L0 { namespace ult { struct L0DebuggerLinuxFixture { - void SetUp() { + void SetUp() { // NOLINT(readability-identifier-naming) auto executionEnvironment = new NEO::ExecutionEnvironment(); auto mockBuiltIns = new MockBuiltins(); executionEnvironment->prepareRootDeviceEnvironments(1); @@ -48,7 +48,7 @@ struct L0DebuggerLinuxFixture { device = driverHandle->devices[0]; } - void TearDown() { + void TearDown() { // NOLINT(readability-identifier-naming) } std::unique_ptr> driverHandle; diff --git a/level_zero/core/test/unit_tests/sources/debugger/test_source_level_debugger.cpp b/level_zero/core/test/unit_tests/sources/debugger/test_source_level_debugger.cpp index a34d951559..973ca249c2 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/test_source_level_debugger.cpp +++ b/level_zero/core/test/unit_tests/sources/debugger/test_source_level_debugger.cpp @@ -243,12 +243,12 @@ TEST_F(DeviceWithDebuggerEnabledTest, givenSldDebuggerWhenGettingL0DebuggerThenN } struct TwoSubDevicesDebuggerEnabledTest : public ActiveDebuggerFixture, public ::testing::Test { - void SetUp() override { // NOLINT(readability-identifier-naming) + void SetUp() override { DebugManager.flags.CreateMultipleSubDevices.set(2); VariableBackup mockDeviceFlagBackup(&MockDevice::createSingleDevice, false); ActiveDebuggerFixture::SetUp(); } - void TearDown() override { // NOLINT(readability-identifier-naming) + void TearDown() override { ActiveDebuggerFixture::TearDown(); } DebugManagerStateRestore restorer; diff --git a/level_zero/core/test/unit_tests/sources/device/test_device.cpp b/level_zero/core/test/unit_tests/sources/device/test_device.cpp index 7d9ab284c5..e6ae46ee2d 100644 --- a/level_zero/core/test/unit_tests/sources/device/test_device.cpp +++ b/level_zero/core/test/unit_tests/sources/device/test_device.cpp @@ -1146,7 +1146,7 @@ TEST_F(DeviceTest, givenValidPciExtPropertiesWhenPciPropertiesIsCalledThenSucces } TEST_F(DeviceTest, givenInvalidPciBusInfoWhenPciPropertiesIsCalledThenUninitializedErrorIsReturned) { - constexpr uint32_t INVALID = NEO::PhysicalDevicePciBusInfo::InvalidValue; + constexpr uint32_t INVALID = NEO::PhysicalDevicePciBusInfo::invalidValue; auto deviceImp = static_cast(device); ze_pci_ext_properties_t pciProperties = {}; std::vector pciBusInfos; diff --git a/level_zero/experimental/test/unit_tests/sources/tracing/test_api_tracing_common.h b/level_zero/experimental/test/unit_tests/sources/tracing/test_api_tracing_common.h index 4fce19048f..f7bd7fbf3e 100644 --- a/level_zero/experimental/test/unit_tests/sources/tracing/test_api_tracing_common.h +++ b/level_zero/experimental/test/unit_tests/sources/tracing/test_api_tracing_common.h @@ -40,14 +40,14 @@ class ZeAPITracingCoreTestsFixture { ZeAPITracingCoreTestsFixture(){}; protected: - virtual void SetUp() { //NOLINT + virtual void SetUp() { // NOLINT(readability-identifier-naming) driver_ddiTable.enableTracing = true; myThreadPrivateTracerData.onList = false; myThreadPrivateTracerData.isInitialized = false; myThreadPrivateTracerData.testAndSetThreadTracerDataInitializedAndOnList(); } - virtual void TearDown() { //NOLINT + virtual void TearDown() { // NOLINT(readability-identifier-naming) myThreadPrivateTracerData.removeThreadTracerDataFromList(); driver_ddiTable.enableTracing = false; } @@ -56,11 +56,11 @@ class ZeAPITracingCoreTestsFixture { class zeAPITracingCoreTests : public ZeAPITracingCoreTestsFixture, public ::testing::Test { protected: - void SetUp() override { //NOLINT + void SetUp() override { ZeAPITracingCoreTestsFixture::SetUp(); } - void TearDown() override { //NOLINT + void TearDown() override { ZeAPITracingCoreTestsFixture::TearDown(); } }; @@ -75,7 +75,7 @@ class zeAPITracingRuntimeTests : public ZeAPITracingCoreTestsFixture, public ::t int defaultUserData = 0; void *userData; - void SetUp() override { //NOLINT + void SetUp() override { ze_result_t result; ZeAPITracingCoreTestsFixture::SetUp(); @@ -86,7 +86,7 @@ class zeAPITracingRuntimeTests : public ZeAPITracingCoreTestsFixture, public ::t EXPECT_NE(nullptr, apiTracerHandle); } - void TearDown() override { //NOLINT + void TearDown() override { ze_result_t result; result = zetTracerExpSetEnabled(apiTracerHandle, false); @@ -135,7 +135,7 @@ class zeAPITracingRuntimeMultipleArgumentsTests : public ZeAPITracingCoreTestsFi int defaultUserData3 = 31; void *pUserData3; - void SetUp() override { //NOLINT + void SetUp() override { ze_result_t result; ZeAPITracingCoreTestsFixture::SetUp(); @@ -165,7 +165,7 @@ class zeAPITracingRuntimeMultipleArgumentsTests : public ZeAPITracingCoreTestsFi EXPECT_NE(nullptr, apiTracerHandle3); } - void TearDown() override { //NOLINT + void TearDown() override { ze_result_t result; result = zetTracerExpSetEnabled(apiTracerHandle0, false); EXPECT_EQ(ZE_RESULT_SUCCESS, result); diff --git a/level_zero/tools/source/metrics/metric_ip_sampling_source.h b/level_zero/tools/source/metrics/metric_ip_sampling_source.h index caa9c283b1..34b0dc1159 100644 --- a/level_zero/tools/source/metrics/metric_ip_sampling_source.h +++ b/level_zero/tools/source/metrics/metric_ip_sampling_source.h @@ -20,7 +20,7 @@ class IpSamplingMetricSourceImp : public MetricSource { public: IpSamplingMetricSourceImp(const MetricDeviceContext &metricDeviceContext); - virtual ~IpSamplingMetricSourceImp() = default; + ~IpSamplingMetricSourceImp() override = default; void enable() override; bool isAvailable() override; ze_result_t metricGroupGet(uint32_t *pCount, zet_metric_group_handle_t *phMetricGroups) override; @@ -55,7 +55,7 @@ typedef std::map StallSumIpDataMap_t; struct IpSamplingMetricGroupImp : public MetricGroup { IpSamplingMetricGroupImp(std::vector &metrics); - virtual ~IpSamplingMetricGroupImp() = default; + ~IpSamplingMetricGroupImp() override = default; ze_result_t getProperties(zet_metric_group_properties_t *pProperties) override; ze_result_t metricGet(uint32_t *pCount, zet_metric_handle_t *phMetrics) override; @@ -94,7 +94,7 @@ struct IpSamplingMetricGroupImp : public MetricGroup { }; struct IpSamplingMetricImp : public Metric { - virtual ~IpSamplingMetricImp() = default; + ~IpSamplingMetricImp() override = default; IpSamplingMetricImp(zet_metric_properties_t &properties); ze_result_t getProperties(zet_metric_properties_t *pProperties) override; diff --git a/level_zero/tools/source/metrics/metric_oa_source.h b/level_zero/tools/source/metrics/metric_oa_source.h index 6ff53c35ae..7f5caa04ac 100644 --- a/level_zero/tools/source/metrics/metric_oa_source.h +++ b/level_zero/tools/source/metrics/metric_oa_source.h @@ -22,7 +22,7 @@ class OaMetricSourceImp : public MetricSource { public: OaMetricSourceImp(const MetricDeviceContext &metricDeviceContext); - virtual ~OaMetricSourceImp(); + ~OaMetricSourceImp() override; void enable() override; bool isAvailable() override; ze_result_t metricGroupGet(uint32_t *pCount, zet_metric_group_handle_t *phMetricGroups) override; diff --git a/level_zero/tools/source/sysman/diagnostics/diagnostics.h b/level_zero/tools/source/sysman/diagnostics/diagnostics.h index dc627bb17d..9955e28bc5 100644 --- a/level_zero/tools/source/sysman/diagnostics/diagnostics.h +++ b/level_zero/tools/source/sysman/diagnostics/diagnostics.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -22,7 +22,7 @@ struct OsSysman; class Diagnostics : _zes_diag_handle_t { public: - virtual ~Diagnostics() {} + ~Diagnostics() override {} virtual ze_result_t diagnosticsGetProperties(zes_diag_properties_t *pProperties) = 0; virtual ze_result_t diagnosticsGetTests(uint32_t *pCount, zes_diag_test_t *pTests) = 0; virtual ze_result_t diagnosticsRunTests(uint32_t start, uint32_t end, zes_diag_result_t *pResult) = 0; @@ -46,7 +46,7 @@ struct DiagnosticsHandleContext { std::vector handleList = {}; private: - void createHandle(ze_device_handle_t deviceHandle, const std::string &DiagTests); + void createHandle(ze_device_handle_t deviceHandle, const std::string &diagTests); }; } // namespace L0 diff --git a/level_zero/tools/source/sysman/diagnostics/os_diagnostics.h b/level_zero/tools/source/sysman/diagnostics/os_diagnostics.h index 4394f853fa..b817258987 100644 --- a/level_zero/tools/source/sysman/diagnostics/os_diagnostics.h +++ b/level_zero/tools/source/sysman/diagnostics/os_diagnostics.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -21,7 +21,7 @@ class OsDiagnostics { virtual void osGetDiagProperties(zes_diag_properties_t *pProperties) = 0; virtual ze_result_t osGetDiagTests(uint32_t *pCount, zes_diag_test_t *pTests) = 0; virtual ze_result_t osRunDiagTests(uint32_t start, uint32_t end, zes_diag_result_t *pResult) = 0; - static std::unique_ptr create(OsSysman *pOsSysman, const std::string &DiagTests, ze_bool_t onSubdevice, uint32_t subdeviceId); + static std::unique_ptr create(OsSysman *pOsSysman, const std::string &diagTests, ze_bool_t onSubdevice, uint32_t subdeviceId); static void getSupportedDiagTestsFromFW(void *pOsSysman, std::vector &supportedDiagTests); virtual ~OsDiagnostics() {} }; diff --git a/level_zero/tools/source/sysman/diagnostics/windows/os_diagnostics_imp.cpp b/level_zero/tools/source/sysman/diagnostics/windows/os_diagnostics_imp.cpp index 398f9108f5..f6155afbc2 100644 --- a/level_zero/tools/source/sysman/diagnostics/windows/os_diagnostics_imp.cpp +++ b/level_zero/tools/source/sysman/diagnostics/windows/os_diagnostics_imp.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -19,7 +19,7 @@ ze_result_t WddmDiagnosticsImp::osRunDiagTests(uint32_t start, uint32_t end, zes return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } -std::unique_ptr OsDiagnostics::create(OsSysman *pOsSysman, const std::string &DiagTests, ze_bool_t onSubdevice, uint32_t subdeviceId) { +std::unique_ptr OsDiagnostics::create(OsSysman *pOsSysman, const std::string &diagTests, ze_bool_t onSubdevice, uint32_t subdeviceId) { std::unique_ptr pWddmDiagnosticsImp = std::make_unique(); return pWddmDiagnosticsImp; } diff --git a/level_zero/tools/source/sysman/fabric_port/fabric_port.h b/level_zero/tools/source/sysman/fabric_port/fabric_port.h index 15b6cc3252..5718ee3528 100644 --- a/level_zero/tools/source/sysman/fabric_port/fabric_port.h +++ b/level_zero/tools/source/sysman/fabric_port/fabric_port.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -30,7 +30,7 @@ class FabricDevice { class FabricPort : _zes_fabric_port_handle_t { public: - virtual ~FabricPort() = default; + ~FabricPort() override = default; virtual ze_result_t fabricPortGetProperties(zes_fabric_port_properties_t *pProperties) = 0; virtual ze_result_t fabricPortGetLinkType(zes_fabric_link_type_t *pLinkType) = 0; virtual ze_result_t fabricPortGetConfig(zes_fabric_port_config_t *pConfig) = 0; diff --git a/level_zero/tools/source/sysman/fabric_port/linux/fabric_device_access_imp.h b/level_zero/tools/source/sysman/fabric_port/linux/fabric_device_access_imp.h index 54fba7db0d..1b08609e8a 100644 --- a/level_zero/tools/source/sysman/fabric_port/linux/fabric_device_access_imp.h +++ b/level_zero/tools/source/sysman/fabric_port/linux/fabric_device_access_imp.h @@ -25,7 +25,7 @@ class FabricDeviceAccessNl : public FabricDeviceAccess { public: FabricDeviceAccessNl() = delete; FabricDeviceAccessNl(OsSysman *pOsSysman); - virtual ~FabricDeviceAccessNl(); + ~FabricDeviceAccessNl() override; ze_result_t getState(const zes_fabric_port_id_t portId, zes_fabric_port_state_t &state) override; ze_result_t getThroughput(const zes_fabric_port_id_t portId, zes_fabric_port_throughput_t &througput) override; diff --git a/level_zero/tools/source/sysman/fabric_port/linux/iaf_nl_api.h b/level_zero/tools/source/sysman/fabric_port/linux/iaf_nl_api.h index bf7bdb1d1e..264ac1aa1d 100644 --- a/level_zero/tools/source/sysman/fabric_port/linux/iaf_nl_api.h +++ b/level_zero/tools/source/sysman/fabric_port/linux/iaf_nl_api.h @@ -25,10 +25,10 @@ class IafNlApi; class Operation { public: uint16_t cmdOp; - bool done; + bool done = false; void *pOutput; - ze_result_t result; - Operation(uint16_t cmdOp, void *pOutput) : cmdOp(cmdOp), done(false), pOutput(pOutput), result(ZE_RESULT_ERROR_UNKNOWN) {} + ze_result_t result = ZE_RESULT_ERROR_UNKNOWN; + Operation(uint16_t cmdOp, void *pOutput) : cmdOp(cmdOp), pOutput(pOutput) {} }; class IafNlApi { diff --git a/level_zero/tools/source/sysman/firmware/firmware.h b/level_zero/tools/source/sysman/firmware/firmware.h index 4071c062d5..7bd0b467bb 100644 --- a/level_zero/tools/source/sysman/firmware/firmware.h +++ b/level_zero/tools/source/sysman/firmware/firmware.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -21,7 +21,7 @@ struct OsSysman; class Firmware : _zes_firmware_handle_t { public: - virtual ~Firmware() {} + ~Firmware() override {} virtual ze_result_t firmwareGetProperties(zes_firmware_properties_t *pProperties) = 0; virtual ze_result_t firmwareFlash(void *pImage, uint32_t size) = 0; diff --git a/level_zero/tools/source/sysman/frequency/frequency.h b/level_zero/tools/source/sysman/frequency/frequency.h index 36ec985c90..6a8b048443 100644 --- a/level_zero/tools/source/sysman/frequency/frequency.h +++ b/level_zero/tools/source/sysman/frequency/frequency.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -23,7 +23,7 @@ struct OsSysman; class Frequency : _zes_freq_handle_t { public: - virtual ~Frequency() {} + ~Frequency() override {} virtual ze_result_t frequencyGetProperties(zes_freq_properties_t *pProperties) = 0; virtual ze_result_t frequencyGetAvailableClocks(uint32_t *pCount, double *phFrequency) = 0; diff --git a/level_zero/tools/source/sysman/linux/firmware_util/firmware_util_imp.h b/level_zero/tools/source/sysman/linux/firmware_util/firmware_util_imp.h index c4f78021f4..a7ee8d41f1 100644 --- a/level_zero/tools/source/sysman/linux/firmware_util/firmware_util_imp.h +++ b/level_zero/tools/source/sysman/linux/firmware_util/firmware_util_imp.h @@ -65,7 +65,7 @@ extern pIgscDeviceClose deviceClose; class FirmwareUtilImp : public FirmwareUtil, NEO::NonCopyableOrMovableClass { public: FirmwareUtilImp(const std::string &pciBDF); - ~FirmwareUtilImp(); + ~FirmwareUtilImp() override; ze_result_t fwDeviceInit() override; ze_result_t getFirstDevice(igsc_device_info *) override; ze_result_t getFwVersion(std::string fwType, std::string &firmwareVersion) override; @@ -73,7 +73,7 @@ class FirmwareUtilImp : public FirmwareUtil, NEO::NonCopyableOrMovableClass { ze_result_t fwIfrApplied(bool &ifrStatus) override; ze_result_t fwSupportedDiagTests(std::vector &supportedDiagTests) override; ze_result_t fwRunDiagTests(std::string &osDiagType, zes_diag_result_t *pDiagResult) override; - virtual ze_result_t fwGetMemoryErrorCount(zes_ras_error_type_t type, uint32_t subDeviceCount, uint32_t subDeviceId, uint64_t &count) override; + ze_result_t fwGetMemoryErrorCount(zes_ras_error_type_t type, uint32_t subDeviceCount, uint32_t subDeviceId, uint64_t &count) override; void getDeviceSupportedFwTypes(std::vector &fwTypes) override; ze_result_t fwGetVersion(std::string &fwVersion); diff --git a/level_zero/tools/source/sysman/linux/fs_access.h b/level_zero/tools/source/sysman/linux/fs_access.h index badfb99f53..8547c59716 100644 --- a/level_zero/tools/source/sysman/linux/fs_access.h +++ b/level_zero/tools/source/sysman/linux/fs_access.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -105,14 +105,14 @@ class SysfsAccess : protected FsAccess { ze_result_t write(const std::string file, std::vector val); MOCKABLE_VIRTUAL ze_result_t scanDirEntries(const std::string path, std::vector &list); - MOCKABLE_VIRTUAL ze_result_t readSymLink(const std::string path, std::string &buf) override; + ze_result_t readSymLink(const std::string path, std::string &buf) override; ze_result_t getRealPath(const std::string path, std::string &buf) override; MOCKABLE_VIRTUAL ze_result_t bindDevice(const std::string device); MOCKABLE_VIRTUAL ze_result_t unbindDevice(const std::string device); - MOCKABLE_VIRTUAL bool fileExists(const std::string file) override; + bool fileExists(const std::string file) override; MOCKABLE_VIRTUAL bool isMyDeviceFile(const std::string dev); - MOCKABLE_VIRTUAL bool directoryExists(const std::string path) override; - MOCKABLE_VIRTUAL bool isRootUser() override; + bool directoryExists(const std::string path) override; + bool isRootUser() override; private: SysfsAccess(const std::string file); diff --git a/level_zero/tools/source/sysman/linux/pmu/pmu_imp.h b/level_zero/tools/source/sysman/linux/pmu/pmu_imp.h index 53e17a851f..3f38a2d4a2 100644 --- a/level_zero/tools/source/sysman/linux/pmu/pmu_imp.h +++ b/level_zero/tools/source/sysman/linux/pmu/pmu_imp.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -21,7 +21,7 @@ class PmuInterfaceImp : public PmuInterface, NEO::NonCopyableOrMovableClass { PmuInterfaceImp(LinuxSysmanImp *pLinuxSysmanImp); ~PmuInterfaceImp() override = default; int64_t pmuInterfaceOpen(uint64_t config, int group, uint32_t format) override; - MOCKABLE_VIRTUAL int pmuRead(int fd, uint64_t *data, ssize_t sizeOfdata) override; + int pmuRead(int fd, uint64_t *data, ssize_t sizeOfdata) override; protected: MOCKABLE_VIRTUAL int getErrorNo(); @@ -38,4 +38,4 @@ class PmuInterfaceImp : public PmuInterface, NEO::NonCopyableOrMovableClass { static const std::string sysDevicesDir; }; -} // namespace L0 \ No newline at end of file +} // namespace L0 diff --git a/level_zero/tools/source/sysman/performance/performance.h b/level_zero/tools/source/sysman/performance/performance.h index c53e4abd2d..4b0394f584 100644 --- a/level_zero/tools/source/sysman/performance/performance.h +++ b/level_zero/tools/source/sysman/performance/performance.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -21,7 +21,7 @@ struct OsSysman; class Performance : _zes_perf_handle_t { public: - virtual ~Performance() {} + ~Performance() override {} virtual ze_result_t performanceGetProperties(zes_perf_properties_t *pProperties) = 0; virtual ze_result_t performanceGetConfig(double *pFactor) = 0; virtual ze_result_t performanceSetConfig(double pFactor) = 0; diff --git a/level_zero/tools/source/sysman/ras/linux/os_ras_imp_prelim.h b/level_zero/tools/source/sysman/ras/linux/os_ras_imp_prelim.h index ba064ae1cc..26790c178b 100644 --- a/level_zero/tools/source/sysman/ras/linux/os_ras_imp_prelim.h +++ b/level_zero/tools/source/sysman/ras/linux/os_ras_imp_prelim.h @@ -56,11 +56,11 @@ class LinuxRasSources : NEO::NonCopyableOrMovableClass { class LinuxRasSourceGt : public LinuxRasSources { public: - virtual ze_result_t osRasGetState(zes_ras_state_t &state, ze_bool_t clear) override; + ze_result_t osRasGetState(zes_ras_state_t &state, ze_bool_t clear) override; static void getSupportedRasErrorTypes(std::set &errorType, OsSysman *pOsSysman, ze_device_handle_t deviceHandle); LinuxRasSourceGt(LinuxSysmanImp *pLinuxSysmanImp, zes_ras_error_type_t type, ze_bool_t onSubdevice, uint32_t subdeviceId); LinuxRasSourceGt() = default; - virtual ~LinuxRasSourceGt(); + ~LinuxRasSourceGt() override; protected: LinuxSysmanImp *pLinuxSysmanImp = nullptr; @@ -94,7 +94,7 @@ class LinuxRasSourceFabric : public LinuxRasSources { public: static ze_result_t getSupportedRasErrorTypes(std::set &errorType, OsSysman *pOsSysman, ze_device_handle_t deviceHandle); LinuxRasSourceFabric(OsSysman *pOsSysman, zes_ras_error_type_t type, uint32_t subDeviceId); - ~LinuxRasSourceFabric() = default; + ~LinuxRasSourceFabric() override = default; ze_result_t osRasGetState(zes_ras_state_t &state, ze_bool_t clear) override; @@ -108,11 +108,11 @@ class LinuxRasSourceFabric : public LinuxRasSources { class LinuxRasSourceHbm : public LinuxRasSources { public: - virtual ze_result_t osRasGetState(zes_ras_state_t &state, ze_bool_t clear) override; + ze_result_t osRasGetState(zes_ras_state_t &state, ze_bool_t clear) override; static void getSupportedRasErrorTypes(std::set &errorType, OsSysman *pOsSysman, ze_device_handle_t deviceHandle); LinuxRasSourceHbm(LinuxSysmanImp *pLinuxSysmanImp, zes_ras_error_type_t type, uint32_t subdeviceId); LinuxRasSourceHbm() = default; - virtual ~LinuxRasSourceHbm() override{}; + ~LinuxRasSourceHbm() override{}; protected: LinuxSysmanImp *pLinuxSysmanImp = nullptr; diff --git a/level_zero/tools/source/sysman/standby/standby.h b/level_zero/tools/source/sysman/standby/standby.h index 4b07cc267a..6ae648b3aa 100644 --- a/level_zero/tools/source/sysman/standby/standby.h +++ b/level_zero/tools/source/sysman/standby/standby.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -21,7 +21,7 @@ struct OsSysman; class Standby : _zes_standby_handle_t { public: - virtual ~Standby() {} + ~Standby() override {} virtual ze_result_t standbyGetProperties(zes_standby_properties_t *pProperties) = 0; virtual ze_result_t standbyGetMode(zes_standby_promo_mode_t *pMode) = 0; virtual ze_result_t standbySetMode(const zes_standby_promo_mode_t mode) = 0; diff --git a/level_zero/tools/source/sysman/sysman_const.h b/level_zero/tools/source/sysman/sysman_const.h index 7b863c96df..0c51f61a4b 100644 --- a/level_zero/tools/source/sysman/sysman_const.h +++ b/level_zero/tools/source/sysman/sysman_const.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -20,7 +20,6 @@ struct steadyClock { typedef duration::rep rep; typedef duration::period period; typedef std::chrono::time_point time_point; - static constexpr bool is_steady = true; static time_point now() noexcept { static auto epoch = std::chrono::steady_clock::now(); return time_point(std::chrono::duration_cast(std::chrono::steady_clock::now() - epoch)); @@ -60,4 +59,4 @@ constexpr uint64_t gigaUnitTransferToUnitTransfer = 1000 * 1000 * 1000; constexpr int32_t memoryBusWidth = 128; // bus width in bits constexpr int32_t numMemoryChannels = 8; -#define BITS(x, at, width) (((x) >> (at)) & ((1 << (width)) - 1)) \ No newline at end of file +#define BITS(x, at, width) (((x) >> (at)) & ((1 << (width)) - 1)) diff --git a/level_zero/tools/test/.clang-tidy b/level_zero/tools/test/.clang-tidy deleted file mode 100644 index c288dff55d..0000000000 --- a/level_zero/tools/test/.clang-tidy +++ /dev/null @@ -1,34 +0,0 @@ ---- -Checks: 'clang-diagnostic-*,clang-analyzer-*,google-default-arguments,modernize-use-override,modernize-use-default-member-init,-clang-analyzer-alpha*,readability-identifier-naming,-clang-analyzer-optin.performance.Padding,-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-cplusplus.NewDeleteLeaks,-clang-analyzer-core.CallAndMessage,-clang-analyzer-unix.MismatchedDeallocator,-clang-analyzer-core.NullDereference,-clang-analyzer-cplusplus.NewDelete,-clang-analyzer-optin.cplusplus.VirtualCall' -# WarningsAsErrors: '.*' -HeaderFilterRegex: '^((?!^third_party\/).+)\.(h|hpp|inl)$' -AnalyzeTemporaryDtors: false -CheckOptions: - - key: google-readability-braces-around-statements.ShortStatementLines - value: '1' - - key: google-readability-function-size.StatementThreshold - value: '800' - - key: google-readability-namespace-comments.ShortNamespaceLines - value: '10' - - key: google-readability-namespace-comments.SpacesBeforeComments - value: '2' - - key: readability-identifier-naming.ParameterCase - value: camelBack - - key: readability-identifier-naming.StructMemberCase - value: camelBack - - key: modernize-loop-convert.MaxCopySize - value: '16' - - key: modernize-loop-convert.MinConfidence - value: reasonable - - key: modernize-loop-convert.NamingStyle - value: CamelCase - - key: modernize-pass-by-value.IncludeStyle - value: llvm - - key: modernize-replace-auto-ptr.IncludeStyle - value: llvm - - key: modernize-use-nullptr.NullMacros - value: 'NULL' - - key: modernize-use-default-member-init.UseAssignment - value: '1' -... - diff --git a/level_zero/tools/test/black_box_tests/zello_metrics/zello_metrics.h b/level_zero/tools/test/black_box_tests/zello_metrics/zello_metrics.h index 2c37729e80..da87a8dec5 100644 --- a/level_zero/tools/test/black_box_tests/zello_metrics/zello_metrics.h +++ b/level_zero/tools/test/black_box_tests/zello_metrics/zello_metrics.h @@ -84,7 +84,7 @@ class SingleDeviceSingleQueueExecutionCtxt : public ExecutionContext { public: SingleDeviceSingleQueueExecutionCtxt(uint32_t deviceIndex, int32_t subDeviceIndex = -1) { initialize(deviceIndex, subDeviceIndex); } - virtual ~SingleDeviceSingleQueueExecutionCtxt() { finalize(); } + ~SingleDeviceSingleQueueExecutionCtxt() override { finalize(); } bool run() override; ze_driver_handle_t getDriverHandle(uint32_t index) override { return driverHandle; } @@ -110,7 +110,7 @@ class SingleDeviceSingleQueueExecutionCtxt : public ExecutionContext { class AppendMemoryCopyFromHeapToDeviceAndBackToHost : public Workload { public: AppendMemoryCopyFromHeapToDeviceAndBackToHost(ExecutionContext *execCtxt) : Workload(execCtxt) { initialize(); } - virtual ~AppendMemoryCopyFromHeapToDeviceAndBackToHost() { finalize(); }; + ~AppendMemoryCopyFromHeapToDeviceAndBackToHost() override { finalize(); }; bool appendCommands() override; bool validate() override; @@ -128,7 +128,7 @@ class AppendMemoryCopyFromHeapToDeviceAndBackToHost : public Workload { class CopyBufferToBuffer : public Workload { public: CopyBufferToBuffer(ExecutionContext *execCtxt) : Workload(execCtxt) { initialize(); } - virtual ~CopyBufferToBuffer() { finalize(); }; + ~CopyBufferToBuffer() override { finalize(); }; bool appendCommands() override; bool validate() override; @@ -151,14 +151,14 @@ class SingleMetricCollector : public Collector { SingleMetricCollector(ExecutionContext *executionCtxt, const char *metricGroupName, const zet_metric_group_sampling_type_flag_t samplingType); - virtual ~SingleMetricCollector() = default; + ~SingleMetricCollector() override = default; - virtual bool prefixCommands() override = 0; - virtual bool suffixCommands() override = 0; - virtual bool isDataAvailable() override = 0; - virtual bool start() override = 0; - virtual bool stop() override = 0; - virtual void showResults() override = 0; + bool prefixCommands() override = 0; + bool suffixCommands() override = 0; + bool isDataAvailable() override = 0; + bool start() override = 0; + bool stop() override = 0; + void showResults() override = 0; zet_metric_group_handle_t metricGroup = {}; zet_metric_group_sampling_type_flag_t samplingType = {}; @@ -170,7 +170,7 @@ class SingleMetricStreamerCollector : public SingleMetricCollector { SingleMetricStreamerCollector(ExecutionContext *executionCtxt, const char *metricGroupName); - virtual ~SingleMetricStreamerCollector() = default; + ~SingleMetricStreamerCollector() override = default; bool prefixCommands() override; bool suffixCommands() override; @@ -183,7 +183,7 @@ class SingleMetricStreamerCollector : public SingleMetricCollector { void setSamplingPeriod(uint32_t period) { samplingPeriod = period; } void setMaxRequestRawReportCount(uint32_t reportCount) { maxRequestRawReportCount = reportCount; } - virtual void showResults() override; + void showResults() override; protected: zet_metric_streamer_handle_t metricStreamer = {}; @@ -200,7 +200,7 @@ class SingleMetricQueryCollector : public SingleMetricCollector { SingleMetricQueryCollector(ExecutionContext *executionCtxt, const char *metricGroupName); - virtual ~SingleMetricQueryCollector() = default; + ~SingleMetricQueryCollector() override = default; bool prefixCommands() override; bool suffixCommands() override; diff --git a/level_zero/tools/test/unit_tests/sources/debug/debug_session_tests.cpp b/level_zero/tools/test/unit_tests/sources/debug/debug_session_tests.cpp index 2ab1f9941e..2bf96af64a 100644 --- a/level_zero/tools/test/unit_tests/sources/debug/debug_session_tests.cpp +++ b/level_zero/tools/test/unit_tests/sources/debug/debug_session_tests.cpp @@ -1605,7 +1605,7 @@ TEST_F(MultiTileDebugSessionTest, givenAllSlicesInRequestWhenAllInterruptsReturn } struct DebugSessionRegistersAccess { - void SetUp() { + void SetUp() { // NOLINT(readability-identifier-naming) zet_debug_config_t config = {}; config.pid = 0x1234; auto hwInfo = *NEO::defaultHwInfo.get(); @@ -1616,7 +1616,7 @@ struct DebugSessionRegistersAccess { session = std::make_unique(config, deviceImp.get()); } - void TearDown() { + void TearDown() { // NOLINT(readability-identifier-naming) } void dumpRegisterState() { diff --git a/level_zero/tools/test/unit_tests/sources/metrics/linux/test_metric_ip_sampling_linux_pvc_prelim.cpp b/level_zero/tools/test/unit_tests/sources/metrics/linux/test_metric_ip_sampling_linux_pvc_prelim.cpp index 83915ca25a..707fd9bdd0 100644 --- a/level_zero/tools/test/unit_tests/sources/metrics/linux/test_metric_ip_sampling_linux_pvc_prelim.cpp +++ b/level_zero/tools/test/unit_tests/sources/metrics/linux/test_metric_ip_sampling_linux_pvc_prelim.cpp @@ -46,7 +46,7 @@ class DrmPrelimMock : public DrmMock { rootDeviceEnvironment.setHwInfo(customHwInfo.get()); setupIoctlHelper(rootDeviceEnvironment.getHardwareInfo()->platform.eProductFamily); if (invokeQueryEngineInfo) { - queryEngineInfo(); + queryEngineInfo(); // NOLINT(clang-analyzer-optin.cplusplus.VirtualCall) } } diff --git a/level_zero/tools/test/unit_tests/sources/metrics/mock_metric_oa.h b/level_zero/tools/test/unit_tests/sources/metrics/mock_metric_oa.h index c429e1bac9..cead263b53 100644 --- a/level_zero/tools/test/unit_tests/sources/metrics/mock_metric_oa.h +++ b/level_zero/tools/test/unit_tests/sources/metrics/mock_metric_oa.h @@ -59,22 +59,22 @@ using MetricsLibraryApi::ValueType; struct MockMetricsLibraryApi { // Original api functions. - static StatusCode ML_STDCALL ContextCreate(ClientType_1_0 clientType, ContextCreateData_1_0 *createData, ContextHandle_1_0 *handle); - static StatusCode ML_STDCALL ContextDelete(const ContextHandle_1_0 handle); - static StatusCode ML_STDCALL GetParameter(const ParameterType parameter, ValueType *type, TypedValue_1_0 *value); - static StatusCode ML_STDCALL CommandBufferGet(const CommandBufferData_1_0 *data); - static StatusCode ML_STDCALL CommandBufferGetSize(const CommandBufferData_1_0 *data, CommandBufferSize_1_0 *size); - static StatusCode ML_STDCALL QueryCreate(const QueryCreateData_1_0 *createData, QueryHandle_1_0 *handle); - static StatusCode ML_STDCALL QueryDelete(const QueryHandle_1_0 handle); - static StatusCode ML_STDCALL OverrideCreate(const OverrideCreateData_1_0 *createData, OverrideHandle_1_0 *handle); - static StatusCode ML_STDCALL OverrideDelete(const OverrideHandle_1_0 handle); - static StatusCode ML_STDCALL MarkerCreate(const MarkerCreateData_1_0 *createData, MarkerHandle_1_0 *handle); - static StatusCode ML_STDCALL MarkerDelete(const MarkerHandle_1_0 handle); - static StatusCode ML_STDCALL ConfigurationCreate(const ConfigurationCreateData_1_0 *createData, ConfigurationHandle_1_0 *handle); - static StatusCode ML_STDCALL ConfigurationActivate(const ConfigurationHandle_1_0 handle, const ConfigurationActivateData_1_0 *activateData); - static StatusCode ML_STDCALL ConfigurationDeactivate(const ConfigurationHandle_1_0 handle); - static StatusCode ML_STDCALL ConfigurationDelete(const ConfigurationHandle_1_0 handle); - static StatusCode ML_STDCALL GetData(GetReportData_1_0 *data); + static StatusCode ML_STDCALL ContextCreate(ClientType_1_0 clientType, ContextCreateData_1_0 *createData, ContextHandle_1_0 *handle); // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL ContextDelete(const ContextHandle_1_0 handle); // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL GetParameter(const ParameterType parameter, ValueType *type, TypedValue_1_0 *value); // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL CommandBufferGet(const CommandBufferData_1_0 *data); // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL CommandBufferGetSize(const CommandBufferData_1_0 *data, CommandBufferSize_1_0 *size); // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL QueryCreate(const QueryCreateData_1_0 *createData, QueryHandle_1_0 *handle); // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL QueryDelete(const QueryHandle_1_0 handle); // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL OverrideCreate(const OverrideCreateData_1_0 *createData, OverrideHandle_1_0 *handle); // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL OverrideDelete(const OverrideHandle_1_0 handle); // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL MarkerCreate(const MarkerCreateData_1_0 *createData, MarkerHandle_1_0 *handle); // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL MarkerDelete(const MarkerHandle_1_0 handle); // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL ConfigurationCreate(const ConfigurationCreateData_1_0 *createData, ConfigurationHandle_1_0 *handle); // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL ConfigurationActivate(const ConfigurationHandle_1_0 handle, const ConfigurationActivateData_1_0 *activateData); // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL ConfigurationDeactivate(const ConfigurationHandle_1_0 handle); // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL ConfigurationDelete(const ConfigurationHandle_1_0 handle); // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL GetData(GetReportData_1_0 *data); // NOLINT(readability-identifier-naming) // Mocked api functions. MOCK_METHOD(StatusCode, MockContextCreate, (ClientType_1_0 clientType, ContextCreateData_1_0 *createData, ContextHandle_1_0 *handle)); @@ -122,7 +122,7 @@ struct Mock : public MetricsLibrary { // Mocked metrics library api version. // We cannot use a static instance here since the gtest validates memory usage, // and mocked functions will stay in memory longer than the test. - static MockMetricsLibraryApi *g_mockApi; + static MockMetricsLibraryApi *g_mockApi; // NOLINT(readability-identifier-naming) }; template <> diff --git a/level_zero/tools/test/unit_tests/sources/metrics/mock_metric_oa_enumeration.h b/level_zero/tools/test/unit_tests/sources/metrics/mock_metric_oa_enumeration.h index eae1b4228b..c6ef044705 100644 --- a/level_zero/tools/test/unit_tests/sources/metrics/mock_metric_oa_enumeration.h +++ b/level_zero/tools/test/unit_tests/sources/metrics/mock_metric_oa_enumeration.h @@ -57,10 +57,10 @@ using MetricsDiscovery::TTypedValue_1_0; struct MockMetricsDiscoveryApi { // Original api functions. - static TCompletionCode MD_STDCALL OpenMetricsDeviceFromFile(const char *fileName, void *openParams, IMetricsDeviceLatest **device); - static TCompletionCode MD_STDCALL CloseMetricsDevice(IMetricsDeviceLatest *device); - static TCompletionCode MD_STDCALL SaveMetricsDeviceToFile(const char *fileName, void *saveParams, IMetricsDeviceLatest *device); - static TCompletionCode MD_STDCALL OpenAdapterGroup(IAdapterGroupLatest **adapterGroup); + static TCompletionCode MD_STDCALL OpenMetricsDeviceFromFile(const char *fileName, void *openParams, IMetricsDeviceLatest **device); // NOLINT(readability-identifier-naming) + static TCompletionCode MD_STDCALL CloseMetricsDevice(IMetricsDeviceLatest *device); // NOLINT(readability-identifier-naming) + static TCompletionCode MD_STDCALL SaveMetricsDeviceToFile(const char *fileName, void *saveParams, IMetricsDeviceLatest *device); // NOLINT(readability-identifier-naming) + static TCompletionCode MD_STDCALL OpenAdapterGroup(IAdapterGroupLatest **adapterGroup); // NOLINT(readability-identifier-naming) // Mocked api functions. MOCK_METHOD(TCompletionCode, MockOpenMetricsDeviceFromFile, (const char *, void *, IMetricsDevice_1_5 **)); @@ -189,7 +189,7 @@ struct Mock : public MetricEnumeration { ze_result_t baseLoadMetricsDiscovery() { return MetricEnumeration::loadMetricsDiscovery(); } // Mock metrics discovery api. - static MockMetricsDiscoveryApi *g_mockApi; + static MockMetricsDiscoveryApi *g_mockApi; // NOLINT(readability-identifier-naming) // Original metric enumeration obtained from metric context. ::L0::MetricEnumeration *metricEnumeration = nullptr; diff --git a/level_zero/tools/test/unit_tests/sources/sysman/diagnostics/linux/test_zes_sysman_diagnostics.cpp b/level_zero/tools/test/unit_tests/sources/sysman/diagnostics/linux/test_zes_sysman_diagnostics.cpp index edb39004bc..a952e7b043 100644 --- a/level_zero/tools/test/unit_tests/sources/sysman/diagnostics/linux/test_zes_sysman_diagnostics.cpp +++ b/level_zero/tools/test/unit_tests/sources/sysman/diagnostics/linux/test_zes_sysman_diagnostics.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -59,12 +59,7 @@ class ZesDiagnosticsFixture : public SysmanDeviceFixture { pLinuxSysmanImp->pFwUtilInterface = pFwUtilInterfaceOld; } - std::vector get_diagnostics_handles(uint32_t &count) { - std::vector handles(count, nullptr); - EXPECT_EQ(zesDeviceEnumDiagnosticTestSuites(device->toHandle(), &count, handles.data()), ZE_RESULT_SUCCESS); - return handles; - } - void clear_and_reinit_handles(std::vector &deviceHandles) { + void clearAndReinitHandles(std::vector &deviceHandles) { for (const auto &handle : pSysmanDeviceImp->pDiagnosticsHandleContext->handleList) { delete handle; } @@ -156,7 +151,7 @@ TEST_F(ZesDiagnosticsFixture, GivenFwInterfaceAsNullWhenCallingzesDeviceEnumDiag TEST_F(ZesDiagnosticsFixture, GivenFailedFirmwareInitializationWhenInitializingDiagnosticsContextThenexpectNoHandles) { std::vector deviceHandles; - clear_and_reinit_handles(deviceHandles); + clearAndReinitHandles(deviceHandles); ON_CALL(*pMockFwInterface.get(), fwDeviceInit()) .WillByDefault(::testing::Invoke(pMockFwInterface.get(), &Mock::mockFwDeviceInitFail)); pSysmanDeviceImp->pDiagnosticsHandleContext->init(deviceHandles); @@ -166,7 +161,7 @@ TEST_F(ZesDiagnosticsFixture, GivenFailedFirmwareInitializationWhenInitializingD TEST_F(ZesDiagnosticsFixture, GivenSupportedTestsWhenInitializingDiagnosticsContextThenExpectHandles) { std::vector deviceHandles; - clear_and_reinit_handles(deviceHandles); + clearAndReinitHandles(deviceHandles); pSysmanDeviceImp->pDiagnosticsHandleContext->supportedDiagTests.push_back(mockSupportedDiagTypes[0]); pSysmanDeviceImp->pDiagnosticsHandleContext->init(deviceHandles); EXPECT_EQ(1u, pSysmanDeviceImp->pDiagnosticsHandleContext->handleList.size()); @@ -174,7 +169,7 @@ TEST_F(ZesDiagnosticsFixture, GivenSupportedTestsWhenInitializingDiagnosticsCont TEST_F(ZesDiagnosticsFixture, GivenFirmwareInitializationFailureThenCreateHandleMustFail) { std::vector deviceHandles; - clear_and_reinit_handles(deviceHandles); + clearAndReinitHandles(deviceHandles); ON_CALL(*pMockFwInterface.get(), fwDeviceInit()) .WillByDefault(::testing::Invoke(pMockFwInterface.get(), &Mock::mockFwDeviceInitFail)); pSysmanDeviceImp->pDiagnosticsHandleContext->init(deviceHandles); @@ -183,7 +178,7 @@ TEST_F(ZesDiagnosticsFixture, GivenFirmwareInitializationFailureThenCreateHandle TEST_F(ZesDiagnosticsFixture, GivenValidDiagnosticsHandleWhenGettingDiagnosticsPropertiesThenCallSucceeds) { std::vector deviceHandles; - clear_and_reinit_handles(deviceHandles); + clearAndReinitHandles(deviceHandles); DiagnosticsImp *ptestDiagnosticsImp = new DiagnosticsImp(pSysmanDeviceImp->pDiagnosticsHandleContext->pOsSysman, mockSupportedDiagTypes[0], deviceHandles[0]); pSysmanDeviceImp->pDiagnosticsHandleContext->handleList.push_back(ptestDiagnosticsImp); @@ -194,7 +189,7 @@ TEST_F(ZesDiagnosticsFixture, GivenValidDiagnosticsHandleWhenGettingDiagnosticsP TEST_F(ZesDiagnosticsFixture, GivenValidDiagnosticsHandleWhenGettingDiagnosticsTestThenCallSucceeds) { std::vector deviceHandles; - clear_and_reinit_handles(deviceHandles); + clearAndReinitHandles(deviceHandles); DiagnosticsImp *ptestDiagnosticsImp = new DiagnosticsImp(pSysmanDeviceImp->pDiagnosticsHandleContext->pOsSysman, mockSupportedDiagTypes[0], deviceHandles[0]); pSysmanDeviceImp->pDiagnosticsHandleContext->handleList.push_back(ptestDiagnosticsImp); @@ -209,7 +204,7 @@ TEST_F(ZesDiagnosticsFixture, GivenValidDiagnosticsHandleWhenGettingDiagnosticsT TEST_F(ZesDiagnosticsFixture, GivenValidDiagnosticsHandleWhenRunningDiagnosticsTestThenCallSucceeds) { std::vector deviceHandles; - clear_and_reinit_handles(deviceHandles); + clearAndReinitHandles(deviceHandles); DiagnosticsImp *ptestDiagnosticsImp = new DiagnosticsImp(pSysmanDeviceImp->pDiagnosticsHandleContext->pOsSysman, mockSupportedDiagTypes[0], deviceHandles[0]); pSysmanDeviceImp->pDiagnosticsHandleContext->handleList.push_back(ptestDiagnosticsImp); diff --git a/level_zero/tools/test/unit_tests/sources/sysman/fan/linux/test_zes_fan.cpp b/level_zero/tools/test/unit_tests/sources/sysman/fan/linux/test_zes_fan.cpp index 0934c459d0..228d4cb2b8 100644 --- a/level_zero/tools/test/unit_tests/sources/sysman/fan/linux/test_zes_fan.cpp +++ b/level_zero/tools/test/unit_tests/sources/sysman/fan/linux/test_zes_fan.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -32,7 +32,7 @@ class SysmanDeviceFanFixture : public SysmanDeviceFixture { SysmanDeviceFixture::TearDown(); } - std::vector get_fan_handles(uint32_t count) { + std::vector getFanHandles(uint32_t count) { std::vector handles(count, nullptr); EXPECT_EQ(zesDeviceEnumFans(device->toHandle(), &count, handles.data()), ZE_RESULT_SUCCESS); return handles; @@ -68,7 +68,7 @@ TEST_F(SysmanDeviceFanFixture, GivenComponentCountZeroWhenEnumeratingFanDomainsT } TEST_F(SysmanDeviceFanFixture, GivenValidFanHandleWhenGettingFanPropertiesThenCallSucceeds) { - auto handles = get_fan_handles(fanHandleComponentCount); + auto handles = getFanHandles(fanHandleComponentCount); for (auto handle : handles) { zes_fan_properties_t properties; @@ -77,7 +77,7 @@ TEST_F(SysmanDeviceFanFixture, GivenValidFanHandleWhenGettingFanPropertiesThenCa } TEST_F(SysmanDeviceFanFixture, GivenValidFanHandleWhenGettingFanConfigThenUnsupportedIsReturned) { - auto handles = get_fan_handles(fanHandleComponentCount); + auto handles = getFanHandles(fanHandleComponentCount); for (auto handle : handles) { zes_fan_config_t fanConfig; @@ -86,7 +86,7 @@ TEST_F(SysmanDeviceFanFixture, GivenValidFanHandleWhenGettingFanConfigThenUnsupp } TEST_F(SysmanDeviceFanFixture, GivenValidFanHandleWhenSettingDefaultModeThenUnsupportedIsReturned) { - auto handles = get_fan_handles(fanHandleComponentCount); + auto handles = getFanHandles(fanHandleComponentCount); for (auto handle : handles) { EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, zesFanSetDefaultMode(handle)); @@ -94,7 +94,7 @@ TEST_F(SysmanDeviceFanFixture, GivenValidFanHandleWhenSettingDefaultModeThenUnsu } TEST_F(SysmanDeviceFanFixture, GivenValidFanHandleWhenSettingFixedSpeedModeThenUnsupportedIsReturned) { - auto handles = get_fan_handles(fanHandleComponentCount); + auto handles = getFanHandles(fanHandleComponentCount); for (auto handle : handles) { zes_fan_speed_t fanSpeed = {0}; @@ -103,7 +103,7 @@ TEST_F(SysmanDeviceFanFixture, GivenValidFanHandleWhenSettingFixedSpeedModeThenU } TEST_F(SysmanDeviceFanFixture, GivenValidFanHandleWhenSettingTheSpeedTableModeThenUnsupportedIsReturned) { - auto handles = get_fan_handles(fanHandleComponentCount); + auto handles = getFanHandles(fanHandleComponentCount); for (auto handle : handles) { zes_fan_speed_table_t fanSpeedTable = {0}; @@ -112,7 +112,7 @@ TEST_F(SysmanDeviceFanFixture, GivenValidFanHandleWhenSettingTheSpeedTableModeTh } TEST_F(SysmanDeviceFanFixture, GivenValidFanHandleWhenGettingFanSpeedWithRPMUnitThenValidFanSpeedReadingsRetrieved) { - auto handles = get_fan_handles(fanHandleComponentCount); + auto handles = getFanHandles(fanHandleComponentCount); for (auto handle : handles) { zes_fan_speed_units_t unit = zes_fan_speed_units_t::ZES_FAN_SPEED_UNITS_RPM; @@ -122,7 +122,7 @@ TEST_F(SysmanDeviceFanFixture, GivenValidFanHandleWhenGettingFanSpeedWithRPMUnit } TEST_F(SysmanDeviceFanFixture, GivenValidFanHandleWhenGettingFanSpeedWithPercentUnitThenUnsupportedIsReturned) { - auto handles = get_fan_handles(fanHandleComponentCount); + auto handles = getFanHandles(fanHandleComponentCount); for (auto handle : handles) { zes_fan_speed_units_t unit = zes_fan_speed_units_t::ZES_FAN_SPEED_UNITS_PERCENT; diff --git a/level_zero/tools/test/unit_tests/sources/sysman/fan/windows/test_zes_sysman_fan.cpp b/level_zero/tools/test/unit_tests/sources/sysman/fan/windows/test_zes_sysman_fan.cpp index 68ea9833dd..9d2a074ce0 100644 --- a/level_zero/tools/test/unit_tests/sources/sysman/fan/windows/test_zes_sysman_fan.cpp +++ b/level_zero/tools/test/unit_tests/sources/sysman/fan/windows/test_zes_sysman_fan.cpp @@ -54,7 +54,7 @@ class SysmanDeviceFanFixture : public SysmanDeviceFixture { pWddmSysmanImp->pKmdSysManager = pOriginalKmdSysManager; } - std::vector get_fan_handles() { + std::vector getFanHandles() { uint32_t count = 0; EXPECT_EQ(zesDeviceEnumFans(device->toHandle(), &count, nullptr), ZE_RESULT_SUCCESS); std::vector handles(count, nullptr); @@ -101,7 +101,7 @@ TEST_F(SysmanDeviceFanFixture, GivenValidFanHandleWhenGettingFanPropertiesAllowS // Setting allow set calls or not init(true, true); - auto handles = get_fan_handles(); + auto handles = getFanHandles(); for (auto handle : handles) { zes_fan_properties_t properties; @@ -123,7 +123,7 @@ TEST_F(SysmanDeviceFanFixture, GivenValidFanHandleWhenGettingFanPropertiesAllowS // Setting allow set calls or not init(false, true); - auto handles = get_fan_handles(); + auto handles = getFanHandles(); for (auto handle : handles) { zes_fan_properties_t properties = {}; @@ -146,7 +146,7 @@ TEST_F(SysmanDeviceFanFixture, GivenValidFanHandleWhenGettingFanPropertiesAllowS // Setting allow set calls or not init(true, true); - auto handles = get_fan_handles(); + auto handles = getFanHandles(); for (auto handle : handles) { zes_fan_properties_t properties; @@ -168,7 +168,7 @@ TEST_F(SysmanDeviceFanFixture, GivenValidFanHandleWhenGettingFanConfigThenUnsupp // Setting allow set calls or not init(true, true); - auto handles = get_fan_handles(); + auto handles = getFanHandles(); for (auto handle : handles) { zes_fan_config_t fanConfig; @@ -180,7 +180,7 @@ TEST_F(SysmanDeviceFanFixture, GivenValidFanHandleWhenSettingDefaultModeThenSupp // Setting allow set calls or not init(true, true); - auto handles = get_fan_handles(); + auto handles = getFanHandles(); for (auto handle : handles) { EXPECT_EQ(ZE_RESULT_SUCCESS, zesFanSetDefaultMode(handle)); @@ -191,7 +191,7 @@ TEST_F(SysmanDeviceFanFixture, GivenValidFanHandleWhenSettingFixedSpeedModeThenU // Setting allow set calls or not init(true, true); - auto handles = get_fan_handles(); + auto handles = getFanHandles(); for (auto handle : handles) { zes_fan_speed_t fanSpeed = {0}; @@ -203,7 +203,7 @@ TEST_F(SysmanDeviceFanFixture, GivenValidFanHandleWhenSettingTheSpeedTableModeWi // Setting allow set calls or not init(true, true); - auto handles = get_fan_handles(); + auto handles = getFanHandles(); for (auto handle : handles) { zes_fan_speed_table_t fanSpeedTable = {0}; @@ -215,7 +215,7 @@ TEST_F(SysmanDeviceFanFixture, GivenValidFanHandleWhenSettingTheSpeedTableModeWi // Setting allow set calls or not init(true, true); - auto handles = get_fan_handles(); + auto handles = getFanHandles(); for (auto handle : handles) { zes_fan_speed_table_t fanSpeedTable = {0}; @@ -228,7 +228,7 @@ TEST_F(SysmanDeviceFanFixture, GivenValidFanHandleWhenGettingFanSpeedWithRPMUnit // Setting allow set calls or not init(true, true); - auto handles = get_fan_handles(); + auto handles = getFanHandles(); for (auto handle : handles) { zes_fan_speed_units_t unit = zes_fan_speed_units_t::ZES_FAN_SPEED_UNITS_RPM; @@ -244,7 +244,7 @@ TEST_F(SysmanDeviceFanFixture, GivenValidFanHandleWhenGettingFanSpeedWithPercent // Setting allow set calls or not init(true, true); - auto handles = get_fan_handles(); + auto handles = getFanHandles(); for (auto handle : handles) { zes_fan_speed_units_t unit = zes_fan_speed_units_t::ZES_FAN_SPEED_UNITS_PERCENT; diff --git a/level_zero/tools/test/unit_tests/sources/sysman/firmware/linux/test_zes_sysman_firmware.cpp b/level_zero/tools/test/unit_tests/sources/sysman/firmware/linux/test_zes_sysman_firmware.cpp index 41696a39f1..0de8585564 100644 --- a/level_zero/tools/test/unit_tests/sources/sysman/firmware/linux/test_zes_sysman_firmware.cpp +++ b/level_zero/tools/test/unit_tests/sources/sysman/firmware/linux/test_zes_sysman_firmware.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -57,7 +57,7 @@ class ZesFirmwareFixture : public SysmanDeviceFixture { pLinuxSysmanImp->pFsAccess = pFsAccessOriginal; } - std::vector get_firmware_handles(uint32_t count) { + std::vector getFirmwareHandles(uint32_t count) { std::vector handles(count, nullptr); EXPECT_EQ(zesDeviceEnumFirmwares(device->toHandle(), &count, handles.data()), ZE_RESULT_SUCCESS); return handles; @@ -113,7 +113,7 @@ TEST_F(ZesFirmwareFixture, GivenValidFirmwareHandleWhenGettingFirmwareProperties ON_CALL(*pMockFwInterface.get(), getFwVersion(_, _)) .WillByDefault(::testing::Invoke(pMockFwInterface.get(), &Mock::mockGetFwVersion)); - auto handles = get_firmware_handles(mockHandleCount); + auto handles = getFirmwareHandles(mockHandleCount); zes_firmware_properties_t properties = {}; EXPECT_EQ(ZE_RESULT_SUCCESS, zesFirmwareGetProperties(handles[0], &properties)); @@ -131,7 +131,7 @@ TEST_F(ZesFirmwareFixture, GivenValidFirmwareHandleWhenGettingOpromPropertiesThe ON_CALL(*pMockFwInterface.get(), getFwVersion(_, _)) .WillByDefault(::testing::Invoke(pMockFwInterface.get(), &Mock::mockGetFwVersion)); - auto handles = get_firmware_handles(mockHandleCount); + auto handles = getFirmwareHandles(mockHandleCount); zes_firmware_properties_t properties = {}; EXPECT_EQ(ZE_RESULT_SUCCESS, zesFirmwareGetProperties(handles[1], &properties)); @@ -175,7 +175,7 @@ TEST_F(ZesFirmwareFixture, GivenValidFirmwareHandleWhenFlashingGscFirmwareThenSu ON_CALL(*pMockFwInterface.get(), flashFirmware(_, _, _)) .WillByDefault(::testing::Return(ZE_RESULT_SUCCESS)); - auto handles = get_firmware_handles(mockHandleCount); + auto handles = getFirmwareHandles(mockHandleCount); uint8_t testImage[ZES_STRING_PROPERTY_SIZE] = {}; memset(testImage, 0xA, ZES_STRING_PROPERTY_SIZE); for (auto handle : handles) { @@ -225,7 +225,7 @@ TEST_F(ZesFirmwareFixture, GivenValidFirmwareHandleFirmwareLibraryCallFailureWhe .WillByDefault(::testing::Return(ZE_RESULT_ERROR_UNINITIALIZED)); pSysmanDeviceImp->pFirmwareHandleContext->init(); - auto handles = get_firmware_handles(mockHandleCount); + auto handles = getFirmwareHandles(mockHandleCount); zes_firmware_properties_t properties = {}; EXPECT_EQ(ZE_RESULT_SUCCESS, zesFirmwareGetProperties(handles[0], &properties)); diff --git a/level_zero/tools/test/unit_tests/sources/sysman/frequency/linux/test_zes_frequency.cpp b/level_zero/tools/test/unit_tests/sources/sysman/frequency/linux/test_zes_frequency.cpp index d58c83fab1..d31968c4ef 100644 --- a/level_zero/tools/test/unit_tests/sources/sysman/frequency/linux/test_zes_frequency.cpp +++ b/level_zero/tools/test/unit_tests/sources/sysman/frequency/linux/test_zes_frequency.cpp @@ -98,7 +98,7 @@ class SysmanDeviceFrequencyFixture : public SysmanDeviceFixture { return static_cast(actualClock); } - std::vector get_freq_handles(uint32_t count) { + std::vector getFreqHandles(uint32_t count) { std::vector handles(count, nullptr); EXPECT_EQ(zesDeviceEnumFrequencyDomains(device->toHandle(), &count, handles.data()), ZE_RESULT_SUCCESS); return handles; @@ -115,7 +115,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenComponentCountZeroWhenEnumeratingFrequ EXPECT_EQ(ZE_RESULT_SUCCESS, zesDeviceEnumFrequencyDomains(device->toHandle(), &testCount, nullptr)); EXPECT_EQ(count, testCount); - auto handles = get_freq_handles(count); + auto handles = getFreqHandles(count); for (auto handle : handles) { EXPECT_NE(handle, nullptr); } @@ -142,7 +142,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenActualComponentCountTwoWhenTryingToGet } TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFrequencyGetPropertiesThenSuccessIsReturned) { - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); for (auto handle : handles) { EXPECT_NE(handle, nullptr); zes_freq_properties_t properties; @@ -157,7 +157,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFreq } TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleAndZeroCountWhenCallingzesFrequencyGetAvailableClocksThenCallSucceeds) { - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); for (auto handle : handles) { EXPECT_NE(handle, nullptr); uint32_t count = 0; @@ -167,7 +167,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleAndZeroCountWhenCa } TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleAndZeroCountWhenCountIsMoreThanNumClocksThenCallSucceeds) { - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); for (auto handle : handles) { EXPECT_NE(handle, nullptr); uint32_t count = 80; @@ -177,7 +177,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleAndZeroCountWhenCo } TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleAndZeroCountWhenCountIsLessThanNumClocksThenCallSucceeds) { - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); for (auto handle : handles) { EXPECT_NE(handle, nullptr); uint32_t count = 20; @@ -186,7 +186,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleAndZeroCountWhenCo } TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleAndCorrectCountWhenCallingzesFrequencyGetAvailableClocksThenCallSucceeds) { - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); for (auto handle : handles) { uint32_t count = 0; @@ -220,7 +220,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenValidateFrequencyGetRangeWhengetMaxAnd } TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFrequencyGetRangeThenVerifyzesFrequencyGetRangeTestCallSucceeds) { - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); for (auto handle : handles) { zes_freq_range_t limits; EXPECT_EQ(ZE_RESULT_SUCCESS, zesFrequencyGetRange(handle, &limits)); @@ -262,7 +262,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyLimitsWhenCallingFrequen } TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFrequencySetRangeThenVerifyzesFrequencySetRangeTest1CallSucceeds) { - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); for (auto handle : handles) { const double startingMin = 900.0; const double newMax = 600.0; @@ -282,7 +282,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFreq } TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFrequencySetRangeThenVerifyzesFrequencySetRangeTest2CallSucceeds) { - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); for (auto handle : handles) { const double startingMax = 600.0; const double newMin = 900.0; @@ -312,7 +312,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenInvalidFrequencyLimitsWhenCallingFrequ } TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFrequencyGetStateThenVerifyzesFrequencyGetStateTestCallSucceeds) { - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); for (auto handle : handles) { const double testRequestValue = 450.0; const double testTdpValue = 1200.0; @@ -350,7 +350,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFreq pSysmanDeviceImp->pFrequencyHandleContext->handleList.clear(); pSysmanDeviceImp->pFrequencyHandleContext->init(deviceHandles); - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); for (auto handle : handles) { const double testRequestValue = 400.0; const double testTdpValue = 1100.0; @@ -401,7 +401,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFreq } TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFrequencyGetStateThenVerifyzesFrequencyThrottleReasonAveragePower) { - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); for (auto handle : handles) { zes_freq_state_t state; uint32_t validReason = 1; @@ -414,7 +414,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFreq } TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFrequencyGetStateThenVerifyzesFrequencyThrottleReasonBurstPower) { - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); for (auto handle : handles) { zes_freq_state_t state; uint32_t validReason = 1; @@ -427,7 +427,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFreq } TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFrequencyGetStateThenVerifyzesFrequencyThrottleReasonsCurrentExcursion) { - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); for (auto handle : handles) { zes_freq_state_t state; uint32_t validReason = 1; @@ -440,7 +440,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFreq } TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFrequencyGetStateThenVerifyzesFrequencyThrottleReasonsThermalExcursion) { - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); for (auto handle : handles) { zes_freq_state_t state; uint32_t validReason = 1; @@ -453,7 +453,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFreq } TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFrequencyGetStateThenVerifyzesFrequencyThrottleReasonsInvalidThermalExcursion) { - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); for (auto handle : handles) { zes_freq_state_t state; uint32_t validReason = 1; @@ -594,7 +594,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFreq } pSysmanDeviceImp->pFrequencyHandleContext->handleList.clear(); pSysmanDeviceImp->pFrequencyHandleContext->init(deviceHandles); - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); double minFreqLegacy = 400.0; double maxFreqLegacy = 1200.0; pSysfsAccess->setValLegacy(minFreqFileLegacy, minFreqLegacy); @@ -721,7 +721,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenOnSubdeviceSetWhenValidatingAnyFrequen } TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFrequencySetRangeAndIfgetMaxFailsThenVerifyzesFrequencySetRangeTestCallFail) { - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); for (auto handle : handles) { const double startingMax = 600.0; const double newMin = 900.0; @@ -739,7 +739,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFreq } TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFrequencySetRangeAndIfsetMaxFailsThenVerifyzesFrequencySetRangeTestCallFail) { - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); for (auto handle : handles) { const double startingMax = 600.0; const double newMin = 900.0; @@ -757,7 +757,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFreq } TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFrequencyOcGetFrequencyTargetThenVerifyTestCallFail) { - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); for (auto handle : handles) { double freqTarget = 0.0; EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, zesFrequencyOcGetFrequencyTarget(handle, &freqTarget)); @@ -765,7 +765,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFreq } TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFrequencyOcSetFrequencyTargetThenVerifyTestCallFail) { - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); for (auto handle : handles) { double freqTarget = 0.0; EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, zesFrequencyOcSetFrequencyTarget(handle, freqTarget)); @@ -773,7 +773,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFreq } TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFrequencyOcGetVoltageTargetThenVerifyTestCallFail) { - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); for (auto handle : handles) { double voltTarget = 0.0, voltOffset = 0.0; EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, zesFrequencyOcGetVoltageTarget(handle, &voltTarget, &voltOffset)); @@ -781,7 +781,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFreq } TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFrequencyOcSetVoltageTargetThenVerifyTestCallFail) { - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); for (auto handle : handles) { double voltTarget = 0.0, voltOffset = 0.0; EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, zesFrequencyOcSetVoltageTarget(handle, voltTarget, voltOffset)); @@ -789,7 +789,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFreq } TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFrequencyOcSetModeThenVerifyTestCallFail) { - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); for (auto handle : handles) { zes_oc_mode_t mode = ZES_OC_MODE_OFF; EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, zesFrequencyOcSetMode(handle, mode)); @@ -797,7 +797,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFreq } TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFrequencyOcGetModeThenVerifyTestCallFail) { - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); for (auto handle : handles) { zes_oc_mode_t mode = ZES_OC_MODE_OFF; EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, zesFrequencyOcGetMode(handle, &mode)); @@ -805,7 +805,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFreq } TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFrequencyOcGetCapabilitiesThenVerifyTestCallFail) { - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); for (auto handle : handles) { zes_oc_capabilities_t caps = {}; EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, zesFrequencyOcGetCapabilities(handle, &caps)); @@ -813,7 +813,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFreq } TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFrequencyOcGetIccMaxThenVerifyTestCallFail) { - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); for (auto handle : handles) { double iccMax = 0.0; EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, zesFrequencyOcGetIccMax(handle, &iccMax)); @@ -821,7 +821,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFreq } TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFrequencyOcSetIccMaxThenVerifyTestCallFail) { - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); for (auto handle : handles) { double iccMax = 0.0; EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, zesFrequencyOcSetIccMax(handle, iccMax)); @@ -829,7 +829,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFreq } TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFrequencyOcGetTjMaxThenVerifyTestCallFail) { - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); for (auto handle : handles) { double tjMax = 0.0; EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, zesFrequencyOcGetTjMax(handle, &tjMax)); @@ -837,7 +837,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFreq } TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFrequencyOcSetTjMaxThenVerifyTestCallFail) { - auto handles = get_freq_handles(handleComponentCount); + auto handles = getFreqHandles(handleComponentCount); for (auto handle : handles) { double tjMax = 0.0; EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, zesFrequencyOcSetTjMax(handle, tjMax)); diff --git a/level_zero/tools/test/unit_tests/sources/sysman/linux/mock_fw_util_fixture.h b/level_zero/tools/test/unit_tests/sources/sysman/linux/mock_fw_util_fixture.h index f57a50ab8b..84da436e22 100644 --- a/level_zero/tools/test/unit_tests/sources/sysman/linux/mock_fw_util_fixture.h +++ b/level_zero/tools/test/unit_tests/sources/sysman/linux/mock_fw_util_fixture.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -38,7 +38,7 @@ struct MockLinuxFwUtilInterface : public LinuxFwUtilInterface { class LinuxOsLibrary : public OsLibrary {}; struct MockOsLibrary : public LinuxOsLibrary { public: - virtual ~MockOsLibrary() = default; + ~MockOsLibrary() override = default; void *getProcAddress(const std::string &procName) override { return nullptr; } diff --git a/level_zero/tools/test/unit_tests/sources/sysman/linux/test_sysman.cpp b/level_zero/tools/test/unit_tests/sources/sysman/linux/test_sysman.cpp index c105341b86..e7c20f2d6a 100644 --- a/level_zero/tools/test/unit_tests/sources/sysman/linux/test_sysman.cpp +++ b/level_zero/tools/test/unit_tests/sources/sysman/linux/test_sysman.cpp @@ -377,7 +377,7 @@ class UnknownDriverModel : public DriverModel { void setGmmInputArgs(void *args) override {} uint32_t getDeviceHandle() const override { return 0u; } PhysicalDevicePciBusInfo getPciBusInfo() const override { - PhysicalDevicePciBusInfo pciBusInfo(PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue); + PhysicalDevicePciBusInfo pciBusInfo(PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue); return pciBusInfo; } PhyicalDevicePciSpeedInfo getPciSpeedInfo() const override { return {}; } diff --git a/level_zero/tools/test/unit_tests/sources/sysman/memory/linux/test_sysman_memory.cpp b/level_zero/tools/test/unit_tests/sources/sysman/memory/linux/test_sysman_memory.cpp index 23a468c760..f6c83bfa79 100644 --- a/level_zero/tools/test/unit_tests/sources/sysman/memory/linux/test_sysman_memory.cpp +++ b/level_zero/tools/test/unit_tests/sources/sysman/memory/linux/test_sysman_memory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -82,7 +82,7 @@ class SysmanDeviceMemoryFixture : public SysmanDeviceFixture { pSysmanDeviceImp->pMemoryHandleContext->init(deviceHandles); } - std::vector get_memory_handles(uint32_t count) { + std::vector getMemoryHandles(uint32_t count) { std::vector handles(count, nullptr); EXPECT_EQ(zesDeviceEnumMemoryModules(device->toHandle(), &count, handles.data()), ZE_RESULT_SUCCESS); return handles; @@ -143,7 +143,7 @@ TEST_F(SysmanDeviceMemoryFixture, GivenComponentCountZeroWhenEnumeratingMemoryMo TEST_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingZetSysmanMemoryGetPropertiesThenVerifySysmanMemoryGetPropertiesCallReturnSuccess) { setLocalSupportedAndReinit(true); - auto handles = get_memory_handles(memoryHandleComponentCount); + auto handles = getMemoryHandles(memoryHandleComponentCount); for (auto handle : handles) { zes_mem_properties_t properties; @@ -153,7 +153,7 @@ TEST_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingZetSysmanMemo TEST_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingZetSysmanMemoryGetStateThenVerifySysmanMemoryGetStateCallReturnUnsupportedFeature) { setLocalSupportedAndReinit(true); - auto handles = get_memory_handles(memoryHandleComponentCount); + auto handles = getMemoryHandles(memoryHandleComponentCount); for (auto handle : handles) { zes_mem_state_t state; @@ -163,7 +163,7 @@ TEST_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingZetSysmanMemo TEST_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingZetSysmanMemoryGetBandwidthThenVerifySysmanMemoryGetBandwidthCallReturnUnsupportedFeature) { setLocalSupportedAndReinit(true); - auto handles = get_memory_handles(memoryHandleComponentCount); + auto handles = getMemoryHandles(memoryHandleComponentCount); for (auto handle : handles) { zes_mem_bandwidth_t bandwidth; diff --git a/level_zero/tools/test/unit_tests/sources/sysman/memory/linux/test_sysman_memory_dg1.cpp b/level_zero/tools/test/unit_tests/sources/sysman/memory/linux/test_sysman_memory_dg1.cpp index 34af60c3e4..e15dbe7b74 100644 --- a/level_zero/tools/test/unit_tests/sources/sysman/memory/linux/test_sysman_memory_dg1.cpp +++ b/level_zero/tools/test/unit_tests/sources/sysman/memory/linux/test_sysman_memory_dg1.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -99,7 +99,7 @@ class SysmanDeviceMemoryFixture : public SysmanDeviceFixture { pSysmanDeviceImp->pMemoryHandleContext->init(deviceHandles); } - std::vector get_memory_handles(uint32_t count) { + std::vector getMemoryHandles(uint32_t count) { std::vector handles(count, nullptr); EXPECT_EQ(zesDeviceEnumMemoryModules(device->toHandle(), &count, handles.data()), ZE_RESULT_SUCCESS); return handles; @@ -180,7 +180,7 @@ TEST_F(SysmanDeviceMemoryFixture, GivenComponentCountZeroWhenEnumeratingMemoryMo TEST_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenGettingPropertiesWithLocalMemoryThenCallSucceeds) { setLocalSupportedAndReinit(true); - auto handles = get_memory_handles(memoryHandleComponentCount); + auto handles = getMemoryHandles(memoryHandleComponentCount); for (auto handle : handles) { zes_mem_properties_t properties; @@ -201,7 +201,7 @@ TEST_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenGettingPropertiesWit TEST_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenGettingStateThenCallSucceeds) { setLocalSupportedAndReinit(true); - auto handles = get_memory_handles(memoryHandleComponentCount); + auto handles = getMemoryHandles(memoryHandleComponentCount); for (auto handle : handles) { zes_mem_state_t state; @@ -221,7 +221,7 @@ TEST_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleAndIfQueryMemoryInfoFail ON_CALL(*pDrm, queryMemoryInfo()) .WillByDefault(::testing::Invoke(pDrm, &Mock::queryMemoryInfoMockReturnFalse)); - auto handles = get_memory_handles(memoryHandleComponentCount); + auto handles = getMemoryHandles(memoryHandleComponentCount); for (auto handle : handles) { zes_mem_state_t state; @@ -235,7 +235,7 @@ TEST_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleAndIfQueryMemoryInfoAndI ON_CALL(*pDrm, queryMemoryInfo()) .WillByDefault(::testing::Invoke(pDrm, &Mock::queryMemoryInfoMockReturnFakeTrue)); - auto handles = get_memory_handles(memoryHandleComponentCount); + auto handles = getMemoryHandles(memoryHandleComponentCount); for (auto handle : handles) { zes_mem_state_t state; @@ -246,7 +246,7 @@ TEST_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleAndIfQueryMemoryInfoAndI TEST_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenGettingBandwidthThenZeResultErrorUnsupportedFeatureIsReturned) { setLocalSupportedAndReinit(true); - auto handles = get_memory_handles(memoryHandleComponentCount); + auto handles = getMemoryHandles(memoryHandleComponentCount); for (auto handle : handles) { zes_mem_bandwidth_t bandwidth; diff --git a/level_zero/tools/test/unit_tests/sources/sysman/memory/windows/test_zes_memory.cpp b/level_zero/tools/test/unit_tests/sources/sysman/memory/windows/test_zes_memory.cpp index ef69a6d340..ad761b350b 100644 --- a/level_zero/tools/test/unit_tests/sources/sysman/memory/windows/test_zes_memory.cpp +++ b/level_zero/tools/test/unit_tests/sources/sysman/memory/windows/test_zes_memory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -97,7 +97,7 @@ class SysmanDeviceMemoryFixture : public SysmanDeviceFixture { pSysmanDeviceImp->pMemoryHandleContext->init(deviceHandles); } - std::vector get_memory_handles(uint32_t count) { + std::vector getMemoryHandles(uint32_t count) { std::vector handles(count, nullptr); EXPECT_EQ(zesDeviceEnumMemoryModules(device->toHandle(), &count, handles.data()), ZE_RESULT_SUCCESS); return handles; @@ -153,7 +153,7 @@ TEST_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingGettingProper pKmdSysManager->mockMemoryLocation = KmdSysman::MemoryLocationsType::DeviceMemory; setLocalSupportedAndReinit(true); - auto handles = get_memory_handles(memoryHandleComponentCount); + auto handles = getMemoryHandles(memoryHandleComponentCount); for (auto handle : handles) { zes_mem_properties_t properties; @@ -173,7 +173,7 @@ TEST_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingGettingProper TEST_F(SysmanDeviceMemoryFixture, DISABLED_GivenValidMemoryHandleWhenGettingStateThenCallSucceeds) { setLocalSupportedAndReinit(true); - auto handles = get_memory_handles(memoryHandleComponentCount); + auto handles = getMemoryHandles(memoryHandleComponentCount); for (auto handle : handles) { zes_mem_state_t state; @@ -189,7 +189,7 @@ TEST_F(SysmanDeviceMemoryFixture, DISABLED_GivenValidMemoryHandleWhenGettingStat TEST_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenGettingBandwidthThenCallSucceeds) { setLocalSupportedAndReinit(true); - auto handles = get_memory_handles(memoryHandleComponentCount); + auto handles = getMemoryHandles(memoryHandleComponentCount); for (auto handle : handles) { zes_mem_bandwidth_t bandwidth; diff --git a/level_zero/tools/test/unit_tests/sources/sysman/mocks/mock_sysman_device_info.h b/level_zero/tools/test/unit_tests/sources/sysman/mocks/mock_sysman_device_info.h index 73ad7b3d04..f8f022f2cd 100644 --- a/level_zero/tools/test/unit_tests/sources/sysman/mocks/mock_sysman_device_info.h +++ b/level_zero/tools/test/unit_tests/sources/sysman/mocks/mock_sysman_device_info.h @@ -21,7 +21,7 @@ namespace ult { class SysmanMultiDeviceInfoFixture : public ::testing::Test { public: - void SetUp() { + void SetUp() override { if (!sysmanUltsEnable) { GTEST_SKIP(); } @@ -39,7 +39,7 @@ class SysmanMultiDeviceInfoFixture : public ::testing::Test { driverHandle->initialize(std::move(devices)); device = driverHandle->devices[0]; } - void TearDown() {} + void TearDown() override {} NEO::MockDevice *neoDevice = nullptr; L0::Device *device = nullptr; std::unique_ptr> driverHandle; @@ -50,4 +50,4 @@ class SysmanMultiDeviceInfoFixture : public ::testing::Test { }; } // namespace ult -} // namespace L0 \ No newline at end of file +} // namespace L0 diff --git a/level_zero/tools/test/unit_tests/sources/sysman/performance/linux/test_zes_performance.cpp b/level_zero/tools/test/unit_tests/sources/sysman/performance/linux/test_zes_performance.cpp index ae81af685d..e84a018a1c 100644 --- a/level_zero/tools/test/unit_tests/sources/sysman/performance/linux/test_zes_performance.cpp +++ b/level_zero/tools/test/unit_tests/sources/sysman/performance/linux/test_zes_performance.cpp @@ -43,12 +43,6 @@ class ZesPerformanceFixture : public SysmanMultiDeviceFixture { } SysmanMultiDeviceFixture::TearDown(); } - - std::vector get_perf_handles(uint32_t count) { - std::vector handles(count, nullptr); - EXPECT_EQ(zesDeviceEnumPerformanceFactorDomains(device->toHandle(), &count, handles.data()), ZE_RESULT_SUCCESS); - return handles; - } }; TEST_F(ZesPerformanceFixture, GivenValidSysmanHandleWhenRetrievingPerfThenZeroHandlesInReturn) { diff --git a/level_zero/tools/test/unit_tests/sources/sysman/ras/linux/test_zes_ras.cpp b/level_zero/tools/test/unit_tests/sources/sysman/ras/linux/test_zes_ras.cpp index 62630cc85a..855103a6f3 100644 --- a/level_zero/tools/test/unit_tests/sources/sysman/ras/linux/test_zes_ras.cpp +++ b/level_zero/tools/test/unit_tests/sources/sysman/ras/linux/test_zes_ras.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -53,7 +53,7 @@ struct SysmanRasFixture : public SysmanDeviceFixture { pLinuxSysmanImp->pFsAccess = pFsAccessOriginal; } - std::vector get_ras_handles(uint32_t count) { + std::vector getRasHandles(uint32_t count) { std::vector handles(count, nullptr); EXPECT_EQ(zesDeviceEnumRasErrorSets(device->toHandle(), &count, handles.data()), ZE_RESULT_SUCCESS); return handles; @@ -96,7 +96,7 @@ TEST_F(SysmanRasFixture, GivenValidRasHandleWhenGettingRasPropertiesThenSuccessI RasImp *pTestRasImp = new RasImp(pSysmanDeviceImp->pRasHandleContext->pOsSysman, ZES_RAS_ERROR_TYPE_CORRECTABLE, device->toHandle()); pSysmanDeviceImp->pRasHandleContext->handleList.push_back(pTestRasImp); - auto handles = get_ras_handles(mockHandleCount + 1); + auto handles = getRasHandles(mockHandleCount + 1); for (auto handle : handles) { zes_ras_properties_t properties = {}; @@ -114,7 +114,7 @@ TEST_F(SysmanRasFixture, GivenValidRasHandleWhileCallingZesRasGetStateThenFailur RasImp *pTestRasImp = new RasImp(pSysmanDeviceImp->pRasHandleContext->pOsSysman, ZES_RAS_ERROR_TYPE_CORRECTABLE, device->toHandle()); pSysmanDeviceImp->pRasHandleContext->handleList.push_back(pTestRasImp); - auto handles = get_ras_handles(mockHandleCount + 1); + auto handles = getRasHandles(mockHandleCount + 1); for (auto handle : handles) { zes_ras_state_t state = {}; @@ -128,7 +128,7 @@ TEST_F(SysmanRasFixture, GivenValidRasHandleWhenCallingzesRasGetConfigAfterzesRa RasImp *pTestRasImp = new RasImp(pSysmanDeviceImp->pRasHandleContext->pOsSysman, ZES_RAS_ERROR_TYPE_CORRECTABLE, device->toHandle()); pSysmanDeviceImp->pRasHandleContext->handleList.push_back(pTestRasImp); - auto handles = get_ras_handles(mockHandleCount + 1); + auto handles = getRasHandles(mockHandleCount + 1); for (auto handle : handles) { zes_ras_config_t setConfig = {}; @@ -151,7 +151,7 @@ TEST_F(SysmanRasFixture, GivenValidRasHandleWhenCallingzesRasSetConfigWithoutPer RasImp *pTestRasImp = new RasImp(pSysmanDeviceImp->pRasHandleContext->pOsSysman, ZES_RAS_ERROR_TYPE_CORRECTABLE, device->toHandle()); pSysmanDeviceImp->pRasHandleContext->handleList.push_back(pTestRasImp); - auto handles = get_ras_handles(mockHandleCount + 1); + auto handles = getRasHandles(mockHandleCount + 1); for (auto handle : handles) { zes_ras_config_t setConfig = {}; @@ -166,7 +166,7 @@ TEST_F(SysmanRasFixture, GivenValidInstanceWhenOsRasImplementationIsNullThenDest RasImp *pTestRasImp = new RasImp(); pTestRasImp->pOsRas = nullptr; - EXPECT_NO_THROW(delete pTestRasImp;); + EXPECT_NO_THROW(delete pTestRasImp;); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) } } // namespace ult diff --git a/level_zero/tools/test/unit_tests/sources/sysman/scheduler/linux/mock_sysfs_scheduler.h b/level_zero/tools/test/unit_tests/sources/sysman/scheduler/linux/mock_sysfs_scheduler.h index abf10b1f26..9088b23c3f 100644 --- a/level_zero/tools/test/unit_tests/sources/sysman/scheduler/linux/mock_sysfs_scheduler.h +++ b/level_zero/tools/test/unit_tests/sources/sysman/scheduler/linux/mock_sysfs_scheduler.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -161,7 +161,7 @@ struct Mock : public SysfsAccess { return ZE_RESULT_ERROR_UNKNOWN; } - for (std::string mappedEngine : listOfMockedEngines) { + for (std::string mappedEngine : listOfMockedEngines) { // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) if (file.find(mappedEngine) == std::string::npos) { continue; } diff --git a/level_zero/tools/test/unit_tests/sources/sysman/scheduler/linux/test_zes_scheduler.cpp b/level_zero/tools/test/unit_tests/sources/sysman/scheduler/linux/test_zes_scheduler.cpp index ab5a330e1d..e1870fdc53 100644 --- a/level_zero/tools/test/unit_tests/sources/sysman/scheduler/linux/test_zes_scheduler.cpp +++ b/level_zero/tools/test/unit_tests/sources/sysman/scheduler/linux/test_zes_scheduler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -96,7 +96,7 @@ class SysmanDeviceSchedulerFixture : public SysmanDeviceFixture { pLinuxSysmanImp->pSysfsAccess = pSysfsAccessOld; } - std::vector get_sched_handles(uint32_t count) { + std::vector getSchedHandles(uint32_t count) { std::vector handles(count, nullptr); EXPECT_EQ(zesDeviceEnumSchedulers(device->toHandle(), &count, handles.data()), ZE_RESULT_SUCCESS); return handles; @@ -156,7 +156,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenComponentCountZeroWhenCallingzesDevice } TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedulerGetCurrentModeThenVerifyzesSchedulerGetCurrentModeCallSucceeds) { - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { auto mode = fixtureGetCurrentMode(handle); EXPECT_EQ(mode, ZES_SCHED_MODE_TIMESLICE); @@ -164,7 +164,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul } TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedulerGetTimeoutModePropertiesThenVerifyzesSchedulerGetTimeoutModePropertiesCallSucceeds) { - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { auto config = fixtureGetTimeoutModeProperties(handle, false); EXPECT_EQ(config.watchdogTimeout, expectedHeartbeatTimeoutMicroSecs); @@ -172,7 +172,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul } TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedulerGetTimeoutModePropertiesThenVerifyzesSchedulerGetTimeoutModePropertiesForDifferingValues) { - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); pSysfsAccess->setVal(engineDir + "/" + "vcs1" + "/" + heartbeatIntervalMilliSecs, (heartbeatMilliSecs + 5)); for (auto handle : handles) { @@ -188,7 +188,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul } TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedulerGetTimeoutModePropertiesWithDefaultsThenVerifyzesSchedulerGetTimeoutModePropertiesCallSucceeds) { - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { auto config = fixtureGetTimeoutModeProperties(handle, true); EXPECT_EQ(config.watchdogTimeout, expectedDefaultHeartbeatTimeoutMicroSecs); @@ -196,7 +196,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul } TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedulerGetTimesliceModePropertiesThenVerifyzesSchedulerGetTimesliceModePropertiesCallSucceeds) { - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { auto config = fixtureGetTimesliceModeProperties(handle, false); EXPECT_EQ(config.interval, expectedTimesliceMicroSecs); @@ -205,7 +205,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul } TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedulerGetTimescliceModePropertiesThenVerifyzesSchedulerGetTimescliceModePropertiesForDifferingPreemptTimeoutValues) { - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); pSysfsAccess->setVal(engineDir + "/" + "vcs1" + "/" + preemptTimeoutMilliSecs, (timeoutMilliSecs + 5)); for (auto handle : handles) { @@ -221,7 +221,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul } TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedulerGetTimescliceModePropertiesThenVerifyzesSchedulerGetTimescliceModePropertiesForDifferingTimesliceDurationValues) { - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); pSysfsAccess->setVal(engineDir + "/" + "vcs1" + "/" + timesliceDurationMilliSecs, (timesliceMilliSecs + 5)); for (auto handle : handles) { @@ -237,7 +237,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul } TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedulerGetTimeoutModePropertiesThenVerifyzesSchedulerGetTimeoutModePropertiesForReadFileFailureFileUnavailable) { - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { zes_sched_properties_t properties = {}; @@ -255,7 +255,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul } TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedulerGetTimeoutModePropertiesThenVerifyzesSchedulerGetTimeoutModePropertiesForReadFileFailureInsufficientPermissions) { - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { zes_sched_properties_t properties = {}; @@ -273,7 +273,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul } TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedulerGetTimescliceModePropertiesThenVerifyzesSchedulerGetTimescliceModePropertiesForReadFileFailureDueToUnavailable) { - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { zes_sched_timeslice_properties_t config; zes_sched_properties_t properties = {}; @@ -293,7 +293,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul } TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedulerGetTimescliceModePropertiesThenVerifyzesSchedulerGetTimescliceModePropertiesForReadFileFailureDueToInsufficientPermissions) { - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { zes_sched_timeslice_properties_t config; zes_sched_properties_t properties = {}; @@ -310,7 +310,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul } TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedulerGetTimesliceModePropertiesWithDefaultsThenVerifyzesSchedulerGetTimesliceModePropertiesCallSucceeds) { - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { auto config = fixtureGetTimesliceModeProperties(handle, true); EXPECT_EQ(config.interval, expectedDefaultTimesliceMicroSecs); @@ -319,7 +319,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul } TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedulerSetTimeoutModeThenVerifyzesSchedulerSetTimeoutModeCallSucceeds) { - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { ze_bool_t needReboot; zes_sched_timeout_properties_t setConfig; @@ -335,7 +335,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul } TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedulerSetTimeoutModeWhenTimeoutLessThanMinimumThenVerifyzesSchedulerSetTimeoutModeCallFails) { - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { ze_bool_t needReboot; zes_sched_timeout_properties_t setConfig; @@ -346,7 +346,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul } TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedulerSetTimeoutModeWhenCurrentModeIsTimeoutModeThenVerifyzesSchedulerSetTimeoutModeCallSucceeds) { - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { ze_bool_t needReboot; zes_sched_timeout_properties_t setTimeOutConfig; @@ -364,7 +364,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul [=](std::string engineName) { pSysfsAccess->setFileProperties(engineName, heartbeatIntervalMilliSecs, false, S_IRUSR | S_IRGRP | S_IROTH | S_IWUSR); }); - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { ze_bool_t needReboot; zes_sched_timeout_properties_t setTimeOutConfig; @@ -379,7 +379,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul [=](std::string engineName) { pSysfsAccess->setFileProperties(engineName, preemptTimeoutMilliSecs, false, S_IRUSR | S_IRGRP | S_IROTH | S_IWUSR); }); - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { ze_bool_t needReboot; zes_sched_timeout_properties_t setConfig; @@ -394,7 +394,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul [=](std::string engineName) { pSysfsAccess->setFileProperties(engineName, preemptTimeoutMilliSecs, true, S_IRUSR | S_IRGRP | S_IROTH); }); - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { ze_bool_t needReboot; zes_sched_timeout_properties_t setConfig; @@ -409,7 +409,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul [=](std::string engineName) { pSysfsAccess->setFileProperties(engineName, timesliceDurationMilliSecs, true, S_IRUSR | S_IRGRP | S_IROTH); }); - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { ze_bool_t needReboot; zes_sched_timeout_properties_t setConfig; @@ -420,7 +420,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul } TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedulerSetTimesliceModeThenVerifyzesSchedulerSetTimesliceModeCallSucceeds) { - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { ze_bool_t needReboot; zes_sched_timeslice_properties_t setConfig; @@ -438,7 +438,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul } TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedulerSetTimesliceModeWhenIntervalIsLessThanMinimumThenVerifyzesSchedulerSetTimesliceModeCallFails) { - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { ze_bool_t needReboot; zes_sched_timeslice_properties_t setConfig; @@ -454,7 +454,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul [=](std::string engineName) { pSysfsAccess->setFileProperties(engineName, timesliceDurationMilliSecs, true, S_IRUSR | S_IRGRP | S_IROTH); }); - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { ze_bool_t needReboot; zes_sched_timeslice_properties_t setConfig; @@ -470,7 +470,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul [=](std::string engineName) { pSysfsAccess->setFileProperties(engineName, heartbeatIntervalMilliSecs, true, S_IRUSR | S_IRGRP | S_IROTH); }); - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { ze_bool_t needReboot; zes_sched_timeslice_properties_t setConfig; @@ -482,7 +482,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul } TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedulerSetExclusiveModeThenVerifyzesSchedulerSetExclusiveModeCallSucceeds) { - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { ze_bool_t needReboot; ze_result_t result = zesSchedulerSetExclusiveMode(handle, &needReboot); @@ -498,7 +498,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul [=](std::string engineName) { pSysfsAccess->setFileProperties(engineName, preemptTimeoutMilliSecs, false, S_IRUSR | S_IRGRP | S_IROTH | S_IWUSR); }); - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { ze_bool_t needReboot; ze_result_t result = zesSchedulerSetExclusiveMode(handle, &needReboot); @@ -511,7 +511,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul [=](std::string engineName) { pSysfsAccess->setFileProperties(engineName, timesliceDurationMilliSecs, false, S_IRUSR | S_IRGRP | S_IROTH | S_IWUSR); }); - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { ze_bool_t needReboot; ze_result_t result = zesSchedulerSetExclusiveMode(handle, &needReboot); @@ -524,7 +524,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul [=](std::string engineName) { pSysfsAccess->setFileProperties(engineName, timesliceDurationMilliSecs, true, S_IRUSR | S_IRGRP | S_IROTH); }); - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { ze_bool_t needReboot; ze_result_t result = zesSchedulerSetExclusiveMode(handle, &needReboot); @@ -537,7 +537,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul [=](std::string engineName) { pSysfsAccess->setFileProperties(engineName, preemptTimeoutMilliSecs, false, S_IRUSR | S_IRGRP | S_IROTH | S_IWUSR); }); - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { zes_sched_mode_t mode; ze_result_t result = zesSchedulerGetCurrentMode(handle, &mode); @@ -550,7 +550,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul [=](std::string engineName) { pSysfsAccess->setFileProperties(engineName, timesliceDurationMilliSecs, false, S_IRUSR | S_IRGRP | S_IROTH | S_IWUSR); }); - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { zes_sched_mode_t mode; ze_result_t result = zesSchedulerGetCurrentMode(handle, &mode); @@ -563,7 +563,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul [=](std::string engineName) { pSysfsAccess->setFileProperties(engineName, timesliceDurationMilliSecs, true, S_IRGRP | S_IROTH | S_IWUSR); }); - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { zes_sched_mode_t mode; ze_result_t result = zesSchedulerGetCurrentMode(handle, &mode); @@ -572,7 +572,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul } TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedulerSetComputeUnitDebugModeThenUnsupportedFeatureIsReturned) { - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { ze_bool_t needReload; ze_result_t result = zesSchedulerSetComputeUnitDebugMode(handle, &needReload); @@ -583,7 +583,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedulerGetTimeoutModePropertiesWithDefaultsWhenSysfsNodeIsAbsentThenFailureIsReturned) { ON_CALL(*pSysfsAccess.get(), read(_, _)) .WillByDefault(::testing::Invoke(pSysfsAccess.get(), &Mock::getValForError)); - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { zes_sched_timeout_properties_t config; ze_result_t result = zesSchedulerGetTimeoutModeProperties(handle, true, &config); @@ -594,7 +594,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedulerGetTimesliceModePropertiesWithDefaultsWhenSysfsNodeIsAbsentThenFailureIsReturned) { ON_CALL(*pSysfsAccess.get(), read(_, _)) .WillByDefault(::testing::Invoke(pSysfsAccess.get(), &Mock::getValForError)); - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { zes_sched_timeslice_properties_t config; ze_result_t result = zesSchedulerGetTimesliceModeProperties(handle, true, &config); @@ -605,7 +605,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedulerSetTimesliceModeWhenSysfsNodeIsAbsentThenFailureIsReturned) { ON_CALL(*pSysfsAccess.get(), write(_, _)) .WillByDefault(::testing::Invoke(pSysfsAccess.get(), &Mock::getValForErrorWhileWrite)); - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { ze_bool_t needReboot; zes_sched_timeslice_properties_t setConfig; @@ -619,7 +619,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedulerSetTimesliceModeWhenSysfsNodeWithoutPermissionsThenFailureIsReturned) { ON_CALL(*pSysfsAccess.get(), write(_, _)) .WillByDefault(::testing::Invoke(pSysfsAccess.get(), &Mock::getValForErrorWhileWrite)); - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { ze_bool_t needReboot; zes_sched_timeslice_properties_t setConfig; @@ -634,7 +634,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul } TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedulerGetPropertiesThenVerifyzesSchedulerGetPropertiesCallSucceeds) { - auto handles = get_sched_handles(handleComponentCount); + auto handles = getSchedHandles(handleComponentCount); for (auto handle : handles) { zes_sched_properties_t properties = {}; ze_result_t result = zesSchedulerGetProperties(handle, &properties); diff --git a/level_zero/tools/test/unit_tests/sources/sysman/standby/linux/test_zes_sysman_standby.cpp b/level_zero/tools/test/unit_tests/sources/sysman/standby/linux/test_zes_sysman_standby.cpp index 7d19441031..d711a10466 100644 --- a/level_zero/tools/test/unit_tests/sources/sysman/standby/linux/test_zes_sysman_standby.cpp +++ b/level_zero/tools/test/unit_tests/sources/sysman/standby/linux/test_zes_sysman_standby.cpp @@ -61,7 +61,7 @@ class ZesStandbyFixture : public SysmanDeviceFixture { SysmanDeviceFixture::TearDown(); } - std::vector get_standby_handles(uint32_t count) { + std::vector getStandbyHandles(uint32_t count) { std::vector handles(count, nullptr); EXPECT_EQ(zesDeviceEnumStandbyDomains(device, &count, handles.data()), ZE_RESULT_SUCCESS); return handles; @@ -114,7 +114,7 @@ TEST_F(ZesStandbyFixture, GivenComponentCountZeroWhenCallingzesStandbyGetThenNon TEST_F(ZesStandbyFixture, GivenValidStandbyHandleWhenCallingzesStandbyGetPropertiesThenVerifyzesStandbyGetPropertiesCallSucceeds) { zes_standby_properties_t properties = {}; - auto handles = get_standby_handles(mockHandleCount); + auto handles = getStandbyHandles(mockHandleCount); for (auto hSysmanStandby : handles) { EXPECT_EQ(ZE_RESULT_SUCCESS, zesStandbyGetProperties(hSysmanStandby, &properties)); @@ -126,7 +126,7 @@ TEST_F(ZesStandbyFixture, GivenValidStandbyHandleWhenCallingzesStandbyGetPropert TEST_F(ZesStandbyFixture, GivenValidStandbyHandleWhenCallingzesStandbyGetModeThenVerifyzesStandbyGetModeCallSucceedsForDefaultMode) { zes_standby_promo_mode_t mode = {}; - auto handles = get_standby_handles(mockHandleCount); + auto handles = getStandbyHandles(mockHandleCount); for (auto hSysmanStandby : handles) { EXPECT_EQ(ZE_RESULT_SUCCESS, zesStandbyGetMode(hSysmanStandby, &mode)); @@ -137,7 +137,7 @@ TEST_F(ZesStandbyFixture, GivenValidStandbyHandleWhenCallingzesStandbyGetModeThe TEST_F(ZesStandbyFixture, GivenValidStandbyHandleWhenCallingzesStandbyGetModeThenVerifyzesStandbyGetModeCallSucceedsForNeverMode) { zes_standby_promo_mode_t mode = {}; ptestSysfsAccess->setVal(standbyModeFile, standbyModeNever); - auto handles = get_standby_handles(mockHandleCount); + auto handles = getStandbyHandles(mockHandleCount); for (auto hSysmanStandby : handles) { EXPECT_EQ(ZE_RESULT_SUCCESS, zesStandbyGetMode(hSysmanStandby, &mode)); @@ -149,7 +149,7 @@ TEST_F(ZesStandbyFixture, GivenInvalidStandbyFileWhenReadisCalledThenExpectFailu zes_standby_promo_mode_t mode = {}; ptestSysfsAccess->setValReturnError(ZE_RESULT_ERROR_NOT_AVAILABLE); - auto handles = get_standby_handles(mockHandleCount); + auto handles = getStandbyHandles(mockHandleCount); for (auto hSysmanStandby : handles) { EXPECT_NE(ZE_RESULT_SUCCESS, zesStandbyGetMode(hSysmanStandby, &mode)); @@ -159,7 +159,7 @@ TEST_F(ZesStandbyFixture, GivenInvalidStandbyFileWhenReadisCalledThenExpectFailu TEST_F(ZesStandbyFixture, GivenValidStandbyHandleWhenCallingzesStandbyGetModeThenVerifyzesStandbyGetModeCallFailsForInvalidMode) { zes_standby_promo_mode_t mode = {}; ptestSysfsAccess->setVal(standbyModeFile, standbyModeInvalid); - auto handles = get_standby_handles(mockHandleCount); + auto handles = getStandbyHandles(mockHandleCount); for (auto hSysmanStandby : handles) { EXPECT_EQ(ZE_RESULT_ERROR_UNKNOWN, zesStandbyGetMode(hSysmanStandby, &mode)); @@ -169,7 +169,7 @@ TEST_F(ZesStandbyFixture, GivenValidStandbyHandleWhenCallingzesStandbyGetModeThe TEST_F(ZesStandbyFixture, GivenValidStandbyHandleWhenCallingzesStandbyGetModeOnUnavailableFileThenVerifyzesStandbyGetModeCallFailsForUnsupportedFeature) { zes_standby_promo_mode_t mode = {}; ptestSysfsAccess->setVal(standbyModeFile, standbyModeInvalid); - auto handles = get_standby_handles(mockHandleCount); + auto handles = getStandbyHandles(mockHandleCount); ptestSysfsAccess->isStandbyModeFileAvailable = false; @@ -181,7 +181,7 @@ TEST_F(ZesStandbyFixture, GivenValidStandbyHandleWhenCallingzesStandbyGetModeOnU TEST_F(ZesStandbyFixture, GivenValidStandbyHandleWhenCallingzesStandbyGetModeWithInsufficientPermissionsThenVerifyzesStandbyGetModeCallFailsForInsufficientPermissions) { zes_standby_promo_mode_t mode = {}; ptestSysfsAccess->setVal(standbyModeFile, standbyModeInvalid); - auto handles = get_standby_handles(mockHandleCount); + auto handles = getStandbyHandles(mockHandleCount); ptestSysfsAccess->mockStandbyFileMode &= ~S_IRUSR; @@ -191,7 +191,7 @@ TEST_F(ZesStandbyFixture, GivenValidStandbyHandleWhenCallingzesStandbyGetModeWit } TEST_F(ZesStandbyFixture, GivenValidStandbyHandleWhenCallingzesStandbySetModeThenwithUnwritableFileVerifySysmanzesySetModeCallFailedWithInsufficientPermissions) { - auto handles = get_standby_handles(mockHandleCount); + auto handles = getStandbyHandles(mockHandleCount); ptestSysfsAccess->mockStandbyFileMode &= ~S_IWUSR; for (auto hSysmanStandby : handles) { @@ -200,7 +200,7 @@ TEST_F(ZesStandbyFixture, GivenValidStandbyHandleWhenCallingzesStandbySetModeThe } TEST_F(ZesStandbyFixture, GivenValidStandbyHandleWhenCallingzesStandbySetModeOnUnavailableFileThenVerifyzesStandbySetModeCallFailsForUnsupportedFeature) { - auto handles = get_standby_handles(mockHandleCount); + auto handles = getStandbyHandles(mockHandleCount); ptestSysfsAccess->isStandbyModeFileAvailable = false; for (auto hSysmanStandby : handles) { @@ -209,7 +209,7 @@ TEST_F(ZesStandbyFixture, GivenValidStandbyHandleWhenCallingzesStandbySetModeOnU } TEST_F(ZesStandbyFixture, GivenValidStandbyHandleWhenCallingzesStandbySetModeNeverThenVerifySysmanzesySetModeCallSucceeds) { - auto handles = get_standby_handles(mockHandleCount); + auto handles = getStandbyHandles(mockHandleCount); for (auto hSysmanStandby : handles) { zes_standby_promo_mode_t mode; @@ -225,7 +225,7 @@ TEST_F(ZesStandbyFixture, GivenValidStandbyHandleWhenCallingzesStandbySetModeNev } TEST_F(ZesStandbyFixture, GivenValidStandbyHandleWhenCallingzesStandbySetModeDefaultThenVerifySysmanzesySetModeCallSucceeds) { - auto handles = get_standby_handles(mockHandleCount); + auto handles = getStandbyHandles(mockHandleCount); for (auto hSysmanStandby : handles) { zes_standby_promo_mode_t mode; @@ -260,7 +260,7 @@ TEST_F(ZesStandbyFixture, GivenValidStandbyHandleWhenCallingzesStandbySetModeDef ptestSysfsAccess->directoryExistsResult = false; pSysmanDeviceImp->pStandbyHandleContext->init(deviceHandles); - auto handles = get_standby_handles(mockHandleCount); + auto handles = getStandbyHandles(mockHandleCount); for (auto hSysmanStandby : handles) { zes_standby_promo_mode_t mode; @@ -283,7 +283,7 @@ TEST_F(ZesStandbyFixture, GivenValidStandbyHandleWhenCallingzesStandbySetModeNev ptestSysfsAccess->directoryExistsResult = false; pSysmanDeviceImp->pStandbyHandleContext->init(deviceHandles); - auto handles = get_standby_handles(mockHandleCount); + auto handles = getStandbyHandles(mockHandleCount); for (auto hSysmanStandby : handles) { zes_standby_promo_mode_t mode; @@ -336,7 +336,7 @@ class ZesStandbyMultiDeviceFixture : public SysmanMultiDeviceFixture { SysmanMultiDeviceFixture::TearDown(); } - std::vector get_standby_handles(uint32_t count) { + std::vector getStandbyHandles(uint32_t count) { std::vector handles(count, nullptr); EXPECT_EQ(zesDeviceEnumStandbyDomains(device, &count, handles.data()), ZE_RESULT_SUCCESS); return handles; diff --git a/level_zero/tools/test/unit_tests/sources/sysman/temperature/linux/test_zes_temperature.cpp b/level_zero/tools/test/unit_tests/sources/sysman/temperature/linux/test_zes_temperature.cpp index 51b4b5cf44..04a99d73fd 100644 --- a/level_zero/tools/test/unit_tests/sources/sysman/temperature/linux/test_zes_temperature.cpp +++ b/level_zero/tools/test/unit_tests/sources/sysman/temperature/linux/test_zes_temperature.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -128,7 +128,7 @@ class SysmanMultiDeviceTemperatureFixture : public SysmanMultiDeviceFixture { pLinuxSysmanImp->pFsAccess = pFsAccessOriginal; } - std::vector get_temp_handles(uint32_t count) { + std::vector getTempHandles(uint32_t count) { std::vector handles(count, nullptr); EXPECT_EQ(zesDeviceEnumTemperatureSensors(device->toHandle(), &count, handles.data()), ZE_RESULT_SUCCESS); return handles; @@ -153,7 +153,7 @@ TEST_F(SysmanMultiDeviceTemperatureFixture, GivenComponentCountZeroWhenCallingZe } TEST_F(SysmanMultiDeviceTemperatureFixture, GivenValidTempHandleWhenGettingTemperatureThenValidTemperatureReadingsRetrieved) { - auto handles = get_temp_handles(handleComponentCountForSubDevices); + auto handles = getTempHandles(handleComponentCountForSubDevices); for (auto &deviceHandle : deviceHandles) { ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES}; Device::fromHandle(deviceHandle)->getProperties(&deviceProperties); @@ -172,7 +172,7 @@ TEST_F(SysmanMultiDeviceTemperatureFixture, GivenValidTempHandleWhenGettingTempe } TEST_F(SysmanMultiDeviceTemperatureFixture, GivenValidTempHandleWhenGettingTemperatureConfigThenUnsupportedIsReturned) { - auto handles = get_temp_handles(handleComponentCountForSubDevices); + auto handles = getTempHandles(handleComponentCountForSubDevices); for (auto handle : handles) { zes_temp_config_t config = {}; EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, zesTemperatureGetConfig(handle, &config)); @@ -180,7 +180,7 @@ TEST_F(SysmanMultiDeviceTemperatureFixture, GivenValidTempHandleWhenGettingTempe } TEST_F(SysmanMultiDeviceTemperatureFixture, GivenValidTempHandleWhenSettingTemperatureConfigThenUnsupportedIsReturned) { - auto handles = get_temp_handles(handleComponentCountForSubDevices); + auto handles = getTempHandles(handleComponentCountForSubDevices); for (auto handle : handles) { zes_temp_config_t config = {}; EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, zesTemperatureSetConfig(handle, &config)); @@ -248,7 +248,7 @@ class SysmanDeviceTemperatureFixture : public SysmanDeviceFixture { pLinuxSysmanImp->pFsAccess = pFsAccessOriginal; } - std::vector get_temp_handles(uint32_t count) { + std::vector getTempHandles(uint32_t count) { std::vector handles(count, nullptr); EXPECT_EQ(zesDeviceEnumTemperatureSensors(device->toHandle(), &count, handles.data()), ZE_RESULT_SUCCESS); return handles; @@ -256,7 +256,7 @@ class SysmanDeviceTemperatureFixture : public SysmanDeviceFixture { }; TEST_F(SysmanDeviceTemperatureFixture, GivenValidTempHandleWhenGettingGPUAndGlobalTemperatureThenValidTemperatureReadingsRetrieved) { - auto handles = get_temp_handles(handleComponentCountForNoSubDevices); + auto handles = getTempHandles(handleComponentCountForNoSubDevices); for (auto &deviceHandle : deviceHandles) { ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES}; Device::fromHandle(deviceHandle)->getProperties(&deviceProperties); @@ -310,7 +310,7 @@ TEST_F(SysmanDeviceTemperatureFixture, GivenValidTempHandleAndPmtReadValueFailsW } pSysmanDeviceImp->pTempHandleContext->init(deviceHandles); - auto handles = get_temp_handles(handleComponentCountForNoSubDevices); + auto handles = getTempHandles(handleComponentCountForNoSubDevices); for (auto &handle : handles) { double temperature; ASSERT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, zesTemperatureGetState(handle, &temperature)); diff --git a/level_zero/tools/test/unit_tests/sources/sysman/temperature/windows/test_zes_temperature.cpp b/level_zero/tools/test/unit_tests/sources/sysman/temperature/windows/test_zes_temperature.cpp index a182b03caf..967758221c 100644 --- a/level_zero/tools/test/unit_tests/sources/sysman/temperature/windows/test_zes_temperature.cpp +++ b/level_zero/tools/test/unit_tests/sources/sysman/temperature/windows/test_zes_temperature.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -63,7 +63,7 @@ class SysmanDeviceTemperatureFixture : public SysmanDeviceFixture { } } - std::vector get_temp_handles(uint32_t count) { + std::vector getTempHandles(uint32_t count) { std::vector handles(count, nullptr); EXPECT_EQ(zesDeviceEnumTemperatureSensors(device->toHandle(), &count, handles.data()), ZE_RESULT_SUCCESS); return handles; @@ -99,7 +99,7 @@ TEST_F(SysmanDeviceTemperatureFixture, GivenComponentCountZeroWhenEnumeratingTem } TEST_F(SysmanDeviceTemperatureFixture, GivenValidPowerHandleWhenGettingTemperaturePropertiesAllowSetToTrueThenCallSucceeds) { - auto handles = get_temp_handles(temperatureHandleComponentCount); + auto handles = getTempHandles(temperatureHandleComponentCount); uint32_t sensorTypeIndex = 0; for (auto handle : handles) { zes_temp_properties_t properties; @@ -118,21 +118,21 @@ TEST_F(SysmanDeviceTemperatureFixture, GivenValidPowerHandleWhenGettingTemperatu } TEST_F(SysmanDeviceTemperatureFixture, GivenValidTempHandleWhenGettingMemoryTemperatureThenValidTemperatureReadingsRetrieved) { - auto handles = get_temp_handles(temperatureHandleComponentCount); + auto handles = getTempHandles(temperatureHandleComponentCount); double temperature; ASSERT_EQ(ZE_RESULT_SUCCESS, zesTemperatureGetState(handles[ZES_TEMP_SENSORS_MEMORY], &temperature)); EXPECT_EQ(temperature, static_cast(pKmdSysManager->mockTempMemory)); } TEST_F(SysmanDeviceTemperatureFixture, GivenValidTempHandleWhenGettingGPUTemperatureThenValidTemperatureReadingsRetrieved) { - auto handles = get_temp_handles(temperatureHandleComponentCount); + auto handles = getTempHandles(temperatureHandleComponentCount); double temperature; ASSERT_EQ(ZE_RESULT_SUCCESS, zesTemperatureGetState(handles[ZES_TEMP_SENSORS_GPU], &temperature)); EXPECT_EQ(temperature, static_cast(pKmdSysManager->mockTempGPU)); } TEST_F(SysmanDeviceTemperatureFixture, GivenValidTempHandleWhenGettingGlobalTemperatureThenValidTemperatureReadingsRetrieved) { - auto handles = get_temp_handles(temperatureHandleComponentCount); + auto handles = getTempHandles(temperatureHandleComponentCount); double temperature; ASSERT_EQ(ZE_RESULT_SUCCESS, zesTemperatureGetState(handles[ZES_TEMP_SENSORS_GLOBAL], &temperature)); EXPECT_EQ(temperature, static_cast(pKmdSysManager->mockTempGlobal)); @@ -146,7 +146,7 @@ TEST_F(SysmanDeviceTemperatureFixture, GivenValidTempHandleWhenGettingUnsupporte } TEST_F(SysmanDeviceTemperatureFixture, GivenValidTempHandleWhenGettingTemperatureConfigThenUnsupportedIsReturned) { - auto handles = get_temp_handles(temperatureHandleComponentCount); + auto handles = getTempHandles(temperatureHandleComponentCount); for (auto handle : handles) { zes_temp_config_t config = {}; EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, zesTemperatureGetConfig(handle, &config)); @@ -154,7 +154,7 @@ TEST_F(SysmanDeviceTemperatureFixture, GivenValidTempHandleWhenGettingTemperatur } TEST_F(SysmanDeviceTemperatureFixture, GivenValidTempHandleWhenSettingTemperatureConfigThenUnsupportedIsReturned) { - auto handles = get_temp_handles(temperatureHandleComponentCount); + auto handles = getTempHandles(temperatureHandleComponentCount); for (auto handle : handles) { zes_temp_config_t config = {}; EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, zesTemperatureSetConfig(handle, &config)); diff --git a/manifests/manifest.yml b/manifests/manifest.yml index f383ca57c7..7add5e48d8 100644 --- a/manifests/manifest.yml +++ b/manifests/manifest.yml @@ -20,7 +20,7 @@ components: infra: branch: master dest_dir: infra - revision: c561f02e5dd06385e0b1884e43c7a13f0a1203b8 + revision: e12b98c001d7b90449d4f337f77eee5ab2697689 type: git internal: branch: master diff --git a/opencl/source/api/api.h b/opencl/source/api/api.h index 6fa18f68ae..7c547d31de 100644 --- a/opencl/source/api/api.h +++ b/opencl/source/api/api.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -928,12 +928,12 @@ extern CL_API_ENTRY cl_program CL_API_CALL clCreateProgramWithILKHR( cl_int *errcodeRet) CL_API_SUFFIX__VERSION_1_2; extern CL_API_ENTRY cl_int CL_API_CALL clGetKernelSuggestedLocalWorkSizeKHR( - cl_command_queue command_queue, + cl_command_queue commandQueue, cl_kernel kernel, - cl_uint work_dim, - const size_t *global_work_offset, - const size_t *global_work_size, - size_t *suggested_local_work_size) CL_API_SUFFIX__VERSION_3_0; + cl_uint workDim, + const size_t *globalWorkOffset, + const size_t *globalWorkSize, + size_t *suggestedLocalWorkSize) CL_API_SUFFIX__VERSION_3_0; void *clHostMemAllocINTEL( cl_context context, @@ -1101,5 +1101,5 @@ cl_mem CL_API_CALL clCreateImageWithProperties( cl_int CL_API_CALL clSetContextDestructorCallback( cl_context context, - void(CL_CALLBACK *pfn_notify)(cl_context /* context */, void * /* user_data */), - void *user_data); + void(CL_CALLBACK *pfnNotify)(cl_context /* context */, void * /* user_data */), + void *userData); diff --git a/opencl/source/cl_device/cl_device.cpp b/opencl/source/cl_device/cl_device.cpp index 311855de14..7393ebbe48 100644 --- a/opencl/source/cl_device/cl_device.cpp +++ b/opencl/source/cl_device/cl_device.cpp @@ -264,8 +264,8 @@ Platform *ClDevice::getPlatform() const { return castToObject(platformId); } bool ClDevice::isPciBusInfoValid() const { - return deviceInfo.pciBusInfo.pci_domain != PhysicalDevicePciBusInfo::InvalidValue && deviceInfo.pciBusInfo.pci_bus != PhysicalDevicePciBusInfo::InvalidValue && - deviceInfo.pciBusInfo.pci_device != PhysicalDevicePciBusInfo::InvalidValue && deviceInfo.pciBusInfo.pci_function != PhysicalDevicePciBusInfo::InvalidValue; + return deviceInfo.pciBusInfo.pci_domain != PhysicalDevicePciBusInfo::invalidValue && deviceInfo.pciBusInfo.pci_bus != PhysicalDevicePciBusInfo::invalidValue && + deviceInfo.pciBusInfo.pci_device != PhysicalDevicePciBusInfo::invalidValue && deviceInfo.pciBusInfo.pci_function != PhysicalDevicePciBusInfo::invalidValue; } } // namespace NEO diff --git a/opencl/source/cl_device/cl_device_caps.cpp b/opencl/source/cl_device/cl_device_caps.cpp index c15504cc7f..5d9ff12eaa 100644 --- a/opencl/source/cl_device/cl_device_caps.cpp +++ b/opencl/source/cl_device/cl_device_caps.cpp @@ -206,7 +206,7 @@ void ClDevice::initializeCaps() { deviceExtensions += sharingFactory.getExtensions(driverInfo.get()); } - PhysicalDevicePciBusInfo pciBusInfo(PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue); + PhysicalDevicePciBusInfo pciBusInfo(PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue); if (driverInfo) { pciBusInfo = driverInfo->getPciBusInfo(); diff --git a/opencl/source/command_queue/command_queue_hw_xehp_and_later.inl b/opencl/source/command_queue/command_queue_hw_xehp_and_later.inl index d4f5eb26c3..e82409dbda 100644 --- a/opencl/source/command_queue/command_queue_hw_xehp_and_later.inl +++ b/opencl/source/command_queue/command_queue_hw_xehp_and_later.inl @@ -47,7 +47,7 @@ bool CommandQueueHw::isCacheFlushCommand(uint32_t commandType) const { template <> LinearStream &getCommandStream(CommandQueue &commandQueue, const CsrDependencies &csrDeps, bool reserveProfilingCmdsSpace, bool reservePerfCounterCmdsSpace, bool blitEnqueue, const MultiDispatchInfo &multiDispatchInfo, Surface **surfaces, size_t numSurfaces, bool isMarkerWithProfiling, bool eventsInWaitList) { size_t expectedSizeCS = 0; - bool usePostSync = false; + [[maybe_unused]] bool usePostSync = false; if (commandQueue.getGpgpuCommandStreamReceiver().peekTimestampPacketWriteEnabled()) { expectedSizeCS += TimestampPacketHelper::getRequiredCmdStreamSize(csrDeps); usePostSync = true; diff --git a/opencl/source/context/context.cpp b/opencl/source/context/context.cpp index 2e126b7ed0..76d132d96b 100644 --- a/opencl/source/context/context.cpp +++ b/opencl/source/context/context.cpp @@ -262,7 +262,7 @@ bool Context::createImpl(const cl_context_properties *properties, for (auto &device : devices) { if (!specialQueues[device->getRootDeviceIndex()]) { - auto commandQueue = CommandQueue::create(this, device, nullptr, true, errcodeRet); // NOLINT + auto commandQueue = CommandQueue::create(this, device, nullptr, true, errcodeRet); // NOLINT(clang-analyzer-cplusplus.NewDelete) DEBUG_BREAK_IF(commandQueue == nullptr); overrideSpecialQueueAndDecrementRefCount(commandQueue, device->getRootDeviceIndex()); } diff --git a/opencl/source/helpers/base_object.h b/opencl/source/helpers/base_object.h index e64f8dc207..ffccfa21c0 100644 --- a/opencl/source/helpers/base_object.h +++ b/opencl/source/helpers/base_object.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -84,7 +84,7 @@ class ConditionVariableWithCounter { --waitersCount; } - void notify_one() { // NOLINT + void notify_one() { // NOLINT(readability-identifier-naming) cond.notify_one(); } diff --git a/opencl/source/helpers/cl_blit_properties.h b/opencl/source/helpers/cl_blit_properties.h index 484fb2e04c..569de19a8b 100644 --- a/opencl/source/helpers/cl_blit_properties.h +++ b/opencl/source/helpers/cl_blit_properties.h @@ -32,7 +32,7 @@ struct ClBlitProperties { GraphicsAllocation *srcAllocation = nullptr; if (!builtinOpParams.dstSvmAlloc) { - dstOffset += builtinOpParams.dstMemObj->getOffset(); + dstOffset += builtinOpParams.dstMemObj->getOffset(); // NOLINT(clang-analyzer-core.CallAndMessage) srcOffset += builtinOpParams.srcMemObj->getOffset(); dstAllocation = builtinOpParams.dstMemObj->getGraphicsAllocation(rootDeviceIndex); srcAllocation = builtinOpParams.srcMemObj->getGraphicsAllocation(rootDeviceIndex); diff --git a/opencl/source/kernel/kernel.h b/opencl/source/kernel/kernel.h index 8ba8b557db..f2b51133bd 100644 --- a/opencl/source/kernel/kernel.h +++ b/opencl/source/kernel/kernel.h @@ -117,7 +117,7 @@ class Kernel : public ReferenceTrackedObject { Kernel &operator=(const Kernel &) = delete; Kernel(const Kernel &) = delete; - virtual ~Kernel(); + ~Kernel() override; static bool isMemObj(kernelArgType kernelArg) { return kernelArg == BUFFER_OBJ || kernelArg == IMAGE_OBJ || kernelArg == PIPE_OBJ; diff --git a/opencl/source/mem_obj/image.cpp b/opencl/source/mem_obj/image.cpp index 966fc80993..1fa7a4943b 100644 --- a/opencl/source/mem_obj/image.cpp +++ b/opencl/source/mem_obj/image.cpp @@ -73,12 +73,11 @@ Image::Image(Context *context, zeroCopy, false, isObjectRedescribed), - createFunction(nullptr), + imageFormat(std::move(imageFormat)), imageDesc(imageDesc), surfaceFormatInfo(surfaceFormatInfo), - cubeFaceIndex(__GMM_NO_CUBE_MAP), - mediaPlaneType(0), + baseMipLevel(baseMipLevel), mipCount(mipCount) { magic = objectMagic; diff --git a/opencl/source/mem_obj/image.h b/opencl/source/mem_obj/image.h index c7f3f1765c..7b894a7976 100644 --- a/opencl/source/mem_obj/image.h +++ b/opencl/source/mem_obj/image.h @@ -149,7 +149,7 @@ class Image : public MemObj { Image *redescribe(); Image *redescribeFillImage(); - ImageCreatFunc createFunction; + ImageCreatFunc createFunction = nullptr; uint32_t getQPitch() { return qPitch; } void setQPitch(uint32_t qPitch) { this->qPitch = qPitch; } @@ -234,8 +234,8 @@ class Image : public MemObj { size_t hostPtrRowPitch = 0; size_t hostPtrSlicePitch = 0; size_t imageCount = 0; - uint32_t cubeFaceIndex; - cl_uint mediaPlaneType; + uint32_t cubeFaceIndex = __GMM_NO_CUBE_MAP; + cl_uint mediaPlaneType = 0; SurfaceOffsets surfaceOffsets = {0}; uint32_t baseMipLevel = 0; uint32_t mipCount = 1; diff --git a/opencl/source/program/create.inl b/opencl/source/program/create.inl index db94b76d86..1fd08fc4bf 100644 --- a/opencl/source/program/create.inl +++ b/opencl/source/program/create.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -33,7 +33,7 @@ T *Program::create( for (auto i = 0u; i < deviceVector.size(); i++) { auto device = deviceVector[i]; - retVal = program->createProgramFromBinary(binaries[i], lengths[i], *device); + retVal = program->createProgramFromBinary(binaries[i], lengths[i], *device); // NOLINT(clang-analyzer-core.CallAndMessage) if (retVal != CL_SUCCESS) { break; } diff --git a/opencl/test/.clang-tidy b/opencl/test/.clang-tidy deleted file mode 100644 index c288dff55d..0000000000 --- a/opencl/test/.clang-tidy +++ /dev/null @@ -1,34 +0,0 @@ ---- -Checks: 'clang-diagnostic-*,clang-analyzer-*,google-default-arguments,modernize-use-override,modernize-use-default-member-init,-clang-analyzer-alpha*,readability-identifier-naming,-clang-analyzer-optin.performance.Padding,-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-cplusplus.NewDeleteLeaks,-clang-analyzer-core.CallAndMessage,-clang-analyzer-unix.MismatchedDeallocator,-clang-analyzer-core.NullDereference,-clang-analyzer-cplusplus.NewDelete,-clang-analyzer-optin.cplusplus.VirtualCall' -# WarningsAsErrors: '.*' -HeaderFilterRegex: '^((?!^third_party\/).+)\.(h|hpp|inl)$' -AnalyzeTemporaryDtors: false -CheckOptions: - - key: google-readability-braces-around-statements.ShortStatementLines - value: '1' - - key: google-readability-function-size.StatementThreshold - value: '800' - - key: google-readability-namespace-comments.ShortNamespaceLines - value: '10' - - key: google-readability-namespace-comments.SpacesBeforeComments - value: '2' - - key: readability-identifier-naming.ParameterCase - value: camelBack - - key: readability-identifier-naming.StructMemberCase - value: camelBack - - key: modernize-loop-convert.MaxCopySize - value: '16' - - key: modernize-loop-convert.MinConfidence - value: reasonable - - key: modernize-loop-convert.NamingStyle - value: CamelCase - - key: modernize-pass-by-value.IncludeStyle - value: llvm - - key: modernize-replace-auto-ptr.IncludeStyle - value: llvm - - key: modernize-use-nullptr.NullMacros - value: 'NULL' - - key: modernize-use-default-member-init.UseAssignment - value: '1' -... - diff --git a/opencl/test/unit_test/api/cl_api_tests.h b/opencl/test/unit_test/api/cl_api_tests.h index 61223778b7..322f589d1f 100644 --- a/opencl/test/unit_test/api/cl_api_tests.h +++ b/opencl/test/unit_test/api/cl_api_tests.h @@ -29,7 +29,7 @@ namespace NEO { template struct ApiFixture { - virtual void SetUp() { + virtual void SetUp() { // NOLINT(readability-identifier-naming) DebugManager.flags.CreateMultipleRootDevices.set(numRootDevices); executionEnvironment = new ClExecutionEnvironment(); prepareDeviceEnvironments(*executionEnvironment); @@ -54,7 +54,7 @@ struct ApiFixture { ASSERT_NE(nullptr, pKernel); } - virtual void TearDown() { + virtual void TearDown() { // NOLINT(readability-identifier-naming) pMultiDeviceKernel->release(); pCommandQueue->release(); pContext->release(); @@ -102,8 +102,8 @@ struct api_tests : public ApiFixture<>, struct api_fixture_using_aligned_memory_manager { public: - virtual void SetUp(); - virtual void TearDown(); + virtual void SetUp(); // NOLINT(readability-identifier-naming) + virtual void TearDown(); // NOLINT(readability-identifier-naming) cl_int retVal; size_t retSize; diff --git a/opencl/test/unit_test/api/cl_enqueue_svm_migrate_mem_tests.cpp b/opencl/test/unit_test/api/cl_enqueue_svm_migrate_mem_tests.cpp index dd9d7c57d1..99df7aeadf 100644 --- a/opencl/test/unit_test/api/cl_enqueue_svm_migrate_mem_tests.cpp +++ b/opencl/test/unit_test/api/cl_enqueue_svm_migrate_mem_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -85,7 +85,7 @@ TEST_F(clEnqueueSVMMigrateMemTests, GivenSvmPointerIsHostPtrWhenMigratingSvmThen GTEST_SKIP(); } char *ptrHost = new char[10]; - ASSERT_NE(nullptr, ptrHost); + ASSERT_NE(nullptr, ptrHost); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) const void *svmPtrs[] = {ptrHost}; auto retVal = clEnqueueSVMMigrateMem( diff --git a/opencl/test/unit_test/aub_tests/command_queue/enqueue_kernel_aub_tests.cpp b/opencl/test/unit_test/aub_tests/command_queue/enqueue_kernel_aub_tests.cpp index 6c47188d2f..f3f370259d 100644 --- a/opencl/test/unit_test/aub_tests/command_queue/enqueue_kernel_aub_tests.cpp +++ b/opencl/test/unit_test/aub_tests/command_queue/enqueue_kernel_aub_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -148,7 +148,7 @@ struct AUBHelloWorldIntegrateTest : public HelloWorldFixturewriteMemory(*allocation); } - aubCsr->writeMemory(*allocation); + aubCsr->writeMemory(*allocation); // NOLINT(clang-analyzer-core.CallAndMessage) } TestParam param; }; diff --git a/opencl/test/unit_test/aub_tests/command_queue/enqueue_map_image_aub_tests.cpp b/opencl/test/unit_test/aub_tests/command_queue/enqueue_map_image_aub_tests.cpp index 3c47e8723c..6147a9ffac 100644 --- a/opencl/test/unit_test/aub_tests/command_queue/enqueue_map_image_aub_tests.cpp +++ b/opencl/test/unit_test/aub_tests/command_queue/enqueue_map_image_aub_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -115,7 +115,7 @@ HWTEST_P(AUBMapImage, WhenMappingAndUnmappingThenExpectationsAreMet) { size_t elementSize = perChannelDataSize * numChannels; auto sizeMemory = testWidth * alignUp(testHeight, 4) * testDepth * elementSize; auto srcMemory = new (std::nothrow) uint8_t[sizeMemory]; - ASSERT_NE(nullptr, srcMemory); + ASSERT_NE(nullptr, srcMemory); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) for (unsigned i = 0; i < sizeMemory; ++i) { uint8_t origValue = i; diff --git a/opencl/test/unit_test/aub_tests/command_stream/copy_engine_aub_tests_xehp_and_later.h b/opencl/test/unit_test/aub_tests/command_stream/copy_engine_aub_tests_xehp_and_later.h index d772612b60..4c7fa00a46 100644 --- a/opencl/test/unit_test/aub_tests/command_stream/copy_engine_aub_tests_xehp_and_later.h +++ b/opencl/test/unit_test/aub_tests/command_stream/copy_engine_aub_tests_xehp_and_later.h @@ -133,7 +133,7 @@ struct CopyEngineXeHPAndLater : public MulticontextAubFixture, public ::testing: template void givenSrcSystemBufferWhenBlitCommandToDstSystemBufferIsDispatchedThenCopiedDataIsValidImpl(); template - void GivenReadOnlyMultiStorageWhenAllocatingBufferThenAllocationIsCopiedWithBlitterToEveryTileImpl(); + void GivenReadOnlyMultiStorageWhenAllocatingBufferThenAllocationIsCopiedWithBlitterToEveryTileImpl(); // NOLINT(readability-identifier-naming) template void givenReadBufferRectWithOffsetWhenHostPtrBlitCommandIsDispatchedToHostPtrThenDataIsCorrectlyCopiedImpl(); template diff --git a/opencl/test/unit_test/aub_tests/fixtures/image_aub_fixture.h b/opencl/test/unit_test/aub_tests/fixtures/image_aub_fixture.h index e7c6685a64..9622d85cdc 100644 --- a/opencl/test/unit_test/aub_tests/fixtures/image_aub_fixture.h +++ b/opencl/test/unit_test/aub_tests/fixtures/image_aub_fixture.h @@ -48,7 +48,7 @@ struct ImageAubFixture : public ClDeviceFixture, public AUBCommandStreamFixture CommandStreamFixture::SetUp(pCmdQ); } - void TearDown() { + void TearDown() override { if (pCmdQ) { auto blocked = pCmdQ->isQueueBlocked(); UNRECOVERABLE_IF(blocked); diff --git a/opencl/test/unit_test/aub_tests/fixtures/multicontext_aub_fixture.h b/opencl/test/unit_test/aub_tests/fixtures/multicontext_aub_fixture.h index e88aef4bf0..818c919bea 100644 --- a/opencl/test/unit_test/aub_tests/fixtures/multicontext_aub_fixture.h +++ b/opencl/test/unit_test/aub_tests/fixtures/multicontext_aub_fixture.h @@ -30,8 +30,8 @@ struct MulticontextAubFixture { All, // RCS + CCS0-3 }; - void SetUp(uint32_t numberOfTiles, EnabledCommandStreamers enabledCommandStreamers, bool enableCompression); - void TearDown(); + void SetUp(uint32_t numberOfTiles, EnabledCommandStreamers enabledCommandStreamers, bool enableCompression); // NOLINT(readability-identifier-naming) + void TearDown(); // NOLINT(readability-identifier-naming) template CommandStreamReceiverSimulatedCommonHw *getSimulatedCsr(uint32_t tile, uint32_t engine) { diff --git a/opencl/test/unit_test/aub_tests/fixtures/run_kernel_fixture.h b/opencl/test/unit_test/aub_tests/fixtures/run_kernel_fixture.h index 6f91c3e3ad..31d976bba3 100644 --- a/opencl/test/unit_test/aub_tests/fixtures/run_kernel_fixture.h +++ b/opencl/test/unit_test/aub_tests/fixtures/run_kernel_fixture.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -50,7 +50,7 @@ class RunKernelFixture : public CommandEnqueueAUBFixture { } protected: - Program *CreateProgramFromBinary( + Program *CreateProgramFromBinary( // NOLINT(readability-identifier-naming) const std::string &binaryFileName) { cl_int retVal = CL_SUCCESS; diff --git a/opencl/test/unit_test/aub_tests/mem_obj/create_image_aub_tests.cpp b/opencl/test/unit_test/aub_tests/mem_obj/create_image_aub_tests.cpp index f89b01ed7c..72dec3e9ae 100644 --- a/opencl/test/unit_test/aub_tests/mem_obj/create_image_aub_tests.cpp +++ b/opencl/test/unit_test/aub_tests/mem_obj/create_image_aub_tests.cpp @@ -351,7 +351,7 @@ HWTEST_P(CopyHostPtrTest, GivenImageWithDoubledRowPitchWhenCreatedWithCopyHostPt } if (readMemory) - delete readMemory; + delete[] readMemory; } HWTEST_P(UseHostPtrTest, GivenImageWithRowPitchWhenCreatedWithUseHostPtrFlagThenExpectationsMet) { @@ -511,6 +511,6 @@ HWTEST_F(AUBCreateImage, GivenImage3DCreatedWithDoubledSlicePitchWhenQueriedForD alignedFree(host_ptr); if (readMemory) { - delete readMemory; + delete[] readMemory; } } diff --git a/opencl/test/unit_test/built_ins/built_in_tests.cpp b/opencl/test/unit_test/built_ins/built_in_tests.cpp index 339bda4110..c84da38b71 100644 --- a/opencl/test/unit_test/built_ins/built_in_tests.cpp +++ b/opencl/test/unit_test/built_ins/built_in_tests.cpp @@ -82,7 +82,7 @@ class BuiltInTests ClDeviceFixture::TearDown(); } - void AppendBuiltInStringFromFile(std::string builtInFile, size_t &size) { + void appendBuiltInStringFromFile(std::string builtInFile, size_t &size) { std::string src; auto pData = loadDataFromFile( builtInFile.c_str(), @@ -238,7 +238,7 @@ TEST_F(BuiltInTests, WhenBuildingListOfBuiltinsThenBuiltinsHaveBeenGenerated) { size_t size = 0; for (auto &fileName : getBuiltInFileNames(supportsImages)) { - AppendBuiltInStringFromFile(fileName, size); + appendBuiltInStringFromFile(fileName, size); ASSERT_NE(0u, size); } diff --git a/opencl/test/unit_test/command_queue/blit_enqueue_tests.cpp b/opencl/test/unit_test/command_queue/blit_enqueue_tests.cpp index b1e0ba97ec..3b9b4a0d88 100644 --- a/opencl/test/unit_test/command_queue/blit_enqueue_tests.cpp +++ b/opencl/test/unit_test/command_queue/blit_enqueue_tests.cpp @@ -71,7 +71,7 @@ struct BlitEnqueueTests : public ::testing::Test { }; template - void SetUpT() { + void setUpT() { if (is32bit) { GTEST_SKIP(); } @@ -111,7 +111,7 @@ struct BlitEnqueueTests : public ::testing::Test { } template - void TearDownT() {} + void tearDownT() {} template void setMockKernelArgs(std::array buffers) { @@ -1284,12 +1284,12 @@ struct BlitEnqueueFlushTests : public BlitEnqueueTests<1> { }; template - void SetUpT() { + void setUpT() { auto csrCreateFcn = &commandStreamReceiverFactory[IGFX_MAX_CORE + defaultHwInfo->platform.eRenderCoreFamily]; variableBackup = std::make_unique>(csrCreateFcn); *csrCreateFcn = MyUltCsr::create; - BlitEnqueueTests<1>::SetUpT(); + BlitEnqueueTests<1>::setUpT(); } std::unique_ptr> variableBackup; diff --git a/opencl/test/unit_test/command_queue/command_queue_fixture.h b/opencl/test/unit_test/command_queue/command_queue_fixture.h index 7bc93edf68..e9a694d078 100644 --- a/opencl/test/unit_test/command_queue/command_queue_fixture.h +++ b/opencl/test/unit_test/command_queue/command_queue_fixture.h @@ -40,10 +40,10 @@ struct CommandQueueHwFixture { static void forceMapBufferOnGpu(Buffer &buffer); - virtual void SetUp(); - virtual void SetUp(ClDevice *pDevice, cl_command_queue_properties properties); + virtual void SetUp(); // NOLINT(readability-identifier-naming) + virtual void SetUp(ClDevice *pDevice, cl_command_queue_properties properties); // NOLINT(readability-identifier-naming) - virtual void TearDown(); + virtual void TearDown(); // NOLINT(readability-identifier-naming) CommandQueue *pCmdQ = nullptr; MockClDevice *device = nullptr; @@ -58,11 +58,11 @@ struct OOQueueFixture : public CommandQueueHwFixture { }; struct CommandQueueFixture { - virtual void SetUp( + virtual void SetUp( // NOLINT(readability-identifier-naming) Context *context, ClDevice *device, cl_command_queue_properties properties); - virtual void TearDown(); + virtual void TearDown(); // NOLINT(readability-identifier-naming) CommandQueue *createCommandQueue( Context *context, diff --git a/opencl/test/unit_test/command_queue/command_queue_hw_1_tests.cpp b/opencl/test/unit_test/command_queue/command_queue_hw_1_tests.cpp index 80d3902680..f18b5459d1 100644 --- a/opencl/test/unit_test/command_queue/command_queue_hw_1_tests.cpp +++ b/opencl/test/unit_test/command_queue/command_queue_hw_1_tests.cpp @@ -354,7 +354,7 @@ HWTEST_F(CommandQueueHwTest, GivenEventWhenEnqueuingBlockedMapUnmapOperationThen // CommandQueue has retained this event, release it returnEvent->release(); pHwQ->virtualEvent = nullptr; - delete returnEvent; + delete returnEvent; // NOLINT(clang-analyzer-cplusplus.NewDelete) buffer->decRefInternal(); } @@ -794,14 +794,14 @@ HWTEST_F(CommandQueueHwTest, GivenEventThatIsNotCompletedWhenFinishIsCalledAndIt DebugManager.flags.EnableAsyncEventsHandler.set(false); struct ClbFuncTempStruct { - static void CL_CALLBACK ClbFuncT(cl_event e, cl_int execStatus, void *valueForUpdate) { + static void CL_CALLBACK clbFuncT(cl_event e, cl_int execStatus, void *valueForUpdate) { *((cl_int *)valueForUpdate) = 1; } }; auto Value = 0u; auto ev = new Event(this->pCmdQ, CL_COMMAND_COPY_BUFFER, 3, CompletionStamp::notReady + 1); - clSetEventCallback(ev, CL_COMPLETE, ClbFuncTempStruct::ClbFuncT, &Value); + clSetEventCallback(ev, CL_COMPLETE, ClbFuncTempStruct::clbFuncT, &Value); auto &csr = this->pCmdQ->getGpgpuCommandStreamReceiver(); EXPECT_GT(3u, csr.peekTaskCount()); @@ -827,14 +827,14 @@ HWTEST_F(CommandQueueHwTest, GivenMultiTileQueueWhenEventNotCompletedAndFinishIs *ptrOffset(tagAddress, 32) = *tagAddress; struct ClbFuncTempStruct { - static void CL_CALLBACK ClbFuncT(cl_event e, cl_int execStatus, void *valueForUpdate) { + static void CL_CALLBACK clbFuncT(cl_event e, cl_int execStatus, void *valueForUpdate) { *static_cast(valueForUpdate) = 1; } }; auto value = 0u; auto ev = new Event(this->pCmdQ, CL_COMMAND_COPY_BUFFER, 3, CompletionStamp::notReady + 1); - clSetEventCallback(ev, CL_COMPLETE, ClbFuncTempStruct::ClbFuncT, &value); + clSetEventCallback(ev, CL_COMPLETE, ClbFuncTempStruct::clbFuncT, &value); EXPECT_GT(3u, csr.peekTaskCount()); *tagAddress = CompletionStamp::notReady + 1; diff --git a/opencl/test/unit_test/command_queue/command_queue_tests.cpp b/opencl/test/unit_test/command_queue/command_queue_tests.cpp index d17d5b5371..c2d2a03eea 100644 --- a/opencl/test/unit_test/command_queue/command_queue_tests.cpp +++ b/opencl/test/unit_test/command_queue/command_queue_tests.cpp @@ -1502,7 +1502,7 @@ TEST(CommandQueueDestructorTest, whenCommandQueueIsDestroyedThenDestroysTimestam queue.timestampPacketContainer.reset(new MockTimestampPacketContainer(*context)); EXPECT_EQ(2, context->getRefInternalCount()); context->release(); - EXPECT_EQ(1, context->getRefInternalCount()); + EXPECT_EQ(1, context->getRefInternalCount()); // NOLINT(clang-analyzer-cplusplus.NewDelete) } TEST(CommandQueuePropertiesTests, whenGetEngineIsCalledThenQueueEngineIsReturned) { diff --git a/opencl/test/unit_test/command_queue/enqueue_fixture.h b/opencl/test/unit_test/command_queue/enqueue_fixture.h index 452249de94..037015f2fd 100644 --- a/opencl/test/unit_test/command_queue/enqueue_fixture.h +++ b/opencl/test/unit_test/command_queue/enqueue_fixture.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -412,7 +412,7 @@ struct EnqueueReadBufferHelper { const cl_event *eventWaitList = Traits::eventWaitList, cl_event *event = Traits::event) { - size = size == static_cast(-1) ? buffer->getSize() : size; + size = size == static_cast(-1) ? buffer->getSize() : size; // NOLINT(clang-analyzer-core.CallAndMessage) cl_int retVal = pCmdQ->enqueueReadBuffer(buffer, blockingRead, @@ -518,7 +518,7 @@ struct EnqueueWriteBufferHelper { const cl_event *eventWaitList = Traits::eventWaitList, cl_event *event = Traits::event) { - size = size == static_cast(-1) ? buffer->getSize() : size; + size = size == static_cast(-1) ? buffer->getSize() : size; // NOLINT(clang-analyzer-core.CallAndMessage) cl_int retVal = pCmdQ->enqueueWriteBuffer(buffer, blockingWrite, diff --git a/opencl/test/unit_test/command_queue/enqueue_kernel_2_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_kernel_2_tests.cpp index 5235a72f4e..faad32e772 100644 --- a/opencl/test/unit_test/command_queue/enqueue_kernel_2_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_kernel_2_tests.cpp @@ -66,7 +66,7 @@ struct EnqueueKernelTypeTest : public HelloWorldFixture -void EnqueueKernelTypeTest::FillValues() { +void EnqueueKernelTypeTest::fillValues() { const TestParam ¶m = GetParam(); globalWorkSize[0] = param.globalWorkSizeX; globalWorkSize[1] = param.globalWorkSizeY; @@ -562,7 +562,7 @@ HWTEST_P(EnqueueKernelPrintfTest, GivenKernelWithPrintfWhenBeingDispatchedThenL3 cl_event *eventWaitList = nullptr; cl_event *event = nullptr; - FillValues(); + fillValues(); // Compute # of expected work items expectedWorkItems = 1; for (auto i = 0u; i < workDim; i++) { @@ -601,7 +601,7 @@ HWCMDTEST_P(IGFX_GEN8_CORE, EnqueueKernelPrintfTest, GivenKernelWithPrintfBlocke cl_uint workDim = 1; size_t globalWorkOffset[3] = {0, 0, 0}; - FillValues(); + fillValues(); cl_event blockedEvent = &userEvent; auto retVal = mockCommandQueue.enqueueKernel( @@ -640,7 +640,7 @@ HWTEST_P(EnqueueKernelPrintfTest, GivenKernelWithPrintfBlockedByEventWhenEventUn cl_uint workDim = 1; size_t globalWorkOffset[3] = {0, 0, 0}; - FillValues(); + fillValues(); cl_event blockedEvent = userEvent.get(); cl_event outEvent{}; @@ -687,7 +687,7 @@ HWTEST_P(EnqueueKernelPrintfTest, GivenKernelWithPrintfWithStringMapDisbaledAndI cl_uint workDim = 1; size_t globalWorkOffset[3] = {0, 0, 0}; - FillValues(); + fillValues(); cl_event blockedEvent = userEvent.get(); cl_event outEvent{}; diff --git a/opencl/test/unit_test/command_queue/enqueue_map_buffer_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_map_buffer_tests.cpp index c03f92ec2a..55f8d3b2ab 100644 --- a/opencl/test/unit_test/command_queue/enqueue_map_buffer_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_map_buffer_tests.cpp @@ -273,7 +273,7 @@ HWTEST_F(EnqueueMapBufferTest, givenNonBlockingReadOnlyMapBufferOnZeroCopyBuffer size_t GWS = 1; struct E2Clb { - static void CL_CALLBACK SignalEv2(cl_event e, cl_int status, void *data) { + static void CL_CALLBACK signalEv2(cl_event e, cl_int status, void *data) { uint32_t *callbackCalled = static_cast(data); *callbackCalled = 1; } @@ -331,7 +331,7 @@ HWTEST_F(EnqueueMapBufferTest, givenNonBlockingReadOnlyMapBufferOnZeroCopyBuffer *pTagMemory += 4; - clSetEventCallback(mapEventReturned, CL_COMPLETE, E2Clb::SignalEv2, (void *)&callbackCalled); + clSetEventCallback(mapEventReturned, CL_COMPLETE, E2Clb::signalEv2, (void *)&callbackCalled); //wait for events needs to flush DC as event requires this. retVal = clWaitForEvents(1, &mapEventReturned); diff --git a/opencl/test/unit_test/command_queue/enqueue_map_image_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_map_image_tests.cpp index a44be04d5e..42c399ec25 100644 --- a/opencl/test/unit_test/command_queue/enqueue_map_image_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_map_image_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -336,7 +336,7 @@ HWTEST_F(EnqueueMapImageTest, givenNonReadOnlyMapWithOutEventWhenMappedThenSetEv EXPECT_TRUE(pTagMemory == tag_address); struct E2Clb { - static void CL_CALLBACK SignalEv2(cl_event e, cl_int status, void *data) { + static void CL_CALLBACK signalEv2(cl_event e, cl_int status, void *data) { uint32_t *pTagMem = static_cast(data); *pTagMem = 4; } @@ -371,7 +371,7 @@ HWTEST_F(EnqueueMapImageTest, givenNonReadOnlyMapWithOutEventWhenMappedThenSetEv taskCount = commandStreamReceiver.peekTaskCount(); EXPECT_EQ(3u, taskCount); - clSetEventCallback(mapEventReturned, CL_COMPLETE, E2Clb::SignalEv2, (void *)pTagMemory); + clSetEventCallback(mapEventReturned, CL_COMPLETE, E2Clb::signalEv2, (void *)pTagMemory); retVal = clWaitForEvents(1, &mapEventReturned); EXPECT_EQ(CL_SUCCESS, retVal); diff --git a/opencl/test/unit_test/command_queue/enqueue_svm_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_svm_tests.cpp index e7ce0afbcb..72fc7f1185 100644 --- a/opencl/test/unit_test/command_queue/enqueue_svm_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_svm_tests.cpp @@ -233,7 +233,7 @@ TEST_F(EnqueueSvmTest, GivenValidParamsWhenFreeingSvmWithCallbackThenSuccessIsRe ClbHelper(bool &callbackWasCalled) : callbackWasCalled(callbackWasCalled) {} - static void CL_CALLBACK Clb(cl_command_queue queue, cl_uint numSvmPointers, void *svmPointers[], void *usrData) { + static void CL_CALLBACK clb(cl_command_queue queue, cl_uint numSvmPointers, void *svmPointers[], void *usrData) { ClbHelper *data = (ClbHelper *)usrData; data->callbackWasCalled = true; } @@ -244,7 +244,7 @@ TEST_F(EnqueueSvmTest, GivenValidParamsWhenFreeingSvmWithCallbackThenSuccessIsRe retVal = this->pCmdQ->enqueueSVMFree( 1, // cl_uint num_svm_pointers svmPtrs, // void *svm_pointers[] - ClbHelper::Clb, // (CL_CALLBACK *pfn_free_func) (cl_command_queue queue, cl_uint num_svm_pointers, void *svm_pointers[]) + ClbHelper::clb, // (CL_CALLBACK *pfn_free_func) (cl_command_queue queue, cl_uint num_svm_pointers, void *svm_pointers[]) &userData, // void *user_data 0, // cl_uint num_events_in_wait_list nullptr, // const cl_event *event_wait_list @@ -263,7 +263,7 @@ TEST_F(EnqueueSvmTest, GivenValidParamsWhenFreeingSvmWithCallbackAndEventThenSuc ClbHelper(bool &callbackWasCalled) : callbackWasCalled(callbackWasCalled) {} - static void CL_CALLBACK Clb(cl_command_queue queue, cl_uint numSvmPointers, void *svmPointers[], void *usrData) { + static void CL_CALLBACK clb(cl_command_queue queue, cl_uint numSvmPointers, void *svmPointers[], void *usrData) { ClbHelper *data = (ClbHelper *)usrData; data->callbackWasCalled = true; } @@ -275,7 +275,7 @@ TEST_F(EnqueueSvmTest, GivenValidParamsWhenFreeingSvmWithCallbackAndEventThenSuc retVal = this->pCmdQ->enqueueSVMFree( 1, // cl_uint num_svm_pointers svmPtrs, // void *svm_pointers[] - ClbHelper::Clb, // (CL_CALLBACK *pfn_free_func) (cl_command_queue queue, cl_uint num_svm_pointers, void *svm_pointers[]) + ClbHelper::clb, // (CL_CALLBACK *pfn_free_func) (cl_command_queue queue, cl_uint num_svm_pointers, void *svm_pointers[]) &userData, // void *user_data 0, // cl_uint num_events_in_wait_list nullptr, // const cl_event *event_wait_list diff --git a/opencl/test/unit_test/command_queue/enqueue_waitlist_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_waitlist_tests.cpp index 55c1d48cec..ab8676e033 100644 --- a/opencl/test/unit_test/command_queue/enqueue_waitlist_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_waitlist_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -81,66 +81,66 @@ struct EnqueueWaitlistTest : public EnqueueWaitlistFixture, Image *image; Image *imageNonZeroCopy; - void test_error(cl_int error, std::string str) { + void testError(cl_int error, std::string str) { EXPECT_EQ(CL_SUCCESS, error) << str << std::endl; } - static void EnqueueNDRange(EnqueueWaitlistTest *test, cl_uint numWaits, cl_event *waits, cl_event *outEvent, bool blocking = false) { + static void enqueueNDRange(EnqueueWaitlistTest *test, cl_uint numWaits, cl_event *waits, cl_event *outEvent, bool blocking = false) { size_t threadNum = 10; size_t threads[1] = {threadNum}; cl_int error = clEnqueueNDRangeKernel(test->pCmdQ, test->pMultiDeviceKernel, 1, NULL, threads, threads, numWaits, waits, outEvent); - test->test_error(error, "Unable to execute kernel"); + test->testError(error, "Unable to execute kernel"); return; } - static void EnqueueMapBuffer(EnqueueWaitlistTest *test, cl_uint numWaits, cl_event *waits, cl_event *outEvent, bool blocking = false) { + static void enqueueMapBuffer(EnqueueWaitlistTest *test, cl_uint numWaits, cl_event *waits, cl_event *outEvent, bool blocking = false) { cl_int error; void *mappedPtr = clEnqueueMapBuffer(test->pCmdQ, test->buffer, blocking ? CL_TRUE : CL_FALSE, CL_MAP_READ, 0, test->buffer->getSize(), numWaits, waits, outEvent, &error); EXPECT_NE(nullptr, mappedPtr); - test->test_error(error, "Unable to enqueue buffer map"); + test->testError(error, "Unable to enqueue buffer map"); error = clEnqueueUnmapMemObject(test->pCmdQ, test->buffer, mappedPtr, 0, nullptr, nullptr); return; } - static void TwoEnqueueMapBuffer(EnqueueWaitlistTest *test, cl_uint numWaits, cl_event *waits, cl_event *outEvent, bool blocking = false) { + static void twoEnqueueMapBuffer(EnqueueWaitlistTest *test, cl_uint numWaits, cl_event *waits, cl_event *outEvent, bool blocking = false) { cl_int error; void *mappedPtr = clEnqueueMapBuffer(test->pCmdQ, test->buffer, blocking ? CL_TRUE : CL_FALSE, CL_MAP_READ, 0, test->buffer->getSize(), numWaits, waits, outEvent, &error); EXPECT_NE(nullptr, mappedPtr); - test->test_error(error, "Unable to enqueue buffer map"); + test->testError(error, "Unable to enqueue buffer map"); void *mappedPtr2 = clEnqueueMapBuffer(test->pCmdQ, test->bufferNonZeroCopy, blocking ? CL_TRUE : CL_FALSE, CL_MAP_READ, 0, test->bufferNonZeroCopy->getSize(), 0, nullptr, nullptr, &error); EXPECT_NE(nullptr, mappedPtr2); - test->test_error(error, "Unable to enqueue buffer map"); + test->testError(error, "Unable to enqueue buffer map"); error = clEnqueueUnmapMemObject(test->pCmdQ, test->buffer, mappedPtr, 0, nullptr, nullptr); error = clEnqueueUnmapMemObject(test->pCmdQ, test->bufferNonZeroCopy, mappedPtr2, 0, nullptr, nullptr); return; } - static void EnqueueUnMapBuffer(EnqueueWaitlistTest *test, cl_uint numWaits, cl_event *waits, cl_event *outEvent, bool blocking = false) { + static void enqueueUnMapBuffer(EnqueueWaitlistTest *test, cl_uint numWaits, cl_event *waits, cl_event *outEvent, bool blocking = false) { cl_int error; void *mappedPtr = clEnqueueMapBuffer(test->pCmdQ, test->buffer, CL_TRUE, CL_MAP_READ, 0, test->buffer->getSize(), 0, nullptr, nullptr, &error); EXPECT_NE(nullptr, mappedPtr); ASSERT_NE(test->buffer, nullptr); error = clEnqueueUnmapMemObject(test->pCmdQ, test->buffer, mappedPtr, numWaits, waits, outEvent); - test->test_error(error, "Unable to unmap buffer"); + test->testError(error, "Unable to unmap buffer"); return; } - static void EnqueueMapImage(EnqueueWaitlistTest *test, cl_uint numWaits, cl_event *waits, cl_event *outEvent, bool blocking = false) { + static void enqueueMapImage(EnqueueWaitlistTest *test, cl_uint numWaits, cl_event *waits, cl_event *outEvent, bool blocking = false) { cl_int error; cl_image_desc desc = test->image->getImageDesc(); size_t origin[3] = {0, 0, 0}, region[3] = {desc.image_width, desc.image_height, 1}; size_t outPitch; void *mappedPtr = clEnqueueMapImage(test->pCmdQ, test->image, blocking ? CL_TRUE : CL_FALSE, CL_MAP_READ, origin, region, &outPitch, NULL, numWaits, waits, outEvent, &error); - test->test_error(error, "Unable to enqueue image map"); + test->testError(error, "Unable to enqueue image map"); EXPECT_NE(nullptr, mappedPtr); - test->test_error(error, "Unable to enqueue buffer map"); + test->testError(error, "Unable to enqueue buffer map"); error = clEnqueueUnmapMemObject(test->pCmdQ, test->image, mappedPtr, 0, nullptr, nullptr); return; } - static void TwoEnqueueMapImage(EnqueueWaitlistTest *test, cl_uint numWaits, cl_event *waits, cl_event *outEvent, bool blocking = false) { + static void twoEnqueueMapImage(EnqueueWaitlistTest *test, cl_uint numWaits, cl_event *waits, cl_event *outEvent, bool blocking = false) { cl_int error; cl_image_desc desc = test->image->getImageDesc(); size_t origin[3] = {0, 0, 0}, region[3] = {desc.image_width, desc.image_height, 1}; @@ -150,14 +150,14 @@ struct EnqueueWaitlistTest : public EnqueueWaitlistFixture, size_t outPitch2; void *mappedPtr = clEnqueueMapImage(test->pCmdQ, test->image, blocking ? CL_TRUE : CL_FALSE, CL_MAP_READ, origin, region, &outPitch, NULL, numWaits, waits, outEvent, &error); - test->test_error(error, "Unable to enqueue image map"); + test->testError(error, "Unable to enqueue image map"); EXPECT_NE(nullptr, mappedPtr); - test->test_error(error, "Unable to enqueue buffer map"); + test->testError(error, "Unable to enqueue buffer map"); void *mappedPtr2 = clEnqueueMapImage(test->pCmdQ, test->imageNonZeroCopy, blocking ? CL_TRUE : CL_FALSE, CL_MAP_READ, origin2, region2, &outPitch2, NULL, 0, nullptr, nullptr, &error); - test->test_error(error, "Unable to enqueue image map"); + test->testError(error, "Unable to enqueue image map"); EXPECT_NE(nullptr, mappedPtr2); - test->test_error(error, "Unable to enqueue buffer map"); + test->testError(error, "Unable to enqueue buffer map"); error = clEnqueueUnmapMemObject(test->pCmdQ, test->image, mappedPtr, 0, nullptr, nullptr); error = clEnqueueUnmapMemObject(test->pCmdQ, test->imageNonZeroCopy, mappedPtr2, 0, nullptr, nullptr); @@ -169,7 +169,7 @@ TEST_P(EnqueueWaitlistTest, GivenCompletedUserEventOnWaitlistWhenWaitingForOutpu // Set up a user event, which we use as a gate for the second event clEventWrapper gateEvent = clCreateUserEvent(context, &error); - test_error(error, "Unable to set up user gate event"); + testError(error, "Unable to set up user gate event"); // Set up the execution of the action with its actual event clEventWrapper actualEvent; @@ -179,11 +179,11 @@ TEST_P(EnqueueWaitlistTest, GivenCompletedUserEventOnWaitlistWhenWaitingForOutpu // Now release the user event, which will allow our actual action to run error = clSetUserEventStatus(gateEvent, CL_COMPLETE); - test_error(error, "Unable to trigger gate event"); + testError(error, "Unable to trigger gate event"); // Now we wait for completion. Note that we can actually wait on the event itself, at least at first error = clWaitForEvents(1, &actualEvent); - test_error(error, "Unable to wait for actual test event"); + testError(error, "Unable to wait for actual test event"); } typedef EnqueueWaitlistTest EnqueueWaitlistTestTwoMapEnqueues; @@ -191,7 +191,7 @@ TEST_P(EnqueueWaitlistTestTwoMapEnqueues, GivenCompletedUserEventOnWaitlistWhenW // Set up a user event, which we use as a gate for the second event clEventWrapper gateEvent = clCreateUserEvent(context, &error); - test_error(error, "Unable to set up user gate event"); + testError(error, "Unable to set up user gate event"); // Set up the execution of the action with its actual event clEventWrapper actualEvent; @@ -204,38 +204,38 @@ TEST_P(EnqueueWaitlistTestTwoMapEnqueues, GivenCompletedUserEventOnWaitlistWhenW // Now we wait for completion. Note that we can actually wait on the event itself, at least at first error = clWaitForEvents(1, &actualEvent); - test_error(error, "Unable to wait for actual test event"); + testError(error, "Unable to wait for actual test event"); } TEST_P(EnqueueWaitlistTest, GivenCompletedUserEventOnWaitlistWhenFinishingCommandQueueThenSuccessIsReturned) { // Set up a user event, which we use as a gate for the second event clEventWrapper gateEvent = clCreateUserEvent(context, &error); - test_error(error, "Unable to set up user gate event"); + testError(error, "Unable to set up user gate event"); // call the function to execute GetParam()(this, 1, &gateEvent, nullptr, false); // Now release the user event, which will allow our actual action to run error = clSetUserEventStatus(gateEvent, CL_COMPLETE); - test_error(error, "Unable to trigger gate event"); + testError(error, "Unable to trigger gate event"); // Now we wait for completion. Note that we can actually wait on the event itself, at least at first error = clFinish(pCmdQ); - test_error(error, "Finish FAILED"); + testError(error, "Finish FAILED"); } ExecuteEnqueue Enqueues[] = { - &EnqueueWaitlistTest::EnqueueNDRange, - &EnqueueWaitlistTest::EnqueueMapBuffer, - &EnqueueWaitlistTest::EnqueueUnMapBuffer, - &EnqueueWaitlistTest::EnqueueMapImage}; + &EnqueueWaitlistTest::enqueueNDRange, + &EnqueueWaitlistTest::enqueueMapBuffer, + &EnqueueWaitlistTest::enqueueUnMapBuffer, + &EnqueueWaitlistTest::enqueueMapImage}; ExecuteEnqueue TwoEnqueueMap[] = { - &EnqueueWaitlistTest::TwoEnqueueMapBuffer, - &EnqueueWaitlistTest::TwoEnqueueMapImage}; + &EnqueueWaitlistTest::twoEnqueueMapBuffer, + &EnqueueWaitlistTest::twoEnqueueMapImage}; INSTANTIATE_TEST_CASE_P( UnblockedEvent, diff --git a/opencl/test/unit_test/command_queue/sync_buffer_handler_tests.cpp b/opencl/test/unit_test/command_queue/sync_buffer_handler_tests.cpp index 71968c6a11..699897d869 100644 --- a/opencl/test/unit_test/command_queue/sync_buffer_handler_tests.cpp +++ b/opencl/test/unit_test/command_queue/sync_buffer_handler_tests.cpp @@ -64,7 +64,7 @@ class SyncBufferHandlerTest : public SyncBufferEnqueueHandlerTest { void TearDown() override {} template - void SetUpT() { + void setUpT() { SyncBufferEnqueueHandlerTest::SetUp(); kernelInternals = std::make_unique(*pClDevice, context); kernelInternals->kernelInfo.kernelDescriptor.kernelAttributes.bufferAddressingMode = KernelDescriptor::Stateless; @@ -78,7 +78,7 @@ class SyncBufferHandlerTest : public SyncBufferEnqueueHandlerTest { } template - void TearDownT() { + void tearDownT() { commandQueue->release(); kernelInternals.reset(); SyncBufferEnqueueHandlerTest::TearDown(); diff --git a/opencl/test/unit_test/command_stream/command_stream_fixture.h b/opencl/test/unit_test/command_stream/command_stream_fixture.h index 838d55a3c4..e0c86fc118 100644 --- a/opencl/test/unit_test/command_stream/command_stream_fixture.h +++ b/opencl/test/unit_test/command_stream/command_stream_fixture.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -13,12 +13,12 @@ namespace NEO { struct CommandStreamFixture { - void SetUp(CommandQueue *pCmdQ) { + void SetUp(CommandQueue *pCmdQ) { // NOLINT(readability-identifier-naming) pCS = &pCmdQ->getCS(1024); pCmdBuffer = pCS->getCpuBase(); } - virtual void TearDown() { + virtual void TearDown() { // NOLINT(readability-identifier-naming) } LinearStream *pCS = nullptr; diff --git a/opencl/test/unit_test/context/context_multi_device_tests.cpp b/opencl/test/unit_test/context/context_multi_device_tests.cpp index 969e1a4e9d..4a2d89b3c3 100644 --- a/opencl/test/unit_test/context/context_multi_device_tests.cpp +++ b/opencl/test/unit_test/context/context_multi_device_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -61,7 +61,7 @@ TEST(ContextMultiDevice, GivenMultipleDevicesWhenCreatingContextThenContextIsCre new MockClDevice{MockDevice::createWithNewExecutionEnvironment(nullptr)}, new MockClDevice{MockDevice::createWithNewExecutionEnvironment(nullptr)}}; auto numDevices = static_cast(arrayCount(devices)); - ASSERT_EQ(8u, numDevices); + ASSERT_EQ(8u, numDevices); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) auto retVal = CL_SUCCESS; auto pContext = Context::create(nullptr, ClDeviceVector(devices, numDevices), diff --git a/opencl/test/unit_test/device/device_caps_tests.cpp b/opencl/test/unit_test/device/device_caps_tests.cpp index 3bd56bb1fb..da11ed45d1 100644 --- a/opencl/test/unit_test/device/device_caps_tests.cpp +++ b/opencl/test/unit_test/device/device_caps_tests.cpp @@ -1140,7 +1140,7 @@ TEST_F(DeviceGetCapsTest, givenSystemWithDriverInfoWhenGettingNameAndVersionThen } TEST_F(DeviceGetCapsTest, givenNoPciBusInfoThenPciBusInfoExtensionNotAvailable) { - const PhysicalDevicePciBusInfo pciBusInfo(PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue); + const PhysicalDevicePciBusInfo pciBusInfo(PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue); DriverInfoMock *driverInfoMock = new DriverInfoMock(); driverInfoMock->setPciBusInfo(pciBusInfo); diff --git a/opencl/test/unit_test/device/device_tests.cpp b/opencl/test/unit_test/device/device_tests.cpp index d79e07be2a..2206e6ef61 100644 --- a/opencl/test/unit_test/device/device_tests.cpp +++ b/opencl/test/unit_test/device/device_tests.cpp @@ -126,10 +126,10 @@ TEST_F(DeviceTest, WhenRetainingThenReferenceIsOneAndApiIsUsed) { TEST_F(DeviceTest, givenNoPciBusInfoThenIsPciBusInfoValidReturnsFalse) { PhysicalDevicePciBusInfo invalidPciBusInfoList[] = { - PhysicalDevicePciBusInfo(0, 1, 2, PhysicalDevicePciBusInfo::InvalidValue), - PhysicalDevicePciBusInfo(0, 1, PhysicalDevicePciBusInfo::InvalidValue, 3), - PhysicalDevicePciBusInfo(0, PhysicalDevicePciBusInfo::InvalidValue, 2, 3), - PhysicalDevicePciBusInfo(PhysicalDevicePciBusInfo::InvalidValue, 1, 2, 3)}; + PhysicalDevicePciBusInfo(0, 1, 2, PhysicalDevicePciBusInfo::invalidValue), + PhysicalDevicePciBusInfo(0, 1, PhysicalDevicePciBusInfo::invalidValue, 3), + PhysicalDevicePciBusInfo(0, PhysicalDevicePciBusInfo::invalidValue, 2, 3), + PhysicalDevicePciBusInfo(PhysicalDevicePciBusInfo::invalidValue, 1, 2, 3)}; for (auto pciBusInfo : invalidPciBusInfoList) { auto driverInfo = new DriverInfoMock(); diff --git a/opencl/test/unit_test/device/get_device_info_tests.cpp b/opencl/test/unit_test/device/get_device_info_tests.cpp index ce47fbf822..5d43a55d8a 100644 --- a/opencl/test/unit_test/device/get_device_info_tests.cpp +++ b/opencl/test/unit_test/device/get_device_info_tests.cpp @@ -1028,7 +1028,7 @@ TEST(GetDeviceInfoTest, givenPciBusInfoWhenGettingPciBusInfoForDeviceThenPciBusI } TEST(GetDeviceInfoTest, givenPciBusInfoIsNotAvailableWhenGettingPciBusInfoForDeviceThenInvalidValueIsReturned) { - PhysicalDevicePciBusInfo pciBusInfo(PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue); + PhysicalDevicePciBusInfo pciBusInfo(PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue); auto driverInfo = new DriverInfoMock(); driverInfo->setPciBusInfo(pciBusInfo); diff --git a/opencl/test/unit_test/event/event_tests.cpp b/opencl/test/unit_test/event/event_tests.cpp index 189839ed82..7b04162c57 100644 --- a/opencl/test/unit_test/event/event_tests.cpp +++ b/opencl/test/unit_test/event/event_tests.cpp @@ -360,7 +360,7 @@ TEST_F(EventTest, GivenRetainAndReleaseEventWhenGettingClEventReferenceCountThen uint32_t tagEvent = 5; Event *pEvent = new Event(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, 3, tagEvent); - ASSERT_NE(nullptr, pEvent); + ASSERT_NE(nullptr, pEvent); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) pEvent->retain(); auto retVal = pEvent->getReference(); @@ -374,7 +374,7 @@ TEST_F(EventTest, GivenRetainAndReleaseEventWhenGettingClEventReferenceCountThen EXPECT_EQ(2u, refCount); pEvent->release(); - retVal = pEvent->getReference(); + retVal = pEvent->getReference(); // NOLINT(clang-analyzer-cplusplus.NewDelete) EXPECT_EQ(1, retVal); delete pEvent; @@ -384,7 +384,7 @@ TEST_F(EventTest, WhenGettingClEventContextThenCorrectValueIsReturned) { uint32_t tagEvent = 5; Event *pEvent = new Event(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, 3, tagEvent); - ASSERT_NE(nullptr, pEvent); + ASSERT_NE(nullptr, pEvent); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) cl_context context; size_t sizeReturned = 0; @@ -1154,13 +1154,13 @@ HWTEST_F(InternalsEventTest, GivenBufferWithoutZeroCopyWhenMappingOrUnmappingThe TEST(EventCallback, WhenOverridingStatusThenEventUsesNewStatus) { struct ClbFuncTempStruct { - static void CL_CALLBACK ClbFuncT(cl_event e, cl_int status, void *retStatus) { + static void CL_CALLBACK clbFuncT(cl_event e, cl_int status, void *retStatus) { *((cl_int *)retStatus) = status; } }; cl_int retStatus = 7; - Event::Callback clb(nullptr, ClbFuncTempStruct::ClbFuncT, CL_COMPLETE, &retStatus); + Event::Callback clb(nullptr, ClbFuncTempStruct::clbFuncT, CL_COMPLETE, &retStatus); EXPECT_EQ(CL_COMPLETE, clb.getCallbackExecutionStatusTarget()); clb.execute(); EXPECT_EQ(CL_COMPLETE, retStatus); @@ -1388,7 +1388,7 @@ TEST(EventCallback, GivenEventWithCallbacksOnWhenPeekingHasCallbacksThenReturnTr DebugManagerStateRestore dbgRestore; DebugManager.flags.EnableAsyncEventsHandler.set(false); struct ClbFuncTempStruct { - static void CL_CALLBACK ClbFuncT(cl_event, cl_int, void *) { + static void CL_CALLBACK clbFuncT(cl_event, cl_int, void *) { } }; @@ -1406,29 +1406,29 @@ TEST(EventCallback, GivenEventWithCallbacksOnWhenPeekingHasCallbacksThenReturnTr { SmallMockEvent ev; - ev.addCallback(ClbFuncTempStruct::ClbFuncT, CL_SUBMITTED, nullptr); + ev.addCallback(ClbFuncTempStruct::clbFuncT, CL_SUBMITTED, nullptr); EXPECT_TRUE(ev.peekHasCallbacks()); ev.decRefInternal(); } { SmallMockEvent ev; - ev.addCallback(ClbFuncTempStruct::ClbFuncT, CL_RUNNING, nullptr); + ev.addCallback(ClbFuncTempStruct::clbFuncT, CL_RUNNING, nullptr); EXPECT_TRUE(ev.peekHasCallbacks()); ev.decRefInternal(); } { SmallMockEvent ev; - ev.addCallback(ClbFuncTempStruct::ClbFuncT, CL_COMPLETE, nullptr); + ev.addCallback(ClbFuncTempStruct::clbFuncT, CL_COMPLETE, nullptr); EXPECT_TRUE(ev.peekHasCallbacks()); ev.decRefInternal(); } { SmallMockEvent ev; - ev.addCallback(ClbFuncTempStruct::ClbFuncT, CL_SUBMITTED, nullptr); - ev.addCallback(ClbFuncTempStruct::ClbFuncT, CL_COMPLETE, nullptr); + ev.addCallback(ClbFuncTempStruct::clbFuncT, CL_SUBMITTED, nullptr); + ev.addCallback(ClbFuncTempStruct::clbFuncT, CL_COMPLETE, nullptr); EXPECT_TRUE(ev.peekHasCallbacks()); ev.decRefInternal(); ev.decRefInternal(); @@ -1436,8 +1436,8 @@ TEST(EventCallback, GivenEventWithCallbacksOnWhenPeekingHasCallbacksThenReturnTr { SmallMockEvent ev; - ev.addCallback(ClbFuncTempStruct::ClbFuncT, CL_RUNNING, nullptr); - ev.addCallback(ClbFuncTempStruct::ClbFuncT, CL_COMPLETE, nullptr); + ev.addCallback(ClbFuncTempStruct::clbFuncT, CL_RUNNING, nullptr); + ev.addCallback(ClbFuncTempStruct::clbFuncT, CL_COMPLETE, nullptr); EXPECT_TRUE(ev.peekHasCallbacks()); ev.decRefInternal(); ev.decRefInternal(); @@ -1445,9 +1445,9 @@ TEST(EventCallback, GivenEventWithCallbacksOnWhenPeekingHasCallbacksThenReturnTr { SmallMockEvent ev; - ev.addCallback(ClbFuncTempStruct::ClbFuncT, CL_SUBMITTED, nullptr); - ev.addCallback(ClbFuncTempStruct::ClbFuncT, CL_RUNNING, nullptr); - ev.addCallback(ClbFuncTempStruct::ClbFuncT, CL_COMPLETE, nullptr); + ev.addCallback(ClbFuncTempStruct::clbFuncT, CL_SUBMITTED, nullptr); + ev.addCallback(ClbFuncTempStruct::clbFuncT, CL_RUNNING, nullptr); + ev.addCallback(ClbFuncTempStruct::clbFuncT, CL_COMPLETE, nullptr); EXPECT_TRUE(ev.peekHasCallbacks()); ev.decRefInternal(); ev.decRefInternal(); @@ -1762,4 +1762,4 @@ TEST(EventTimestampTest, givenEnableTimestampWaitWhenCheckIsTimestampWaitEnabled DebugManager.flags.EnableTimestampWaitForEvents.set(4); EXPECT_TRUE(event.isWaitForTimestampsEnabled()); } -} \ No newline at end of file +} diff --git a/opencl/test/unit_test/event/user_events_tests.cpp b/opencl/test/unit_test/event/user_events_tests.cpp index 99e1f2a6e1..602eaf4ecb 100644 --- a/opencl/test/unit_test/event/user_events_tests.cpp +++ b/opencl/test/unit_test/event/user_events_tests.cpp @@ -804,7 +804,7 @@ TEST_F(EventTests, givenUserEventThatHasCallbackAndBlockQueueWhenQueueIsQueriedF auto event1 = MockEventBuilder::createAndFinalize(&pCmdQ->getContext()); struct E2Clb { - static void CL_CALLBACK SignalEv2(cl_event e, cl_int status, void *data) { + static void CL_CALLBACK signalEv2(cl_event e, cl_int status, void *data) { bool *called = (bool *)data; *called = true; } @@ -819,7 +819,7 @@ TEST_F(EventTests, givenUserEventThatHasCallbackAndBlockQueueWhenQueueIsQueriedF ASSERT_EQ(retVal, CL_SUCCESS); bool callbackCalled = false; - retVal = clSetEventCallback(event1, CL_COMPLETE, E2Clb::SignalEv2, &callbackCalled); + retVal = clSetEventCallback(event1, CL_COMPLETE, E2Clb::signalEv2, &callbackCalled); ASSERT_EQ(retVal, CL_SUCCESS); EXPECT_EQ(1, event1->updated); @@ -841,7 +841,7 @@ TEST_F(EventTests, GivenEventCallbackWithWaitWhenWaitingForEventsThenSuccessIsRe DebugManager.flags.EnableAsyncEventsHandler.set(false); UserEvent event1; struct E2Clb { - static void CL_CALLBACK SignalEv2(cl_event e, cl_int status, void *data) + static void CL_CALLBACK signalEv2(cl_event e, cl_int status, void *data) { UserEvent *event2 = static_cast(data); @@ -857,7 +857,7 @@ TEST_F(EventTests, GivenEventCallbackWithWaitWhenWaitingForEventsThenSuccessIsRe retVal = clWaitForEvents(1, &retEvent); EXPECT_EQ(CL_SUCCESS, retVal); - clSetEventCallback(retEvent, CL_COMPLETE, E2Clb::SignalEv2, &event1); + clSetEventCallback(retEvent, CL_COMPLETE, E2Clb::signalEv2, &event1); cl_event events[] = {&event1}; auto result = UserEvent::waitForEvents(sizeof(events) / sizeof(events[0]), events); @@ -872,7 +872,7 @@ TEST_F(EventTests, GivenEventCallbackWithoutWaitWhenWaitingForEventsThenSuccessI DebugManager.flags.EnableAsyncEventsHandler.set(false); UserEvent event1(context); struct E2Clb { - static void CL_CALLBACK SignalEv2(cl_event e, cl_int status, void *data) + static void CL_CALLBACK signalEv2(cl_event e, cl_int status, void *data) { UserEvent *event2 = static_cast(data); @@ -885,7 +885,7 @@ TEST_F(EventTests, GivenEventCallbackWithoutWaitWhenWaitingForEventsThenSuccessI retVal = callOneWorkItemNDRKernel(nullptr, 0, &retEvent); EXPECT_EQ(CL_SUCCESS, retVal); - clSetEventCallback(retEvent, CL_COMPLETE, E2Clb::SignalEv2, &event1); + clSetEventCallback(retEvent, CL_COMPLETE, E2Clb::signalEv2, &event1); cl_event events[] = {&event1}; auto result = UserEvent::waitForEvents(sizeof(events) / sizeof(events[0]), events); @@ -970,7 +970,7 @@ TEST_F(EventTest, GivenMultipleOutOfOrderCallbacksWhenWaitingForEventsThenSucces DebugManager.flags.EnableAsyncEventsHandler.set(false); UserEvent event1; struct E2Clb { - static void CL_CALLBACK SignalEv2(cl_event e, cl_int status, void *data) + static void CL_CALLBACK signalEv2(cl_event e, cl_int status, void *data) { UserEvent *event2 = static_cast(data); @@ -979,7 +979,7 @@ TEST_F(EventTest, GivenMultipleOutOfOrderCallbacksWhenWaitingForEventsThenSucces }; UserEvent event2; - event2.addCallback(E2Clb::SignalEv2, CL_COMPLETE, &event1); + event2.addCallback(E2Clb::signalEv2, CL_COMPLETE, &event1); event2.setStatus(CL_COMPLETE); cl_event events[] = {&event1, &event2}; auto result = UserEvent::waitForEvents(sizeof(events) / sizeof(events[0]), events); @@ -990,7 +990,7 @@ TEST_F(EventTests, WhenCalbackWasRegisteredOnCallbackThenExecutionPassesCorrectE DebugManagerStateRestore dbgRestore; DebugManager.flags.EnableAsyncEventsHandler.set(false); struct HelperClb { - static void CL_CALLBACK SetClbStatus(cl_event e, cl_int status, void *data) + static void CL_CALLBACK setClbStatus(cl_event e, cl_int status, void *data) { cl_int *ret = static_cast(data); @@ -1005,11 +1005,11 @@ TEST_F(EventTests, WhenCalbackWasRegisteredOnCallbackThenExecutionPassesCorrectE cl_int submittedClbExecStatus = -1; cl_int runningClbExecStatus = -1; cl_int completeClbExecStatus = -1; - retVal = clSetEventCallback(retEvent, CL_SUBMITTED, HelperClb::SetClbStatus, &submittedClbExecStatus); + retVal = clSetEventCallback(retEvent, CL_SUBMITTED, HelperClb::setClbStatus, &submittedClbExecStatus); ASSERT_EQ(CL_SUCCESS, retVal); - retVal = clSetEventCallback(retEvent, CL_RUNNING, HelperClb::SetClbStatus, &runningClbExecStatus); + retVal = clSetEventCallback(retEvent, CL_RUNNING, HelperClb::setClbStatus, &runningClbExecStatus); ASSERT_EQ(CL_SUCCESS, retVal); - retVal = clSetEventCallback(retEvent, CL_COMPLETE, HelperClb::SetClbStatus, &completeClbExecStatus); + retVal = clSetEventCallback(retEvent, CL_COMPLETE, HelperClb::setClbStatus, &completeClbExecStatus); ASSERT_EQ(CL_SUCCESS, retVal); auto result = UserEvent::waitForEvents(1, &retEvent); diff --git a/opencl/test/unit_test/fixtures/built_in_fixture.h b/opencl/test/unit_test/fixtures/built_in_fixture.h index 418eac4ec2..fe8c4d7d01 100644 --- a/opencl/test/unit_test/fixtures/built_in_fixture.h +++ b/opencl/test/unit_test/fixtures/built_in_fixture.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -14,8 +14,8 @@ class Device; class BuiltInFixture { public: - void SetUp(NEO::Device *pDevice); - void TearDown(); + void SetUp(NEO::Device *pDevice); // NOLINT(readability-identifier-naming) + void TearDown(); // NOLINT(readability-identifier-naming) NEO::BuiltIns *pBuiltIns = nullptr; }; diff --git a/opencl/test/unit_test/fixtures/cl_device_fixture.h b/opencl/test/unit_test/fixtures/cl_device_fixture.h index b5446b323b..944252252d 100644 --- a/opencl/test/unit_test/fixtures/cl_device_fixture.h +++ b/opencl/test/unit_test/fixtures/cl_device_fixture.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -14,9 +14,9 @@ namespace NEO { struct HardwareInfo; struct ClDeviceFixture { - void SetUp(); - void SetUpImpl(const NEO::HardwareInfo *hardwareInfo); - void TearDown(); + void SetUp(); // NOLINT(readability-identifier-naming) + void SetUpImpl(const NEO::HardwareInfo *hardwareInfo); // NOLINT(readability-identifier-naming) + void TearDown(); // NOLINT(readability-identifier-naming) MockDevice *createWithUsDeviceId(unsigned short usDeviceId); diff --git a/opencl/test/unit_test/fixtures/context_fixture.h b/opencl/test/unit_test/fixtures/context_fixture.h index 64d95bfcd0..12086f84a5 100644 --- a/opencl/test/unit_test/fixtures/context_fixture.h +++ b/opencl/test/unit_test/fixtures/context_fixture.h @@ -13,8 +13,8 @@ class MockContext; class ContextFixture { protected: - void SetUp(cl_uint numDevices, cl_device_id *pDeviceList); - void TearDown(); + void SetUp(cl_uint numDevices, cl_device_id *pDeviceList); // NOLINT(readability-identifier-naming) + void TearDown(); // NOLINT(readability-identifier-naming) MockContext *pContext = nullptr; }; diff --git a/opencl/test/unit_test/fixtures/device_instrumentation_fixture.h b/opencl/test/unit_test/fixtures/device_instrumentation_fixture.h index a147b087e0..a57d0ff103 100644 --- a/opencl/test/unit_test/fixtures/device_instrumentation_fixture.h +++ b/opencl/test/unit_test/fixtures/device_instrumentation_fixture.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2020 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -14,7 +14,7 @@ class Device; struct HardwareInfo; struct DeviceInstrumentationFixture { - void SetUp(bool instrumentation); + void SetUp(bool instrumentation); // NOLINT(readability-identifier-naming) std::unique_ptr device = nullptr; HardwareInfo *hwInfo = nullptr; diff --git a/opencl/test/unit_test/fixtures/dispatch_flags_fixture.h b/opencl/test/unit_test/fixtures/dispatch_flags_fixture.h index eb0ab156cd..e151f896bb 100644 --- a/opencl/test/unit_test/fixtures/dispatch_flags_fixture.h +++ b/opencl/test/unit_test/fixtures/dispatch_flags_fixture.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Intel Corporation + * Copyright (C) 2019-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -20,7 +20,7 @@ namespace NEO { template struct DispatchFlagsTestsBase : public ::testing::Test { template - void SetUpImpl() { + void SetUpImpl() { // NOLINT(readability-identifier-naming) HardwareInfo hwInfo = *defaultHwInfo; if (setupBlitter) { hwInfo.capabilityTable.blitterOperationsSupported = true; diff --git a/opencl/test/unit_test/fixtures/one_mip_level_image_fixture.h b/opencl/test/unit_test/fixtures/one_mip_level_image_fixture.h index 9bb5a1e22d..1e15415017 100644 --- a/opencl/test/unit_test/fixtures/one_mip_level_image_fixture.h +++ b/opencl/test/unit_test/fixtures/one_mip_level_image_fixture.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -29,7 +29,7 @@ struct OneMipLevelImageFixture { } }; - void SetUp() { + void SetUp() { // NOLINT(readability-identifier-naming) REQUIRE_IMAGES_OR_SKIP(defaultHwInfo); cl_image_desc imageDesc = Image3dDefaults::imageDesc; @@ -40,7 +40,7 @@ struct OneMipLevelImageFixture { this->image.reset(createImage()); } - void TearDown() { + void TearDown() { // NOLINT(readability-identifier-naming) } Image *createImage() { diff --git a/opencl/test/unit_test/fixtures/platform_fixture.h b/opencl/test/unit_test/fixtures/platform_fixture.h index 43d6e282ee..64563d4466 100644 --- a/opencl/test/unit_test/fixtures/platform_fixture.h +++ b/opencl/test/unit_test/fixtures/platform_fixture.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -13,8 +13,8 @@ namespace NEO { class PlatformFixture { protected: - void SetUp(); - void TearDown(); + void SetUp(); // NOLINT(readability-identifier-naming) + void TearDown(); // NOLINT(readability-identifier-naming) Platform *pPlatform = nullptr; diff --git a/opencl/test/unit_test/fixtures/program_fixture.h b/opencl/test/unit_test/fixtures/program_fixture.h index bb73878842..488e5e5302 100644 --- a/opencl/test/unit_test/fixtures/program_fixture.h +++ b/opencl/test/unit_test/fixtures/program_fixture.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -18,29 +18,29 @@ namespace NEO { class ProgramFixture { public: - void CreateProgramFromBinary(Context *pContext, + void CreateProgramFromBinary(Context *pContext, // NOLINT(readability-identifier-naming) const ClDeviceVector &deviceVector, const std::string &binaryFileName, cl_int &retVal, const std::string &options = ""); - void CreateProgramFromBinary(Context *pContext, + void CreateProgramFromBinary(Context *pContext, // NOLINT(readability-identifier-naming) const ClDeviceVector &deviceVector, const std::string &binaryFileName, const std::string &options = ""); - void CreateProgramWithSource(Context *pContext, + void CreateProgramWithSource(Context *pContext, // NOLINT(readability-identifier-naming) const std::string &sourceFileName); protected: - virtual void SetUp() { + virtual void SetUp() { // NOLINT(readability-identifier-naming) } - virtual void TearDown() { + virtual void TearDown() { // NOLINT(readability-identifier-naming) Cleanup(); } - void Cleanup() { + void Cleanup() { // NOLINT(readability-identifier-naming) if (pProgram != nullptr) { pProgram->release(); } diff --git a/opencl/test/unit_test/gmm_helper/gmm_helper_tests.cpp b/opencl/test/unit_test/gmm_helper/gmm_helper_tests.cpp index d809dba5e9..1a23bbfaf2 100644 --- a/opencl/test/unit_test/gmm_helper/gmm_helper_tests.cpp +++ b/opencl/test/unit_test/gmm_helper/gmm_helper_tests.cpp @@ -120,7 +120,7 @@ TEST_F(GmmTests, GivenBufferSizeLargerThenMaxPitchWhenAskedForGmmCreationThenGmm auto gmmRes = new Gmm(getGmmHelper(), pSysMem, maxSize, 0, GMM_RESOURCE_USAGE_OCL_BUFFER, false, {}, true); - ASSERT_TRUE(gmmRes->gmmResourceInfo.get() != nullptr); + ASSERT_TRUE(gmmRes->gmmResourceInfo.get() != nullptr); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) EXPECT_EQ(gmmRes->resourceParams.Flags.Gpu.NoRestriction, 1u); diff --git a/opencl/test/unit_test/gtpin/gtpin_tests.cpp b/opencl/test/unit_test/gtpin/gtpin_tests.cpp index 84e2a033e7..9765dbd891 100644 --- a/opencl/test/unit_test/gtpin/gtpin_tests.cpp +++ b/opencl/test/unit_test/gtpin/gtpin_tests.cpp @@ -163,10 +163,10 @@ class GTPinFixture : public ContextFixture, public MemoryManagementFixture { public: void SetUp() override { DebugManager.flags.GTPinAllocateBufferInSharedMemory.set(false); - SetUpImpl(); + setUpImpl(); } - void SetUpImpl() { + void setUpImpl() { platformsImpl->clear(); MemoryManagementFixture::SetUp(); constructPlatform(); @@ -2393,7 +2393,7 @@ class GTPinFixtureWithLocalMemory : public GTPinFixture { void SetUp() override { DebugManager.flags.EnableLocalMemory.set(true); DebugManager.flags.GTPinAllocateBufferInSharedMemory.set(true); - GTPinFixture::SetUpImpl(); + GTPinFixture::setUpImpl(); } void TearDown() override { GTPinFixture::TearDown(); diff --git a/opencl/test/unit_test/helpers/base_object_tests.cpp b/opencl/test/unit_test/helpers/base_object_tests.cpp index 7afd64e290..ce65fbe406 100644 --- a/opencl/test/unit_test/helpers/base_object_tests.cpp +++ b/opencl/test/unit_test/helpers/base_object_tests.cpp @@ -145,7 +145,7 @@ TYPED_TEST(BaseObjectTests, WhenRetainingAndReleasingThenObjectReferenceIsUpdate EXPECT_EQ(2, object->getReference()); object->release(); - EXPECT_EQ(1, object->getReference()); + EXPECT_EQ(1, object->getReference()); // NOLINT(clang-analyzer-cplusplus.NewDelete) object->release(); @@ -331,7 +331,7 @@ TYPED_TEST(BaseObjectTests, WhenConvertingToInternalObjectThenRefApiCountIsSetTo EXPECT_EQ(1, object->getRefApiCount()); EXPECT_EQ(1, object->getRefInternalCount()); object->convertToInternalObject(); - EXPECT_EQ(0, object->getRefApiCount()); + EXPECT_EQ(0, object->getRefApiCount()); // NOLINT(clang-analyzer-cplusplus.NewDelete) EXPECT_EQ(1, object->getRefInternalCount()); object->decRefInternal(); } diff --git a/opencl/test/unit_test/helpers/dispatch_info_builder_tests.cpp b/opencl/test/unit_test/helpers/dispatch_info_builder_tests.cpp index 6dbd5a6b86..708913fa8c 100644 --- a/opencl/test/unit_test/helpers/dispatch_info_builder_tests.cpp +++ b/opencl/test/unit_test/helpers/dispatch_info_builder_tests.cpp @@ -84,7 +84,7 @@ TEST_F(DispatchInfoBuilderTest, Given1dWhenSplittingMultiDispatchInfoThenMultiDi MultiDispatchInfo multiDispatchInfo; auto diBuilder = new DispatchInfoBuilderMock(*pClDevice); - ASSERT_NE(nullptr, diBuilder); + ASSERT_NE(nullptr, diBuilder); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) DispatchInfo dispatchInfo; diBuilder->pushSplit(dispatchInfo, multiDispatchInfo); @@ -97,13 +97,13 @@ TEST_F(DispatchInfoBuilderTest, WhenGettingDimensionThenCorrectDimensionIsReturn MultiDispatchInfo mdi1D, mdi2D, mdi3D; DispatchInfoBuilder *diBuilder1D = new DispatchInfoBuilder(*pClDevice); - ASSERT_NE(nullptr, diBuilder1D); + ASSERT_NE(nullptr, diBuilder1D); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) DispatchInfoBuilder *diBuilder2D = new DispatchInfoBuilder(*pClDevice); - ASSERT_NE(nullptr, diBuilder2D); + ASSERT_NE(nullptr, diBuilder2D); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) DispatchInfoBuilder *diBuilder3D = new DispatchInfoBuilder(*pClDevice); - ASSERT_NE(nullptr, diBuilder3D); + ASSERT_NE(nullptr, diBuilder3D); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) diBuilder1D->setDispatchGeometry(Vec3(1, 0, 0), Vec3(0, 0, 0), Vec3(0, 0, 0)); diBuilder1D->bake(mdi1D); @@ -130,7 +130,7 @@ TEST_F(DispatchInfoBuilderTest, WhenGettingDimensionThenCorrectDimensionIsReturn TEST_F(DispatchInfoBuilderTest, WhenGettingGwsThenCorrectValuesAreReturned) { DispatchInfoBuilder *diBuilder = new DispatchInfoBuilder(*pClDevice); - ASSERT_NE(nullptr, diBuilder); + ASSERT_NE(nullptr, diBuilder); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) MultiDispatchInfo mdi0, mdi1, mdi2, mdi3; @@ -176,7 +176,7 @@ TEST_F(DispatchInfoBuilderTest, WhenGettingGwsThenCorrectValuesAreReturned) { TEST_F(DispatchInfoBuilderTest, WhenGettingElwsThenCorrectValuesAreReturned) { DispatchInfoBuilder *diBuilder = new DispatchInfoBuilder(*pClDevice); - ASSERT_NE(nullptr, diBuilder); + ASSERT_NE(nullptr, diBuilder); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) MultiDispatchInfo mdi0, mdi1, mdi2, mdi3; @@ -261,7 +261,7 @@ TEST_F(DispatchInfoBuilderTest, WhenGettingLwsThenCorrectValuesAreReturned) { TEST_F(DispatchInfoBuilderTest, GivenNoSplitWhenCheckingIfBuiltinThenReturnTrue) { DispatchInfoBuilder *diBuilder = new DispatchInfoBuilder(*pClDevice); - ASSERT_NE(nullptr, diBuilder); + ASSERT_NE(nullptr, diBuilder); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) diBuilder->setKernel(pKernel); diBuilder->setDispatchGeometry(Vec3(256, 256, 256), Vec3(16, 16, 16), Vec3(0, 0, 0)); @@ -278,13 +278,13 @@ TEST_F(DispatchInfoBuilderTest, GivenNoSplitWhenCheckingIfBuiltinThenReturnTrue) TEST_F(DispatchInfoBuilderTest, GivenSplitWhenCheckingIfBuiltinThenReturnTrue) { DispatchInfoBuilder *diBuilder1D = new DispatchInfoBuilder(*pClDevice); - ASSERT_NE(nullptr, diBuilder1D); + ASSERT_NE(nullptr, diBuilder1D); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) DispatchInfoBuilder *diBuilder2D = new DispatchInfoBuilder(*pClDevice); - ASSERT_NE(nullptr, diBuilder2D); + ASSERT_NE(nullptr, diBuilder2D); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) DispatchInfoBuilder *diBuilder3D = new DispatchInfoBuilder(*pClDevice); - ASSERT_NE(nullptr, diBuilder3D); + ASSERT_NE(nullptr, diBuilder3D); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) // 1D diBuilder1D->setKernel(RegionCoordX::Left, pKernel); @@ -325,13 +325,13 @@ TEST_F(DispatchInfoBuilderTest, GivenSplitWhenCheckingIfBuiltinThenReturnTrue) { TEST_F(DispatchInfoBuilderTest, GivenNoSplitWhenGettingWalkerInfoThenCorrectValuesAreReturned) { DispatchInfoBuilder *diBuilder1D = new DispatchInfoBuilder(*pClDevice); - ASSERT_NE(nullptr, diBuilder1D); + ASSERT_NE(nullptr, diBuilder1D); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) DispatchInfoBuilder *diBuilder2D = new DispatchInfoBuilder(*pClDevice); - ASSERT_NE(nullptr, diBuilder2D); + ASSERT_NE(nullptr, diBuilder2D); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) DispatchInfoBuilder *diBuilder3D = new DispatchInfoBuilder(*pClDevice); - ASSERT_NE(nullptr, diBuilder3D); + ASSERT_NE(nullptr, diBuilder3D); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) // 1D diBuilder1D->setKernel(pKernel); @@ -436,13 +436,13 @@ TEST_F(DispatchInfoBuilderTest, GivenNoSplitWhenGettingWalkerInfoThenCorrectValu TEST_F(DispatchInfoBuilderTest, GivenSplitWhenGettingWalkerInfoThenCorrectValuesAreReturned) { DispatchInfoBuilder *diBuilder1D = new DispatchInfoBuilder(*pClDevice); - ASSERT_NE(nullptr, diBuilder1D); + ASSERT_NE(nullptr, diBuilder1D); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) DispatchInfoBuilder *diBuilder2D = new DispatchInfoBuilder(*pClDevice); - ASSERT_NE(nullptr, diBuilder2D); + ASSERT_NE(nullptr, diBuilder2D); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) DispatchInfoBuilder *diBuilder3D = new DispatchInfoBuilder(*pClDevice); - ASSERT_NE(nullptr, diBuilder3D); + ASSERT_NE(nullptr, diBuilder3D); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) // 1D diBuilder1D->setKernel(pKernel); @@ -727,7 +727,7 @@ TEST_F(DispatchInfoBuilderTest, GivenSplitWhenGettingWalkerInfoThenCorrectValues TEST_F(DispatchInfoBuilderTest, GivenSplit1dWhenSettingDispatchGeometryThenMdiSizeIsCorrect) { DispatchInfoBuilder *diBuilder = new DispatchInfoBuilder(*pClDevice); - ASSERT_NE(nullptr, diBuilder); + ASSERT_NE(nullptr, diBuilder); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) diBuilder->setDispatchGeometry(Vec3(0, 0, 0), Vec3(2, 0, 0), Vec3(0, 0, 0)); MultiDispatchInfo mdiSize0; @@ -749,7 +749,7 @@ TEST_F(DispatchInfoBuilderTest, GivenSplit1dWhenSettingDispatchGeometryThenMdiSi TEST_F(DispatchInfoBuilderTest, GivenSplit2dWhenSettingDispatchGeometryThenMdiSizeIsCorrect) { DispatchInfoBuilder *diBuilder = new DispatchInfoBuilder(*pClDevice); - ASSERT_NE(nullptr, diBuilder); + ASSERT_NE(nullptr, diBuilder); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) diBuilder->setDispatchGeometry(Vec3(0, 0, 0), Vec3(2, 2, 0), Vec3(0, 0, 0)); MultiDispatchInfo mdiSize00; @@ -781,7 +781,7 @@ TEST_F(DispatchInfoBuilderTest, GivenSplit2dWhenSettingDispatchGeometryThenMdiSi TEST_F(DispatchInfoBuilderTest, GivenSplit3dWhenSettingDispatchGeometryThenMdiSizeIsCorrect) { DispatchInfoBuilder *diBuilder = new DispatchInfoBuilder(*pClDevice); - ASSERT_NE(nullptr, diBuilder); + ASSERT_NE(nullptr, diBuilder); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) diBuilder->setDispatchGeometry(Vec3(0, 0, 0), Vec3(2, 2, 2), Vec3(0, 0, 0)); MultiDispatchInfo mdiSize000; @@ -838,7 +838,7 @@ TEST_F(DispatchInfoBuilderTest, WhenSettingKernelArgThenAddressesAreCorrect) { auto pVal = &val; DispatchInfoBuilder *diBuilder = new DispatchInfoBuilder(*pClDevice); - ASSERT_NE(nullptr, diBuilder); + ASSERT_NE(nullptr, diBuilder); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) diBuilder->setKernel(pKernel); diBuilder->setDispatchGeometry(Vec3(256, 256, 256), Vec3(16, 16, 16), Vec3(0, 0, 0)); @@ -942,7 +942,7 @@ TEST_F(DispatchInfoBuilderTest, GivenInvalidInputWhenSettingKernelArgThenInvalid auto pVal = &val; DispatchInfoBuilder *diBuilder = new DispatchInfoBuilder(*pClDevice); - ASSERT_NE(nullptr, diBuilder); + ASSERT_NE(nullptr, diBuilder); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) diBuilder->setKernel(pKernel); diBuilder->setDispatchGeometry(Vec3(256, 256, 256), Vec3(16, 16, 16), Vec3(0, 0, 0)); @@ -965,7 +965,7 @@ TEST_F(DispatchInfoBuilderTest, GivenNullKernelWhenSettingKernelArgThenSuccessIs MockGraphicsAllocation svmAlloc(svmPtr, 128); DispatchInfoBuilder *diBuilder = new DispatchInfoBuilder(*pClDevice); - ASSERT_NE(nullptr, diBuilder); + ASSERT_NE(nullptr, diBuilder); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) diBuilder->setDispatchGeometry(Vec3(256, 256, 256), Vec3(16, 16, 16), Vec3(0, 0, 0)); MultiDispatchInfo multiDispatchInfo; diff --git a/opencl/test/unit_test/helpers/queue_helpers_tests.cpp b/opencl/test/unit_test/helpers/queue_helpers_tests.cpp index fe3e9f3bd1..b4ae2bd10d 100644 --- a/opencl/test/unit_test/helpers/queue_helpers_tests.cpp +++ b/opencl/test/unit_test/helpers/queue_helpers_tests.cpp @@ -26,7 +26,7 @@ TEST(QueueHelpersTest, givenCommandQueueWithoutVirtualEventWhenReleaseQueueIsCal releaseQueue(cmdQ, retVal); - EXPECT_EQ(1, cmdQ->getRefInternalCount()); + EXPECT_EQ(1, cmdQ->getRefInternalCount()); // NOLINT(clang-analyzer-cplusplus.NewDelete) cmdQ->decRefInternal(); } diff --git a/opencl/test/unit_test/indirect_heap/indirect_heap_fixture.h b/opencl/test/unit_test/indirect_heap/indirect_heap_fixture.h index 0b4d9e3a65..1791af62f8 100644 --- a/opencl/test/unit_test/indirect_heap/indirect_heap_fixture.h +++ b/opencl/test/unit_test/indirect_heap/indirect_heap_fixture.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -14,8 +14,8 @@ namespace NEO { class CommandQueue; struct IndirectHeapFixture { - virtual void SetUp(CommandQueue *pCmdQ); - virtual void TearDown() { + virtual void SetUp(CommandQueue *pCmdQ); // NOLINT(readability-identifier-naming) + virtual void TearDown() { // NOLINT(readability-identifier-naming) } IndirectHeap *pDSH = nullptr; diff --git a/opencl/test/unit_test/kernel/cache_flush_tests.inl b/opencl/test/unit_test/kernel/cache_flush_tests.inl index 883f19b28b..85082acf6e 100644 --- a/opencl/test/unit_test/kernel/cache_flush_tests.inl +++ b/opencl/test/unit_test/kernel/cache_flush_tests.inl @@ -51,7 +51,7 @@ struct L3ControlPolicy : CmdValidator { template class GivenCacheFlushAfterWalkerEnabledWhenSvmAllocationsSetAsCacheFlushRequiringThenExpectCacheFlushCommand : public HardwareCommandsTest { public: - void TestBodyImpl() { + void TestBodyImpl() { // NOLINT(readability-identifier-naming) using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; using L3_CONTROL_WITHOUT_POST_SYNC = typename FamilyType::L3_CONTROL; @@ -87,7 +87,7 @@ class GivenCacheFlushAfterWalkerEnabledWhenSvmAllocationsSetAsCacheFlushRequirin template class GivenCacheFlushAfterWalkerEnabledAndProperSteppingIsSetWhenKernelArgIsSetAsCacheFlushRequiredAndA0SteppingIsDisabledThenExpectCacheFlushCommand : public HardwareCommandsTest { public: - void TestBodyImpl(bool isA0Stepping) { + void TestBodyImpl(bool isA0Stepping) { // NOLINT(readability-identifier-naming) using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; using L3_FLUSH_ADDRESS_RANGE = typename FamilyType::L3_FLUSH_ADDRESS_RANGE; using L3_CONTROL_WITHOUT_POST_SYNC = typename FamilyType::L3_CONTROL; @@ -133,7 +133,7 @@ class GivenCacheFlushAfterWalkerEnabledAndProperSteppingIsSetWhenKernelArgIsSetA template class GivenCacheFlushAfterWalkerEnabledWhenProgramGlobalSurfacePresentThenExpectCacheFlushCommand : public HardwareCommandsTest { public: - void TestBodyImpl() { + void TestBodyImpl() { // NOLINT(readability-identifier-naming) using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; using L3_CONTROL_WITHOUT_POST_SYNC = typename FamilyType::L3_CONTROL; DebugManagerStateRestore dbgRestore; @@ -167,7 +167,7 @@ class GivenCacheFlushAfterWalkerEnabledWhenProgramGlobalSurfacePresentThenExpect template class GivenCacheFlushAfterWalkerEnabledWhenProgramGlobalSurfacePresentAndPostSyncRequiredThenExpectProperCacheFlushCommand : public HardwareCommandsTest { public: - void TestBodyImpl() { + void TestBodyImpl() { // NOLINT(readability-identifier-naming) using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; using L3_CONTROL_WITH_POST_SYNC = typename FamilyType::L3_CONTROL; @@ -207,7 +207,7 @@ using EnqueueKernelTest = Test; template class GivenCacheFlushAfterWalkerEnabledAndProperSteppingIsSetWhenAllocationRequiresCacheFlushThenFlushCommandPresentAfterWalker : public EnqueueKernelTest { public: - void TestBodyImpl(bool isA0Stepping) { + void TestBodyImpl(bool isA0Stepping) { // NOLINT(readability-identifier-naming) using WALKER = typename FamilyType::WALKER_TYPE; using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; using L3_FLUSH_ADDRESS_RANGE = typename FamilyType::L3_FLUSH_ADDRESS_RANGE; @@ -271,7 +271,7 @@ class GivenCacheFlushAfterWalkerEnabledAndProperSteppingIsSetWhenAllocationRequi template class GivenCacheFlushAfterWalkerAndTimestampPacketsEnabledWhenAllocationRequiresCacheFlushThenFlushCommandPresentAfterWalker : public EnqueueKernelTest { public: - void TestBodyImpl() { + void TestBodyImpl() { // NOLINT(readability-identifier-naming) using WALKER = typename FamilyType::WALKER_TYPE; using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; using L3_FLUSH_ADDRESS_RANGE = typename FamilyType::L3_FLUSH_ADDRESS_RANGE; @@ -327,7 +327,7 @@ class GivenCacheFlushAfterWalkerAndTimestampPacketsEnabledWhenAllocationRequires template class GivenCacheFlushAfterWalkerDisabledAndProperSteppingIsSetWhenAllocationRequiresCacheFlushThenFlushCommandNotPresentAfterWalker : public EnqueueKernelTest { public: - void TestBodyImpl(bool isA0Stepping) { + void TestBodyImpl(bool isA0Stepping) { // NOLINT(readability-identifier-naming) using WALKER = typename FamilyType::WALKER_TYPE; using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; using L3_FLUSH_ADDRESS_RANGE = typename FamilyType::L3_FLUSH_ADDRESS_RANGE; @@ -379,7 +379,7 @@ class GivenCacheFlushAfterWalkerDisabledAndProperSteppingIsSetWhenAllocationRequ template class GivenCacheResourceSurfacesWhenprocessingCacheFlushThenExpectProperCacheFlushCommand : public EnqueueKernelTest { public: - void TestBodyImpl() { + void TestBodyImpl() { // NOLINT(readability-identifier-naming) using L3_CONTROL_WITHOUT_POST_SYNC = typename FamilyType::L3_CONTROL; diff --git a/opencl/test/unit_test/kernel/cache_flush_xehp_and_later_tests.inl b/opencl/test/unit_test/kernel/cache_flush_xehp_and_later_tests.inl index 67691cd7fc..3e59f036e2 100644 --- a/opencl/test/unit_test/kernel/cache_flush_xehp_and_later_tests.inl +++ b/opencl/test/unit_test/kernel/cache_flush_xehp_and_later_tests.inl @@ -49,7 +49,7 @@ struct L3ControlPolicy : CmdValidator { template class GivenCacheFlushAfterWalkerEnabledWhenSvmAllocationsSetAsCacheFlushRequiringThenExpectCorrectCommandSize : public HardwareCommandsTest { public: - void TestBodyImpl() { + void TestBodyImpl() { // NOLINT(readability-identifier-naming) using COMPUTE_WALKER = typename FamilyType::COMPUTE_WALKER; using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; using L3_CONTROL = typename FamilyType::L3_CONTROL; @@ -81,7 +81,7 @@ class GivenCacheFlushAfterWalkerEnabledWhenSvmAllocationsSetAsCacheFlushRequirin template class GivenCacheFlushAfterWalkerEnabledWhenSvmAllocationsSetAsCacheFlushRequiringThenExpectCacheFlushCommand : public HardwareCommandsTest { public: - void TestBodyImpl() { + void TestBodyImpl() { // NOLINT(readability-identifier-naming) using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; using L3_CONTROL = typename FamilyType::L3_CONTROL; @@ -113,7 +113,7 @@ class GivenCacheFlushAfterWalkerEnabledWhenSvmAllocationsSetAsCacheFlushRequirin template class GivenCacheFlushAfterWalkerEnabledWhenKernelArgIsSetAsCacheFlushRequiredThenExpectCacheFlushCommand : public HardwareCommandsTest { public: - void TestBodyImpl() { + void TestBodyImpl() { // NOLINT(readability-identifier-naming) using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; using L3_FLUSH_ADDRESS_RANGE = typename FamilyType::L3_FLUSH_ADDRESS_RANGE; using L3_CONTROL = typename FamilyType::L3_CONTROL; @@ -152,7 +152,7 @@ class GivenCacheFlushAfterWalkerEnabledWhenKernelArgIsSetAsCacheFlushRequiredThe template class GivenCacheFlushAfterWalkerEnabledWhenNoGlobalSurfaceSvmAllocationKernelArgRequireCacheFlushThenExpectNoCacheFlushCommand : public HardwareCommandsTest { public: - void TestBodyImpl() { + void TestBodyImpl() { // NOLINT(readability-identifier-naming) DebugManagerStateRestore dbgRestore; DebugManager.flags.EnableCacheFlushAfterWalker.set(1); @@ -172,7 +172,7 @@ class GivenCacheFlushAfterWalkerEnabledWhenNoGlobalSurfaceSvmAllocationKernelArg template class GivenCacheFlushAfterWalkerEnabledWhenProgramGlobalSurfacePresentThenExpectCacheFlushCommand : public HardwareCommandsTest { public: - void TestBodyImpl() { + void TestBodyImpl() { // NOLINT(readability-identifier-naming) using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; using L3_CONTROL = typename FamilyType::L3_CONTROL; DebugManagerStateRestore dbgRestore; @@ -202,7 +202,7 @@ class GivenCacheFlushAfterWalkerEnabledWhenProgramGlobalSurfacePresentThenExpect template class GivenCacheFlushAfterWalkerEnabledWhenProgramGlobalSurfacePresentAndPostSyncRequiredThenExpectProperCacheFlushCommand : public HardwareCommandsTest { public: - void TestBodyImpl() { + void TestBodyImpl() { // NOLINT(readability-identifier-naming) using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; using L3_CONTROL = typename FamilyType::L3_CONTROL; @@ -240,7 +240,7 @@ using EnqueueKernelTest = Test; template class GivenCacheFlushAfterWalkerEnabledWhenAllocationRequiresCacheFlushThenFlushCommandPresentAfterWalker : public EnqueueKernelTest { public: - void TestBodyImpl() { + void TestBodyImpl() { // NOLINT(readability-identifier-naming) using WALKER = typename FamilyType::WALKER_TYPE; using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; using L3_FLUSH_ADDRESS_RANGE = typename FamilyType::L3_FLUSH_ADDRESS_RANGE; @@ -295,7 +295,7 @@ class GivenCacheFlushAfterWalkerEnabledWhenAllocationRequiresCacheFlushThenFlush template class GivenCacheFlushAfterWalkerAndTimestampPacketsEnabledWhenAllocationRequiresCacheFlushThenFlushCommandPresentAfterWalker : public EnqueueKernelTest { public: - void TestBodyImpl() { + void TestBodyImpl() { // NOLINT(readability-identifier-naming) using WALKER = typename FamilyType::WALKER_TYPE; using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; using L3_FLUSH_ADDRESS_RANGE = typename FamilyType::L3_FLUSH_ADDRESS_RANGE; @@ -352,7 +352,7 @@ class GivenCacheFlushAfterWalkerAndTimestampPacketsEnabledWhenAllocationRequires template class GivenCacheFlushAfterWalkerDisabledWhenAllocationRequiresCacheFlushThenFlushCommandNotPresentAfterWalker : public EnqueueKernelTest { public: - void TestBodyImpl() { + void TestBodyImpl() { // NOLINT(readability-identifier-naming) using WALKER = typename FamilyType::WALKER_TYPE; using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; using L3_FLUSH_ADDRESS_RANGE = typename FamilyType::L3_FLUSH_ADDRESS_RANGE; @@ -400,7 +400,7 @@ class GivenCacheFlushAfterWalkerDisabledWhenAllocationRequiresCacheFlushThenFlus template class GivenCacheFlushAfterWalkerEnabledWhenMoreThan126AllocationRangesRequiresCacheFlushThenAtLeatsTwoFlushCommandPresentAfterWalker : public EnqueueKernelTest { public: - void TestBodyImpl() { + void TestBodyImpl() { // NOLINT(readability-identifier-naming) using WALKER = typename FamilyType::WALKER_TYPE; using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; using L3_FLUSH_ADDRESS_RANGE = typename FamilyType::L3_FLUSH_ADDRESS_RANGE; @@ -452,7 +452,7 @@ class GivenCacheFlushAfterWalkerEnabledWhenMoreThan126AllocationRangesRequiresCa template class GivenCacheFlushAfterWalkerAndTimestampPacketsEnabledWhenMoreThan126AllocationRangesRequiresCacheFlushThenExpectFlushWithOutPostSyncAndThenWithPostSync : public EnqueueKernelTest { public: - void TestBodyImpl() { + void TestBodyImpl() { // NOLINT(readability-identifier-naming) using WALKER = typename FamilyType::WALKER_TYPE; using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; using L3_FLUSH_ADDRESS_RANGE = typename FamilyType::L3_FLUSH_ADDRESS_RANGE; @@ -525,7 +525,7 @@ class GivenCacheFlushAfterWalkerAndTimestampPacketsEnabledWhenMoreThan126Allocat template class GivenCacheFlushAfterWalkerEnabledWhen126AllocationRangesRequiresCacheFlushThenExpectOneFlush : public EnqueueKernelTest { public: - void TestBodyImpl() { + void TestBodyImpl() { // NOLINT(readability-identifier-naming) using WALKER = typename FamilyType::WALKER_TYPE; using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; using L3_FLUSH_ADDRESS_RANGE = typename FamilyType::L3_FLUSH_ADDRESS_RANGE; @@ -572,4 +572,4 @@ class GivenCacheFlushAfterWalkerEnabledWhen126AllocationRangesRequiresCacheFlush svmManager.freeSVMAlloc(svm); } } -}; \ No newline at end of file +}; diff --git a/opencl/test/unit_test/linux/drm_null_device_tests.cpp b/opencl/test/unit_test/linux/drm_null_device_tests.cpp index cf1399aaed..51c5f882f4 100644 --- a/opencl/test/unit_test/linux/drm_null_device_tests.cpp +++ b/opencl/test/unit_test/linux/drm_null_device_tests.cpp @@ -22,7 +22,7 @@ extern const DeviceDescriptor NEO::deviceDescriptorTable[]; class DrmNullDeviceTestsFixture { public: - void SetUp() { + void SetUp() { // NOLINT(readability-identifier-naming) if (deviceDescriptorTable[0].deviceId == 0) { GTEST_SKIP(); } @@ -35,7 +35,7 @@ class DrmNullDeviceTestsFixture { ASSERT_NE(drmNullDevice, nullptr); } - void TearDown() { + void TearDown() { // NOLINT(readability-identifier-naming) } std::unique_ptr drmNullDevice; diff --git a/opencl/test/unit_test/linux/main_linux_dll.cpp b/opencl/test/unit_test/linux/main_linux_dll.cpp index 3861aebb55..8b35efc9d7 100644 --- a/opencl/test/unit_test/linux/main_linux_dll.cpp +++ b/opencl/test/unit_test/linux/main_linux_dll.cpp @@ -53,7 +53,7 @@ using namespace NEO; class DrmTestsFixture { public: - void SetUp() { + void SetUp() { // NOLINT(readability-identifier-naming) if (deviceDescriptorTable[0].deviceId == 0) { GTEST_SKIP(); } @@ -62,7 +62,7 @@ class DrmTestsFixture { rootDeviceEnvironment = executionEnvironment.rootDeviceEnvironments[0].get(); } - void TearDown() { + void TearDown() { // NOLINT(readability-identifier-naming) } ExecutionEnvironment executionEnvironment; RootDeviceEnvironment *rootDeviceEnvironment = nullptr; diff --git a/opencl/test/unit_test/linux/mock_os_layer.cpp b/opencl/test/unit_test/linux/mock_os_layer.cpp index 4a3d357ea5..b518c5961e 100644 --- a/opencl/test/unit_test/linux/mock_os_layer.cpp +++ b/opencl/test/unit_test/linux/mock_os_layer.cpp @@ -245,7 +245,7 @@ int drmVirtualMemoryDestroy(drm_i915_gem_vm_control *control) { } int drmVersion(drm_version_t *version) { - strcpy(version->name, providedDrmVersion); + strcpy(version->name, providedDrmVersion); // NOLINT(clang-analyzer-security.insecureAPI.strcpy) return failOnDrmVersion; } diff --git a/opencl/test/unit_test/mem_obj/buffer_bcs_tests.cpp b/opencl/test/unit_test/mem_obj/buffer_bcs_tests.cpp index 87badba0aa..61afee1ebf 100644 --- a/opencl/test/unit_test/mem_obj/buffer_bcs_tests.cpp +++ b/opencl/test/unit_test/mem_obj/buffer_bcs_tests.cpp @@ -63,7 +63,7 @@ struct BcsBufferTests : public ::testing::Test { }; template - void SetUpT() { + void setUpT() { if (is32bit) { GTEST_SKIP(); } @@ -86,7 +86,7 @@ struct BcsBufferTests : public ::testing::Test { } template - void TearDownT() {} + void tearDownT() {} template void waitForCacheFlushFromBcsTest(MockCommandQueueHw &commandQueue); @@ -1181,12 +1181,12 @@ HWTEST_TEMPLATED_F(BcsBufferTests, givenSvmToSvmCopyTypeWhenEnqueueNonBlockingSV struct BcsSvmTests : public BcsBufferTests { template - void SetUpT() { + void setUpT() { if (is32bit) { GTEST_SKIP(); } REQUIRE_SVM_OR_SKIP(defaultHwInfo); - BcsBufferTests::SetUpT(); + BcsBufferTests::setUpT(); if (IsSkipped()) { GTEST_SKIP(); } @@ -1209,11 +1209,11 @@ struct BcsSvmTests : public BcsBufferTests { } template - void TearDownT() { + void tearDownT() { if (IsSkipped()) { return; } - BcsBufferTests::TearDownT(); + BcsBufferTests::tearDownT(); clMemFreeINTEL(bcsMockContext.get(), sharedMemAlloc); clMemFreeINTEL(bcsMockContext.get(), hostMemAlloc); diff --git a/opencl/test/unit_test/mem_obj/image_set_arg_tests.cpp b/opencl/test/unit_test/mem_obj/image_set_arg_tests.cpp index 5864d2489f..a095c3b0b4 100644 --- a/opencl/test/unit_test/mem_obj/image_set_arg_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image_set_arg_tests.cpp @@ -39,7 +39,7 @@ class ImageSetArgTest : public ClDeviceFixture, protected: template - void SetupChannels(int imgChannelOrder) { + void setupChannels(int imgChannelOrder) { typedef typename FamilyType::RENDER_SURFACE_STATE RENDER_SURFACE_STATE; expectedChannelRed = RENDER_SURFACE_STATE::SHADER_CHANNEL_SELECT_RED; @@ -362,7 +362,7 @@ HWTEST_F(ImageSetArgTest, WhenSettingKernelArgThenPropertiesAreSetCorrectly) { size_t rPitch = srcImage->getImageDesc().image_row_pitch; - SetupChannels(srcImage->getImageFormat().image_channel_order); + setupChannels(srcImage->getImageFormat().image_channel_order); auto surfaceAddress = surfaceState->getSurfaceBaseAddress(); EXPECT_EQ(srcAllocation->getGpuAddress(), surfaceAddress); @@ -435,7 +435,7 @@ HWTEST_F(ImageSetArgTest, Given2dArrayWhenSettingKernelArgThenPropertiesAreSetCo size_t rPitch = srcImage->getImageDesc().image_row_pitch; - SetupChannels(image2Darray->getImageFormat().image_channel_order); + setupChannels(image2Darray->getImageFormat().image_channel_order); EXPECT_EQ(graphicsAllocation->getGpuAddress(), surfaceAddress); EXPECT_EQ(image2Darray->getImageDesc().image_width, surfaceState->getWidth()); @@ -481,7 +481,7 @@ HWTEST_F(ImageSetArgTest, Given1dArrayWhenSettingKernelArgThenPropertiesAreSetCo pKernelInfo->argAsImg(0).bindful)); auto surfaceAddress = surfaceState->getSurfaceBaseAddress(); - SetupChannels(image1Darray->getImageFormat().image_channel_order); + setupChannels(image1Darray->getImageFormat().image_channel_order); EXPECT_EQ(graphicsAllocation->getGpuAddress(), surfaceAddress); EXPECT_EQ(image1Darray->getImageDesc().image_width, surfaceState->getWidth()); @@ -978,7 +978,7 @@ HWTEST_F(ImageMediaBlockSetArgTest, WhenSettingKernelArgImageThenPropertiesAreCo uint32_t element_size = static_cast(srcImage->getSurfaceFormatInfo().surfaceFormat.ImageElementSizeInBytes); - SetupChannels(srcImage->getImageFormat().image_channel_order); + setupChannels(srcImage->getImageFormat().image_channel_order); EXPECT_EQ(srcImage->getImageDesc().image_width * element_size / sizeof(uint32_t), surfaceState->getWidth()); EXPECT_EQ(srcImage->getImageDesc().image_height, surfaceState->getHeight()); diff --git a/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp b/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp index 687bb81602..664e5e1ef3 100644 --- a/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp +++ b/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp @@ -1252,7 +1252,7 @@ TEST(OsAgnosticMemoryManager, givenDefaultMemoryManagerWhenGraphicsAllocationIsP TEST(OsAgnosticMemoryManager, WhenPointerIsCreatedThenLeakIsDetected) { void *ptr = new int[10]; - EXPECT_NE(nullptr, ptr); + EXPECT_NE(nullptr, ptr); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) MemoryManagement::fastLeaksDetectionMode = MemoryManagement::LeakDetectionMode::EXPECT_TO_LEAK; } diff --git a/opencl/test/unit_test/memory_manager/surface_tests.cpp b/opencl/test/unit_test/memory_manager/surface_tests.cpp index 7ae464b49b..d5dbf094fa 100644 --- a/opencl/test/unit_test/memory_manager/surface_tests.cpp +++ b/opencl/test/unit_test/memory_manager/surface_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -75,10 +75,10 @@ HWTEST_TYPED_TEST(SurfaceTest, GivenSurfaceWhenInterfaceIsUsedThenSurfaceBehaves Surface *surface = createSurface::Create(this->data, &this->buffer, &this->gfxAllocation); - ASSERT_NE(nullptr, surface); + ASSERT_NE(nullptr, surface); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) Surface *duplicatedSurface = surface->duplicate(); - ASSERT_NE(nullptr, duplicatedSurface); + ASSERT_NE(nullptr, duplicatedSurface); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) surface->makeResident(*csr); diff --git a/opencl/test/unit_test/memory_manager/unified_memory_manager_tests.cpp b/opencl/test/unit_test/memory_manager/unified_memory_manager_tests.cpp index f6405e46f2..0561e69249 100644 --- a/opencl/test/unit_test/memory_manager/unified_memory_manager_tests.cpp +++ b/opencl/test/unit_test/memory_manager/unified_memory_manager_tests.cpp @@ -36,7 +36,7 @@ template struct SVMMemoryAllocatorFixture { SVMMemoryAllocatorFixture() : executionEnvironment(defaultHwInfo.get()) {} - virtual void SetUp() { + virtual void SetUp() { // NOLINT(readability-identifier-naming) bool svmSupported = executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo()->capabilityTable.ftrSvm; if (!svmSupported) { GTEST_SKIP(); @@ -48,7 +48,7 @@ struct SVMMemoryAllocatorFixture { memoryManager->pageFaultManager.reset(new MockPageFaultManager); } } - virtual void TearDown() { + virtual void TearDown() { // NOLINT(readability-identifier-naming) } MockExecutionEnvironment executionEnvironment; diff --git a/opencl/test/unit_test/mt_tests/utilities/reference_tracked_object_tests_mt.cpp b/opencl/test/unit_test/mt_tests/utilities/reference_tracked_object_tests_mt.cpp index f0c034a5a7..1ecb6cf4ab 100644 --- a/opencl/test/unit_test/mt_tests/utilities/reference_tracked_object_tests_mt.cpp +++ b/opencl/test/unit_test/mt_tests/utilities/reference_tracked_object_tests_mt.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -32,16 +32,16 @@ struct MockReferenceTrackedObject : ReferenceTrackedObject(this)->SetMarker(marker); + const_cast(this)->setMarker(marker); return nullptr; } - virtual void SetMarker(std::atomic &marker) { - marker = GetMarker(); + virtual void setMarker(std::atomic &marker) { + marker = getMarker(); } - static int GetMarker() { + static int getMarker() { return 1; } @@ -54,11 +54,11 @@ struct MockReferenceTrackedObject : ReferenceTrackedObject &marker) override { - marker = GetMarker(); + void setMarker(std::atomic &marker) override { + marker = getMarker(); } - static int GetMarker() { + static int getMarker() { return 2; } }; @@ -78,7 +78,7 @@ void DecRefCount(MockReferenceTrackedObject *obj, bool useInternalRefCount, std: } TEST(ReferenceTrackedObject, whenDecreasingApiRefcountSimultaneouslyThenRetrieveProperCustomDeleterWhileObjectIsStillAlive) { - ASSERT_NE(MockReferenceTrackedObjectDerivative::GetMarker(), MockReferenceTrackedObject::GetMarker()); + ASSERT_NE(MockReferenceTrackedObjectDerivative::getMarker(), MockReferenceTrackedObject::getMarker()); std::atomic marker; std::atomic flagInsideCustomDeleter; @@ -101,11 +101,11 @@ TEST(ReferenceTrackedObject, whenDecreasingApiRefcountSimultaneouslyThenRetrieve obj->decRefApi(); bgThread.join(); - EXPECT_EQ(MockReferenceTrackedObjectDerivative::GetMarker(), marker); + EXPECT_EQ(MockReferenceTrackedObjectDerivative::getMarker(), marker); } TEST(ReferenceTrackedObject, whenDecreasingInternalRefcountSimultaneouslyThenRetrieveProperCustomDeleterWhileObjectIsStillAlive) { - ASSERT_NE(MockReferenceTrackedObjectDerivative::GetMarker(), MockReferenceTrackedObject::GetMarker()); + ASSERT_NE(MockReferenceTrackedObjectDerivative::getMarker(), MockReferenceTrackedObject::getMarker()); std::atomic marker; std::atomic flagInsideCustomDeleter; @@ -128,6 +128,6 @@ TEST(ReferenceTrackedObject, whenDecreasingInternalRefcountSimultaneouslyThenRet obj->decRefInternal(); bgThread.join(); - EXPECT_EQ(MockReferenceTrackedObjectDerivative::GetMarker(), marker); + EXPECT_EQ(MockReferenceTrackedObjectDerivative::getMarker(), marker); } } // namespace NEO diff --git a/opencl/test/unit_test/offline_compiler/environment.h b/opencl/test/unit_test/offline_compiler/environment.h index 5c80a37e1c..bc4f39e637 100644 --- a/opencl/test/unit_test/offline_compiler/environment.h +++ b/opencl/test/unit_test/offline_compiler/environment.h @@ -21,7 +21,7 @@ class Environment : public ::testing::Environment { : devicePrefix(devicePrefix), familyNameWithType(familyNameWithType) { } - void SetInputFileName( + void SetInputFileName( // NOLINT(readability-identifier-naming) const std::string filename) { retrieveBinaryKernelFilename(igcDebugVars.fileName, filename + "_", ".gen"); diff --git a/opencl/test/unit_test/offline_compiler/mock/mock_argument_helper.h b/opencl/test/unit_test/offline_compiler/mock/mock_argument_helper.h index e3c4429bd1..420b7969fe 100644 --- a/opencl/test/unit_test/offline_compiler/mock/mock_argument_helper.h +++ b/opencl/test/unit_test/offline_compiler/mock/mock_argument_helper.h @@ -45,7 +45,7 @@ class MockOclocArgHelper : public OclocArgHelper { MockOclocArgHelper(FilesMap &filesMap) : OclocArgHelper(0, nullptr, nullptr, nullptr, 0, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr), filesMap(filesMap){}; - ~MockOclocArgHelper() { + ~MockOclocArgHelper() override { cleanUpOutput(); } diff --git a/opencl/test/unit_test/offline_compiler/segfault_test/segfault_helper.h b/opencl/test/unit_test/offline_compiler/segfault_test/segfault_helper.h index 456aea6c20..6495964055 100644 --- a/opencl/test/unit_test/offline_compiler/segfault_test/segfault_helper.h +++ b/opencl/test/unit_test/offline_compiler/segfault_test/segfault_helper.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2020 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -18,7 +18,7 @@ class SegfaultHelper { public: int NO_SANITIZE generateSegfault() { int *pointer = reinterpret_cast(0); - *pointer = 0; + *pointer = 0; // NOLINT(clang-analyzer-core.NullDereference) return 0; } diff --git a/opencl/test/unit_test/os_interface/linux/.clang-tidy b/opencl/test/unit_test/os_interface/linux/.clang-tidy deleted file mode 100644 index 7bae212950..0000000000 --- a/opencl/test/unit_test/os_interface/linux/.clang-tidy +++ /dev/null @@ -1,32 +0,0 @@ ---- -Checks: 'clang-diagnostic-*,clang-analyzer-*,google-default-arguments,modernize-use-override,modernize-use-default-member-init,-clang-analyzer-alpha*,readability-identifier-naming,-clang-analyzer-optin.performance.Padding,-clang-analyzer-cplusplus.NewDelete,-clang-analyzer-cplusplus.NewDeleteLeaks,-clang-analyzer-optin.cplusplus.VirtualCall' -# WarningsAsErrors: '.*' -HeaderFilterRegex: '^((?!^third_party\/).+)\.(h|hpp|inl)$' -AnalyzeTemporaryDtors: false -CheckOptions: - - key: google-readability-braces-around-statements.ShortStatementLines - value: '1' - - key: google-readability-function-size.StatementThreshold - value: '800' - - key: google-readability-namespace-comments.ShortNamespaceLines - value: '10' - - key: google-readability-namespace-comments.SpacesBeforeComments - value: '2' - - key: readability-identifier-naming.ParameterCase - value: camelBack - - key: modernize-loop-convert.MaxCopySize - value: '16' - - key: modernize-loop-convert.MinConfidence - value: reasonable - - key: modernize-loop-convert.NamingStyle - value: CamelCase - - key: modernize-pass-by-value.IncludeStyle - value: llvm - - key: modernize-replace-auto-ptr.IncludeStyle - value: llvm - - key: modernize-use-nullptr.NullMacros - value: 'NULL' - - key: modernize-use-default-member-init.UseAssignment - value: '1' -... - diff --git a/opencl/test/unit_test/os_interface/linux/drm_buffer_object_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_buffer_object_tests.cpp index 41539fa3be..a61ae5841a 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_buffer_object_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_buffer_object_tests.cpp @@ -49,7 +49,7 @@ TEST_F(DrmBufferObjectTest, GivenDetectedGpuHangDuringEvictUnusedAllocationsWhen drm_i915_gem_exec_object2 execObjectsStorage = {}; const auto result = bo->exec(0, 0, 0, false, osContext.get(), 0, 1, nullptr, 0u, &execObjectsStorage, 0, 0); - EXPECT_EQ(BufferObject::GPU_HANG_DETECTED, result); + EXPECT_EQ(BufferObject::gpuHangDetected, result); } TEST_F(DrmBufferObjectTest, WhenSettingTilingThenCallSucceeds) { diff --git a/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests_1.cpp b/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests_1.cpp index 09104a2c5f..1c94937b9b 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests_1.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests_1.cpp @@ -231,7 +231,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenLowPriorityContextWhenFlushingThen HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenInvalidAddressWhenFlushingThenSucceeds) { //allocate command buffer manually char *commandBuffer = new (std::nothrow) char[1024]; - ASSERT_NE(nullptr, commandBuffer); + ASSERT_NE(nullptr, commandBuffer); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) DrmAllocation commandBufferAllocation(0, AllocationType::COMMAND_BUFFER, nullptr, commandBuffer, 1024, static_cast(1u), MemoryPool::MemoryNull); LinearStream cs(&commandBufferAllocation); @@ -415,14 +415,14 @@ class DrmCommandStreamBatchingTests : public DrmCommandStreamEnhancedTest { DrmAllocation *preemptionAllocation; template - void SetUpT() { - DrmCommandStreamEnhancedTest::SetUpT(); + void setUpT() { + DrmCommandStreamEnhancedTest::setUpT(); preemptionAllocation = static_cast(device->getDefaultEngine().commandStreamReceiver->getPreemptionAllocation()); } template - void TearDownT() { - DrmCommandStreamEnhancedTest::TearDownT(); + void tearDownT() { + DrmCommandStreamEnhancedTest::tearDownT(); } }; @@ -600,10 +600,10 @@ HWTEST_TEMPLATED_F(DrmCommandStreamBatchingTests, givenRecordedCommandBufferWhen struct DrmCommandStreamDirectSubmissionTest : public DrmCommandStreamEnhancedTest { template - void SetUpT() { + void setUpT() { DebugManager.flags.EnableDirectSubmission.set(1u); DebugManager.flags.DirectSubmissionDisableMonitorFence.set(0); - DrmCommandStreamEnhancedTest::SetUpT(); + DrmCommandStreamEnhancedTest::setUpT(); auto hwInfo = device->getRootDeviceEnvironment().getMutableHardwareInfo(); auto engineType = device->getDefaultEngine().osContext->getEngineType(); hwInfo->capabilityTable.directSubmissionEngines.data[engineType].engineSupported = true; @@ -611,9 +611,9 @@ struct DrmCommandStreamDirectSubmissionTest : public DrmCommandStreamEnhancedTes } template - void TearDownT() { + void tearDownT() { this->dbgState.reset(); - DrmCommandStreamEnhancedTest::TearDownT(); + DrmCommandStreamEnhancedTest::tearDownT(); } DebugManagerStateRestore restorer; @@ -621,12 +621,12 @@ struct DrmCommandStreamDirectSubmissionTest : public DrmCommandStreamEnhancedTes struct DrmCommandStreamBlitterDirectSubmissionTest : public DrmCommandStreamDirectSubmissionTest { template - void SetUpT() { + void setUpT() { DebugManager.flags.DirectSubmissionOverrideBlitterSupport.set(1u); DebugManager.flags.DirectSubmissionOverrideRenderSupport.set(0u); DebugManager.flags.DirectSubmissionOverrideComputeSupport.set(0u); - DrmCommandStreamDirectSubmissionTest::SetUpT(); + DrmCommandStreamDirectSubmissionTest::setUpT(); executionEnvironment->incRefInternal(); osContext.reset(OsContext::create(device->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0, @@ -639,10 +639,10 @@ struct DrmCommandStreamBlitterDirectSubmissionTest : public DrmCommandStreamDire } template - void TearDownT() { - DrmCommandStreamDirectSubmissionTest::TearDownT(); + void tearDownT() { + DrmCommandStreamDirectSubmissionTest::tearDownT(); osContext.reset(); - executionEnvironment->decRefInternal(); + executionEnvironment->decRefInternal(); // NOLINT(clang-analyzer-cplusplus.NewDelete) } std::unique_ptr osContext; @@ -661,10 +661,10 @@ struct MockDrmDirectSubmissionToTestDtor : public DrmDirectSubmission(this->currentTagData.tagValue)); + stopRingBuffer(); // NOLINT(clang-analyzer-optin.cplusplus.VirtualCall) + wait(static_cast(this->currentTagData.tagValue)); // NOLINT(clang-analyzer-optin.cplusplus.VirtualCall) } - deallocateResources(); + deallocateResources(); // NOLINT(clang-analyzer-optin.cplusplus.VirtualCall) } using DrmDirectSubmission>::ringStart; bool stopRingBuffer() override { diff --git a/opencl/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_prelim_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_prelim_tests.cpp index a703881021..435351457f 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_prelim_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_prelim_tests.cpp @@ -284,7 +284,7 @@ class DrmCommandStreamForceTileTest : public ::testing::Test { const uint32_t expectedHandleId = std::numeric_limits::max(); }; template - void SetUpT() { + void setUpT() { mock = new DrmMock(mockFd, *executionEnvironment.rootDeviceEnvironments[0]); auto hwInfo = executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo(); @@ -319,7 +319,7 @@ class DrmCommandStreamForceTileTest : public ::testing::Test { } template - void TearDownT() { + void tearDownT() { memoryManager->waitForDeletions(); memoryManager->peekGemCloseWorker()->close(true); delete csr; diff --git a/opencl/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_tests.cpp index 94d064896d..de979bf517 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_tests.cpp @@ -28,7 +28,7 @@ using namespace NEO; struct DrmCommandStreamMultiTileMemExecFixture { - void SetUp() { + void SetUp() { // NOLINT(readability-identifier-naming) DebugManager.flags.CreateMultipleSubDevices.set(2u); DebugManager.flags.EnableImplicitScaling.set(1); DebugManager.flags.EnableForcePin.set(false); @@ -57,7 +57,7 @@ struct DrmCommandStreamMultiTileMemExecFixture { device.reset(MockDevice::create(executionEnvironment, 0)); } - void TearDown() { + void TearDown() { // NOLINT(readability-identifier-naming) executionEnvironment->decRefInternal(); } diff --git a/opencl/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp index 2ccaf02f02..adb03c8a9e 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp @@ -64,7 +64,7 @@ class DrmGemCloseWorkerFixture { DrmMockForWorker *drmMock; uint32_t deadCnt = deadCntInit; - void SetUp() { + void SetUp() { // NOLINT(readability-identifier-naming) this->drmMock = new DrmMockForWorker(*executionEnvironment.rootDeviceEnvironments[0]); auto hwInfo = executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo(); @@ -83,7 +83,7 @@ class DrmGemCloseWorkerFixture { this->drmMock->gem_close_expected = 0; } - void TearDown() { + void TearDown() { // NOLINT(readability-identifier-naming) if (this->drmMock->gem_close_expected >= 0) { EXPECT_EQ(this->drmMock->gem_close_expected, this->drmMock->gem_close_cnt); } diff --git a/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp index b836e231b3..238a4c0fc6 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp @@ -1338,7 +1338,7 @@ struct ClDrmMemoryManagerTest : public DrmMemoryManagerTest { executionEnvironment = MockClDevice::prepareExecutionEnvironment(defaultHwInfo.get(), numRootDevices - 1); DrmMemoryManagerFixture::SetUp(new DrmMockCustom(*executionEnvironment->rootDeviceEnvironments[0]), false); - pClDevice = new MockClDevice{device}; + pClDevice = new MockClDevice{device}; // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) device->incRefInternal(); } void TearDown() override { diff --git a/opencl/test/unit_test/os_interface/linux/drm_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_tests.cpp index 1f17b9d51d..055ba36e62 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_tests.cpp @@ -88,10 +88,10 @@ TEST(DrmTest, GivenInvalidPciPathWhenGettingAdapterBdfThenInvalidPciInfoIsReturn EXPECT_EQ(std::numeric_limits::max(), adapterBdf.Data); auto pciInfo = drm.getPciBusInfo(); - EXPECT_EQ(PhysicalDevicePciBusInfo::InvalidValue, pciInfo.pciDomain); - EXPECT_EQ(PhysicalDevicePciBusInfo::InvalidValue, pciInfo.pciBus); - EXPECT_EQ(PhysicalDevicePciBusInfo::InvalidValue, pciInfo.pciDevice); - EXPECT_EQ(PhysicalDevicePciBusInfo::InvalidValue, pciInfo.pciFunction); + EXPECT_EQ(PhysicalDevicePciBusInfo::invalidValue, pciInfo.pciDomain); + EXPECT_EQ(PhysicalDevicePciBusInfo::invalidValue, pciInfo.pciBus); + EXPECT_EQ(PhysicalDevicePciBusInfo::invalidValue, pciInfo.pciDevice); + EXPECT_EQ(PhysicalDevicePciBusInfo::invalidValue, pciInfo.pciFunction); } TEST(DrmTest, GivenInvalidPciPathWhenFrequencyIsQueriedThenReturnError) { diff --git a/opencl/test/unit_test/os_interface/mock_performance_counters.h b/opencl/test/unit_test/os_interface/mock_performance_counters.h index 728f6cf2c8..1bb7dc4eaa 100644 --- a/opencl/test/unit_test/os_interface/mock_performance_counters.h +++ b/opencl/test/unit_test/os_interface/mock_performance_counters.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -118,18 +118,18 @@ class MockMetricsLibraryValidInterface: public MetricsLibraryInterface { bool validActivateConfigurationOa = true; bool validGpuReportSize = true; - static StatusCode ML_STDCALL ContextCreate ( ClientType_1_0 clientType, ContextCreateData_1_0* createData, ContextHandle_1_0* handle ); - static StatusCode ML_STDCALL ContextDelete (const ContextHandle_1_0 handle); - static StatusCode ML_STDCALL GetParameter (const ParameterType parameter, ValueType *type, TypedValue_1_0 *value); - static StatusCode ML_STDCALL CommandBufferGet (const CommandBufferData_1_0 *data); - static StatusCode ML_STDCALL CommandBufferGetSize (const CommandBufferData_1_0 *data, CommandBufferSize_1_0 *size); - static StatusCode ML_STDCALL QueryCreate (const QueryCreateData_1_0 *createData, QueryHandle_1_0 *handle); - static StatusCode ML_STDCALL QueryDelete (const QueryHandle_1_0 handle); - static StatusCode ML_STDCALL ConfigurationCreate (const ConfigurationCreateData_1_0 *createData, ConfigurationHandle_1_0 *handle); - static StatusCode ML_STDCALL ConfigurationActivate (const ConfigurationHandle_1_0 handle, const ConfigurationActivateData_1_0 *activateData); - static StatusCode ML_STDCALL ConfigurationDeactivate (const ConfigurationHandle_1_0 handle) { return StatusCode::Success; } - static StatusCode ML_STDCALL ConfigurationDelete (const ConfigurationHandle_1_0 handle); - static StatusCode ML_STDCALL GetData (GetReportData_1_0 *data); + static StatusCode ML_STDCALL ContextCreate ( ClientType_1_0 clientType, ContextCreateData_1_0* createData, ContextHandle_1_0* handle ); // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL ContextDelete (const ContextHandle_1_0 handle); // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL GetParameter (const ParameterType parameter, ValueType *type, TypedValue_1_0 *value); // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL CommandBufferGet (const CommandBufferData_1_0 *data); // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL CommandBufferGetSize (const CommandBufferData_1_0 *data, CommandBufferSize_1_0 *size); // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL QueryCreate (const QueryCreateData_1_0 *createData, QueryHandle_1_0 *handle); // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL QueryDelete (const QueryHandle_1_0 handle); // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL ConfigurationCreate (const ConfigurationCreateData_1_0 *createData, ConfigurationHandle_1_0 *handle); // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL ConfigurationActivate (const ConfigurationHandle_1_0 handle, const ConfigurationActivateData_1_0 *activateData); // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL ConfigurationDeactivate (const ConfigurationHandle_1_0 handle) { return StatusCode::Success; } // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL ConfigurationDelete (const ConfigurationHandle_1_0 handle); // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL GetData (GetReportData_1_0 *data); // NOLINT(readability-identifier-naming) MockMetricsLibraryValidInterface() { @@ -153,18 +153,18 @@ class MockMetricsLibraryValidInterface: public MetricsLibraryInterface { ////////////////////////////////////////////////////// class MockMetricsLibraryInvalidInterface: public MetricsLibraryInterface { public: - static StatusCode ML_STDCALL ContextCreate ( ClientType_1_0 clientType, ContextCreateData_1_0* createData, ContextHandle_1_0* handle ){ return StatusCode::Failed;} - static StatusCode ML_STDCALL ContextDelete (const ContextHandle_1_0 handle){ return StatusCode::Failed;} - static StatusCode ML_STDCALL GetParameter (const ParameterType parameter, ValueType *type, TypedValue_1_0 *value){ return StatusCode::Failed;} - static StatusCode ML_STDCALL CommandBufferGet (const CommandBufferData_1_0 *data){ return StatusCode::Failed;} - static StatusCode ML_STDCALL CommandBufferGetSize (const CommandBufferData_1_0 *data, CommandBufferSize_1_0 *size){ return StatusCode::Failed;} - static StatusCode ML_STDCALL QueryCreate (const QueryCreateData_1_0 *createData, QueryHandle_1_0 *handle){ return StatusCode::Failed;} - static StatusCode ML_STDCALL QueryDelete (const QueryHandle_1_0 handle){ return StatusCode::Failed;} - static StatusCode ML_STDCALL ConfigurationCreate (const ConfigurationCreateData_1_0 *createData, ConfigurationHandle_1_0 *handle){ return StatusCode::Failed;} - static StatusCode ML_STDCALL ConfigurationActivate (const ConfigurationHandle_1_0 handle, const ConfigurationActivateData_1_0 *activateData){ return StatusCode::Failed;} - static StatusCode ML_STDCALL ConfigurationDeactivate (const ConfigurationHandle_1_0 handle){ return StatusCode::Failed;} - static StatusCode ML_STDCALL ConfigurationDelete (const ConfigurationHandle_1_0 handle){ return StatusCode::Failed;} - static StatusCode ML_STDCALL GetData (GetReportData_1_0 *data){ return StatusCode::Failed;} + static StatusCode ML_STDCALL ContextCreate ( ClientType_1_0 clientType, ContextCreateData_1_0* createData, ContextHandle_1_0* handle ){ return StatusCode::Failed;} // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL ContextDelete (const ContextHandle_1_0 handle){ return StatusCode::Failed;} // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL GetParameter (const ParameterType parameter, ValueType *type, TypedValue_1_0 *value){ return StatusCode::Failed;} // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL CommandBufferGet (const CommandBufferData_1_0 *data){ return StatusCode::Failed;} // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL CommandBufferGetSize (const CommandBufferData_1_0 *data, CommandBufferSize_1_0 *size){ return StatusCode::Failed;} // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL QueryCreate (const QueryCreateData_1_0 *createData, QueryHandle_1_0 *handle){ return StatusCode::Failed;} // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL QueryDelete (const QueryHandle_1_0 handle){ return StatusCode::Failed;} // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL ConfigurationCreate (const ConfigurationCreateData_1_0 *createData, ConfigurationHandle_1_0 *handle){ return StatusCode::Failed;} // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL ConfigurationActivate (const ConfigurationHandle_1_0 handle, const ConfigurationActivateData_1_0 *activateData){ return StatusCode::Failed;} // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL ConfigurationDeactivate (const ConfigurationHandle_1_0 handle){ return StatusCode::Failed;} // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL ConfigurationDelete (const ConfigurationHandle_1_0 handle){ return StatusCode::Failed;} // NOLINT(readability-identifier-naming) + static StatusCode ML_STDCALL GetData (GetReportData_1_0 *data){ return StatusCode::Failed;} // NOLINT(readability-identifier-naming) MockMetricsLibraryInvalidInterface() { @@ -209,8 +209,8 @@ class MockPerformanceCounters { // PerformanceCountersDeviceFixture ////////////////////////////////////////////////////// struct PerformanceCountersDeviceFixture { - virtual void SetUp(); - virtual void TearDown(); + virtual void SetUp(); // NOLINT(readability-identifier-naming) + virtual void TearDown(); // NOLINT(readability-identifier-naming) decltype(&PerformanceCounters::create) createFunc; }; @@ -222,8 +222,8 @@ struct RootDeviceEnvironment; struct PerformanceCountersFixture { PerformanceCountersFixture(); ~PerformanceCountersFixture(); - virtual void SetUp(); - virtual void TearDown(); + virtual void SetUp(); // NOLINT(readability-identifier-naming) + virtual void TearDown(); // NOLINT(readability-identifier-naming) virtual void createPerfCounters(); cl_queue_properties queueProperties = {}; std::unique_ptr device; diff --git a/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp b/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp index cbd74979de..eff4d1c25f 100644 --- a/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp @@ -149,7 +149,7 @@ class WddmCommandStreamMockGdiTest : public ::testing::Test { GraphicsAllocation *preemptionAllocation = nullptr; template - void SetUpT() { + void setUpT() { HardwareInfo *hwInfo = nullptr; ExecutionEnvironment *executionEnvironment = getExecutionEnvironmentImpl(hwInfo, 1); wddm = static_cast(executionEnvironment->rootDeviceEnvironments[0]->osInterface->getDriverModel()->as()); @@ -169,7 +169,7 @@ class WddmCommandStreamMockGdiTest : public ::testing::Test { } template - void TearDownT() { + void tearDownT() { wddm = nullptr; } }; diff --git a/opencl/test/unit_test/os_interface/windows/driver_info_tests.cpp b/opencl/test/unit_test/os_interface/windows/driver_info_tests.cpp index ea96ac63b6..77adfa6f99 100644 --- a/opencl/test/unit_test/os_interface/windows/driver_info_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/driver_info_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -83,7 +83,7 @@ class MockDriverInfoWindows : public DriverInfoWindows { static MockDriverInfoWindows *create(std::string path) { - auto result = new MockDriverInfoWindows("", PhysicalDevicePciBusInfo(PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue)); + auto result = new MockDriverInfoWindows("", PhysicalDevicePciBusInfo(PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue)); result->reader = new TestedRegistryReader(path); result->registryReader.reset(result->reader); @@ -152,7 +152,7 @@ struct DriverInfoWindowsTest : public ::testing::Test { DriverInfoWindows::createRegistryReaderFunc = [](const std::string &) -> std::unique_ptr { return std::make_unique(); }; - driverInfo = std::make_unique("", PhysicalDevicePciBusInfo(PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue)); + driverInfo = std::make_unique("", PhysicalDevicePciBusInfo(PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue)); } VariableBackup createFuncBackup{&DriverInfoWindows::createRegistryReaderFunc}; @@ -178,7 +178,7 @@ TEST_F(DriverInfoWindowsTest, GivenDriverInfoWhenThenReturnNonNullptr) { }; TEST(DriverInfo, givenDriverInfoWhenGetStringReturnNotMeaningEmptyStringThenEnableSharingSupport) { - MockDriverInfoWindows driverInfo("", PhysicalDevicePciBusInfo(PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue)); + MockDriverInfoWindows driverInfo("", PhysicalDevicePciBusInfo(PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue)); MockRegistryReader *registryReaderMock = new MockRegistryReader(); driverInfo.registryReader.reset(registryReaderMock); @@ -190,7 +190,7 @@ TEST(DriverInfo, givenDriverInfoWhenGetStringReturnNotMeaningEmptyStringThenEnab }; TEST(DriverInfo, givenDriverInfoWhenGetStringReturnMeaningEmptyStringThenDisableSharingSupport) { - MockDriverInfoWindows driverInfo("", PhysicalDevicePciBusInfo(PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue)); + MockDriverInfoWindows driverInfo("", PhysicalDevicePciBusInfo(PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue)); MockRegistryReader *registryReaderMock = new MockRegistryReader(); registryReaderMock->returnString = "<>"; driverInfo.registryReader.reset(registryReaderMock); @@ -206,7 +206,7 @@ TEST(DriverInfo, givenFullPathToRegistryWhenCreatingDriverInfoWindowsThenTheRegi std::string registryPath = "Path\\In\\Registry"; std::string fullRegistryPath = "\\REGISTRY\\MACHINE\\" + registryPath; std::string expectedTrimmedRegistryPath = registryPath; - MockDriverInfoWindows driverInfo(std::move(fullRegistryPath), PhysicalDevicePciBusInfo(PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue)); + MockDriverInfoWindows driverInfo(std::move(fullRegistryPath), PhysicalDevicePciBusInfo(PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue)); EXPECT_STREQ(expectedTrimmedRegistryPath.c_str(), driverInfo.path.c_str()); }; diff --git a/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp index e3d0e7a63a..9b481b9946 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp @@ -1748,8 +1748,8 @@ TEST_F(WddmTestWithMockGdiDll, givenQueryAdapterInfoCallReturnsInvalidAdapterBDF auto pciBusInfo = wddm->getPciBusInfo(); - EXPECT_EQ(pciBusInfo.pciDomain, PhysicalDevicePciBusInfo::InvalidValue); - EXPECT_EQ(pciBusInfo.pciBus, PhysicalDevicePciBusInfo::InvalidValue); - EXPECT_EQ(pciBusInfo.pciDevice, PhysicalDevicePciBusInfo::InvalidValue); - EXPECT_EQ(pciBusInfo.pciFunction, PhysicalDevicePciBusInfo::InvalidValue); + EXPECT_EQ(pciBusInfo.pciDomain, PhysicalDevicePciBusInfo::invalidValue); + EXPECT_EQ(pciBusInfo.pciBus, PhysicalDevicePciBusInfo::invalidValue); + EXPECT_EQ(pciBusInfo.pciDevice, PhysicalDevicePciBusInfo::invalidValue); + EXPECT_EQ(pciBusInfo.pciFunction, PhysicalDevicePciBusInfo::invalidValue); } diff --git a/opencl/test/unit_test/program/program_data_tests.cpp b/opencl/test/unit_test/program/program_data_tests.cpp index cbe2d90496..8bebb8ecdb 100644 --- a/opencl/test/unit_test/program/program_data_tests.cpp +++ b/opencl/test/unit_test/program/program_data_tests.cpp @@ -146,7 +146,7 @@ void ProgramDataTestBase::buildAndDecodeProgramPatchList() { programBinaryHeader.PatchListSize = programPatchListSize; char *pProgramData = new char[headerSize + programBinaryHeader.PatchListSize]; - ASSERT_NE(nullptr, pProgramData); + ASSERT_NE(nullptr, pProgramData); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) pCurPtr = pProgramData; diff --git a/opencl/test/unit_test/program/program_tests.cpp b/opencl/test/unit_test/program/program_tests.cpp index ee0677e21a..49ef3f6ac4 100644 --- a/opencl/test/unit_test/program/program_tests.cpp +++ b/opencl/test/unit_test/program/program_tests.cpp @@ -2233,7 +2233,7 @@ TEST_F(ProgramTests, givenProgramCreatedFromILWhenCompileIsCalledThenReuseTheILI const uint32_t spirv[16] = {0x03022307}; cl_int errCode = 0; auto pProgram = Program::createFromIL(pContext, reinterpret_cast(spirv), sizeof(spirv), errCode); - ASSERT_NE(nullptr, pProgram); + ASSERT_NE(nullptr, pProgram); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) auto debugVars = NEO::getIgcDebugVars(); debugVars.forceBuildFailure = true; gEnvironment->fclPushDebugVars(debugVars); @@ -2336,15 +2336,15 @@ TEST_F(ProgramTests, WhenLinkingTwoValidSpirvProgramsThenValidProgramIsReturned) cl_int errCode = CL_SUCCESS; auto node1 = Program::createFromIL>(pContext, reinterpret_cast(spirv), sizeof(spirv), errCode); - ASSERT_NE(nullptr, node1); + ASSERT_NE(nullptr, node1); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) EXPECT_EQ(CL_SUCCESS, errCode); auto node2 = Program::createFromIL>(pContext, reinterpret_cast(spirv), sizeof(spirv), errCode); - ASSERT_NE(nullptr, node2); + ASSERT_NE(nullptr, node2); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) EXPECT_EQ(CL_SUCCESS, errCode); auto prog = Program::createFromIL>(pContext, reinterpret_cast(spirv), sizeof(spirv), errCode); - ASSERT_NE(nullptr, prog); + ASSERT_NE(nullptr, prog); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) EXPECT_EQ(CL_SUCCESS, errCode); cl_program linkNodes[] = {node1, node2}; diff --git a/opencl/test/unit_test/program/program_with_zebin.h b/opencl/test/unit_test/program/program_with_zebin.h index 54cb32084c..f9560a4d72 100644 --- a/opencl/test/unit_test/program/program_with_zebin.h +++ b/opencl/test/unit_test/program/program_with_zebin.h @@ -24,5 +24,5 @@ class ProgramWithZebinFixture : public ProgramTests { void TearDown() override; void addEmptyZebin(MockProgram *program); void populateProgramWithSegments(MockProgram *program); - ~ProgramWithZebinFixture() = default; -}; \ No newline at end of file + ~ProgramWithZebinFixture() override = default; +}; diff --git a/opencl/test/unit_test/sampler/sampler_tests.cpp b/opencl/test/unit_test/sampler/sampler_tests.cpp index 4696d17737..035136d57f 100644 --- a/opencl/test/unit_test/sampler/sampler_tests.cpp +++ b/opencl/test/unit_test/sampler/sampler_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -56,7 +56,7 @@ TEST_P(CreateSampler, GivenModeWhenSamplerIsCreatedThenParamsAreSetCorrectly) { normalizedCoords, addressingMode, filterMode); - ASSERT_NE(nullptr, sampler); + ASSERT_NE(nullptr, sampler); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) EXPECT_EQ(context, sampler->getContext()); EXPECT_EQ(normalizedCoords, sampler->getNormalizedCoordinates()); diff --git a/opencl/test/unit_test/utilities/.clang-tidy b/opencl/test/unit_test/utilities/.clang-tidy deleted file mode 100644 index 82ba9103bb..0000000000 --- a/opencl/test/unit_test/utilities/.clang-tidy +++ /dev/null @@ -1,32 +0,0 @@ ---- -Checks: 'clang-diagnostic-*,clang-analyzer-*,google-default-arguments,modernize-use-override,modernize-use-default-member-init,-clang-analyzer-alpha*,readability-identifier-naming,-clang-analyzer-core.UndefinedBinaryOperatorResult' -# WarningsAsErrors: '.*' -HeaderFilterRegex: '^((?!^third_party\/).+)\.(h|hpp|inl)$' -AnalyzeTemporaryDtors: false -CheckOptions: - - key: google-readability-braces-around-statements.ShortStatementLines - value: '1' - - key: google-readability-function-size.StatementThreshold - value: '800' - - key: google-readability-namespace-comments.ShortNamespaceLines - value: '10' - - key: google-readability-namespace-comments.SpacesBeforeComments - value: '2' - - key: readability-identifier-naming.ParameterCase - value: camelBack - - key: modernize-loop-convert.MaxCopySize - value: '16' - - key: modernize-loop-convert.MinConfidence - value: reasonable - - key: modernize-loop-convert.NamingStyle - value: CamelCase - - key: modernize-pass-by-value.IncludeStyle - value: llvm - - key: modernize-replace-auto-ptr.IncludeStyle - value: llvm - - key: modernize-use-nullptr.NullMacros - value: 'NULL' - - key: modernize-use-default-member-init.UseAssignment - value: '1' -... - diff --git a/opencl/test/unit_test/utilities/file_logger_tests.h b/opencl/test/unit_test/utilities/file_logger_tests.h index 92c8f58d04..61185ceccb 100644 --- a/opencl/test/unit_test/utilities/file_logger_tests.h +++ b/opencl/test/unit_test/utilities/file_logger_tests.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Intel Corporation + * Copyright (C) 2019-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -66,11 +66,11 @@ using FullyDisabledClFileLogger = NEO::ClFileLogger class TestLoggerApiEnterWrapper : public NEO::LoggerApiEnterWrapper { public: - TestLoggerApiEnterWrapper(const char *functionName, int *errCode) : NEO::LoggerApiEnterWrapper(functionName, errCode), loggedEnter(false) { + TestLoggerApiEnterWrapper(const char *functionName, int *errCode) : NEO::LoggerApiEnterWrapper(functionName, errCode) { if (DebugFunctionality) { loggedEnter = true; } } - bool loggedEnter; + bool loggedEnter = false; }; diff --git a/opencl/test/unit_test/xe_hpc_core/hw_helper_tests_xe_hpc_core.cpp b/opencl/test/unit_test/xe_hpc_core/hw_helper_tests_xe_hpc_core.cpp index b7e0e57c35..4530ebd8a4 100644 --- a/opencl/test/unit_test/xe_hpc_core/hw_helper_tests_xe_hpc_core.cpp +++ b/opencl/test/unit_test/xe_hpc_core/hw_helper_tests_xe_hpc_core.cpp @@ -783,7 +783,7 @@ XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenCCSEngineWhenCallingIsCooperative auto device = MockDevice::createWithNewExecutionEnvironment(&hwInfo); ASSERT_NE(nullptr, device); auto clDevice = new MockClDevice{device}; - ASSERT_NE(nullptr, clDevice); + ASSERT_NE(nullptr, clDevice); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) auto context = new NEO::MockContext(clDevice); auto commandQueue = reinterpret_cast(new MockCommandQueueHw(context, clDevice, 0)); diff --git a/shared/source/command_stream/aub_command_stream_receiver_hw.h b/shared/source/command_stream/aub_command_stream_receiver_hw.h index a9889f4bd7..469328dea6 100644 --- a/shared/source/command_stream/aub_command_stream_receiver_hw.h +++ b/shared/source/command_stream/aub_command_stream_receiver_hw.h @@ -94,7 +94,7 @@ class AUBCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw subCaptureManager; uint32_t aubDeviceId; bool standalone; diff --git a/shared/source/command_stream/experimental_command_buffer.cpp b/shared/source/command_stream/experimental_command_buffer.cpp index 8ffe4c0382..34c7ae4342 100644 --- a/shared/source/command_stream/experimental_command_buffer.cpp +++ b/shared/source/command_stream/experimental_command_buffer.cpp @@ -21,9 +21,6 @@ namespace NEO { ExperimentalCommandBuffer::ExperimentalCommandBuffer(CommandStreamReceiver *csr, double profilingTimerResolution) : commandStreamReceiver(csr), currentStream(nullptr), - timestampsOffset(0), - experimentalAllocationOffset(0), - defaultPrint(true), timerResolution(profilingTimerResolution) { auto rootDeviceIndex = csr->getRootDeviceIndex(); timestamps = csr->getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, MemoryConstants::pageSize, AllocationType::INTERNAL_HOST_MEMORY, csr->getOsContext().getDeviceBitfield()}); diff --git a/shared/source/command_stream/experimental_command_buffer.h b/shared/source/command_stream/experimental_command_buffer.h index 9246c8dd96..05f4448611 100644 --- a/shared/source/command_stream/experimental_command_buffer.h +++ b/shared/source/command_stream/experimental_command_buffer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2020 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -54,12 +54,12 @@ class ExperimentalCommandBuffer { std::unique_ptr currentStream; GraphicsAllocation *timestamps; - uint32_t timestampsOffset; + uint32_t timestampsOffset = 0; GraphicsAllocation *experimentalAllocation; - uint32_t experimentalAllocationOffset; + uint32_t experimentalAllocationOffset = 0; - bool defaultPrint; + bool defaultPrint = true; double timerResolution; }; diff --git a/shared/source/debug_settings/debug_settings_manager.h b/shared/source/debug_settings/debug_settings_manager.h index 2d075490db..815474e1c3 100644 --- a/shared/source/debug_settings/debug_settings_manager.h +++ b/shared/source/debug_settings/debug_settings_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -74,13 +74,13 @@ struct DebugVarBase { T value; }; -struct DebugVariables { +struct DebugVariables { // NOLINT(clang-analyzer-optin.performance.Padding) struct DEBUGGER_LOG_BITMASK { - constexpr static int32_t LOG_INFO{1}; - constexpr static int32_t LOG_ERROR{1 << 1}; - constexpr static int32_t LOG_THREADS{1 << 2}; - constexpr static int32_t LOG_MEM{1 << 3}; - constexpr static int32_t DUMP_ELF{1 << 10}; + constexpr static int32_t LOG_INFO{1}; // NOLINT(readability-identifier-naming) + constexpr static int32_t LOG_ERROR{1 << 1}; // NOLINT(readability-identifier-naming) + constexpr static int32_t LOG_THREADS{1 << 2}; // NOLINT(readability-identifier-naming) + constexpr static int32_t LOG_MEM{1 << 3}; // NOLINT(readability-identifier-naming) + constexpr static int32_t DUMP_ELF{1 << 10}; // NOLINT(readability-identifier-naming) }; #define DECLARE_DEBUG_VARIABLE(dataType, variableName, defaultValue, description) \ diff --git a/shared/source/device/device.cpp b/shared/source/device/device.cpp index 8901c02ae7..0ef79fd4b2 100644 --- a/shared/source/device/device.cpp +++ b/shared/source/device/device.cpp @@ -691,7 +691,7 @@ bool Device::getUuid(std::array &uuid) { } bool Device::generateUuidFromPciBusInfo(const PhysicalDevicePciBusInfo &pciBusInfo, std::array &uuid) { - if (pciBusInfo.pciDomain != PhysicalDevicePciBusInfo::InvalidValue) { + if (pciBusInfo.pciDomain != PhysicalDevicePciBusInfo::invalidValue) { uuid.fill(0); memcpy_s(&uuid[0], 2, &pciBusInfo.pciDomain, 2); diff --git a/shared/source/direct_submission/linux/drm_direct_submission.h b/shared/source/direct_submission/linux/drm_direct_submission.h index 37b3e6f5d0..a4193e8bbb 100644 --- a/shared/source/direct_submission/linux/drm_direct_submission.h +++ b/shared/source/direct_submission/linux/drm_direct_submission.h @@ -18,7 +18,7 @@ class DrmDirectSubmission : public DirectSubmissionHw { DrmDirectSubmission(const DirectSubmissionInputParams &inputParams); - ~DrmDirectSubmission(); + ~DrmDirectSubmission() override; uint32_t *getCompletionValuePointer() override { if (this->completionFenceAllocation) { diff --git a/shared/source/direct_submission/windows/wddm_direct_submission.h b/shared/source/direct_submission/windows/wddm_direct_submission.h index 0c8c9a828b..2ec84c7ae7 100644 --- a/shared/source/direct_submission/windows/wddm_direct_submission.h +++ b/shared/source/direct_submission/windows/wddm_direct_submission.h @@ -21,7 +21,7 @@ class WddmDirectSubmission : public DirectSubmissionHw { public: WddmDirectSubmission(const DirectSubmissionInputParams &inputParams); - ~WddmDirectSubmission(); + ~WddmDirectSubmission() override; protected: bool allocateOsResources() override; diff --git a/shared/source/gmm_helper/windows/gmm_memory/gmm_memory.h b/shared/source/gmm_helper/windows/gmm_memory/gmm_memory.h index 94091ed9ae..b324accb50 100644 --- a/shared/source/gmm_helper/windows/gmm_memory/gmm_memory.h +++ b/shared/source/gmm_helper/windows/gmm_memory/gmm_memory.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -12,7 +12,7 @@ namespace NEO { class GmmMemory : public GmmMemoryBase { public: static GmmMemory *create(GmmClientContext *gmmClientContext); - virtual ~GmmMemory() = default; + ~GmmMemory() override = default; protected: using GmmMemoryBase::GmmMemoryBase; diff --git a/shared/source/helpers/l3_range.h b/shared/source/helpers/l3_range.h index 8c3cc875a5..b075902e95 100644 --- a/shared/source/helpers/l3_range.h +++ b/shared/source/helpers/l3_range.h @@ -64,7 +64,7 @@ struct L3Range { } uint64_t getSizeInBytes() const { - return (1ULL << (minAlignmentBitOffset + getMask())); + return (1ULL << (minAlignmentBitOffset + getMask())); // NOLINT(clang-analyzer-core.UndefinedBinaryOperatorResult) } uint64_t getMaskedAddress() const { diff --git a/shared/source/memory_manager/migration_sync_data.h b/shared/source/memory_manager/migration_sync_data.h index 7b822761b9..f98c89bfac 100644 --- a/shared/source/memory_manager/migration_sync_data.h +++ b/shared/source/memory_manager/migration_sync_data.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -17,7 +17,7 @@ class MigrationSyncData : public ReferenceTrackedObject { static constexpr uint32_t locationUndefined = std::numeric_limits::max(); MigrationSyncData(size_t size); - ~MigrationSyncData(); + ~MigrationSyncData() override; uint32_t getCurrentLocation() const; void startMigration(); void setCurrentLocation(uint32_t rootDeviceIndex); diff --git a/shared/source/memory_manager/physical_address_allocator.h b/shared/source/memory_manager/physical_address_allocator.h index d21f4ff75d..0017849efc 100644 --- a/shared/source/memory_manager/physical_address_allocator.h +++ b/shared/source/memory_manager/physical_address_allocator.h @@ -64,9 +64,9 @@ class PhysicalAddressAllocatorHw : public PhysicalAddressAllocator { } } - virtual ~PhysicalAddressAllocatorHw() override { + ~PhysicalAddressAllocatorHw() override { if (bankAllocators) { - delete bankAllocators; + delete[] bankAllocators; } } diff --git a/shared/source/os_interface/driver_info.h b/shared/source/os_interface/driver_info.h index a770c44cc5..330fd604ca 100644 --- a/shared/source/os_interface/driver_info.h +++ b/shared/source/os_interface/driver_info.h @@ -22,26 +22,26 @@ struct PhysicalDevicePciBusInfo { PhysicalDevicePciBusInfo(uint32_t domain, uint32_t bus, uint32_t device, uint32_t function) : pciDomain(domain), pciBus(bus), pciDevice(device), pciFunction(function) {} - static constexpr uint32_t InvalidValue = std::numeric_limits::max(); + static constexpr uint32_t invalidValue = std::numeric_limits::max(); static constexpr PhysicalDevicePciBusInfo invalid() { return {}; } - uint32_t pciDomain = InvalidValue; - uint32_t pciBus = InvalidValue; - uint32_t pciDevice = InvalidValue; - uint32_t pciFunction = InvalidValue; + uint32_t pciDomain = invalidValue; + uint32_t pciBus = invalidValue; + uint32_t pciDevice = invalidValue; + uint32_t pciFunction = invalidValue; }; struct PhyicalDevicePciSpeedInfo { - static constexpr int32_t Unknown = -1; - int32_t genVersion = Unknown; - int32_t width = Unknown; - int64_t maxBandwidth = Unknown; + static constexpr int32_t unknown = -1; + int32_t genVersion = unknown; + int32_t width = unknown; + int64_t maxBandwidth = unknown; }; class DriverInfo { public: DriverInfo() - : pciBusInfo(PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue) {} + : pciBusInfo(PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue) {} static DriverInfo *create(const HardwareInfo *hwInfo, const OSInterface *osInterface); diff --git a/shared/source/os_interface/linux/driver_info_linux.cpp b/shared/source/os_interface/linux/driver_info_linux.cpp index cd29fae4ca..353d9d2928 100644 --- a/shared/source/os_interface/linux/driver_info_linux.cpp +++ b/shared/source/os_interface/linux/driver_info_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -15,7 +15,7 @@ namespace NEO { DriverInfo *DriverInfo::create(const HardwareInfo *hwInfo, const OSInterface *osInterface) { - PhysicalDevicePciBusInfo pciBusInfo(PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue); + PhysicalDevicePciBusInfo pciBusInfo(PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue); if (osInterface) { pciBusInfo = osInterface->getDriverModel()->getPciBusInfo(); } diff --git a/shared/source/os_interface/linux/drm_buffer_object.cpp b/shared/source/os_interface/linux/drm_buffer_object.cpp index 8fdde40ad7..cff1045c6d 100644 --- a/shared/source/os_interface/linux/drm_buffer_object.cpp +++ b/shared/source/os_interface/linux/drm_buffer_object.cpp @@ -33,7 +33,7 @@ namespace NEO { -BufferObject::BufferObject(Drm *drm, uint64_t patIndex, int handle, size_t size, size_t maxOsContextCount) : drm(drm), refCount(1), handle(handle), size(size), isReused(false) { +BufferObject::BufferObject(Drm *drm, uint64_t patIndex, int handle, size_t size, size_t maxOsContextCount) : drm(drm), refCount(1), handle(handle), size(size) { this->tilingMode = I915_TILING_NONE; this->lockedAddress = nullptr; this->patIndex = patIndex; @@ -172,8 +172,8 @@ int BufferObject::exec(uint32_t used, size_t startOffset, unsigned int flags, bo if (ret != 0) { const auto status = evictUnusedAllocations(true, true); if (status == MemoryOperationsStatus::GPU_HANG_DETECTED_DURING_OPERATION) { - PRINT_DEBUG_STRING(DebugManager.flags.PrintDebugMessages.get(), stderr, "Error! GPU hang detected in BufferObject::exec(). Returning %d\n", GPU_HANG_DETECTED); - return GPU_HANG_DETECTED; + PRINT_DEBUG_STRING(DebugManager.flags.PrintDebugMessages.get(), stderr, "Error! GPU hang detected in BufferObject::exec(). Returning %d\n", gpuHangDetected); + return gpuHangDetected; } ret = ioctlHelper->execBuffer(drm, &execbuf, completionGpuAddress, completionValue); diff --git a/shared/source/os_interface/linux/drm_buffer_object.h b/shared/source/os_interface/linux/drm_buffer_object.h index 0c37c36ec2..a30c313e4e 100644 --- a/shared/source/os_interface/linux/drm_buffer_object.h +++ b/shared/source/os_interface/linux/drm_buffer_object.h @@ -139,7 +139,7 @@ class BufferObject { uint64_t peekPatIndex() const { return patIndex; } void setPatIndex(uint64_t newPatIndex) { this->patIndex = newPatIndex; } - static constexpr int GPU_HANG_DETECTED{-7171}; + static constexpr int gpuHangDetected{-7171}; protected: MOCKABLE_VIRTUAL MemoryOperationsStatus evictUnusedAllocations(bool waitForCompletion, bool isLockNeeded); @@ -151,7 +151,7 @@ class BufferObject { uint32_t rootDeviceIndex = std::numeric_limits::max(); int handle; // i915 gem object handle uint64_t size; - bool isReused; + bool isReused = false; uint32_t tilingMode; bool allowCapture = false; diff --git a/shared/source/os_interface/linux/drm_command_stream.h b/shared/source/os_interface/linux/drm_command_stream.h index 871c5ddc2b..3eb581f5de 100644 --- a/shared/source/os_interface/linux/drm_command_stream.h +++ b/shared/source/os_interface/linux/drm_command_stream.h @@ -43,10 +43,10 @@ class DrmCommandStreamReceiver : public DeviceCommandStreamReceiver { uint32_t rootDeviceIndex, const DeviceBitfield deviceBitfield, gemCloseWorkerMode mode = gemCloseWorkerMode::gemCloseWorkerActive); - ~DrmCommandStreamReceiver(); + ~DrmCommandStreamReceiver() override; SubmissionStatus flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override; - MOCKABLE_VIRTUAL void processResidency(const ResidencyContainer &allocationsForResidency, uint32_t handleId) override; + void processResidency(const ResidencyContainer &allocationsForResidency, uint32_t handleId) override; void makeNonResident(GraphicsAllocation &gfxAllocation) override; bool waitForFlushStamp(FlushStamp &flushStampToWait) override; bool isKmdWaitModeActive() override; diff --git a/shared/source/os_interface/linux/drm_neo.cpp b/shared/source/os_interface/linux/drm_neo.cpp index d684325f35..90b344dafb 100644 --- a/shared/source/os_interface/linux/drm_neo.cpp +++ b/shared/source/os_interface/linux/drm_neo.cpp @@ -821,7 +821,7 @@ bool Drm::translateTopologyInfo(const drm_i915_query_topology_info *queryTopolog } PhysicalDevicePciBusInfo Drm::getPciBusInfo() const { - PhysicalDevicePciBusInfo pciBusInfo(PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue); + PhysicalDevicePciBusInfo pciBusInfo(PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue); if (adapterBDF.Data != std::numeric_limits::max()) { pciBusInfo.pciDomain = this->pciDomain; diff --git a/shared/source/os_interface/linux/drm_neo.h b/shared/source/os_interface/linux/drm_neo.h index 8af7f0a844..dc35503857 100644 --- a/shared/source/os_interface/linux/drm_neo.h +++ b/shared/source/os_interface/linux/drm_neo.h @@ -50,7 +50,7 @@ struct HardwareInfo; struct RootDeviceEnvironment; struct SystemInfo; -struct DeviceDescriptor { // NOLINT(clang-analyzer-optin.performance.Padding) +struct DeviceDescriptor { unsigned short deviceId; const HardwareInfo *pHwInfo; void (*setupHardwareInfo)(HardwareInfo *, bool); @@ -86,7 +86,7 @@ class Drm : public DriverModel { int maxEuCount; }; - virtual ~Drm(); + ~Drm() override; virtual int ioctl(unsigned long request, void *arg); diff --git a/shared/source/os_interface/linux/drm_null_device.h b/shared/source/os_interface/linux/drm_null_device.h index e7b5a4243f..3c466b72e9 100644 --- a/shared/source/os_interface/linux/drm_null_device.h +++ b/shared/source/os_interface/linux/drm_null_device.h @@ -39,9 +39,9 @@ class DrmNullDevice : public Drm { } } - DrmNullDevice(std::unique_ptr &&hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::move(hwDeviceId), rootDeviceEnvironment), gpuTimestamp(0){}; + DrmNullDevice(std::unique_ptr &&hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::move(hwDeviceId), rootDeviceEnvironment){}; protected: - uint64_t gpuTimestamp; + uint64_t gpuTimestamp = 0; }; } // namespace NEO diff --git a/shared/source/os_interface/windows/deferrable_deletion_win.h b/shared/source/os_interface/windows/deferrable_deletion_win.h index cfc2c442be..f8e05aeb51 100644 --- a/shared/source/os_interface/windows/deferrable_deletion_win.h +++ b/shared/source/os_interface/windows/deferrable_deletion_win.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -20,7 +20,7 @@ class DeferrableDeletionImpl : public DeferrableDeletion { public: DeferrableDeletionImpl(Wddm *wddm, const D3DKMT_HANDLE *handles, uint32_t allocationCount, D3DKMT_HANDLE resourceHandle); bool apply() override; - ~DeferrableDeletionImpl(); + ~DeferrableDeletionImpl() override; DeferrableDeletionImpl(const DeferrableDeletionImpl &) = delete; DeferrableDeletionImpl &operator=(const DeferrableDeletionImpl &) = delete; diff --git a/shared/source/os_interface/windows/driver_info_windows.cpp b/shared/source/os_interface/windows/driver_info_windows.cpp index 3a8c9a1cf9..1dfd204af0 100644 --- a/shared/source/os_interface/windows/driver_info_windows.cpp +++ b/shared/source/os_interface/windows/driver_info_windows.cpp @@ -89,7 +89,7 @@ bool DriverInfoWindows::isCompatibleDriverStore() const { } bool isCompatibleDriverStore(std::string &&deviceRegistryPath) { - DriverInfoWindows driverInfo(deviceRegistryPath, PhysicalDevicePciBusInfo(PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue)); + DriverInfoWindows driverInfo(deviceRegistryPath, PhysicalDevicePciBusInfo(PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue)); return driverInfo.isCompatibleDriverStore(); } diff --git a/shared/source/os_interface/windows/driver_info_windows.h b/shared/source/os_interface/windows/driver_info_windows.h index a4aa5f2272..39ff265355 100644 --- a/shared/source/os_interface/windows/driver_info_windows.h +++ b/shared/source/os_interface/windows/driver_info_windows.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -22,7 +22,7 @@ bool isCompatibleDriverStore(std::string &&deviceRegistryPath); class DriverInfoWindows : public DriverInfo { public: DriverInfoWindows(const std::string &path, const PhysicalDevicePciBusInfo &pciBusInfo); - ~DriverInfoWindows(); + ~DriverInfoWindows() override; std::string getDeviceName(std::string defaultName) override; std::string getVersion(std::string defaultVersion) override; bool isCompatibleDriverStore() const; diff --git a/shared/source/os_interface/windows/wddm/wddm.cpp b/shared/source/os_interface/windows/wddm/wddm.cpp index 3c714db1e7..30b20a6e2c 100644 --- a/shared/source/os_interface/windows/wddm/wddm.cpp +++ b/shared/source/os_interface/windows/wddm/wddm.cpp @@ -421,32 +421,32 @@ bool Wddm::mapGpuVirtualAddress(AllocationStorageData *allocationStorageData) { } bool Wddm::mapGpuVirtualAddress(Gmm *gmm, D3DKMT_HANDLE handle, D3DGPU_VIRTUAL_ADDRESS minimumAddress, D3DGPU_VIRTUAL_ADDRESS maximumAddress, D3DGPU_VIRTUAL_ADDRESS preferredAddress, D3DGPU_VIRTUAL_ADDRESS &gpuPtr) { - D3DDDI_MAPGPUVIRTUALADDRESS MapGPUVA = {}; + D3DDDI_MAPGPUVIRTUALADDRESS mapGPUVA = {}; D3DDDIGPUVIRTUALADDRESS_PROTECTION_TYPE protectionType = {}; protectionType.Write = TRUE; uint64_t size = gmm->gmmResourceInfo->getSizeAllocation(); - MapGPUVA.hPagingQueue = pagingQueue; - MapGPUVA.hAllocation = handle; - MapGPUVA.Protection = protectionType; + mapGPUVA.hPagingQueue = pagingQueue; + mapGPUVA.hAllocation = handle; + mapGPUVA.Protection = protectionType; - MapGPUVA.SizeInPages = size / MemoryConstants::pageSize; - MapGPUVA.OffsetInPages = 0; + mapGPUVA.SizeInPages = size / MemoryConstants::pageSize; + mapGPUVA.OffsetInPages = 0; - MapGPUVA.BaseAddress = preferredAddress; - MapGPUVA.MinimumAddress = minimumAddress; - MapGPUVA.MaximumAddress = maximumAddress; + mapGPUVA.BaseAddress = preferredAddress; + mapGPUVA.MinimumAddress = minimumAddress; + mapGPUVA.MaximumAddress = maximumAddress; - applyAdditionalMapGPUVAFields(MapGPUVA, gmm); + applyAdditionalMapGPUVAFields(mapGPUVA, gmm); - NTSTATUS status = getGdi()->mapGpuVirtualAddress(&MapGPUVA); + NTSTATUS status = getGdi()->mapGpuVirtualAddress(&mapGPUVA); auto gmmHelper = rootDeviceEnvironment.getGmmHelper(); - gpuPtr = gmmHelper->canonize(MapGPUVA.VirtualAddress); + gpuPtr = gmmHelper->canonize(mapGPUVA.VirtualAddress); if (status == STATUS_PENDING) { - updatePagingFenceValue(MapGPUVA.PagingFenceValue); + updatePagingFenceValue(mapGPUVA.PagingFenceValue); status = STATUS_SUCCESS; } @@ -455,7 +455,7 @@ bool Wddm::mapGpuVirtualAddress(Gmm *gmm, D3DKMT_HANDLE handle, D3DGPU_VIRTUAL_A return false; } - kmDafListener->notifyMapGpuVA(featureTable->flags.ftrKmdDaf, getAdapter(), device, handle, MapGPUVA.VirtualAddress, getGdi()->escape); + kmDafListener->notifyMapGpuVA(featureTable->flags.ftrKmdDaf, getAdapter(), device, handle, mapGPUVA.VirtualAddress, getGdi()->escape); bool ret = true; if (gmm->isCompressionEnabled && HwInfoConfig::get(gfxPlatform->eProductFamily)->isPageTableManagerSupported(*rootDeviceEnvironment.getHardwareInfo())) { for (auto engine : rootDeviceEnvironment.executionEnvironment.memoryManager->getRegisteredEngines()) { @@ -1102,7 +1102,7 @@ void Wddm::createPagingFenceLogger() { PhysicalDevicePciBusInfo Wddm::getPciBusInfo() const { if (adapterBDF.Data == std::numeric_limits::max()) { - return PhysicalDevicePciBusInfo(PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue); + return PhysicalDevicePciBusInfo(PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue); } return PhysicalDevicePciBusInfo(0, adapterBDF.Bus, adapterBDF.Device, adapterBDF.Function); } diff --git a/shared/source/os_interface/windows/wddm/wddm.h b/shared/source/os_interface/windows/wddm/wddm.h index 9ba4986773..55f3648fa5 100644 --- a/shared/source/os_interface/windows/wddm/wddm.h +++ b/shared/source/os_interface/windows/wddm/wddm.h @@ -65,7 +65,7 @@ class Wddm : public DriverModel { typedef HRESULT(WINAPI *DXCoreCreateAdapterFactoryFcn)(REFIID riid, void **ppFactory); typedef void(WINAPI *GetSystemInfoFcn)(SYSTEM_INFO *pSystemInfo); - virtual ~Wddm(); + ~Wddm() override; static Wddm *createWddm(std::unique_ptr &&hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment); bool init(); @@ -77,7 +77,7 @@ class Wddm : public DriverModel { MOCKABLE_VIRTUAL D3DGPU_VIRTUAL_ADDRESS reserveGpuVirtualAddress(D3DGPU_VIRTUAL_ADDRESS minimumAddress, D3DGPU_VIRTUAL_ADDRESS maximumAddress, D3DGPU_SIZE_T size); MOCKABLE_VIRTUAL bool createContext(OsContextWin &osContext); MOCKABLE_VIRTUAL void applyAdditionalContextFlags(CREATECONTEXT_PVTDATA &privateData, OsContextWin &osContext, const HardwareInfo &hwInfo); - MOCKABLE_VIRTUAL void applyAdditionalMapGPUVAFields(D3DDDI_MAPGPUVIRTUALADDRESS &MapGPUVA, Gmm *gmm); + MOCKABLE_VIRTUAL void applyAdditionalMapGPUVAFields(D3DDDI_MAPGPUVIRTUALADDRESS &mapGPUVA, Gmm *gmm); MOCKABLE_VIRTUAL bool freeGpuVirtualAddress(D3DGPU_VIRTUAL_ADDRESS &gpuPtr, uint64_t size); MOCKABLE_VIRTUAL NTSTATUS createAllocation(const void *alignedCpuPtr, const Gmm *gmm, D3DKMT_HANDLE &outHandle, D3DKMT_HANDLE &outResourceHandle, uint64_t *outSharedHandle); MOCKABLE_VIRTUAL bool createAllocation(const Gmm *gmm, D3DKMT_HANDLE &outHandle); diff --git a/shared/source/os_interface/windows/wddm_device_command_stream.h b/shared/source/os_interface/windows/wddm_device_command_stream.h index 6aa9329aba..bca2753929 100644 --- a/shared/source/os_interface/windows/wddm_device_command_stream.h +++ b/shared/source/os_interface/windows/wddm_device_command_stream.h @@ -23,7 +23,7 @@ class WddmCommandStreamReceiver : public DeviceCommandStreamReceiver public: WddmCommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, const DeviceBitfield deviceBitfield); - virtual ~WddmCommandStreamReceiver(); + ~WddmCommandStreamReceiver() override; SubmissionStatus flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override; void processResidency(const ResidencyContainer &allocationsForResidency, uint32_t handleId) override; diff --git a/shared/source/utilities/perf_profiler.cpp b/shared/source/utilities/perf_profiler.cpp index 39b81ddfc6..3c8b5a5f0a 100644 --- a/shared/source/utilities/perf_profiler.cpp +++ b/shared/source/utilities/perf_profiler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -53,7 +53,7 @@ void PerfProfiler::destroyAll() { gPerfProfiler = nullptr; } -PerfProfiler::PerfProfiler(int id, std::unique_ptr &&logOut, std::unique_ptr &&sysLogOut) : totalSystemTime(0) { +PerfProfiler::PerfProfiler(int id, std::unique_ptr &&logOut, std::unique_ptr &&sysLogOut) { ApiTimer.setFreq(); systemLogs.reserve(20); diff --git a/shared/source/utilities/perf_profiler.h b/shared/source/utilities/perf_profiler.h index f35428e0ec..316f2a7e20 100644 --- a/shared/source/utilities/perf_profiler.h +++ b/shared/source/utilities/perf_profiler.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -91,7 +91,7 @@ class PerfProfiler { static PerfProfiler *objects[PerfProfiler::objectsNumber]; Timer ApiTimer; Timer SystemTimer; - unsigned long long totalSystemTime; + unsigned long long totalSystemTime = 0; std::unique_ptr logFile; std::unique_ptr sysLogFile; std::vector systemLogs; diff --git a/shared/source/utilities/reference_tracked_object.h b/shared/source/utilities/reference_tracked_object.h index 4847bceaef..66c7c934ce 100644 --- a/shared/source/utilities/reference_tracked_object.h +++ b/shared/source/utilities/reference_tracked_object.h @@ -98,7 +98,7 @@ class unique_ptr_if_unused : public std::unique_ptr\n"; os << " \n"; os << " Name of the kernel.\n"; @@ -118,7 +118,7 @@ void PipeControlReasonTag::bxml(std::ostream &os) { BaseTag::bxml(os, OpCode::PipeControlReason, sizeof(PipeControlReasonTag), "PIPE_CONTROL_REASON"); - unsigned int stringDWORDSize = REASON_STR_LENGTH / sizeof(uint32_t); + unsigned int stringDWORDSize = reasonStrLength / sizeof(uint32_t); os << " \n"; os << " \n"; os << " Reason of the PIPE_CONTROL.\n"; @@ -134,7 +134,7 @@ void CallNameBeginTag::bxml(std::ostream &os) { BaseTag::bxml(os, OpCode::CallNameBegin, sizeof(CallNameBeginTag), "ZE_CALL_NAME_BEGIN"); - unsigned int stringDWORDSize = ZE_CALL_NAME_STR_LENGTH / sizeof(uint32_t); + unsigned int stringDWORDSize = zeCallNameStrLength / sizeof(uint32_t); os << " \n"; os << " \n"; os << " Entry of ZE Call where the GPU originated from.\n"; @@ -155,7 +155,7 @@ void CallNameEndTag::bxml(std::ostream &os) { BaseTag::bxml(os, OpCode::CallNameEnd, sizeof(CallNameEndTag), "ZE_CALL_NAME_END"); - unsigned int stringDWORDSize = ZE_CALL_NAME_STR_LENGTH / sizeof(uint32_t); + unsigned int stringDWORDSize = zeCallNameStrLength / sizeof(uint32_t); os << " \n"; os << " \n"; os << " Exit of ZE Call where the GPU originated from.\n"; diff --git a/shared/source/utilities/software_tags.h b/shared/source/utilities/software_tags.h index fa9075d3c5..23eafb89cb 100644 --- a/shared/source/utilities/software_tags.h +++ b/shared/source/utilities/software_tags.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -88,60 +88,60 @@ struct KernelNameTag : public BaseTag { public: KernelNameTag(const char *name, uint32_t callId) : BaseTag(OpCode::KernelName, sizeof(KernelNameTag)) { - strcpy_s(kernelName, KENEL_NAME_STR_LENGTH, name); + strcpy_s(kernelName, kenelNameStrLength, name); } static void bxml(std::ostream &os); private: - static constexpr unsigned int KENEL_NAME_STR_LENGTH = sizeof(uint32_t) * 16; // Dword aligned - char kernelName[KENEL_NAME_STR_LENGTH] = {}; + static constexpr unsigned int kenelNameStrLength = sizeof(uint32_t) * 16; // Dword aligned + char kernelName[kenelNameStrLength] = {}; }; struct PipeControlReasonTag : public BaseTag { public: PipeControlReasonTag(const char *reason, uint32_t callId) : BaseTag(OpCode::PipeControlReason, sizeof(PipeControlReasonTag)) { - strcpy_s(reasonString, REASON_STR_LENGTH, reason); + strcpy_s(reasonString, reasonStrLength, reason); } static void bxml(std::ostream &os); private: - static constexpr unsigned int REASON_STR_LENGTH = sizeof(uint32_t) * 32; // Dword aligned - char reasonString[REASON_STR_LENGTH] = {}; + static constexpr unsigned int reasonStrLength = sizeof(uint32_t) * 32; // Dword aligned + char reasonString[reasonStrLength] = {}; }; struct CallNameBeginTag : public BaseTag { public: CallNameBeginTag(const char *name, uint32_t callId) : BaseTag(OpCode::CallNameBegin, sizeof(CallNameBeginTag)) { - strcpy_s(zeCallName, ZE_CALL_NAME_STR_LENGTH, name); + strcpy_s(zeCallName, zeCallNameStrLength, name); snprintf(zeCallId, sizeof(uint32_t), "%x", callId); } static void bxml(std::ostream &os); private: - static constexpr unsigned int ZE_CALL_NAME_STR_LENGTH = sizeof(uint32_t) * 32; // Dword aligned - char zeCallName[ZE_CALL_NAME_STR_LENGTH] = {}; - char zeCallId[ZE_CALL_NAME_STR_LENGTH] = {}; + static constexpr unsigned int zeCallNameStrLength = sizeof(uint32_t) * 32; // Dword aligned + char zeCallName[zeCallNameStrLength] = {}; + char zeCallId[zeCallNameStrLength] = {}; }; struct CallNameEndTag : public BaseTag { public: CallNameEndTag(const char *name, uint32_t callId) : BaseTag(OpCode::CallNameEnd, sizeof(CallNameEndTag)) { - strcpy_s(zeCallName, ZE_CALL_NAME_STR_LENGTH, name); + strcpy_s(zeCallName, zeCallNameStrLength, name); snprintf(zeCallId, sizeof(uint32_t), "%x", callId); } static void bxml(std::ostream &os); private: - static constexpr unsigned int ZE_CALL_NAME_STR_LENGTH = sizeof(uint32_t) * 32; // Dword aligned - char zeCallName[ZE_CALL_NAME_STR_LENGTH] = {}; - char zeCallId[ZE_CALL_NAME_STR_LENGTH] = {}; + static constexpr unsigned int zeCallNameStrLength = sizeof(uint32_t) * 32; // Dword aligned + char zeCallName[zeCallNameStrLength] = {}; + char zeCallId[zeCallNameStrLength] = {}; }; struct SWTagBXML { diff --git a/shared/source/utilities/software_tags_manager.cpp b/shared/source/utilities/software_tags_manager.cpp index 38555ad043..cc0e09dc2a 100644 --- a/shared/source/utilities/software_tags_manager.cpp +++ b/shared/source/utilities/software_tags_manager.cpp @@ -43,12 +43,12 @@ void SWTagsManager::allocateBXMLHeap(Device &device) { void SWTagsManager::allocateSWTagHeap(Device &device) { const AllocationProperties properties{ device.getRootDeviceIndex(), - MAX_TAG_HEAP_SIZE, + maxTagHeapSize, AllocationType::SW_TAG_BUFFER, device.getDeviceBitfield()}; tagHeap = memoryManager->allocateGraphicsMemoryWithProperties(properties); - SWTags::SWTagHeapInfo tagHeapInfo(MAX_TAG_HEAP_SIZE / sizeof(uint32_t)); + SWTags::SWTagHeapInfo tagHeapInfo(maxTagHeapSize / sizeof(uint32_t)); MemoryTransferHelper::transferMemoryToAllocation(false, device, tagHeap, 0, &tagHeapInfo, sizeof(tagHeapInfo)); currentHeapOffset += sizeof(tagHeapInfo); } diff --git a/shared/source/utilities/software_tags_manager.h b/shared/source/utilities/software_tags_manager.h index 360a8c65ed..2cff590c5d 100644 --- a/shared/source/utilities/software_tags_manager.h +++ b/shared/source/utilities/software_tags_manager.h @@ -39,8 +39,8 @@ class SWTagsManager { template static size_t estimateSpaceForSWTags(); - static const unsigned int MAX_TAG_COUNT = 200; - static const unsigned int MAX_TAG_HEAP_SIZE = 16384; + static const unsigned int maxTagCount = 200; + static const unsigned int maxTagHeapSize = 16384; unsigned int currentCallCount = 0; unsigned int getCurrentHeapOffset() { return currentHeapOffset; } @@ -86,7 +86,7 @@ void SWTagsManager::insertTag(LinearStream &cmdStream, Device &device, Params... unsigned int tagSize = sizeof(Tag); - if (currentTagCount >= MAX_TAG_COUNT || getCurrentHeapOffset() + tagSize > MAX_TAG_HEAP_SIZE) { + if (currentTagCount >= maxTagCount || getCurrentHeapOffset() + tagSize > maxTagHeapSize) { return; } ++currentTagCount; @@ -113,7 +113,7 @@ template size_t SWTagsManager::estimateSpaceForSWTags() { using MI_NOOP = typename GfxFamily::MI_NOOP; - return 2 * EncodeStoreMemory::getStoreDataImmSize() + 2 * MAX_TAG_COUNT * sizeof(MI_NOOP); + return 2 * EncodeStoreMemory::getStoreDataImmSize() + 2 * maxTagCount * sizeof(MI_NOOP); } } // namespace NEO diff --git a/shared/source/utilities/stackvec.h b/shared/source/utilities/stackvec.h index 9b661a1e6b..38df99ffe0 100644 --- a/shared/source/utilities/stackvec.h +++ b/shared/source/utilities/stackvec.h @@ -31,9 +31,9 @@ struct StackVecSize { template ::SizeT> -class StackVec { +class StackVec { // NOLINT(clang-analyzer-optin.performance.Padding) public: - using value_type = DataType; // NOLINT + using value_type = DataType; using SizeT = StackSizeT; using iterator = DataType *; using const_iterator = const DataType *; @@ -226,7 +226,7 @@ class StackVec { clearStackObjects(); } - void push_back(const DataType &v) { // NOLINT + void push_back(const DataType &v) { // NOLINT(readability-identifier-naming) if (onStackSize == onStackCaps) { ensureDynamicMem(); } @@ -244,7 +244,7 @@ class StackVec { std::sort(this->begin(), this->end()); } - void remove_duplicates() { + void remove_duplicates() { // NOLINT(readability-identifier-naming) if (1 >= this->size()) { return; } @@ -256,7 +256,7 @@ class StackVec { } } - void pop_back() { // NOLINT + void pop_back() { // NOLINT(readability-identifier-naming) if (usesDynamicMem()) { dynamicMem->pop_back(); return; diff --git a/shared/test/.clang-tidy b/shared/test/.clang-tidy deleted file mode 100644 index c288dff55d..0000000000 --- a/shared/test/.clang-tidy +++ /dev/null @@ -1,34 +0,0 @@ ---- -Checks: 'clang-diagnostic-*,clang-analyzer-*,google-default-arguments,modernize-use-override,modernize-use-default-member-init,-clang-analyzer-alpha*,readability-identifier-naming,-clang-analyzer-optin.performance.Padding,-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-cplusplus.NewDeleteLeaks,-clang-analyzer-core.CallAndMessage,-clang-analyzer-unix.MismatchedDeallocator,-clang-analyzer-core.NullDereference,-clang-analyzer-cplusplus.NewDelete,-clang-analyzer-optin.cplusplus.VirtualCall' -# WarningsAsErrors: '.*' -HeaderFilterRegex: '^((?!^third_party\/).+)\.(h|hpp|inl)$' -AnalyzeTemporaryDtors: false -CheckOptions: - - key: google-readability-braces-around-statements.ShortStatementLines - value: '1' - - key: google-readability-function-size.StatementThreshold - value: '800' - - key: google-readability-namespace-comments.ShortNamespaceLines - value: '10' - - key: google-readability-namespace-comments.SpacesBeforeComments - value: '2' - - key: readability-identifier-naming.ParameterCase - value: camelBack - - key: readability-identifier-naming.StructMemberCase - value: camelBack - - key: modernize-loop-convert.MaxCopySize - value: '16' - - key: modernize-loop-convert.MinConfidence - value: reasonable - - key: modernize-loop-convert.NamingStyle - value: CamelCase - - key: modernize-pass-by-value.IncludeStyle - value: llvm - - key: modernize-replace-auto-ptr.IncludeStyle - value: llvm - - key: modernize-use-nullptr.NullMacros - value: 'NULL' - - key: modernize-use-default-member-init.UseAssignment - value: '1' -... - diff --git a/shared/test/common/cmd_parse/hw_parse.h b/shared/test/common/cmd_parse/hw_parse.h index 2e31a91332..7e8e09e1fd 100644 --- a/shared/test/common/cmd_parse/hw_parse.h +++ b/shared/test/common/cmd_parse/hw_parse.h @@ -28,10 +28,10 @@ struct HardwareParse { itorGpgpuCsrBaseAddress = cmdList.end(); } - void SetUp() { + void SetUp() { // NOLINT(readability-identifier-naming) } - void TearDown() { + void TearDown() { // NOLINT(readability-identifier-naming) cmdList.clear(); lriList.clear(); pipeControlList.clear(); diff --git a/shared/test/common/fixtures/command_container_fixture.h b/shared/test/common/fixtures/command_container_fixture.h index 65680d24de..4ee95de044 100644 --- a/shared/test/common/fixtures/command_container_fixture.h +++ b/shared/test/common/fixtures/command_container_fixture.h @@ -61,7 +61,7 @@ class CommandEncodeStatesFixture : public DeviceFixture { } // namespace NEO struct WalkerThreadFixture { - void SetUp() { + void SetUp() { // NOLINT(readability-identifier-naming) startWorkGroup[0] = startWorkGroup[1] = startWorkGroup[2] = 0u; numWorkGroups[0] = numWorkGroups[1] = numWorkGroups[2] = 1u; workGroupSizes[0] = 32u; @@ -70,7 +70,7 @@ struct WalkerThreadFixture { localIdDimensions = 3u; requiredWorkGroupOrder = 0u; } - void TearDown() {} + void TearDown() {} // NOLINT(readability-identifier-naming) uint32_t startWorkGroup[3]; uint32_t numWorkGroups[3]; diff --git a/shared/test/common/fixtures/device_fixture.h b/shared/test/common/fixtures/device_fixture.h index f9ad0323a2..ba96ddd455 100644 --- a/shared/test/common/fixtures/device_fixture.h +++ b/shared/test/common/fixtures/device_fixture.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -12,9 +12,9 @@ namespace NEO { struct HardwareInfo; struct DeviceFixture { - void SetUp(); - void SetUpImpl(const NEO::HardwareInfo *hardwareInfo); - void TearDown(); + void SetUp(); // NOLINT(readability-identifier-naming) + void SetUpImpl(const NEO::HardwareInfo *hardwareInfo); // NOLINT(readability-identifier-naming) + void TearDown(); // NOLINT(readability-identifier-naming) MockDevice *createWithUsDeviceId(unsigned short usDeviceId); diff --git a/shared/test/common/fixtures/linear_stream_fixture.h b/shared/test/common/fixtures/linear_stream_fixture.h index 7a9e311454..bf9c6790e1 100644 --- a/shared/test/common/fixtures/linear_stream_fixture.h +++ b/shared/test/common/fixtures/linear_stream_fixture.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -19,10 +19,10 @@ struct LinearStreamFixture { : gfxAllocation(static_cast(pCmdBuffer), sizeof(pCmdBuffer)), linearStream(&gfxAllocation) { } - virtual void SetUp(void) { + virtual void SetUp(void) { // NOLINT(readability-identifier-naming) } - virtual void TearDown(void) { + virtual void TearDown(void) { // NOLINT(readability-identifier-naming) } MockGraphicsAllocation gfxAllocation; LinearStream linearStream; diff --git a/shared/test/common/fixtures/memory_allocator_multi_device_fixture.h b/shared/test/common/fixtures/memory_allocator_multi_device_fixture.h index 60dc0dbc28..606edcfe98 100644 --- a/shared/test/common/fixtures/memory_allocator_multi_device_fixture.h +++ b/shared/test/common/fixtures/memory_allocator_multi_device_fixture.h @@ -20,8 +20,8 @@ using namespace NEO; class MemoryAllocatorMultiDeviceSystemSpecificFixture { public: - void SetUp(ExecutionEnvironment &executionEnvironment); - void TearDown(ExecutionEnvironment &executionEnvironment); + void SetUp(ExecutionEnvironment &executionEnvironment); // NOLINT(readability-identifier-naming) + void TearDown(ExecutionEnvironment &executionEnvironment); // NOLINT(readability-identifier-naming) std::unique_ptr gmm; }; diff --git a/shared/test/common/fixtures/memory_management_fixture.h b/shared/test/common/fixtures/memory_management_fixture.h index c78942e0ba..1cf0b6e751 100644 --- a/shared/test/common/fixtures/memory_management_fixture.h +++ b/shared/test/common/fixtures/memory_management_fixture.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -19,8 +19,8 @@ struct MemoryManagementFixture { virtual ~MemoryManagementFixture() { MemoryManagement::detailedAllocationLoggingActive = false; }; // Typical Fixture methods - virtual void SetUp(void); - virtual void TearDown(void); + virtual void SetUp(void); // NOLINT(readability-identifier-naming) + virtual void TearDown(void); // NOLINT(readability-identifier-naming) // Helper methods void setFailingAllocation(size_t allocation); diff --git a/shared/test/common/fixtures/memory_manager_fixture.h b/shared/test/common/fixtures/memory_manager_fixture.h index 55cc2afa85..95c449a0fd 100644 --- a/shared/test/common/fixtures/memory_manager_fixture.h +++ b/shared/test/common/fixtures/memory_manager_fixture.h @@ -26,6 +26,6 @@ class MemoryManagerWithCsrFixture { ~MemoryManagerWithCsrFixture() = default; - void SetUp(); - void TearDown(); + void SetUp(); // NOLINT(readability-identifier-naming) + void TearDown(); // NOLINT(readability-identifier-naming) }; diff --git a/shared/test/common/fixtures/mock_execution_environment_gmm_fixture.h b/shared/test/common/fixtures/mock_execution_environment_gmm_fixture.h index f711e74210..00963edfd7 100644 --- a/shared/test/common/fixtures/mock_execution_environment_gmm_fixture.h +++ b/shared/test/common/fixtures/mock_execution_environment_gmm_fixture.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -17,8 +17,8 @@ class GmmClientContext; class MockExecutionEnvironmentGmmFixture { protected: - void SetUp(); - void TearDown(); + void SetUp(); // NOLINT(readability-identifier-naming) + void TearDown(); // NOLINT(readability-identifier-naming) std::unique_ptr executionEnvironment; @@ -26,4 +26,4 @@ class MockExecutionEnvironmentGmmFixture { GmmHelper *getGmmHelper(); GmmClientContext *getGmmClientContext(); }; -} // namespace NEO \ No newline at end of file +} // namespace NEO diff --git a/shared/test/common/fixtures/tbx_command_stream_fixture.h b/shared/test/common/fixtures/tbx_command_stream_fixture.h index 15f2377b5f..039778fa82 100644 --- a/shared/test/common/fixtures/tbx_command_stream_fixture.h +++ b/shared/test/common/fixtures/tbx_command_stream_fixture.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -15,8 +15,8 @@ class MemoryManager; class TbxCommandStreamFixture { public: - void SetUp(MockDevice *pDevice); - void TearDown(); + void SetUp(MockDevice *pDevice); // NOLINT(readability-identifier-naming) + void TearDown(); // NOLINT(readability-identifier-naming) CommandStreamReceiver *pCommandStreamReceiver = nullptr; diff --git a/shared/test/common/helpers/blit_commands_helper_tests.inl b/shared/test/common/helpers/blit_commands_helper_tests.inl index 00cfdb85e3..2dd314e42d 100644 --- a/shared/test/common/helpers/blit_commands_helper_tests.inl +++ b/shared/test/common/helpers/blit_commands_helper_tests.inl @@ -29,7 +29,7 @@ class GivenLinearStreamWhenCallDispatchBlitMemoryColorFillThenCorrectDepthIsProg using XY_COLOR_BLT = typename FamilyType::XY_COLOR_BLT; using COLOR_DEPTH = typename XY_COLOR_BLT::COLOR_DEPTH; GivenLinearStreamWhenCallDispatchBlitMemoryColorFillThenCorrectDepthIsProgrammed(Device *device) : device(device) {} - void TestBodyImpl(size_t patternSize, COLOR_DEPTH expectedDepth) { + void TestBodyImpl(size_t patternSize, COLOR_DEPTH expectedDepth) { // NOLINT(readability-identifier-naming) uint32_t streamBuffer[100] = {}; LinearStream stream(streamBuffer, sizeof(streamBuffer)); MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, diff --git a/shared/test/common/helpers/kernel_binary_helper.h b/shared/test/common/helpers/kernel_binary_helper.h index b77caca25a..d41187d4a4 100644 --- a/shared/test/common/helpers/kernel_binary_helper.h +++ b/shared/test/common/helpers/kernel_binary_helper.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -13,6 +13,6 @@ class KernelBinaryHelper { KernelBinaryHelper(const std::string &name = "copybuffer", bool appendOptionsToFileName = true); ~KernelBinaryHelper(); - static const std::string BUILT_INS; - static const std::string BUILT_INS_WITH_IMAGES; + static const std::string BUILT_INS; // NOLINT(readability-identifier-naming) + static const std::string BUILT_INS_WITH_IMAGES; // NOLINT(readability-identifier-naming) }; diff --git a/shared/test/common/helpers/simd_helper_tests.inl b/shared/test/common/helpers/simd_helper_tests.inl index fcb32c1bdb..763c39b424 100644 --- a/shared/test/common/helpers/simd_helper_tests.inl +++ b/shared/test/common/helpers/simd_helper_tests.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Intel Corporation + * Copyright (C) 2019-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -13,7 +13,7 @@ namespace NEO { template class GivenSimdSizeWhenGetSimdConfigCalledThenCorrectEnumReturned { public: - static void TestBodyImpl() { + static void TestBodyImpl() { // NOLINT(readability-identifier-naming) uint32_t simd = 32; auto result = getSimdConfig(simd); EXPECT_EQ(result, WALKER_TYPE::SIMD_SIZE::SIMD_SIZE_SIMD32); diff --git a/shared/test/common/helpers/simd_helper_tests_pvc_and_later.inl b/shared/test/common/helpers/simd_helper_tests_pvc_and_later.inl index 860712e4e0..9ade3654b3 100644 --- a/shared/test/common/helpers/simd_helper_tests_pvc_and_later.inl +++ b/shared/test/common/helpers/simd_helper_tests_pvc_and_later.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -13,7 +13,7 @@ namespace NEO { template class GivenSimdSizeWhenGetSimdConfigCalledThenCorrectEnumReturnedPVCAndLater { public: - static void TestBodyImpl() { + static void TestBodyImpl() { // NOLINT(readability-identifier-naming) uint32_t simd = 32; auto result = getSimdConfig(simd); EXPECT_EQ(result, WALKER_TYPE::SIMD_SIZE::SIMD_SIZE_SIMT32); diff --git a/shared/test/common/libult/linux/drm_mock.h b/shared/test/common/libult/linux/drm_mock.h index 059ebefd96..b3ec3725d2 100644 --- a/shared/test/common/libult/linux/drm_mock.h +++ b/shared/test/common/libult/linux/drm_mock.h @@ -67,7 +67,7 @@ class DrmMock : public Drm { } DrmMock(RootDeviceEnvironment &rootDeviceEnvironment) : DrmMock(mockFd, rootDeviceEnvironment) {} - ~DrmMock() { + ~DrmMock() override { if (expectIoctlCallsOnDestruction) { EXPECT_EQ(expectedIoctlCallsOnDestruction, ioctlCallsCount); } diff --git a/shared/test/common/libult/ult_command_stream_receiver.h b/shared/test/common/libult/ult_command_stream_receiver.h index bb8dc0498d..72f406e4d5 100644 --- a/shared/test/common/libult/ult_command_stream_receiver.h +++ b/shared/test/common/libult/ult_command_stream_receiver.h @@ -133,7 +133,7 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw, publ this->downloadAllocationUlt(graphicsAllocation); }; } - ~UltCommandStreamReceiver() { + ~UltCommandStreamReceiver() override { this->downloadAllocationImpl = nullptr; } static CommandStreamReceiver *create(bool withAubDump, diff --git a/shared/test/common/mocks/mock_cif.h b/shared/test/common/mocks/mock_cif.h index 06a5125106..e93dd3a1ea 100644 --- a/shared/test/common/mocks/mock_cif.h +++ b/shared/test/common/mocks/mock_cif.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -22,7 +22,7 @@ using CreatorFuncT = CIF::ICIF *(*)(CIF::InterfaceId_t intId, CIF::Version_t ver template struct MockCIF : BaseType { - void Release() override { // NOLINT(readability-identifier-naming) + void Release() override { auto prev = refCount--; assert(prev >= 1); if (prev == 1) { @@ -30,19 +30,19 @@ struct MockCIF : BaseType { } } - void Retain() override { // NOLINT(readability-identifier-naming) + void Retain() override { ++refCount; } - uint32_t GetRefCount() const override { // NOLINT(readability-identifier-naming) + uint32_t GetRefCount() const override { return refCount; } - CIF::Version_t GetEnabledVersion() const override { // NOLINT(readability-identifier-naming) + CIF::Version_t GetEnabledVersion() const override { return 1; } - bool GetSupportedVersions(CIF::InterfaceId_t intId, CIF::Version_t &verMin, // NOLINT(readability-identifier-naming) + bool GetSupportedVersions(CIF::InterfaceId_t intId, CIF::Version_t &verMin, CIF::Version_t &verMax) const override { verMin = 1; verMax = CIF::MaxVersion; @@ -91,13 +91,13 @@ struct MockCIFMain : MockCIF { MockCIFMain(); - CIF::Version_t GetBinaryVersion() const override { // NOLINT(readability-identifier-naming) + CIF::Version_t GetBinaryVersion() const override { return 1; } - CIF::ICIF *CreateInterfaceImpl(CIF::InterfaceId_t intId, CIF::Version_t version) override; // NOLINT(readability-identifier-naming) + CIF::ICIF *CreateInterfaceImpl(CIF::InterfaceId_t intId, CIF::Version_t version) override; - CIF::InterfaceId_t FindIncompatibleImpl(CIF::InterfaceId_t entryPointInterface, CIF::CompatibilityDataHandle handle) const override { // NOLINT(readability-identifier-naming) + CIF::InterfaceId_t FindIncompatibleImpl(CIF::InterfaceId_t entryPointInterface, CIF::CompatibilityDataHandle handle) const override { if (globalCreators.find(entryPointInterface) != globalCreators.end()) { return CIF::InvalidInterface; } @@ -107,7 +107,7 @@ struct MockCIFMain : MockCIF { return entryPointInterface; } - bool FindSupportedVersionsImpl(CIF::InterfaceId_t entryPointInterface, CIF::InterfaceId_t interfaceToFind, CIF::Version_t &verMin, CIF::Version_t &verMax) const override { // NOLINT(readability-identifier-naming) + bool FindSupportedVersionsImpl(CIF::InterfaceId_t entryPointInterface, CIF::InterfaceId_t interfaceToFind, CIF::Version_t &verMin, CIF::Version_t &verMax) const override { if (globalCreators.find(entryPointInterface) != globalCreators.end()) { verMin = verMax = 1; return true; @@ -128,12 +128,12 @@ struct MockCIFBuffer : MockCIF { static CIF::ICIF *Create(CIF::InterfaceId_t intId, CIF::Version_t version); // NOLINT(readability-identifier-naming) static bool failAllocations; - void SetAllocator(CIF::Builtins::AllocatorT allocator, CIF::Builtins::DeallocatorT deallocator, // NOLINT(readability-identifier-naming) + void SetAllocator(CIF::Builtins::AllocatorT allocator, CIF::Builtins::DeallocatorT deallocator, CIF::Builtins::ReallocatorT reallocator) override { // unsupported in mock } - void SetUnderlyingStorage(void *memory, size_t size, CIF::Builtins::DeallocatorT deallocator) override { // NOLINT(readability-identifier-naming) + void SetUnderlyingStorage(void *memory, size_t size, CIF::Builtins::DeallocatorT deallocator) override { if ((memory == nullptr) || (size == 0)) { data.clear(); return; @@ -141,7 +141,7 @@ struct MockCIFBuffer : MockCIF { data.assign((char *)memory, ((char *)memory) + size); } - void SetUnderlyingStorage(const void *memory, size_t size) override { // NOLINT(readability-identifier-naming) + void SetUnderlyingStorage(const void *memory, size_t size) override { if ((memory == nullptr) || (size == 0)) { data.clear(); return; @@ -149,12 +149,12 @@ struct MockCIFBuffer : MockCIF { data.assign((char *)memory, ((char *)memory) + size); } - void *DetachAllocation() override { // NOLINT(readability-identifier-naming) + void *DetachAllocation() override { // unsupported in mock return nullptr; } - const void *GetMemoryRaw() const override { // NOLINT(readability-identifier-naming) + const void *GetMemoryRaw() const override { if (data.size() > 0) { return data.data(); } else { @@ -162,7 +162,7 @@ struct MockCIFBuffer : MockCIF { } } - void *GetMemoryRawWriteable() override { // NOLINT(readability-identifier-naming) + void *GetMemoryRawWriteable() override { if (data.size() > 0) { return data.data(); } else { @@ -170,34 +170,34 @@ struct MockCIFBuffer : MockCIF { } } - size_t GetSizeRaw() const override { // NOLINT(readability-identifier-naming) + size_t GetSizeRaw() const override { return data.size(); } - size_t GetCapacityRaw() const override { // NOLINT(readability-identifier-naming) + size_t GetCapacityRaw() const override { return data.capacity(); } - bool Resize(size_t newSize) override { // NOLINT(readability-identifier-naming) + bool Resize(size_t newSize) override { data.resize(newSize); return true; } - bool Reserve(size_t newCapacity) override { // NOLINT(readability-identifier-naming) + bool Reserve(size_t newCapacity) override { data.reserve(newCapacity); return true; } - void Clear() override { // NOLINT(readability-identifier-naming) + void Clear() override { data.clear(); } - void Deallocate() override { // NOLINT(readability-identifier-naming) + void Deallocate() override { std::vector rhs; rhs.swap(data); } - bool AlignUp(uint32_t alignment) override { // NOLINT(readability-identifier-naming) + bool AlignUp(uint32_t alignment) override { auto rest = data.size() & alignment; if (rest != 0) { data.resize(data.size() + alignment - rest); @@ -205,7 +205,7 @@ struct MockCIFBuffer : MockCIF { return true; } - bool PushBackRawBytes(const void *newData, size_t size) override { // NOLINT(readability-identifier-naming) + bool PushBackRawBytes(const void *newData, size_t size) override { if ((newData == nullptr) || (size == 0)) { return true; } @@ -213,7 +213,7 @@ struct MockCIFBuffer : MockCIF { return true; } - bool IsConst() const override { // NOLINT(readability-identifier-naming) + bool IsConst() const override { return false; } diff --git a/shared/test/common/mocks/mock_compilers.cpp b/shared/test/common/mocks/mock_compilers.cpp index d6a8ded941..6cf1a0cca6 100644 --- a/shared/test/common/mocks/mock_compilers.cpp +++ b/shared/test/common/mocks/mock_compilers.cpp @@ -413,7 +413,7 @@ void translate(bool usingIgc, CIF::Builtins::BufferSimple *src, CIF::Builtins::B (out && src && src->GetMemoryRaw() && src->GetSizeRaw())) { if (debugVars.internalOptionsExpected) { - if (internalOptions->GetSizeRaw() < 1 || internalOptions->GetMemoryRaw() == nullptr) { + if (internalOptions->GetSizeRaw() < 1 || internalOptions->GetMemoryRaw() == nullptr) { // NOLINT(clang-analyzer-core.CallAndMessage) if (out) { out->setError(); } diff --git a/shared/test/common/mocks/mock_compilers.h b/shared/test/common/mocks/mock_compilers.h index b4a3e7e229..5c99eebfa8 100644 --- a/shared/test/common/mocks/mock_compilers.h +++ b/shared/test/common/mocks/mock_compilers.h @@ -53,8 +53,8 @@ struct MockCompilerEnableGuard { MockCompilerEnableGuard(bool autoEnable = false); ~MockCompilerEnableGuard(); - void Enable(); - void Disable(); + void Enable(); // NOLINT(readability-identifier-naming) + void Disable(); // NOLINT(readability-identifier-naming) const char *oldFclDllName; const char *oldIgcDllName; @@ -194,7 +194,7 @@ struct MockOclTranslationOutput : MockCIF { }; struct MockIgcOclDeviceCtx : MockCIF { - static CIF::ICIF *Create(CIF::InterfaceId_t intId, CIF::Version_t version); + static CIF::ICIF *Create(CIF::InterfaceId_t intId, CIF::Version_t version); // NOLINT(readability-identifier-naming) MockIgcOclDeviceCtx(); ~MockIgcOclDeviceCtx() override; @@ -229,7 +229,7 @@ struct MockIgcOclDeviceCtx : MockCIF { CIF::Builtins::BufferSimple *outSystemRoutineBuffer, CIF::Builtins::BufferSimple *stateSaveAreaHeaderInit) override; - void SetDebugVars(MockCompilerDebugVars &debugVars) { + void SetDebugVars(MockCompilerDebugVars &debugVars) { // NOLINT(readability-identifier-naming) this->debugVars = debugVars; } @@ -259,7 +259,7 @@ struct MockFclOclDeviceCtx : MockCIF { MockFclOclDeviceCtx(); ~MockFclOclDeviceCtx() override; - static CIF::ICIF *Create(CIF::InterfaceId_t intId, CIF::Version_t version); + static CIF::ICIF *Create(CIF::InterfaceId_t intId, CIF::Version_t version); // NOLINT(readability-identifier-naming) void SetOclApiVersion(uint32_t version) override { oclApiVersion = version; } diff --git a/shared/test/common/mocks/mock_debugger.h b/shared/test/common/mocks/mock_debugger.h index 77a8b42766..33943b3a30 100644 --- a/shared/test/common/mocks/mock_debugger.h +++ b/shared/test/common/mocks/mock_debugger.h @@ -14,7 +14,7 @@ class CommandContainer; class MockDebugger : public Debugger { public: MockDebugger() = default; - ~MockDebugger() = default; + ~MockDebugger() override = default; void captureStateBaseAddress(NEO::LinearStream &cmdStream, SbaAddresses sba) override{}; size_t getSbaTrackingCommandsSize(size_t trackedAddressCount) override { return 0; diff --git a/shared/test/common/mocks/mock_gfx_partition.h b/shared/test/common/mocks/mock_gfx_partition.h index b2128eb141..1a01aa2d86 100644 --- a/shared/test/common/mocks/mock_gfx_partition.h +++ b/shared/test/common/mocks/mock_gfx_partition.h @@ -75,7 +75,7 @@ class MockGfxPartitionBasic : public GfxPartition { class FailedInitGfxPartition : public MockGfxPartition { public: - virtual bool init(uint64_t gpuAddressSpace, size_t cpuAddressRangeSizeToReserve, uint32_t rootDeviceIndex, size_t numRootDevices, bool useFrontWindowPool) override { + bool init(uint64_t gpuAddressSpace, size_t cpuAddressRangeSizeToReserve, uint32_t rootDeviceIndex, size_t numRootDevices, bool useFrontWindowPool) override { return false; } }; diff --git a/shared/test/common/mocks/mock_ostime.h b/shared/test/common/mocks/mock_ostime.h index 2a6197b4d3..28b7ffadd0 100644 --- a/shared/test/common/mocks/mock_ostime.h +++ b/shared/test/common/mocks/mock_ostime.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -50,8 +50,8 @@ class MockOSTime : public OSTime { class MockDeviceTimeWithConstTimestamp : public DeviceTime { public: - static constexpr uint64_t CPU_TIME_IN_NS = 1u; - static constexpr uint64_t GPU_TIMESTAMP = 2u; + static constexpr uint64_t CPU_TIME_IN_NS = 1u; // NOLINT(readability-identifier-naming) + static constexpr uint64_t GPU_TIMESTAMP = 2u; // NOLINT(readability-identifier-naming) bool getCpuGpuTime(TimeStampData *pGpuCpuTime, OSTime *osTime) override { pGpuCpuTime->GPUTimeStamp = GPU_TIMESTAMP; diff --git a/shared/test/common/mocks/mock_tbx_csr.h b/shared/test/common/mocks/mock_tbx_csr.h index 0726b4cbab..d0129bba8f 100644 --- a/shared/test/common/mocks/mock_tbx_csr.h +++ b/shared/test/common/mocks/mock_tbx_csr.h @@ -30,7 +30,7 @@ class MockTbxCsr : public TbxCommandStreamReceiverHw { this->downloadAllocationTbxMock(gfxAllocation); }; } - ~MockTbxCsr() { + ~MockTbxCsr() override { this->downloadAllocationImpl = nullptr; } @@ -89,7 +89,7 @@ struct MockTbxCsrRegisterDownloadedAllocations : TbxCommandStreamReceiverHwdownloadAllocationTbxMock(gfxAllocation); }; } - ~MockTbxCsrRegisterDownloadedAllocations() { + ~MockTbxCsrRegisterDownloadedAllocations() override { this->downloadAllocationImpl = nullptr; } void downloadAllocationTbxMock(GraphicsAllocation &gfxAllocation) { diff --git a/shared/test/common/os_interface/linux/device_command_stream_fixture.cpp b/shared/test/common/os_interface/linux/device_command_stream_fixture.cpp index 6013a9e038..6bd07d31f6 100644 --- a/shared/test/common/os_interface/linux/device_command_stream_fixture.cpp +++ b/shared/test/common/os_interface/linux/device_command_stream_fixture.cpp @@ -209,7 +209,7 @@ DrmMockCustom::DrmMockCustom(RootDeviceEnvironment &rootDeviceEnvironment) ioctl_expected.contextDestroy = ioctl_expected.contextCreate.load(); setupIoctlHelper(rootDeviceEnvironment.getHardwareInfo()->platform.eProductFamily); createVirtualMemoryAddressSpace(NEO::HwHelper::getSubDevicesCount(rootDeviceEnvironment.getHardwareInfo())); - isVmBindAvailable(); + isVmBindAvailable(); // NOLINT(clang-analyzer-optin.cplusplus.VirtualCall) reset(); } diff --git a/shared/test/common/os_interface/linux/drm_buffer_object_fixture.h b/shared/test/common/os_interface/linux/drm_buffer_object_fixture.h index 45106ca8f9..ef5895bd40 100644 --- a/shared/test/common/os_interface/linux/drm_buffer_object_fixture.h +++ b/shared/test/common/os_interface/linux/drm_buffer_object_fixture.h @@ -73,7 +73,7 @@ class DrmBufferObjectFixture { drm_i915_gem_exec_object2 execObjectsStorage[256]; std::unique_ptr osContext; - void SetUp() { + void SetUp() { // NOLINT(readability-identifier-naming) this->mock = std::make_unique(*executionEnvironment.rootDeviceEnvironments[0]); ASSERT_NE(nullptr, this->mock); executionEnvironment.rootDeviceEnvironments[0]->memoryOperationsInterface = DrmMemoryOperationsHandler::create(*mock.get(), 0u); @@ -83,7 +83,7 @@ class DrmBufferObjectFixture { ASSERT_NE(nullptr, bo); } - void TearDown() { + void TearDown() { // NOLINT(readability-identifier-naming) delete bo; if (this->mock->ioctl_expected.total >= 0) { EXPECT_EQ(this->mock->ioctl_expected.total, this->mock->ioctl_cnt.total); diff --git a/shared/test/common/os_interface/linux/drm_command_stream_fixture.h b/shared/test/common/os_interface/linux/drm_command_stream_fixture.h index d2d37cc9d3..c8a7c76085 100644 --- a/shared/test/common/os_interface/linux/drm_command_stream_fixture.h +++ b/shared/test/common/os_interface/linux/drm_command_stream_fixture.h @@ -23,7 +23,7 @@ class DrmCommandStreamTest : public ::testing::Test { public: template - void SetUpT() { + void setUpT() { //make sure this is disabled, we don't want to test this now DebugManager.flags.EnableForcePin.set(false); @@ -63,7 +63,7 @@ class DrmCommandStreamTest : public ::testing::Test { } template - void TearDownT() { + void tearDownT() { memoryManager->waitForDeletions(); memoryManager->peekGemCloseWorker()->close(true); delete csr; @@ -100,7 +100,7 @@ class DrmCommandStreamEnhancedTemplate : public ::testing::Test { std::unique_ptr device; template - void SetUpT() { + void setUpT() { executionEnvironment = new MockExecutionEnvironment(); executionEnvironment->incRefInternal(); executionEnvironment->initGmm(); @@ -130,7 +130,7 @@ class DrmCommandStreamEnhancedTemplate : public ::testing::Test { } template - void TearDownT() { + void tearDownT() { executionEnvironment->decRefInternal(); device.reset(); } @@ -181,7 +181,7 @@ class DrmCommandStreamEnhancedWithFailingExecTemplate : public ::testing::Test { std::unique_ptr device; template - void SetUpT() { + void setUpT() { executionEnvironment = new MockExecutionEnvironment(); executionEnvironment->incRefInternal(); executionEnvironment->initGmm(); @@ -211,7 +211,7 @@ class DrmCommandStreamEnhancedWithFailingExecTemplate : public ::testing::Test { } template - void TearDownT() { + void tearDownT() { executionEnvironment->decRefInternal(); } diff --git a/shared/test/common/os_interface/linux/drm_memory_manager_tests.h b/shared/test/common/os_interface/linux/drm_memory_manager_tests.h index d98745d1a8..48e29d7fc9 100644 --- a/shared/test/common/os_interface/linux/drm_memory_manager_tests.h +++ b/shared/test/common/os_interface/linux/drm_memory_manager_tests.h @@ -58,7 +58,7 @@ class DrmMemoryManagerFixture : public MemoryManagementFixture { executionEnvironment = MockDevice::prepareExecutionEnvironment(defaultHwInfo.get(), numRootDevices - 1); SetUp(new DrmMockCustom(*executionEnvironment->rootDeviceEnvironments[0]), false); - } + } // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) void SetUp(DrmMockCustom *mock, bool localMemoryEnabled) { ASSERT_NE(nullptr, executionEnvironment); @@ -177,11 +177,11 @@ class DrmMemoryManagerFixtureWithoutQuietIoctlExpectation { std::unique_ptr memoryManager; DrmMockCustom *mock; - void SetUp() { + void SetUp() { // NOLINT(readability-identifier-naming) SetUp(false); } - void SetUp(bool enableLocalMem) { + void SetUp(bool enableLocalMem) { // NOLINT(readability-identifier-naming) DebugManager.flags.DeferOsContextInitialization.set(0); executionEnvironment = new ExecutionEnvironment; @@ -212,7 +212,7 @@ class DrmMemoryManagerFixtureWithoutQuietIoctlExpectation { device.reset(MockDevice::createWithExecutionEnvironment(defaultHwInfo.get(), executionEnvironment, rootDeviceIndex)); } - void TearDown() { + void TearDown() { // NOLINT(readability-identifier-naming) } protected: diff --git a/shared/test/common/test_macros/test.h b/shared/test/common/test_macros/test.h index 38c2637980..0a279b3de2 100644 --- a/shared/test/common/test_macros/test.h +++ b/shared/test/common/test_macros/test.h @@ -281,7 +281,7 @@ extern GFXCORE_FAMILY renderCoreFamily; #define HWTEST_TEMPLATED_F(test_fixture, test_name) \ HWTEST_TEST_(test_fixture, test_name, test_fixture, \ - ::testing::internal::GetTypeId(), SetUpT, TearDownT) + ::testing::internal::GetTypeId(), setUpT, tearDownT) // Macros to provide template based testing. // Test can use FamilyType in the test -- equivalent to SKLFamily diff --git a/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp b/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp index d0dc9cf352..50f15ea235 100644 --- a/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp +++ b/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp @@ -618,7 +618,7 @@ HWTEST_F(CommandStreamReceiverTest, givenUpdateTaskCountFromWaitWhenCheckIfEnabl } struct InitDirectSubmissionFixture { - void SetUp() { + void SetUp() { // NOLINT(readability-identifier-naming) DebugManager.flags.EnableDirectSubmission.set(1); executionEnvironment = new MockExecutionEnvironment(); DeviceFactory::prepareDeviceEnvironments(*executionEnvironment); @@ -628,7 +628,7 @@ struct InitDirectSubmissionFixture { device.reset(new MockDevice(executionEnvironment, 0u)); } - void TearDown() {} + void TearDown() {} // NOLINT(readability-identifier-naming) DebugManagerStateRestore restore; MockExecutionEnvironment *executionEnvironment; diff --git a/shared/test/unit_test/command_stream/compute_mode_tests.h b/shared/test/unit_test/command_stream/compute_mode_tests.h index 66aae9e10e..412da7e5b0 100644 --- a/shared/test/unit_test/command_stream/compute_mode_tests.h +++ b/shared/test/unit_test/command_stream/compute_mode_tests.h @@ -72,12 +72,12 @@ struct ComputeModeRequirements : public ::testing::Test { } template - void SetUpImpl() { + void SetUpImpl() { // NOLINT(readability-identifier-naming) SetUpImpl(defaultHwInfo.get()); } template - void SetUpImpl(const NEO::HardwareInfo *hardwareInfo) { + void SetUpImpl(const NEO::HardwareInfo *hardwareInfo) { // NOLINT(readability-identifier-naming) device.reset(MockDevice::createWithNewExecutionEnvironment(hardwareInfo)); device->executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(hardwareInfo); csr = new myCsr(*device->executionEnvironment, device->getDeviceBitfield()); diff --git a/shared/test/unit_test/compiler_interface/compiler_interface_tests.cpp b/shared/test/unit_test/compiler_interface/compiler_interface_tests.cpp index 60687b1f59..b7ca2469ef 100644 --- a/shared/test/unit_test/compiler_interface/compiler_interface_tests.cpp +++ b/shared/test/unit_test/compiler_interface/compiler_interface_tests.cpp @@ -435,11 +435,11 @@ struct TranslationCtxMock { CIF::Builtins::BufferSimple *receivedIntOpt = nullptr; CIF::Builtins::BufferSimple *receivedTracingOpt = nullptr; - CIF::RAII::UPtr_t Translate(CIF::Builtins::BufferSimple *src, + CIF::RAII::UPtr_t Translate(CIF::Builtins::BufferSimple *src, // NOLINT(readability-identifier-naming) CIF::Builtins::BufferSimple *options, CIF::Builtins::BufferSimple *internalOptions, CIF::Builtins::BufferSimple *tracingOptions, - uint32_t tracingOptionsCount) { // NOLINT(readability-identifier-naming) + uint32_t tracingOptionsCount) { this->receivedSrc = src; this->receivedOpt = options; this->receivedIntOpt = internalOptions; @@ -467,22 +467,22 @@ struct TranslationCtxMock { return CIF::RAII::UPtr_t(ret); } - CIF::RAII::UPtr_t Translate(CIF::Builtins::BufferSimple *src, + CIF::RAII::UPtr_t Translate(CIF::Builtins::BufferSimple *src, // NOLINT(readability-identifier-naming) CIF::Builtins::BufferSimple *options, CIF::Builtins::BufferSimple *internalOptions, CIF::Builtins::BufferSimple *tracingOptions, uint32_t tracingOptionsCount, - void *gtpinInit) { // NOLINT(readability-identifier-naming) + void *gtpinInit) { return this->Translate(src, options, internalOptions, tracingOptions, tracingOptionsCount); } - CIF::RAII::UPtr_t Translate(CIF::Builtins::BufferSimple *src, + CIF::RAII::UPtr_t Translate(CIF::Builtins::BufferSimple *src, // NOLINT(readability-identifier-naming) CIF::Builtins::BufferSimple *specConstantsIds, CIF::Builtins::BufferSimple *specConstantsValues, CIF::Builtins::BufferSimple *options, CIF::Builtins::BufferSimple *internalOptions, CIF::Builtins::BufferSimple *tracingOptions, uint32_t tracingOptionsCount, - void *gtPinInput) { // NOLINT(readability-identifier-naming) + void *gtPinInput) { return this->Translate(src, options, internalOptions, tracingOptions, tracingOptionsCount); } }; @@ -676,7 +676,7 @@ TEST(LoadCompilerTest, GivenZebinIgnoreIcbeVersionDebugFlagThenIgnoreIgcsIcbeVer template struct MockCompilerDeviceCtx : DeviceCtxBase { TranslationCtx *CreateTranslationCtxImpl(CIF::Version_t ver, IGC::CodeType::CodeType_t inType, - IGC::CodeType::CodeType_t outType) override { // NOLINT(readability-identifier-naming) + IGC::CodeType::CodeType_t outType) override { returned = new TranslationCtx; return returned; } diff --git a/shared/test/unit_test/device/neo_device_tests.cpp b/shared/test/unit_test/device/neo_device_tests.cpp index a406331f81..85ead79a08 100644 --- a/shared/test/unit_test/device/neo_device_tests.cpp +++ b/shared/test/unit_test/device/neo_device_tests.cpp @@ -201,7 +201,7 @@ TEST_F(DeviceGetCapsTest, givenDeviceWithMidThreadPreemptionWhenDeviceIsCreatedT DebugManagerStateRestore dbgRestorer; { auto builtIns = new MockBuiltins(); - ASSERT_FALSE(MockSipData::called); + ASSERT_FALSE(MockSipData::called); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) DebugManager.flags.ForcePreemptionMode.set((int32_t)PreemptionMode::MidThread); diff --git a/shared/test/unit_test/device_binary_format/zebin_tests.h b/shared/test/unit_test/device_binary_format/zebin_tests.h index ef505d97a6..c35da49547 100644 --- a/shared/test/unit_test/device_binary_format/zebin_tests.h +++ b/shared/test/unit_test/device_binary_format/zebin_tests.h @@ -38,7 +38,7 @@ struct ValidEmptyProgram { enc.appendSection(NEO::Elf::SHT_ZEBIN_ZEINFO, NEO::Elf::SectionsNamesZebin::zeInfo, zeInfo); enc.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Elf::SectionsNamesZebin::textPrefix.str() + "valid_empty_kernel", zeInfo); storage = enc.encode(); - recalcPtr(); + recalcPtr(); // NOLINT(clang-analyzer-optin.cplusplus.VirtualCall) } virtual void recalcPtr() { diff --git a/shared/test/unit_test/fixtures/templated_fixture_tests.cpp b/shared/test/unit_test/fixtures/templated_fixture_tests.cpp index adc0e10f19..5d79e36cca 100644 --- a/shared/test/unit_test/fixtures/templated_fixture_tests.cpp +++ b/shared/test/unit_test/fixtures/templated_fixture_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Intel Corporation + * Copyright (C) 2019-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -21,12 +21,12 @@ struct TemplatedFixtureTests : public ::testing::Test { } template - void SetUpT() { + void setUpT() { templateBaseSetUpCallId = callsOrder++; } template - void TearDownT() { + void tearDownT() { templateBaseTearDownCallId = callsOrder++; } @@ -49,15 +49,15 @@ HWTEST_TEMPLATED_F(TemplatedFixtureTests, whenExecutingTemplatedTestThenCallTemp struct DerivedTemplatedFixtureTests : public TemplatedFixtureTests { template - void SetUpT() { - TemplatedFixtureTests::SetUpT(); + void setUpT() { + TemplatedFixtureTests::setUpT(); templateDerivedSetUpCallId = callsOrder++; } template - void TearDownT() { + void tearDownT() { templateDerivedTearDownCallId = callsOrder++; - TemplatedFixtureTests::TearDownT(); + TemplatedFixtureTests::tearDownT(); } uint32_t templateDerivedSetUpCallId = -1; @@ -76,12 +76,12 @@ HWTEST_TEMPLATED_F(DerivedTemplatedFixtureTests, whenExecutingTemplatedTestThenC struct TemplatedFixtureBaseTests : public ::testing::Test { template - void SetUpT() { + void setUpT() { capturedPipeControlWaRequiredInSetUp = MemorySynchronizationCommands::isPipeControlWArequired(*defaultHwInfo); } template - void TearDownT() {} + void tearDownT() {} bool capturedPipeControlWaRequiredInSetUp = false; }; diff --git a/shared/test/unit_test/helpers/flush_stamp_tests.cpp b/shared/test/unit_test/helpers/flush_stamp_tests.cpp index 57124817a7..11f070ade4 100644 --- a/shared/test/unit_test/helpers/flush_stamp_tests.cpp +++ b/shared/test/unit_test/helpers/flush_stamp_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -14,7 +14,7 @@ using namespace NEO; TEST(FlushStampTest, WhenAddingRemovingReferencesThenRefCountIsUpdated) { FlushStampTracker *flushStampTracker = new FlushStampTracker(true); auto flushStampSharedHandle = flushStampTracker->getStampReference(); - ASSERT_NE(nullptr, flushStampSharedHandle); + ASSERT_NE(nullptr, flushStampSharedHandle); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) EXPECT_EQ(1, flushStampSharedHandle->getRefInternalCount()); EXPECT_EQ(0, flushStampSharedHandle->getRefApiCount()); diff --git a/shared/test/unit_test/helpers/get_info_tests.cpp b/shared/test/unit_test/helpers/get_info_tests.cpp index 8ccbc11df3..fd0200fd41 100644 --- a/shared/test/unit_test/helpers/get_info_tests.cpp +++ b/shared/test/unit_test/helpers/get_info_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -104,7 +104,7 @@ TEST(getInfoHelper, GivenPointerWhenSettingValueThenValueIsSetCorrectly) { getValue = new uint32_t(0); GetInfoHelper::set(getValue, expectedValue); - ASSERT_NE(nullptr, getValue); + ASSERT_NE(nullptr, getValue); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) EXPECT_EQ(*getValue, expectedValue); delete getValue; diff --git a/shared/test/unit_test/helpers/memory_management_tests.cpp b/shared/test/unit_test/helpers/memory_management_tests.cpp index 2d8dfb0b9f..2472280efa 100644 --- a/shared/test/unit_test/helpers/memory_management_tests.cpp +++ b/shared/test/unit_test/helpers/memory_management_tests.cpp @@ -40,7 +40,7 @@ TEST(allocation, GivenFailingAllocationOneWhenCreatingAllocationsThenOnlyOneAllo failingAllocation = -1; EXPECT_NE(nullptr, ptr1); - EXPECT_EQ(nullptr, ptr2); + EXPECT_EQ(nullptr, ptr2); // NOLINT(clang-analyzer-cplusplus.NewDelete) EXPECT_EQ(previousAllocations, currentAllocations); MemoryManagement::detailedAllocationLoggingActive = false; } @@ -65,7 +65,7 @@ TEST_F(MemoryManagementTest, GivenFailingAllocationOneWhenCreatingAllocationsThe clearFailingAllocation(); EXPECT_NE(nullptr, ptr1); - EXPECT_EQ(nullptr, ptr2); + EXPECT_EQ(nullptr, ptr2); // NOLINT(clang-analyzer-cplusplus.NewDelete) } TEST_F(MemoryManagementTest, GivenNoFailingAllocationWhenCreatingAllocationThenMemoryIsNotLeaked) { @@ -80,7 +80,7 @@ TEST_F(MemoryManagementTest, GivenOneFailingAllocationWhenCreatingAllocationThen auto indexAllocationTop = indexAllocation.load(); auto indexDeallocationTop = indexDeallocation.load(); auto leakIndex = MemoryManagement::enumerateLeak(indexAllocationTop, indexDeallocationTop, false, false); - ASSERT_NE(static_cast(-1), leakIndex); + ASSERT_NE(static_cast(-1), leakIndex); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) EXPECT_EQ(ptr, eventsAllocated[leakIndex].address); EXPECT_EQ(sizeBuffer, eventsAllocated[leakIndex].size); @@ -98,7 +98,7 @@ TEST_F(MemoryManagementTest, GivenFourEventsWhenCreatingAllocationThenMemoryIsLe auto indexAllocationTop = indexAllocation.load(); auto indexDeallocationTop = indexDeallocation.load(); auto leakIndex = MemoryManagement::enumerateLeak(indexAllocationTop, indexDeallocationTop, false, false); - ASSERT_NE(static_cast(-1), leakIndex); + ASSERT_NE(static_cast(-1), leakIndex); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) EXPECT_EQ(ptr, eventsAllocated[leakIndex].address); EXPECT_EQ(sizeBuffer, eventsAllocated[leakIndex].size); @@ -116,7 +116,7 @@ TEST_F(MemoryManagementTest, GivenTwoFailingAllocationsWhenCreatingAllocationThe auto indexDeallocationTop = indexDeallocation.load(); auto leakIndex1 = MemoryManagement::enumerateLeak(indexAllocationTop, indexDeallocationTop, false, false); auto leakIndex2 = MemoryManagement::enumerateLeak(indexAllocationTop, indexDeallocationTop, false, false); - ASSERT_NE(static_cast(-1), leakIndex1); + ASSERT_NE(static_cast(-1), leakIndex1); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) EXPECT_EQ(ptr1, eventsAllocated[leakIndex1].address); EXPECT_EQ(sizeBuffer, eventsAllocated[leakIndex1].size); @@ -144,9 +144,9 @@ TEST_F(MemoryManagementTest, WhenPointerIsDeletedThenAllocationShouldbeVisible) EXPECT_EQ(sizeBuffer, eventsAllocated[index].size); index = MemoryManagement::indexDeallocation; - auto ptrCopy = ptr; + uintptr_t ptrCopy = reinterpret_cast(ptr); delete[] ptr; - EXPECT_EQ(ptrCopy, eventsDeallocated[index].address); + EXPECT_EQ(ptrCopy, reinterpret_cast(eventsDeallocated[index].address)); } #if ENABLE_ME_FOR_LEAK_TESTING diff --git a/shared/test/unit_test/memory_manager/address_mapper_tests.cpp b/shared/test/unit_test/memory_manager/address_mapper_tests.cpp index 8f20b1d34a..eb6bf404a5 100644 --- a/shared/test/unit_test/memory_manager/address_mapper_tests.cpp +++ b/shared/test/unit_test/memory_manager/address_mapper_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -17,11 +17,11 @@ using namespace NEO; class AddressMapperFixture { public: - void SetUp() { + void SetUp() { // NOLINT(readability-identifier-naming) mapper = new AddressMapper(); } - void TearDown() { + void TearDown() { // NOLINT(readability-identifier-naming) delete mapper; } AddressMapper *mapper; diff --git a/shared/test/unit_test/memory_manager/page_table_tests.cpp b/shared/test/unit_test/memory_manager/page_table_tests.cpp index 7b8759318c..cb0e98e39e 100644 --- a/shared/test/unit_test/memory_manager/page_table_tests.cpp +++ b/shared/test/unit_test/memory_manager/page_table_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -107,11 +107,11 @@ class PageTableFixture { uint64_t startAddress = 0x1000; public: - void SetUp() { + void SetUp() { // NOLINT(readability-identifier-naming) startAddress = 0x1000; } - void TearDown() { + void TearDown() { // NOLINT(readability-identifier-naming) } }; diff --git a/shared/test/unit_test/os_interface/device_uuid_tests.cpp b/shared/test/unit_test/os_interface/device_uuid_tests.cpp index 423c9e8dc6..04aa5072ca 100644 --- a/shared/test/unit_test/os_interface/device_uuid_tests.cpp +++ b/shared/test/unit_test/os_interface/device_uuid_tests.cpp @@ -113,10 +113,10 @@ HWTEST2_F(MultipleDeviceBdfUuidTest, GivenIncorrectBdfWhenRetrievingDeviceUuidFr setupMockHwInfoConfig(); VariableBackup backupHwInfoConfig(&hwInfoConfigFactory[productFamily], mockHwInfoConfig.get()); - PhysicalDevicePciBusInfo pciBusInfo(PhysicalDevicePciBusInfo::InvalidValue, - PhysicalDevicePciBusInfo::InvalidValue, - PhysicalDevicePciBusInfo::InvalidValue, - PhysicalDevicePciBusInfo::InvalidValue); + PhysicalDevicePciBusInfo pciBusInfo(PhysicalDevicePciBusInfo::invalidValue, + PhysicalDevicePciBusInfo::invalidValue, + PhysicalDevicePciBusInfo::invalidValue, + PhysicalDevicePciBusInfo::invalidValue); const auto deviceFactory = createDevices(pciBusInfo, 2); std::array uuid; diff --git a/shared/test/unit_test/os_interface/linux/drm_memory_info_prelim_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_memory_info_prelim_tests.cpp index 0b9bb46e0c..f087c7af6a 100644 --- a/shared/test/unit_test/os_interface/linux/drm_memory_info_prelim_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_memory_info_prelim_tests.cpp @@ -90,7 +90,7 @@ TEST(MemoryInfoPrelim, givenNewMemoryInfoQuerySupportedWhenQueryingMemoryInfoThe } struct DrmVmTestFixture { - void SetUp() { + void SetUp() { // NOLINT(readability-identifier-naming) executionEnvironment = std::make_unique(); executionEnvironment->prepareRootDeviceEnvironments(1); executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(NEO::defaultHwInfo.get()); @@ -112,7 +112,7 @@ struct DrmVmTestFixture { backupIoctlVmCreateExtensionArg = std::make_unique>(&NEO::SysCalls::ioctlVmCreateExtensionArg, 0ull); } - void TearDown() {} + void TearDown() {} // NOLINT(readability-identifier-naming) DebugManagerStateRestore restorer; std::unique_ptr executionEnvironment; diff --git a/shared/test/unit_test/os_interface/linux/drm_mock_impl.h b/shared/test/unit_test/os_interface/linux/drm_mock_impl.h index 727c53ae49..7eda497c37 100644 --- a/shared/test/unit_test/os_interface/linux/drm_mock_impl.h +++ b/shared/test/unit_test/os_interface/linux/drm_mock_impl.h @@ -41,7 +41,7 @@ class DrmTipMock : public DrmMock { prelimVersion = ""; } - virtual int handleRemainingRequests(unsigned long request, void *arg) override { + int handleRemainingRequests(unsigned long request, void *arg) override { if ((request == DRM_IOCTL_I915_QUERY) && (arg != nullptr)) { if (i915QuerySuccessCount == 0) { return EINVAL; diff --git a/shared/test/unit_test/os_interface/linux/drm_special_heap_test.cpp b/shared/test/unit_test/os_interface/linux/drm_special_heap_test.cpp index 1fd375ac90..76b5730bad 100644 --- a/shared/test/unit_test/os_interface/linux/drm_special_heap_test.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_special_heap_test.cpp @@ -23,7 +23,7 @@ class DrmMemManagerFixture { void forceLimitedRangeAllocator(uint32_t rootDeviceIndex, uint64_t range) { getGfxPartition(rootDeviceIndex)->init(range, 0, 0, gfxPartitions.size(), true); } }; - void SetUp() { + void SetUp() { // NOLINT(readability-identifier-naming) DebugManagerStateRestore dbgRestorer; DebugManager.flags.UseExternalAllocatorForSshAndDsh.set(true); executionEnvironment = std::make_unique(); @@ -34,7 +34,7 @@ class DrmMemManagerFixture { executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr(new DrmMock(*executionEnvironment->rootDeviceEnvironments[0]))); memManager = std::unique_ptr(new FrontWindowMemManagerMock(*executionEnvironment)); } - void TearDown() { + void TearDown() { // NOLINT(readability-identifier-naming) } std::unique_ptr memManager; std::unique_ptr executionEnvironment; @@ -50,4 +50,4 @@ TEST_F(DrmFrontWindowPoolAllocatorTests, givenAllocateInSpecialPoolFlagWhenDrmAl EXPECT_EQ(allocation->getGpuBaseAddress(), allocation->getGpuAddress()); memManager->freeGraphicsMemory(allocation); } -} // namespace NEO \ No newline at end of file +} // namespace NEO diff --git a/shared/test/unit_test/utilities/.clang-tidy b/shared/test/unit_test/utilities/.clang-tidy deleted file mode 100644 index 09b0be2aa8..0000000000 --- a/shared/test/unit_test/utilities/.clang-tidy +++ /dev/null @@ -1,31 +0,0 @@ ---- -Checks: 'clang-diagnostic-*,clang-analyzer-*,google-default-arguments,modernize-use-override,modernize-use-default-member-init,-clang-analyzer-alpha*,readability-identifier-naming,-clang-analyzer-core.UndefinedBinaryOperatorResult' -# WarningsAsErrors: '.*' -HeaderFilterRegex: '^((?!^third_party\/).+)\.(h|hpp|inl)$' -AnalyzeTemporaryDtors: false -CheckOptions: - - key: google-readability-braces-around-statements.ShortStatementLines - value: '1' - - key: google-readability-function-size.StatementThreshold - value: '800' - - key: google-readability-namespace-comments.ShortNamespaceLines - value: '10' - - key: google-readability-namespace-comments.SpacesBeforeComments - value: '2' - - key: readability-identifier-naming.ParameterCase - value: camelBack - - key: modernize-loop-convert.MaxCopySize - value: '16' - - key: modernize-loop-convert.MinConfidence - value: reasonable - - key: modernize-loop-convert.NamingStyle - value: CamelCase - - key: modernize-pass-by-value.IncludeStyle - value: llvm - - key: modernize-replace-auto-ptr.IncludeStyle - value: llvm - - key: modernize-use-nullptr.NullMacros - value: 'NULL' - - key: modernize-use-default-member-init.UseAssignment - value: '1' -... diff --git a/shared/test/unit_test/utilities/containers_tests.cpp b/shared/test/unit_test/utilities/containers_tests.cpp index 7a18039754..031a73936d 100644 --- a/shared/test/unit_test/utilities/containers_tests.cpp +++ b/shared/test/unit_test/utilities/containers_tests.cpp @@ -790,7 +790,7 @@ void iDListTestDetachSequence() { ASSERT_EQ(nodes[4], nodes[0]->next); ASSERT_NE(nullptr, nodes[4]); - ASSERT_EQ(nodes[0], nodes[4]->prev); // NOLINT(clang-analyzer-core.NonNullParamChecker) + ASSERT_EQ(nodes[0], nodes[4]->prev); ASSERT_EQ(nodes[0], list.peekHead()); ASSERT_EQ(nodes[9], list.peekTail()); diff --git a/shared/test/unit_test/utilities/reference_tracked_object_tests.cpp b/shared/test/unit_test/utilities/reference_tracked_object_tests.cpp index 19c090b89f..e581c816cb 100644 --- a/shared/test/unit_test/utilities/reference_tracked_object_tests.cpp +++ b/shared/test/unit_test/utilities/reference_tracked_object_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -111,13 +111,13 @@ TEST(UniquePtrIfUnused, GivenNoCustomDeleterAtCreationWhenDeletingThenUseDefault TEST(UniquePtrIfUnused, GivenCustomDeleterAtCreationWhenDeletingThenUseProvidedDeleter) { struct CustomDeleterTestStruct { bool customDeleterWasCalled; - static void Delete(CustomDeleterTestStruct *ptr) { // NOLINT(readability-identifier-naming) + static void deleter(CustomDeleterTestStruct *ptr) { ptr->customDeleterWasCalled = true; } } customDeleterObj; customDeleterObj.customDeleterWasCalled = false; { - unique_ptr_if_unused uptr(&customDeleterObj, true, &CustomDeleterTestStruct::Delete); + unique_ptr_if_unused uptr(&customDeleterObj, true, &CustomDeleterTestStruct::deleter); } ASSERT_TRUE(customDeleterObj.customDeleterWasCalled); } @@ -126,11 +126,11 @@ TEST(UniquePtrIfUnused, GivenIntializedWithDerivativeOfReferenceCounterWhenDestr struct ObtainedDeleterTestStruct : public ReferenceTrackedObject { using DeleterFuncType = void (*)(ObtainedDeleterTestStruct *); DeleterFuncType getCustomDeleter() const { - return &ObtainedDeleterTestStruct::Delete; + return &ObtainedDeleterTestStruct::deleter; } bool obtainedDeleterWasCalled; - static void Delete(ObtainedDeleterTestStruct *ptr) { // NOLINT(readability-identifier-naming) + static void deleter(ObtainedDeleterTestStruct *ptr) { ptr->obtainedDeleterWasCalled = true; } } obtainedDeleterObj; diff --git a/shared/test/unit_test/utilities/software_tags_manager_tests.cpp b/shared/test/unit_test/utilities/software_tags_manager_tests.cpp index a49fb56654..6ea587bd17 100644 --- a/shared/test/unit_test/utilities/software_tags_manager_tests.cpp +++ b/shared/test/unit_test/utilities/software_tags_manager_tests.cpp @@ -72,7 +72,7 @@ TEST_F(SoftwareTagsManagerTests, whenSWTagsMangerIsInitializedThenHeapAllocation auto memoryMgr = pDevice->getMemoryManager(); SWTagBXML bxml; BXMLHeapInfo bxmlInfo((sizeof(BXMLHeapInfo) + bxml.str.size() + 1) / sizeof(uint32_t)); - SWTagHeapInfo tagInfo(SWTagsManager::MAX_TAG_HEAP_SIZE / sizeof(uint32_t)); + SWTagHeapInfo tagInfo(SWTagsManager::maxTagHeapSize / sizeof(uint32_t)); auto bxmlHeap = tagsManager->getBXMLHeapAllocation(); auto tagHeap = tagsManager->getSWTagHeapAllocation(); @@ -160,17 +160,17 @@ HWTEST_F(SoftwareTagsManagerTests, givenSoftwareManagerWithMaxTagsReachedWhenTag initializeTestCmdStream(); - EXPECT_TRUE(tagsManager->MAX_TAG_HEAP_SIZE > (tagsManager->MAX_TAG_COUNT + 1) * sizeof(TestTag)); + EXPECT_TRUE(tagsManager->maxTagHeapSize > (tagsManager->maxTagCount + 1) * sizeof(TestTag)); - for (unsigned int i = 0; i <= tagsManager->MAX_TAG_COUNT; ++i) { + for (unsigned int i = 0; i <= tagsManager->maxTagCount; ++i) { tagsManager->insertTag(*testCmdStream.get(), *pDevice); } - EXPECT_EQ(testCmdStream->getUsed(), tagsManager->MAX_TAG_COUNT * 2 * sizeof(MI_NOOP)); + EXPECT_EQ(testCmdStream->getUsed(), tagsManager->maxTagCount * 2 * sizeof(MI_NOOP)); tagsManager->insertTag(*testCmdStream.get(), *pDevice); - EXPECT_EQ(testCmdStream->getUsed(), tagsManager->MAX_TAG_COUNT * 2 * sizeof(MI_NOOP)); + EXPECT_EQ(testCmdStream->getUsed(), tagsManager->maxTagCount * 2 * sizeof(MI_NOOP)); freeTestCmdStream(); } @@ -183,7 +183,7 @@ HWTEST_F(SoftwareTagsManagerTests, givenSoftwareManagerWithMaxHeapReachedWhenTag size_t prevHeapOffset = tagsManager->getCurrentHeapOffset(); uint32_t i = 0; - while (tagsManager->getCurrentHeapOffset() + sizeof(VeryLargeTag) <= NEO::SWTagsManager::MAX_TAG_HEAP_SIZE) { + while (tagsManager->getCurrentHeapOffset() + sizeof(VeryLargeTag) <= NEO::SWTagsManager::maxTagHeapSize) { tagsManager->insertTag(*testCmdStream.get(), *pDevice); i++; } diff --git a/third_party/gtest/gmock/gmock.h b/third_party/gtest/gmock/gmock.h index b5e8903c3c..f68d024313 100644 --- a/third_party/gtest/gmock/gmock.h +++ b/third_party/gtest/gmock/gmock.h @@ -8138,7 +8138,7 @@ class FunctionMocker : public UntypedFunctionMockerBase { MutexLock l(&g_gmock_mutex); VerifyAndClearExpectationsLocked(); Mock::UnregisterLocked(this); - ClearDefaultActionsLocked(); + ClearDefaultActionsLocked(); // NOLINT(clang-analyzer-optin.cplusplus.VirtualCall) } // Returns the ON_CALL spec that matches this mock function with the