diff --git a/.clang-tidy b/.clang-tidy index 10a1aa148cc91..3542e600cd812 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -24,6 +24,8 @@ CheckOptions: value: CamelCase - key: readability-identifier-naming.StructIgnoredRegexp value: '(_|TOKSTR_).+' + - key: readability-identifier-naming.EnumCase + value: CamelCase - key: readability-identifier-naming.MethodCase value: camelBack - key: readability-identifier-naming.PrivateMethodCase diff --git a/level_zero/core/source/cmdqueue/cmdqueue.cpp b/level_zero/core/source/cmdqueue/cmdqueue.cpp index 38338fe7ef781..a12db6d73f48b 100644 --- a/level_zero/core/source/cmdqueue/cmdqueue.cpp +++ b/level_zero/core/source/cmdqueue/cmdqueue.cpp @@ -283,34 +283,34 @@ ze_result_t CommandQueueImp::CommandBufferManager::initialize(Device *device, si secondBuffer = device->getNEODevice()->getMemoryManager()->allocateGraphicsMemoryWithProperties(properties); } - buffers[BUFFER_ALLOCATION::FIRST] = firstBuffer; - buffers[BUFFER_ALLOCATION::SECOND] = secondBuffer; + buffers[BufferAllocation::first] = firstBuffer; + buffers[BufferAllocation::second] = secondBuffer; - if (!buffers[BUFFER_ALLOCATION::FIRST] || !buffers[BUFFER_ALLOCATION::SECOND]) { + if (!buffers[BufferAllocation::first] || !buffers[BufferAllocation::second]) { return ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY; } - flushId[BUFFER_ALLOCATION::FIRST] = std::make_pair(0u, 0u); - flushId[BUFFER_ALLOCATION::SECOND] = std::make_pair(0u, 0u); + flushId[BufferAllocation::first] = std::make_pair(0u, 0u); + flushId[BufferAllocation::second] = std::make_pair(0u, 0u); return ZE_RESULT_SUCCESS; } void CommandQueueImp::CommandBufferManager::destroy(Device *device) { - if (buffers[BUFFER_ALLOCATION::FIRST]) { - device->storeReusableAllocation(*buffers[BUFFER_ALLOCATION::FIRST]); - buffers[BUFFER_ALLOCATION::FIRST] = nullptr; + if (buffers[BufferAllocation::first]) { + device->storeReusableAllocation(*buffers[BufferAllocation::first]); + buffers[BufferAllocation::first] = nullptr; } - if (buffers[BUFFER_ALLOCATION::SECOND]) { - device->storeReusableAllocation(*buffers[BUFFER_ALLOCATION::SECOND]); - buffers[BUFFER_ALLOCATION::SECOND] = nullptr; + if (buffers[BufferAllocation::second]) { + device->storeReusableAllocation(*buffers[BufferAllocation::second]); + buffers[BufferAllocation::second] = nullptr; } } NEO::WaitStatus CommandQueueImp::CommandBufferManager::switchBuffers(NEO::CommandStreamReceiver *csr) { - if (bufferUse == BUFFER_ALLOCATION::FIRST) { - bufferUse = BUFFER_ALLOCATION::SECOND; + if (bufferUse == BufferAllocation::first) { + bufferUse = BufferAllocation::second; } else { - bufferUse = BUFFER_ALLOCATION::FIRST; + bufferUse = BufferAllocation::first; } auto waitStatus{NEO::WaitStatus::ready}; diff --git a/level_zero/core/source/cmdqueue/cmdqueue_imp.h b/level_zero/core/source/cmdqueue/cmdqueue_imp.h index c47f9ab84f580..db2d2af65de12 100644 --- a/level_zero/core/source/cmdqueue/cmdqueue_imp.h +++ b/level_zero/core/source/cmdqueue/cmdqueue_imp.h @@ -36,10 +36,10 @@ struct Kernel; struct CommandQueueImp : public CommandQueue { class CommandBufferManager { public: - enum BUFFER_ALLOCATION : uint32_t { - FIRST = 0, - SECOND, - COUNT + enum BufferAllocation : uint32_t { + first = 0, + second, + count }; ze_result_t initialize(Device *device, size_t sizeRequested); @@ -58,9 +58,9 @@ struct CommandQueueImp : public CommandQueue { } private: - NEO::GraphicsAllocation *buffers[BUFFER_ALLOCATION::COUNT]{}; - std::pair flushId[BUFFER_ALLOCATION::COUNT]; - BUFFER_ALLOCATION bufferUse = BUFFER_ALLOCATION::FIRST; + NEO::GraphicsAllocation *buffers[BufferAllocation::count]{}; + std::pair flushId[BufferAllocation::count]; + BufferAllocation bufferUse = BufferAllocation::first; }; static constexpr size_t defaultQueueCmdBufferSize = 128 * MemoryConstants::kiloByte; static constexpr size_t minCmdBufferPtrAlign = 8; diff --git a/level_zero/core/source/gfx_core_helpers/l0_gfx_core_helper.h b/level_zero/core/source/gfx_core_helpers/l0_gfx_core_helper.h index 23d7abcb0dbda..ebb48ffabbca3 100644 --- a/level_zero/core/source/gfx_core_helpers/l0_gfx_core_helper.h +++ b/level_zero/core/source/gfx_core_helpers/l0_gfx_core_helper.h @@ -29,12 +29,10 @@ class Debugger; namespace L0 { -typedef enum _ze_rtas_device_format_internal_t { - ZE_RTAS_DEVICE_FORMAT_EXP_INVALID = 0, // invalid acceleration structure format - ZE_RTAS_DEVICE_FORMAT_EXP_VERSION_1 = 1, // acceleration structure format version 1 - ZE_RTAS_DEVICE_FORMAT_EXP_VERSION_2 = 2, // acceleration structure format version 2 - ZE_RTAS_DEVICE_FORMAT_EXP_VERSION_MAX = 2 -} ze_rtas_device_format_internal_t; +enum class RTASDeviceFormatInternal { + version1 = 1, + version2 = 2, +}; struct Event; struct Device; diff --git a/level_zero/core/source/gfx_core_helpers/l0_gfx_core_helper_xehp_and_later.inl b/level_zero/core/source/gfx_core_helpers/l0_gfx_core_helper_xehp_and_later.inl index c3ca24a959080..4570c919bde10 100644 --- a/level_zero/core/source/gfx_core_helpers/l0_gfx_core_helper_xehp_and_later.inl +++ b/level_zero/core/source/gfx_core_helpers/l0_gfx_core_helper_xehp_and_later.inl @@ -74,7 +74,7 @@ NEO::HeapAddressModel L0GfxCoreHelperHw::getPlatformHeapAddressModel() c template ze_rtas_format_exp_t L0GfxCoreHelperHw::getSupportedRTASFormat() const { - return static_cast(ZE_RTAS_DEVICE_FORMAT_EXP_VERSION_1); + return static_cast(RTASDeviceFormatInternal::version1); } template diff --git a/level_zero/core/test/unit_tests/fixtures/module_fixture.cpp b/level_zero/core/test/unit_tests/fixtures/module_fixture.cpp index 0e4765c30d560..e8768a0a529c2 100644 --- a/level_zero/core/test/unit_tests/fixtures/module_fixture.cpp +++ b/level_zero/core/test/unit_tests/fixtures/module_fixture.cpp @@ -88,7 +88,7 @@ void ModuleImmutableDataFixture::setUp() { DeviceFixture::setupWithExecutionEnvironment(*executionEnvironment); } -void ModuleImmutableDataFixture::createModuleFromMockBinary(uint32_t perHwThreadPrivateMemorySize, bool isInternal, MockImmutableData *mockKernelImmData, std::initializer_list additionalSections) { +void ModuleImmutableDataFixture::createModuleFromMockBinary(uint32_t perHwThreadPrivateMemorySize, bool isInternal, MockImmutableData *mockKernelImmData, std::initializer_list additionalSections) { DebugManagerStateRestore restore; debugManager.flags.FailBuildProgramWithStatefulAccess.set(0); 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 27b41738826f9..60fee03881e63 100644 --- a/level_zero/core/test/unit_tests/fixtures/module_fixture.h +++ b/level_zero/core/test/unit_tests/fixtures/module_fixture.h @@ -108,7 +108,7 @@ struct ModuleImmutableDataFixture : public DeviceFixture { void setUp(); void createModuleFromMockBinary(uint32_t perHwThreadPrivateMemorySize, bool isInternal, MockImmutableData *mockKernelImmData, - std::initializer_list additionalSections = {}); + std::initializer_list additionalSections = {}); void createKernel(MockKernel *kernel); diff --git a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_2.cpp b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_2.cpp index b81b7d8e83ea8..c7744fa61d4a6 100644 --- a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_2.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_2.cpp @@ -723,7 +723,7 @@ TEST_F(CommandQueueInitTests, givenMultipleSubDevicesWhenInitializingThenAllocat } } - EXPECT_EQ(static_cast(CommandQueueImp::CommandBufferManager::BUFFER_ALLOCATION::COUNT), cmdBufferAllocationsFound); + EXPECT_EQ(static_cast(CommandQueueImp::CommandBufferManager::BufferAllocation::count), cmdBufferAllocationsFound); commandQueue->destroy(); } diff --git a/level_zero/core/test/unit_tests/sources/debugger/test_module_with_debug.cpp b/level_zero/core/test/unit_tests/sources/debugger/test_module_with_debug.cpp index e18da218554c5..6a833ba155cf4 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/test_module_with_debug.cpp +++ b/level_zero/core/test/unit_tests/sources/debugger/test_module_with_debug.cpp @@ -614,7 +614,7 @@ HWTEST_F(NotifyModuleLoadTest, givenDebuggingEnabledWhenModuleIsCreatedAndFullyL auto debugger = MockDebuggerL0Hw::allocate(neoDevice); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->debugger.reset(debugger); - auto elfAdditionalSections = {ZebinTestData::appendElfAdditionalSection::constant}; // for const surface allocation copy + auto elfAdditionalSections = {ZebinTestData::AppendElfAdditionalSection::constant}; // for const surface allocation copy auto zebinData = std::make_unique(device->getHwInfo(), elfAdditionalSections); const auto &src = zebinData->storage; diff --git a/level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp b/level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp index 072de090daab7..b3d34e1b03e49 100644 --- a/level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp +++ b/level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp @@ -719,7 +719,7 @@ TEST_F(KernelImmutableDataIsaCopyTests, whenUserKernelIsCreatedThenIsaIsCopiedWh std::unique_ptr mockKernelImmData = std::make_unique(perHwThreadPrivateMemorySizeRequested); - auto additionalSections = {ZebinTestData::appendElfAdditionalSection::global}; + auto additionalSections = {ZebinTestData::AppendElfAdditionalSection::global}; createModuleFromMockBinary(perHwThreadPrivateMemorySizeRequested, isInternal, mockKernelImmData.get(), additionalSections); size_t copyForGlobalSurface = 1u; @@ -799,7 +799,7 @@ TEST_F(KernelImmutableDataTests, givenInternalModuleWhenKernelIsCreatedThenIsaIs size_t previouscopyMemoryToAllocationCalledTimes = mockMemoryManager->copyMemoryToAllocationCalledTimes; - auto additionalSections = {ZebinTestData::appendElfAdditionalSection::global}; + auto additionalSections = {ZebinTestData::AppendElfAdditionalSection::global}; createModuleFromMockBinary(perHwThreadPrivateMemorySizeRequested, isInternal, mockKernelImmData.get(), additionalSections); size_t copyForGlobalSurface = 1u; diff --git a/level_zero/core/test/unit_tests/sources/memory/linux/test_memory_linux.cpp b/level_zero/core/test/unit_tests/sources/memory/linux/test_memory_linux.cpp index 5048872f7ebcc..b994876e36ca5 100644 --- a/level_zero/core/test/unit_tests/sources/memory/linux/test_memory_linux.cpp +++ b/level_zero/core/test/unit_tests/sources/memory/linux/test_memory_linux.cpp @@ -61,7 +61,7 @@ class IpcImplicitScalingObtainFdMockGraphicsAllocation : public NEO::DrmAllocati class MemoryManagerIpcImplicitScalingObtainFdMock : public NEO::DrmMemoryManager { public: - MemoryManagerIpcImplicitScalingObtainFdMock(NEO::ExecutionEnvironment &executionEnvironment) : NEO::DrmMemoryManager(gemCloseWorkerMode::gemCloseWorkerInactive, false, false, executionEnvironment) {} + MemoryManagerIpcImplicitScalingObtainFdMock(NEO::ExecutionEnvironment &executionEnvironment) : NEO::DrmMemoryManager(GemCloseWorkerMode::gemCloseWorkerInactive, false, false, executionEnvironment) {} NEO::GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, const AllocationProperties &properties, bool requireSpecificBitness, bool isHostIpcAllocation, bool reuseSharedAllocation, void *mapPointer) override { return nullptr; } void addAllocationToHostPtrManager(NEO::GraphicsAllocation *memory) override{}; @@ -477,7 +477,7 @@ class IpcObtainFdMockGraphicsAllocation : public NEO::DrmAllocation { class MemoryManagerIpcObtainFdMock : public NEO::DrmMemoryManager { public: - MemoryManagerIpcObtainFdMock(NEO::ExecutionEnvironment &executionEnvironment) : NEO::DrmMemoryManager(gemCloseWorkerMode::gemCloseWorkerInactive, false, false, executionEnvironment) {} + MemoryManagerIpcObtainFdMock(NEO::ExecutionEnvironment &executionEnvironment) : NEO::DrmMemoryManager(GemCloseWorkerMode::gemCloseWorkerInactive, false, false, executionEnvironment) {} NEO::GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, const AllocationProperties &properties, bool requireSpecificBitness, bool isHostIpcAllocation, bool reuseSharedAllocation, void *mapPointer) override { return nullptr; } void addAllocationToHostPtrManager(NEO::GraphicsAllocation *memory) override{}; diff --git a/level_zero/core/test/unit_tests/sources/module/test_module.cpp b/level_zero/core/test/unit_tests/sources/module/test_module.cpp index 1b9108f1e395a..c6bae947d39c4 100644 --- a/level_zero/core/test/unit_tests/sources/module/test_module.cpp +++ b/level_zero/core/test/unit_tests/sources/module/test_module.cpp @@ -643,7 +643,7 @@ struct ModuleSpecConstantsFixture : public DeviceFixture { } void runTest() { - auto additionalSections = {ZebinTestData::appendElfAdditionalSection::spirv}; + auto additionalSections = {ZebinTestData::AppendElfAdditionalSection::spirv}; zebinData = std::make_unique(device->getHwInfo(), additionalSections); const auto &src = zebinData->storage; @@ -682,7 +682,7 @@ struct ModuleSpecConstantsFixture : public DeviceFixture { } void runTestStatic() { - auto additionalSections = {ZebinTestData::appendElfAdditionalSection::spirv}; + auto additionalSections = {ZebinTestData::AppendElfAdditionalSection::spirv}; zebinData = std::make_unique(device->getHwInfo(), additionalSections); const auto &src = zebinData->storage; @@ -775,7 +775,7 @@ TEST_F(ModuleSpecConstantsLongTests, givenSpecializationConstantsSetWhenCompiler mockCompiler = new FailingMockCompilerInterfaceWithSpecConstants(moduleNumSpecConstants); auto rootDeviceEnvironment = neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0].get(); rootDeviceEnvironment->compilerInterface.reset(mockCompiler); - auto additionalSections = {ZebinTestData::appendElfAdditionalSection::spirv}; + auto additionalSections = {ZebinTestData::AppendElfAdditionalSection::spirv}; auto zebinData = std::make_unique(device->getHwInfo(), additionalSections); const auto &src = zebinData->storage; @@ -806,7 +806,7 @@ TEST_F(ModuleSpecConstantsLongTests, givenSpecializationConstantsSetWhenCompiler } TEST_F(ModuleSpecConstantsLongTests, givenSpecializationConstantsSetWhenUserPassTooMuchConstsIdsThenModuleInitFails) { - auto additionalSections = {ZebinTestData::appendElfAdditionalSection::spirv}; + auto additionalSections = {ZebinTestData::AppendElfAdditionalSection::spirv}; auto zebinData = std::make_unique(device->getHwInfo(), additionalSections); const auto &src = zebinData->storage; @@ -862,7 +862,7 @@ TEST_F(ModuleSpecConstantsLongTests, givenSpecializationConstantsSetWhenCompiler mockCompiler = new FailingMockCompilerInterfaceWithSpecConstants(moduleNumSpecConstants); auto rootDeviceEnvironment = neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0].get(); rootDeviceEnvironment->compilerInterface.reset(mockCompiler); - auto additionalSections = {ZebinTestData::appendElfAdditionalSection::spirv}; + auto additionalSections = {ZebinTestData::AppendElfAdditionalSection::spirv}; auto zebinData = std::make_unique(device->getHwInfo(), additionalSections); const auto &src = zebinData->storage; @@ -925,7 +925,7 @@ struct ModuleStaticLinkFixture : public DeviceFixture { } void loadModules(bool multiple) { - auto additionalSections = {ZebinTestData::appendElfAdditionalSection::spirv}; + auto additionalSections = {ZebinTestData::AppendElfAdditionalSection::spirv}; zebinData = std::make_unique(device->getHwInfo(), additionalSections); const auto &storage = zebinData->storage; @@ -2846,7 +2846,7 @@ HWTEST_F(ModuleTranslationUnitTest, GivenRebuildFlagWhenCreatingModuleFromNative DebugManagerStateRestore dgbRestorer; NEO::debugManager.flags.RebuildPrecompiledKernels.set(true); - auto additionalSections = {ZebinTestData::appendElfAdditionalSection::spirv}; + auto additionalSections = {ZebinTestData::AppendElfAdditionalSection::spirv}; bool forceRecompilation = true; auto zebinData = std::make_unique(device->getHwInfo(), additionalSections, forceRecompilation); const auto &src = zebinData->storage; @@ -2881,7 +2881,7 @@ HWTEST_F(ModuleTranslationUnitTest, GivenRebuildFlagWhenCreatingModuleFromNative DebugManagerStateRestore dgbRestorer; NEO::debugManager.flags.RebuildPrecompiledKernels.set(true); - auto additionalSections = {ZebinTestData::appendElfAdditionalSection::spirv}; + auto additionalSections = {ZebinTestData::AppendElfAdditionalSection::spirv}; bool forceRecompilation = true; auto zebinData = std::make_unique(device->getHwInfo(), additionalSections, forceRecompilation); const auto &src = zebinData->storage; @@ -3003,8 +3003,8 @@ HWTEST2_F(ModuleTranslationUnitTest, givenLargeGrfAndSimd16WhenProcessingBinaryT uint8_t kernelIsa[8]{0U}; ZebinTestData::ValidEmptyProgram zebin; - zebin.removeSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); - zebin.appendSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(validZeInfo.data(), validZeInfo.size())); + zebin.removeSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); + zebin.appendSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(validZeInfo.data(), validZeInfo.size())); zebin.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Zebin::Elf::SectionNames::textPrefix.str() + "kernel_with_default_maxWGS", {kernelIsa, sizeof(kernelIsa)}); zebin.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Zebin::Elf::SectionNames::textPrefix.str() + "kernel_with_reduced_maxWGS", {kernelIsa, sizeof(kernelIsa)}); zebin.elfHeader->machine = this->device->getNEODevice()->getHardwareInfo().platform.eProductFamily; @@ -3050,8 +3050,8 @@ HWTEST2_F(ModuleTranslationUnitTest, givenLargeGrfAndSimd16WhenProcessingBinaryT uint8_t kernelIsa[8]{0U}; ZebinTestData::ValidEmptyProgram zebin; - zebin.removeSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); - zebin.appendSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(validZeInfo.data(), validZeInfo.size())); + zebin.removeSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); + zebin.appendSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(validZeInfo.data(), validZeInfo.size())); zebin.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Zebin::Elf::SectionNames::textPrefix.str() + "kernel_with_default_maxWGS", {kernelIsa, sizeof(kernelIsa)}); zebin.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Zebin::Elf::SectionNames::textPrefix.str() + "kernel_with_reduced_maxWGS", {kernelIsa, sizeof(kernelIsa)}); zebin.elfHeader->machine = this->device->getNEODevice()->getHardwareInfo().platform.eProductFamily; @@ -3109,15 +3109,15 @@ TEST_F(ModuleTranslationUnitTest, WhenCreatingFromZeBinaryAndGlobalsAreExportedT elfEncoder.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Zebin::Elf::SectionNames::dataGlobal, std::string{"12345678"}); auto dataGlobalSectionIndex = elfEncoder.getLastSectionHeaderIndex(); - NEO::Elf::ElfSymbolEntry symbolTable[2] = {}; + NEO::Elf::ElfSymbolEntry symbolTable[2] = {}; symbolTable[0].name = decltype(symbolTable[0].name)(elfEncoder.appendSectionName("const.data")); - symbolTable[0].info = NEO::Elf::SYMBOL_TABLE_TYPE::STT_OBJECT | NEO::Elf::SYMBOL_TABLE_BIND::STB_GLOBAL << 4; + symbolTable[0].info = NEO::Elf::SymbolTableType::STT_OBJECT | NEO::Elf::SymbolTableBind::STB_GLOBAL << 4; symbolTable[0].shndx = decltype(symbolTable[0].shndx)(dataConstSectionIndex); symbolTable[0].size = 4; symbolTable[0].value = 0; symbolTable[1].name = decltype(symbolTable[1].name)(elfEncoder.appendSectionName("global.data")); - symbolTable[1].info = NEO::Elf::SYMBOL_TABLE_TYPE::STT_OBJECT | NEO::Elf::SYMBOL_TABLE_BIND::STB_GLOBAL << 4; + symbolTable[1].info = NEO::Elf::SymbolTableType::STT_OBJECT | NEO::Elf::SymbolTableBind::STB_GLOBAL << 4; symbolTable[1].shndx = decltype(symbolTable[1].shndx)(dataGlobalSectionIndex); symbolTable[1].size = 4; symbolTable[1].value = 0; @@ -4525,7 +4525,7 @@ TEST_F(ModuleIsaCopyTest, whenModuleIsInitializedThenIsaIsCopied) { uint32_t previouscopyMemoryToAllocationCalledTimes = mockMemoryManager->copyMemoryToAllocationCalledTimes; - auto additionalSections = {ZebinTestData::appendElfAdditionalSection::global}; + auto additionalSections = {ZebinTestData::AppendElfAdditionalSection::global}; createModuleFromMockBinary(perHwThreadPrivateMemorySizeRequested, isInternal, mockKernelImmData.get(), additionalSections); uint32_t numOfKernels = static_cast(module->getKernelImmutableDataVector().size()); diff --git a/level_zero/core/test/unit_tests/xe_hpc_core/test_l0_gfx_core_helper_xe_hpc_core.cpp b/level_zero/core/test/unit_tests/xe_hpc_core/test_l0_gfx_core_helper_xe_hpc_core.cpp index e511cef6b411f..d9187f7a6d15a 100644 --- a/level_zero/core/test/unit_tests/xe_hpc_core/test_l0_gfx_core_helper_xe_hpc_core.cpp +++ b/level_zero/core/test/unit_tests/xe_hpc_core/test_l0_gfx_core_helper_xe_hpc_core.cpp @@ -80,7 +80,7 @@ XE_HPC_CORETEST_F(L0GfxCoreHelperTestXeHpc, GivenXeHpcWhenGetRegsetTypeForLargeG XE_HPC_CORETEST_F(L0GfxCoreHelperTestXeHpc, GivenXeHpcWhenGettingSupportedRTASFormatThenExpectedFormatIsReturned) { const auto &l0GfxCoreHelper = getHelper(); - EXPECT_EQ(ZE_RTAS_DEVICE_FORMAT_EXP_VERSION_1, static_cast(l0GfxCoreHelper.getSupportedRTASFormat())); + EXPECT_EQ(RTASDeviceFormatInternal::version1, static_cast(l0GfxCoreHelper.getSupportedRTASFormat())); } } // namespace ult diff --git a/level_zero/core/test/unit_tests/xe_hpg_core/test_l0_gfx_core_helper_xe_hpg_core.cpp b/level_zero/core/test/unit_tests/xe_hpg_core/test_l0_gfx_core_helper_xe_hpg_core.cpp index 55e89a53109b5..32488f42d2ba0 100644 --- a/level_zero/core/test/unit_tests/xe_hpg_core/test_l0_gfx_core_helper_xe_hpg_core.cpp +++ b/level_zero/core/test/unit_tests/xe_hpg_core/test_l0_gfx_core_helper_xe_hpg_core.cpp @@ -82,7 +82,7 @@ XE_HPG_CORETEST_F(L0GfxCoreHelperTestXeHpg, GivenXeHpgWhenCheckingL0HelperForPla XE_HPG_CORETEST_F(L0GfxCoreHelperTestXeHpg, GivenXeHpgWhenGettingSupportedRTASFormatThenExpectedFormatIsReturned) { const auto &l0GfxCoreHelper = getHelper(); - EXPECT_EQ(ZE_RTAS_DEVICE_FORMAT_EXP_VERSION_1, static_cast(l0GfxCoreHelper.getSupportedRTASFormat())); + EXPECT_EQ(RTASDeviceFormatInternal::version1, static_cast(l0GfxCoreHelper.getSupportedRTASFormat())); } } // namespace ult diff --git a/level_zero/experimental/source/tracing/tracing_imp.h b/level_zero/experimental/source/tracing/tracing_imp.h index 8c3a4a59ce11a..8eabac666aae9 100644 --- a/level_zero/experimental/source/tracing/tracing_imp.h +++ b/level_zero/experimental/source/tracing/tracing_imp.h @@ -51,11 +51,11 @@ typedef struct TracerArray { tracer_array_entry_t *tracerArrayEntries; } tracer_array_t; -typedef enum tracingState { +enum TracingState { disabledState, // tracing has never been enabled enabledState, // tracing is enabled. disabledWaitingState, // tracing has been disabled, but not waited for -} tracingState_t; +}; struct APITracerImp : APITracer { ze_result_t destroyTracer(zet_tracer_exp_handle_t phTracer) override; @@ -64,7 +64,7 @@ struct APITracerImp : APITracer { ze_result_t enableTracer(ze_bool_t enable) override; tracer_array_entry_t tracerFunctions{}; - tracingState_t tracingState = disabledState; + TracingState tracingState = disabledState; private: }; diff --git a/level_zero/include/.clang-tidy b/level_zero/include/.clang-tidy new file mode 100644 index 0000000000000..5c7d265eb62b3 --- /dev/null +++ b/level_zero/include/.clang-tidy @@ -0,0 +1,29 @@ +--- +Checks: 'clang-diagnostic-*,clang-analyzer-*,-clang-analyzer-osx.*,-clang-analyzer-optin.osx.*,-clang-analyzer-nullability.*,google-default-arguments,modernize-use-override,modernize-use-default-member-init,-clang-analyzer-alpha*' +WarningsAsErrors: '.*' +HeaderFilterRegex: '(shared|opencl|level_zero).+\.(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: 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/sysman/source/api/ecc/sysman_ecc_imp.h b/level_zero/sysman/source/api/ecc/sysman_ecc_imp.h index d5043542db76e..c41e137a896d5 100644 --- a/level_zero/sysman/source/api/ecc/sysman_ecc_imp.h +++ b/level_zero/sysman/source/api/ecc/sysman_ecc_imp.h @@ -16,6 +16,9 @@ namespace Sysman { class FirmwareUtil; struct OsSysman; +static constexpr uint8_t eccStateDisable = 0; +static constexpr uint8_t eccStateEnable = 1; +static constexpr uint8_t eccStateNone = 0xFF; class EccImp : public Ecc, NEO::NonCopyableOrMovableClass { public: void init() override {} @@ -31,12 +34,6 @@ class EccImp : public Ecc, NEO::NonCopyableOrMovableClass { OsSysman *pOsSysman = nullptr; FirmwareUtil *pFwInterface = nullptr; - enum eccState : uint8_t { - eccStateDisable = 0, - eccStateEnable = 1, - eccStateNone = 0xFF - }; - zes_device_ecc_state_t getEccState(uint8_t state); static FirmwareUtil *getFirmwareUtilInterface(OsSysman *pOsSysman); ze_result_t getEccFwUtilInterface(FirmwareUtil *&pFwUtil); diff --git a/level_zero/sysman/test/unit_tests/sources/ecc/linux/test_zes_ecc.cpp b/level_zero/sysman/test/unit_tests/sources/ecc/linux/test_zes_ecc.cpp index 5eebae8e54cea..e70c9214d53ee 100644 --- a/level_zero/sysman/test/unit_tests/sources/ecc/linux/test_zes_ecc.cpp +++ b/level_zero/sysman/test/unit_tests/sources/ecc/linux/test_zes_ecc.cpp @@ -13,11 +13,6 @@ namespace L0 { namespace Sysman { namespace ult { -enum eccState : uint8_t { - eccStateEnable = 1, - eccStateNone = 0xFF -}; - class ZesEccFixture : public SysmanDeviceFixture { protected: L0::Sysman::SysmanDevice *device = nullptr; diff --git a/level_zero/sysman/test/unit_tests/sources/global_operations/linux/mock_global_operations.h b/level_zero/sysman/test/unit_tests/sources/global_operations/linux/mock_global_operations.h index 5f193d2c0f0de..f0b02f4662188 100644 --- a/level_zero/sysman/test/unit_tests/sources/global_operations/linux/mock_global_operations.h +++ b/level_zero/sysman/test/unit_tests/sources/global_operations/linux/mock_global_operations.h @@ -65,7 +65,7 @@ const std::string mockSlotPathAddress("/sys/bus/pci/slots/1/address"); const std::string mockRootAddress("devices"); const std::string mockCardBusPath("/sys/devices"); -enum mockEnumListProcessCall { +enum MockEnumListProcessCall { DEVICE_IN_USE = 0, DEVICE_UNUSED = 1, RETURN_ERROR = 2 @@ -374,7 +374,7 @@ struct MockGlobalOperationsProcfsAccess : public L0::Sysman::ProcFsAccessInterfa int ourDeviceFd = 0; int ourDeviceFd1 = 0; - std::vector mockListProcessCall{}; + std::vector mockListProcessCall{}; std::vector isRepeated{}; ze_result_t listProcessesResult = ZE_RESULT_SUCCESS; uint32_t listProcessCalled = 0u; @@ -383,17 +383,17 @@ struct MockGlobalOperationsProcfsAccess : public L0::Sysman::ProcFsAccessInterfa list = pidList; if (!mockListProcessCall.empty()) { - mockEnumListProcessCall mockListProcessCallValue = mockListProcessCall.front(); - if (mockListProcessCallValue == mockEnumListProcessCall::DEVICE_IN_USE) { + MockEnumListProcessCall mockListProcessCallValue = mockListProcessCall.front(); + if (mockListProcessCallValue == MockEnumListProcessCall::DEVICE_IN_USE) { if (ourDevicePid) { list.push_back(ourDevicePid); } } - else if (mockListProcessCallValue == mockEnumListProcessCall::DEVICE_UNUSED) { + else if (mockListProcessCallValue == MockEnumListProcessCall::DEVICE_UNUSED) { } - else if (mockListProcessCallValue == mockEnumListProcessCall::RETURN_ERROR) { + else if (mockListProcessCallValue == MockEnumListProcessCall::RETURN_ERROR) { listProcessesResult = ZE_RESULT_ERROR_NOT_AVAILABLE; } diff --git a/level_zero/tools/test/unit_tests/sources/sysman/global_operations/linux/mock_global_operations.h b/level_zero/tools/test/unit_tests/sources/sysman/global_operations/linux/mock_global_operations.h index 9b6edf3b14e4e..37d2f12b663d6 100644 --- a/level_zero/tools/test/unit_tests/sources/sysman/global_operations/linux/mock_global_operations.h +++ b/level_zero/tools/test/unit_tests/sources/sysman/global_operations/linux/mock_global_operations.h @@ -53,7 +53,7 @@ const std::string mockDeviceDir("devices/pci0000:89/0000:89:02.0/0000:8a:00.0/00 const std::string mockFunctionResetPath(mockDeviceDir + "/reset"); const std::string mockDeviceName("/MOCK_DEVICE_NAME"); -enum mockEnumListProcessCall { +enum MockEnumListProcessCall { DEVICE_IN_USE = 0, DEVICE_UNUSED = 1, RETURN_ERROR = 2 @@ -349,7 +349,7 @@ struct MockGlobalOperationsProcfsAccess : public ProcfsAccess { ::pid_t ourDevicePid = 0; int ourDeviceFd = 0; - std::vector mockListProcessCall{}; + std::vector mockListProcessCall{}; std::vector isRepeated{}; ze_result_t listProcessesResult = ZE_RESULT_SUCCESS; uint32_t listProcessCalled = 0u; @@ -358,17 +358,17 @@ struct MockGlobalOperationsProcfsAccess : public ProcfsAccess { list = pidList; if (!mockListProcessCall.empty()) { - mockEnumListProcessCall mockListProcessCallValue = mockListProcessCall.front(); - if (mockListProcessCallValue == mockEnumListProcessCall::DEVICE_IN_USE) { + MockEnumListProcessCall mockListProcessCallValue = mockListProcessCall.front(); + if (mockListProcessCallValue == MockEnumListProcessCall::DEVICE_IN_USE) { if (ourDevicePid) { list.push_back(ourDevicePid); } } - else if (mockListProcessCallValue == mockEnumListProcessCall::DEVICE_UNUSED) { + else if (mockListProcessCallValue == MockEnumListProcessCall::DEVICE_UNUSED) { } - else if (mockListProcessCallValue == mockEnumListProcessCall::RETURN_ERROR) { + else if (mockListProcessCallValue == MockEnumListProcessCall::RETURN_ERROR) { listProcessesResult = ZE_RESULT_ERROR_NOT_AVAILABLE; } diff --git a/opencl/extensions/.clang-tidy b/opencl/extensions/.clang-tidy new file mode 100644 index 0000000000000..5c7d265eb62b3 --- /dev/null +++ b/opencl/extensions/.clang-tidy @@ -0,0 +1,29 @@ +--- +Checks: 'clang-diagnostic-*,clang-analyzer-*,-clang-analyzer-osx.*,-clang-analyzer-optin.osx.*,-clang-analyzer-nullability.*,google-default-arguments,modernize-use-override,modernize-use-default-member-init,-clang-analyzer-alpha*' +WarningsAsErrors: '.*' +HeaderFilterRegex: '(shared|opencl|level_zero).+\.(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: 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/source/helpers/sampler_helpers.h b/opencl/source/helpers/sampler_helpers.h index 0e7f2e6e25315..8dee1b66859fb 100644 --- a/opencl/source/helpers/sampler_helpers.h +++ b/opencl/source/helpers/sampler_helpers.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -11,7 +11,7 @@ #include // Sampler Patch Token Enums -enum SAMPLER_PATCH_ENUM { +enum SamplerPatchEnum { CLK_DEFAULT_SAMPLER = 0x00, CLK_ADDRESS_NONE = 0x00, CLK_ADDRESS_CLAMP = 0x01, @@ -25,7 +25,7 @@ enum SAMPLER_PATCH_ENUM { CLK_FILTER_LINEAR = 0x00, }; -inline SAMPLER_PATCH_ENUM getAddrModeEnum(cl_addressing_mode addressingMode) { +inline SamplerPatchEnum getAddrModeEnum(cl_addressing_mode addressingMode) { switch (addressingMode) { case CL_ADDRESS_REPEAT: return CLK_ADDRESS_REPEAT; @@ -41,7 +41,7 @@ inline SAMPLER_PATCH_ENUM getAddrModeEnum(cl_addressing_mode addressingMode) { return CLK_ADDRESS_NONE; } -inline SAMPLER_PATCH_ENUM getNormCoordsEnum(cl_bool normalizedCoords) { +inline SamplerPatchEnum getNormCoordsEnum(cl_bool normalizedCoords) { if (normalizedCoords == CL_TRUE) { return CLK_NORMALIZED_COORDS_TRUE; } else { diff --git a/opencl/source/kernel/kernel.cpp b/opencl/source/kernel/kernel.cpp index d20b05fd3451c..41c0fe1a6cdce 100644 --- a/opencl/source/kernel/kernel.cpp +++ b/opencl/source/kernel/kernel.cpp @@ -1008,7 +1008,7 @@ cl_int Kernel::setArgSvmAlloc(uint32_t argIndex, void *svmPtr, GraphicsAllocatio return CL_SUCCESS; } -void Kernel::storeKernelArg(uint32_t argIndex, kernelArgType argType, void *argObject, +void Kernel::storeKernelArg(uint32_t argIndex, KernelArgType argType, void *argObject, const void *argValue, size_t argSize, GraphicsAllocation *argSvmAlloc, cl_mem_flags argSvmFlags) { kernelArguments[argIndex].type = argType; diff --git a/opencl/source/kernel/kernel.h b/opencl/source/kernel/kernel.h index 1ea34499b025c..f0bf19a6797f6 100644 --- a/opencl/source/kernel/kernel.h +++ b/opencl/source/kernel/kernel.h @@ -47,7 +47,7 @@ class Kernel : public ReferenceTrackedObject { public: static const uint32_t kernelBinaryAlignment = 64; - enum kernelArgType { + enum KernelArgType { NONE_OBJ, IMAGE_OBJ, BUFFER_OBJ, @@ -66,7 +66,7 @@ class Kernel : public ReferenceTrackedObject { const void *value; size_t size; GraphicsAllocation *svmAllocation; - kernelArgType type; + KernelArgType type; uint32_t allocId; uint32_t allocIdMemoryManagerCounter; bool isPatched = false; @@ -118,7 +118,7 @@ class Kernel : public ReferenceTrackedObject { ~Kernel() override; - static bool isMemObj(kernelArgType kernelArg) { + static bool isMemObj(KernelArgType kernelArg) { return kernelArg == BUFFER_OBJ || kernelArg == IMAGE_OBJ || kernelArg == PIPE_OBJ; } @@ -268,7 +268,7 @@ class Kernel : public ReferenceTrackedObject { const void *argVal); void storeKernelArg(uint32_t argIndex, - kernelArgType argType, + KernelArgType argType, void *argObject, const void *argValue, size_t argSize, diff --git a/opencl/source/sharings/gl/windows/gl_texture_windows.cpp b/opencl/source/sharings/gl/windows/gl_texture_windows.cpp index ecef37ac587ec..6df2808c9226c 100644 --- a/opencl/source/sharings/gl/windows/gl_texture_windows.cpp +++ b/opencl/source/sharings/gl/windows/gl_texture_windows.cpp @@ -122,7 +122,7 @@ Image *GlTexture::createSharedGlTexture(Context *context, cl_mem_flags flags, cl } auto surfaceFormatInfo = *surfaceFormatInfoAddress; if (texInfo.glInternalFormat != GL_RGB10) { - surfaceFormatInfo.surfaceFormat.genxSurfaceFormat = (GFX3DSTATE_SURFACEFORMAT)texInfo.glHWFormat; + surfaceFormatInfo.surfaceFormat.genxSurfaceFormat = (SurfaceFormat)texInfo.glHWFormat; } GraphicsAllocation *mcsAlloc = nullptr; diff --git a/opencl/source/sharings/va/va_surface.cpp b/opencl/source/sharings/va/va_surface.cpp index 184be048e1655..e3e3893dc8dc8 100644 --- a/opencl/source/sharings/va/va_surface.cpp +++ b/opencl/source/sharings/va/va_surface.cpp @@ -270,7 +270,7 @@ const ClSurfaceFormatInfo *VASurface::getExtendedSurfaceFormatInfo(uint32_t form if (formatFourCC == VA_FOURCC_P010) { static const ClSurfaceFormatInfo formatInfoP010 = {{CL_NV12_INTEL, CL_UNORM_INT16}, {GMM_RESOURCE_FORMAT::GMM_FORMAT_P010, - static_cast(NUM_GFX3DSTATE_SURFACEFORMATS), // not used for plane images + static_cast(NUM_GFX3DSTATE_SURFACEFORMATS), // not used for plane images 0, 1, 2, @@ -280,7 +280,7 @@ const ClSurfaceFormatInfo *VASurface::getExtendedSurfaceFormatInfo(uint32_t form if (formatFourCC == VA_FOURCC_P016) { static const ClSurfaceFormatInfo formatInfoP016 = {{CL_NV12_INTEL, CL_UNORM_INT16}, {GMM_RESOURCE_FORMAT::GMM_FORMAT_P016, - static_cast(NUM_GFX3DSTATE_SURFACEFORMATS), // not used for plane images + static_cast(NUM_GFX3DSTATE_SURFACEFORMATS), // not used for plane images 0, 1, 2, @@ -290,7 +290,7 @@ const ClSurfaceFormatInfo *VASurface::getExtendedSurfaceFormatInfo(uint32_t form if (formatFourCC == VA_FOURCC_RGBP) { static const ClSurfaceFormatInfo formatInfoRGBP = {{CL_NV12_INTEL, CL_UNORM_INT8}, {GMM_RESOURCE_FORMAT::GMM_FORMAT_RGBP, - static_cast(GFX3DSTATE_SURFACEFORMAT_R8_UNORM), // not used for plane images + static_cast(GFX3DSTATE_SURFACEFORMAT_R8_UNORM), // not used for plane images 0, 1, 1, @@ -300,7 +300,7 @@ const ClSurfaceFormatInfo *VASurface::getExtendedSurfaceFormatInfo(uint32_t form if (formatFourCC == VA_FOURCC_YUY2) { static const ClSurfaceFormatInfo formatInfoYUY2 = {{CL_YUYV_INTEL, CL_UNORM_INT8}, {GMM_RESOURCE_FORMAT::GMM_FORMAT_YUY2, - static_cast(GFX3DSTATE_SURFACEFORMAT_YCRCB_NORMAL), + static_cast(GFX3DSTATE_SURFACEFORMAT_YCRCB_NORMAL), 0, 2, 1, @@ -310,7 +310,7 @@ const ClSurfaceFormatInfo *VASurface::getExtendedSurfaceFormatInfo(uint32_t form if (formatFourCC == VA_FOURCC_Y210) { static const ClSurfaceFormatInfo formatInfoY210 = {{CL_RGBA, CL_UNORM_INT16}, {GMM_RESOURCE_FORMAT::GMM_FORMAT_Y210, - static_cast(GFX3DSTATE_SURFACEFORMAT_R16G16B16A16_UNORM), + static_cast(GFX3DSTATE_SURFACEFORMAT_R16G16B16A16_UNORM), 0, 4, 2, @@ -321,7 +321,7 @@ const ClSurfaceFormatInfo *VASurface::getExtendedSurfaceFormatInfo(uint32_t form if (formatFourCC == VA_FOURCC_ARGB) { static const ClSurfaceFormatInfo formatInfoARGB = {{CL_RGBA, CL_UNORM_INT8}, {GMM_RESOURCE_FORMAT::GMM_FORMAT_R8G8B8A8_UNORM_TYPE, - static_cast(GFX3DSTATE_SURFACEFORMAT_R8G8B8A8_UNORM), + static_cast(GFX3DSTATE_SURFACEFORMAT_R8G8B8A8_UNORM), 0, 4, 1, diff --git a/opencl/source/tracing/tracing_api.cpp b/opencl/source/tracing/tracing_api.cpp index 38d05577d6854..4e5b22ca80980 100644 --- a/opencl/source/tracing/tracing_api.cpp +++ b/opencl/source/tracing/tracing_api.cpp @@ -89,7 +89,7 @@ cl_int CL_API_CALL clCreateTracingHandleINTEL(cl_device_id device, cl_tracing_ca return CL_SUCCESS; } -cl_int CL_API_CALL clSetTracingPointINTEL(cl_tracing_handle handle, cl_function_id fid, cl_bool enable) { +cl_int CL_API_CALL clSetTracingPointINTEL(cl_tracing_handle handle, ClFunctionId fid, cl_bool enable) { if (handle == nullptr) { return CL_INVALID_VALUE; } diff --git a/opencl/source/tracing/tracing_api.h b/opencl/source/tracing/tracing_api.h index 089c0fe38962b..24d94ce5e4e7d 100644 --- a/opencl/source/tracing/tracing_api.h +++ b/opencl/source/tracing/tracing_api.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2020 Intel Corporation + * Copyright (C) 2019-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -38,7 +38,7 @@ cl_int CL_API_CALL clCreateTracingHandleINTEL(cl_device_id device, cl_tracing_ca Thread Safety: no */ -cl_int CL_API_CALL clSetTracingPointINTEL(cl_tracing_handle handle, cl_function_id fid, cl_bool enable); +cl_int CL_API_CALL clSetTracingPointINTEL(cl_tracing_handle handle, ClFunctionId fid, cl_bool enable); /*! Function destroys the tracing handle object and releases all the associated diff --git a/opencl/source/tracing/tracing_handle.h b/opencl/source/tracing/tracing_handle.h index 0d31818aa7e4e..49832fdadacd4 100644 --- a/opencl/source/tracing/tracing_handle.h +++ b/opencl/source/tracing/tracing_handle.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2020 Intel Corporation + * Copyright (C) 2019-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -20,16 +20,16 @@ struct TracingHandle { public: TracingHandle(cl_tracing_callback callback, void *userData) : callback(callback), userData(userData) {} - void call(cl_function_id fid, cl_callback_data *callbackData) { + void call(ClFunctionId fid, cl_callback_data *callbackData) { callback(fid, callbackData, userData); } - void setTracingPoint(cl_function_id fid, bool enable) { + void setTracingPoint(ClFunctionId fid, bool enable) { DEBUG_BREAK_IF(static_cast(fid) >= CL_FUNCTION_COUNT); mask[static_cast(fid)] = enable; } - bool getTracingPoint(cl_function_id fid) const { + bool getTracingPoint(ClFunctionId fid) const { DEBUG_BREAK_IF(static_cast(fid) >= CL_FUNCTION_COUNT); return mask[static_cast(fid)]; } diff --git a/opencl/source/tracing/tracing_notify.h b/opencl/source/tracing/tracing_notify.h index cc4c670c99e95..4af3070b437cf 100644 --- a/opencl/source/tracing/tracing_notify.h +++ b/opencl/source/tracing/tracing_notify.h @@ -52,11 +52,11 @@ inline thread_local bool tracingInProgress = false; currentlyTracedCall = false; \ } -typedef enum _tracing_notify_state_t { +enum TracingNotifyState { TRACING_NOTIFY_STATE_NOTHING_CALLED = 0, TRACING_NOTIFY_STATE_ENTER_CALLED = 1, TRACING_NOTIFY_STATE_EXIT_CALLED = 2, -} tracing_notify_state_t; +}; inline constexpr size_t tracingMaxHandleCount = 16; @@ -158,7 +158,7 @@ class ClBuildProgramTracer { cl_params_clBuildProgram params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClCloneKernelTracer { @@ -221,7 +221,7 @@ class ClCloneKernelTracer { cl_params_clCloneKernel params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClCompileProgramTracer { @@ -298,7 +298,7 @@ class ClCompileProgramTracer { cl_params_clCompileProgram params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClCreateBufferTracer { @@ -367,7 +367,7 @@ class ClCreateBufferTracer { cl_params_clCreateBuffer params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClCreateCommandQueueTracer { @@ -434,7 +434,7 @@ class ClCreateCommandQueueTracer { cl_params_clCreateCommandQueue params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClCreateCommandQueueWithPropertiesTracer { @@ -501,7 +501,7 @@ class ClCreateCommandQueueWithPropertiesTracer { cl_params_clCreateCommandQueueWithProperties params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClCreateContextTracer { @@ -572,7 +572,7 @@ class ClCreateContextTracer { cl_params_clCreateContext params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClCreateContextFromTypeTracer { @@ -641,7 +641,7 @@ class ClCreateContextFromTypeTracer { cl_params_clCreateContextFromType params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClCreateImageTracer { @@ -712,7 +712,7 @@ class ClCreateImageTracer { cl_params_clCreateImage params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClCreateImage2DTracer { @@ -787,7 +787,7 @@ class ClCreateImage2DTracer { cl_params_clCreateImage2D params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClCreateImage3DTracer { @@ -866,7 +866,7 @@ class ClCreateImage3DTracer { cl_params_clCreateImage3D params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClCreateKernelTracer { @@ -931,7 +931,7 @@ class ClCreateKernelTracer { cl_params_clCreateKernel params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClCreateKernelsInProgramTracer { @@ -998,7 +998,7 @@ class ClCreateKernelsInProgramTracer { cl_params_clCreateKernelsInProgram params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClCreateSubDevicesTracer { @@ -1067,7 +1067,7 @@ class ClCreateSubDevicesTracer { cl_params_clCreateSubDevices params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClCreatePipeTracer { @@ -1138,7 +1138,7 @@ class ClCreatePipeTracer { cl_params_clCreatePipe params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClCreateProgramWithBinaryTracer { @@ -1211,7 +1211,7 @@ class ClCreateProgramWithBinaryTracer { cl_params_clCreateProgramWithBinary params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClCreateProgramWithBuiltInKernelsTracer { @@ -1280,7 +1280,7 @@ class ClCreateProgramWithBuiltInKernelsTracer { cl_params_clCreateProgramWithBuiltInKernels params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClCreateProgramWithIlTracer { @@ -1347,7 +1347,7 @@ class ClCreateProgramWithIlTracer { cl_params_clCreateProgramWithIL params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClCreateProgramWithSourceTracer { @@ -1416,7 +1416,7 @@ class ClCreateProgramWithSourceTracer { cl_params_clCreateProgramWithSource params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClCreateSamplerTracer { @@ -1485,7 +1485,7 @@ class ClCreateSamplerTracer { cl_params_clCreateSampler params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClCreateSamplerWithPropertiesTracer { @@ -1550,7 +1550,7 @@ class ClCreateSamplerWithPropertiesTracer { cl_params_clCreateSamplerWithProperties params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClCreateSubBufferTracer { @@ -1619,7 +1619,7 @@ class ClCreateSubBufferTracer { cl_params_clCreateSubBuffer params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClCreateUserEventTracer { @@ -1682,7 +1682,7 @@ class ClCreateUserEventTracer { cl_params_clCreateUserEvent params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueBarrierTracer { @@ -1743,7 +1743,7 @@ class ClEnqueueBarrierTracer { cl_params_clEnqueueBarrier params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueBarrierWithWaitListTracer { @@ -1810,7 +1810,7 @@ class ClEnqueueBarrierWithWaitListTracer { cl_params_clEnqueueBarrierWithWaitList params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueCopyBufferTracer { @@ -1887,7 +1887,7 @@ class ClEnqueueCopyBufferTracer { cl_params_clEnqueueCopyBuffer params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueCopyBufferRectTracer { @@ -1972,7 +1972,7 @@ class ClEnqueueCopyBufferRectTracer { cl_params_clEnqueueCopyBufferRect params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueCopyBufferToImageTracer { @@ -2049,7 +2049,7 @@ class ClEnqueueCopyBufferToImageTracer { cl_params_clEnqueueCopyBufferToImage params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueCopyImageTracer { @@ -2126,7 +2126,7 @@ class ClEnqueueCopyImageTracer { cl_params_clEnqueueCopyImage params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueCopyImageToBufferTracer { @@ -2203,7 +2203,7 @@ class ClEnqueueCopyImageToBufferTracer { cl_params_clEnqueueCopyImageToBuffer params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueFillBufferTracer { @@ -2280,7 +2280,7 @@ class ClEnqueueFillBufferTracer { cl_params_clEnqueueFillBuffer params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueFillImageTracer { @@ -2355,7 +2355,7 @@ class ClEnqueueFillImageTracer { cl_params_clEnqueueFillImage params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueMapBufferTracer { @@ -2434,7 +2434,7 @@ class ClEnqueueMapBufferTracer { cl_params_clEnqueueMapBuffer params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueMapImageTracer { @@ -2517,7 +2517,7 @@ class ClEnqueueMapImageTracer { cl_params_clEnqueueMapImage params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueMarkerTracer { @@ -2580,7 +2580,7 @@ class ClEnqueueMarkerTracer { cl_params_clEnqueueMarker params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueMarkerWithWaitListTracer { @@ -2647,7 +2647,7 @@ class ClEnqueueMarkerWithWaitListTracer { cl_params_clEnqueueMarkerWithWaitList params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueMigrateMemObjectsTracer { @@ -2720,7 +2720,7 @@ class ClEnqueueMigrateMemObjectsTracer { cl_params_clEnqueueMigrateMemObjects params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueNdRangeKernelTracer { @@ -2797,7 +2797,7 @@ class ClEnqueueNdRangeKernelTracer { cl_params_clEnqueueNDRangeKernel params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueNativeKernelTracer { @@ -2876,7 +2876,7 @@ class ClEnqueueNativeKernelTracer { cl_params_clEnqueueNativeKernel params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueReadBufferTracer { @@ -2953,7 +2953,7 @@ class ClEnqueueReadBufferTracer { cl_params_clEnqueueReadBuffer params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueReadBufferRectTracer { @@ -3040,7 +3040,7 @@ class ClEnqueueReadBufferRectTracer { cl_params_clEnqueueReadBufferRect params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueReadImageTracer { @@ -3121,7 +3121,7 @@ class ClEnqueueReadImageTracer { cl_params_clEnqueueReadImage params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueSvmFreeTracer { @@ -3196,7 +3196,7 @@ class ClEnqueueSvmFreeTracer { cl_params_clEnqueueSVMFree params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueSvmMapTracer { @@ -3271,7 +3271,7 @@ class ClEnqueueSvmMapTracer { cl_params_clEnqueueSVMMap params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueSvmMemFillTracer { @@ -3346,7 +3346,7 @@ class ClEnqueueSvmMemFillTracer { cl_params_clEnqueueSVMMemFill params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueSvmMemcpyTracer { @@ -3421,7 +3421,7 @@ class ClEnqueueSvmMemcpyTracer { cl_params_clEnqueueSVMMemcpy params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueSvmMigrateMemTracer { @@ -3496,7 +3496,7 @@ class ClEnqueueSvmMigrateMemTracer { cl_params_clEnqueueSVMMigrateMem params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueSvmUnmapTracer { @@ -3565,7 +3565,7 @@ class ClEnqueueSvmUnmapTracer { cl_params_clEnqueueSVMUnmap params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueTaskTracer { @@ -3634,7 +3634,7 @@ class ClEnqueueTaskTracer { cl_params_clEnqueueTask params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueUnmapMemObjectTracer { @@ -3705,7 +3705,7 @@ class ClEnqueueUnmapMemObjectTracer { cl_params_clEnqueueUnmapMemObject params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueWaitForEventsTracer { @@ -3770,7 +3770,7 @@ class ClEnqueueWaitForEventsTracer { cl_params_clEnqueueWaitForEvents params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueWriteBufferTracer { @@ -3847,7 +3847,7 @@ class ClEnqueueWriteBufferTracer { cl_params_clEnqueueWriteBuffer params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueWriteBufferRectTracer { @@ -3934,7 +3934,7 @@ class ClEnqueueWriteBufferRectTracer { cl_params_clEnqueueWriteBufferRect params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueWriteImageTracer { @@ -4015,7 +4015,7 @@ class ClEnqueueWriteImageTracer { cl_params_clEnqueueWriteImage params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClFinishTracer { @@ -4076,7 +4076,7 @@ class ClFinishTracer { cl_params_clFinish params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClFlushTracer { @@ -4137,7 +4137,7 @@ class ClFlushTracer { cl_params_clFlush params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClGetCommandQueueInfoTracer { @@ -4206,7 +4206,7 @@ class ClGetCommandQueueInfoTracer { cl_params_clGetCommandQueueInfo params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClGetContextInfoTracer { @@ -4275,7 +4275,7 @@ class ClGetContextInfoTracer { cl_params_clGetContextInfo params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClGetDeviceAndHostTimerTracer { @@ -4340,7 +4340,7 @@ class ClGetDeviceAndHostTimerTracer { cl_params_clGetDeviceAndHostTimer params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClGetDeviceIDsTracer { @@ -4409,7 +4409,7 @@ class ClGetDeviceIDsTracer { cl_params_clGetDeviceIDs params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClGetDeviceInfoTracer { @@ -4478,7 +4478,7 @@ class ClGetDeviceInfoTracer { cl_params_clGetDeviceInfo params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClGetEventInfoTracer { @@ -4547,7 +4547,7 @@ class ClGetEventInfoTracer { cl_params_clGetEventInfo params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClGetEventProfilingInfoTracer { @@ -4616,7 +4616,7 @@ class ClGetEventProfilingInfoTracer { cl_params_clGetEventProfilingInfo params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClGetExtensionFunctionAddressTracer { @@ -4677,7 +4677,7 @@ class ClGetExtensionFunctionAddressTracer { cl_params_clGetExtensionFunctionAddress params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClGetExtensionFunctionAddressForPlatformTracer { @@ -4740,7 +4740,7 @@ class ClGetExtensionFunctionAddressForPlatformTracer { cl_params_clGetExtensionFunctionAddressForPlatform params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClGetHostTimerTracer { @@ -4803,7 +4803,7 @@ class ClGetHostTimerTracer { cl_params_clGetHostTimer params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClGetImageInfoTracer { @@ -4872,7 +4872,7 @@ class ClGetImageInfoTracer { cl_params_clGetImageInfo params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClGetKernelArgInfoTracer { @@ -4943,7 +4943,7 @@ class ClGetKernelArgInfoTracer { cl_params_clGetKernelArgInfo params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClGetKernelInfoTracer { @@ -5012,7 +5012,7 @@ class ClGetKernelInfoTracer { cl_params_clGetKernelInfo params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClGetKernelSubGroupInfoTracer { @@ -5087,7 +5087,7 @@ class ClGetKernelSubGroupInfoTracer { cl_params_clGetKernelSubGroupInfo params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClGetKernelWorkGroupInfoTracer { @@ -5158,7 +5158,7 @@ class ClGetKernelWorkGroupInfoTracer { cl_params_clGetKernelWorkGroupInfo params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClGetMemObjectInfoTracer { @@ -5227,7 +5227,7 @@ class ClGetMemObjectInfoTracer { cl_params_clGetMemObjectInfo params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClGetPipeInfoTracer { @@ -5296,7 +5296,7 @@ class ClGetPipeInfoTracer { cl_params_clGetPipeInfo params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClGetPlatformIDsTracer { @@ -5361,7 +5361,7 @@ class ClGetPlatformIDsTracer { cl_params_clGetPlatformIDs params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClGetPlatformInfoTracer { @@ -5430,7 +5430,7 @@ class ClGetPlatformInfoTracer { cl_params_clGetPlatformInfo params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClGetProgramBuildInfoTracer { @@ -5501,7 +5501,7 @@ class ClGetProgramBuildInfoTracer { cl_params_clGetProgramBuildInfo params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClGetProgramInfoTracer { @@ -5570,7 +5570,7 @@ class ClGetProgramInfoTracer { cl_params_clGetProgramInfo params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClGetSamplerInfoTracer { @@ -5639,7 +5639,7 @@ class ClGetSamplerInfoTracer { cl_params_clGetSamplerInfo params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClGetSupportedImageFormatsTracer { @@ -5710,7 +5710,7 @@ class ClGetSupportedImageFormatsTracer { cl_params_clGetSupportedImageFormats params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClLinkProgramTracer { @@ -5787,7 +5787,7 @@ class ClLinkProgramTracer { cl_params_clLinkProgram params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClReleaseCommandQueueTracer { @@ -5848,7 +5848,7 @@ class ClReleaseCommandQueueTracer { cl_params_clReleaseCommandQueue params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClReleaseContextTracer { @@ -5909,7 +5909,7 @@ class ClReleaseContextTracer { cl_params_clReleaseContext params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClReleaseDeviceTracer { @@ -5970,7 +5970,7 @@ class ClReleaseDeviceTracer { cl_params_clReleaseDevice params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClReleaseEventTracer { @@ -6031,7 +6031,7 @@ class ClReleaseEventTracer { cl_params_clReleaseEvent params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClReleaseKernelTracer { @@ -6092,7 +6092,7 @@ class ClReleaseKernelTracer { cl_params_clReleaseKernel params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClReleaseMemObjectTracer { @@ -6153,7 +6153,7 @@ class ClReleaseMemObjectTracer { cl_params_clReleaseMemObject params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClReleaseProgramTracer { @@ -6214,7 +6214,7 @@ class ClReleaseProgramTracer { cl_params_clReleaseProgram params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClReleaseSamplerTracer { @@ -6275,7 +6275,7 @@ class ClReleaseSamplerTracer { cl_params_clReleaseSampler params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClRetainCommandQueueTracer { @@ -6336,7 +6336,7 @@ class ClRetainCommandQueueTracer { cl_params_clRetainCommandQueue params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClRetainContextTracer { @@ -6397,7 +6397,7 @@ class ClRetainContextTracer { cl_params_clRetainContext params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClRetainDeviceTracer { @@ -6458,7 +6458,7 @@ class ClRetainDeviceTracer { cl_params_clRetainDevice params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClRetainEventTracer { @@ -6519,7 +6519,7 @@ class ClRetainEventTracer { cl_params_clRetainEvent params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClRetainKernelTracer { @@ -6580,7 +6580,7 @@ class ClRetainKernelTracer { cl_params_clRetainKernel params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClRetainMemObjectTracer { @@ -6641,7 +6641,7 @@ class ClRetainMemObjectTracer { cl_params_clRetainMemObject params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClRetainProgramTracer { @@ -6702,7 +6702,7 @@ class ClRetainProgramTracer { cl_params_clRetainProgram params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClRetainSamplerTracer { @@ -6763,7 +6763,7 @@ class ClRetainSamplerTracer { cl_params_clRetainSampler params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClSvmAllocTracer { @@ -6830,7 +6830,7 @@ class ClSvmAllocTracer { cl_params_clSVMAlloc params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClSvmFreeTracer { @@ -6893,7 +6893,7 @@ class ClSvmFreeTracer { cl_params_clSVMFree params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClSetCommandQueuePropertyTracer { @@ -6960,7 +6960,7 @@ class ClSetCommandQueuePropertyTracer { cl_params_clSetCommandQueueProperty params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClSetDefaultDeviceCommandQueueTracer { @@ -7025,7 +7025,7 @@ class ClSetDefaultDeviceCommandQueueTracer { cl_params_clSetDefaultDeviceCommandQueue params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClSetEventCallbackTracer { @@ -7092,7 +7092,7 @@ class ClSetEventCallbackTracer { cl_params_clSetEventCallback params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClSetKernelArgTracer { @@ -7159,7 +7159,7 @@ class ClSetKernelArgTracer { cl_params_clSetKernelArg params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClSetKernelArgSvmPointerTracer { @@ -7224,7 +7224,7 @@ class ClSetKernelArgSvmPointerTracer { cl_params_clSetKernelArgSVMPointer params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClSetKernelExecInfoTracer { @@ -7291,7 +7291,7 @@ class ClSetKernelExecInfoTracer { cl_params_clSetKernelExecInfo params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClSetMemObjectDestructorCallbackTracer { @@ -7356,7 +7356,7 @@ class ClSetMemObjectDestructorCallbackTracer { cl_params_clSetMemObjectDestructorCallback params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClSetUserEventStatusTracer { @@ -7419,7 +7419,7 @@ class ClSetUserEventStatusTracer { cl_params_clSetUserEventStatus params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClUnloadCompilerTracer { @@ -7477,7 +7477,7 @@ class ClUnloadCompilerTracer { private: cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClUnloadPlatformCompilerTracer { @@ -7538,7 +7538,7 @@ class ClUnloadPlatformCompilerTracer { cl_params_clUnloadPlatformCompiler params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClWaitForEventsTracer { @@ -7601,7 +7601,7 @@ class ClWaitForEventsTracer { cl_params_clWaitForEvents params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClCreateFromGlBufferTracer { @@ -7668,7 +7668,7 @@ class ClCreateFromGlBufferTracer { cl_params_clCreateFromGLBuffer params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClCreateFromGlRenderbufferTracer { @@ -7735,7 +7735,7 @@ class ClCreateFromGlRenderbufferTracer { cl_params_clCreateFromGLRenderbuffer params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClCreateFromGlTextureTracer { @@ -7806,7 +7806,7 @@ class ClCreateFromGlTextureTracer { cl_params_clCreateFromGLTexture params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClCreateFromGlTexture2DTracer { @@ -7877,7 +7877,7 @@ class ClCreateFromGlTexture2DTracer { cl_params_clCreateFromGLTexture2D params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClCreateFromGlTexture3DTracer { @@ -7948,7 +7948,7 @@ class ClCreateFromGlTexture3DTracer { cl_params_clCreateFromGLTexture3D params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueAcquireGlObjectsTracer { @@ -8019,7 +8019,7 @@ class ClEnqueueAcquireGlObjectsTracer { cl_params_clEnqueueAcquireGLObjects params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClEnqueueReleaseGlObjectsTracer { @@ -8090,7 +8090,7 @@ class ClEnqueueReleaseGlObjectsTracer { cl_params_clEnqueueReleaseGLObjects params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClGetGlObjectInfoTracer { @@ -8155,7 +8155,7 @@ class ClGetGlObjectInfoTracer { cl_params_clGetGLObjectInfo params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; class ClGetGlTextureInfoTracer { @@ -8224,7 +8224,7 @@ class ClGetGlTextureInfoTracer { cl_params_clGetGLTextureInfo params{}; cl_callback_data data{}; uint64_t correlationData[tracingMaxHandleCount]; - tracing_notify_state_t state = TRACING_NOTIFY_STATE_NOTHING_CALLED; + TracingNotifyState state = TRACING_NOTIFY_STATE_NOTHING_CALLED; }; } // namespace HostSideTracing diff --git a/opencl/source/tracing/tracing_types.h b/opencl/source/tracing/tracing_types.h index 13962028f6be7..1e41b4a68d2af 100644 --- a/opencl/source/tracing/tracing_types.h +++ b/opencl/source/tracing/tracing_types.h @@ -14,10 +14,10 @@ struct _cl_tracing_handle; typedef _cl_tracing_handle *cl_tracing_handle; //! Enumeration of callback call sites -typedef enum _cl_callback_site { +enum ClCallbackSite { CL_CALLBACK_SITE_ENTER = 0, //!< Before the function CL_CALLBACK_SITE_EXIT = 1 //!< After the function -} cl_callback_site; +}; /*! \brief Callback data structure @@ -32,7 +32,7 @@ typedef enum _cl_callback_site { Return value will be available only within on-exit callback */ typedef struct _cl_callback_data { - cl_callback_site site; //!< Call site, can be ENTER or EXIT + ClCallbackSite site; //!< Call site, can be ENTER or EXIT cl_uint correlationId; //!< Correlation identifier, the same for ENTER //!< and EXIT callbacks cl_ulong *correlationData; //!< Pointer to correlation data repository, @@ -45,7 +45,7 @@ typedef struct _cl_callback_data { } cl_callback_data; //! Enumeration of supported functions for tracing -typedef enum _cl_function_id { +enum ClFunctionId { CL_FUNCTION_clBuildProgram = 0, CL_FUNCTION_clCloneKernel = 1, CL_FUNCTION_clCompileProgram = 2, @@ -165,7 +165,7 @@ typedef enum _cl_function_id { CL_FUNCTION_clUnloadPlatformCompiler = 116, CL_FUNCTION_clWaitForEvents = 117, CL_FUNCTION_COUNT = 118, -} cl_function_id; +}; /*! User-defined tracing callback prototype @@ -177,7 +177,7 @@ typedef enum _cl_function_id { Thread Safety: must be guaranteed by customer */ -typedef void (*cl_tracing_callback)(cl_function_id fid, cl_callback_data *callbackData, void *userData); +typedef void (*cl_tracing_callback)(ClFunctionId fid, cl_callback_data *callbackData, void *userData); typedef struct _cl_params_clBuildProgram { cl_program *program; diff --git a/opencl/test/black_box_test/hello_world_opencl_tracing.cpp b/opencl/test/black_box_test/hello_world_opencl_tracing.cpp index 2480be6903a46..b6346fdce07c5 100644 --- a/opencl/test/black_box_test/hello_world_opencl_tracing.cpp +++ b/opencl/test/black_box_test/hello_world_opencl_tracing.cpp @@ -29,13 +29,13 @@ std::stringstream callbackOutput{}; std::abort(); \ } -auto callback = [](cl_function_id fid, +auto callback = [](ClFunctionId fid, cl_callback_data *callbackData, void *userData) { callbackOutput << "Function " << callbackData->functionName << " is called (" << (callbackData->site == CL_CALLBACK_SITE_ENTER ? "enter" : "exit") << ")" << std::endl; }; -auto contextNestedCallback = [](cl_function_id fid, +auto contextNestedCallback = [](ClFunctionId fid, cl_callback_data *callbackData, void *userData) { static int numCalled = 0; diff --git a/opencl/test/unit_test/api/cl_intel_tracing_tests.inl b/opencl/test/unit_test/api/cl_intel_tracing_tests.inl index 151b37999bed3..28db49701a795 100644 --- a/opencl/test/unit_test/api/cl_intel_tracing_tests.inl +++ b/opencl/test/unit_test/api/cl_intel_tracing_tests.inl @@ -27,13 +27,13 @@ struct IntelTracingTest : public ApiTests { } protected: - static void callback(cl_function_id fid, cl_callback_data *callbackData, void *userData) { + static void callback(ClFunctionId fid, cl_callback_data *callbackData, void *userData) { ASSERT_NE(nullptr, userData); IntelTracingTest *base = (IntelTracingTest *)userData; base->vcallback(fid, callbackData, nullptr); } - virtual void vcallback(cl_function_id fid, cl_callback_data *callbackData, void *userData) {} + virtual void vcallback(ClFunctionId fid, cl_callback_data *callbackData, void *userData) {} protected: cl_tracing_handle handle = nullptr; @@ -230,7 +230,7 @@ struct IntelAllTracingTest : public IntelTracingTest { ASSERT_EQ(CL_SUCCESS, status); for (uint32_t i = 0; i < CL_FUNCTION_COUNT; ++i) { - status = clSetTracingPointINTEL(handle, static_cast(i), CL_TRUE); + status = clSetTracingPointINTEL(handle, static_cast(i), CL_TRUE); ASSERT_EQ(CL_SUCCESS, status); } @@ -249,7 +249,7 @@ struct IntelAllTracingTest : public IntelTracingTest { } protected: - void vcallback(cl_function_id fid, cl_callback_data *callbackData, void *userData) override { + void vcallback(ClFunctionId fid, cl_callback_data *callbackData, void *userData) override { if (fid == functionId) { if (callbackData->site == CL_CALLBACK_SITE_ENTER) { ++enterCount; @@ -707,7 +707,7 @@ struct IntelAllTracingTest : public IntelTracingTest { protected: uint16_t enterCount = 0; uint16_t exitCount = 0; - cl_function_id functionId = CL_FUNCTION_COUNT; + ClFunctionId functionId = CL_FUNCTION_COUNT; }; TEST_F(IntelAllTracingTest, GivenValidFunctionWhenTracingThenTracingIsPerformed) { @@ -718,7 +718,7 @@ TEST_F(IntelAllTracingTest, GivenValidFunctionWhenTracingThenTracingIsPerformed) TEST_F(IntelAllTracingTest, GivenNoFunctionsWhenTracingThenTracingIsNotPerformed) { for (uint32_t i = 0; i < CL_FUNCTION_COUNT; ++i) { - status = clSetTracingPointINTEL(handle, static_cast(i), CL_FALSE); + status = clSetTracingPointINTEL(handle, static_cast(i), CL_FALSE); EXPECT_EQ(CL_SUCCESS, status); } @@ -743,7 +743,7 @@ struct IntelAllTracingWithMaxHandlesTest : public IntelAllTracingTest { for (size_t i = 0; i < HostSideTracing::tracingMaxHandleCount; ++i) { for (uint32_t j = 0; j < CL_FUNCTION_COUNT; ++j) { - status = clSetTracingPointINTEL(handleList[i], static_cast(j), CL_TRUE); + status = clSetTracingPointINTEL(handleList[i], static_cast(j), CL_TRUE); ASSERT_EQ(CL_SUCCESS, status); } } @@ -786,7 +786,7 @@ struct IntelClGetDeviceInfoTracingCollectTest : public IntelAllTracingTest { status = clGetDeviceInfo(device, CL_DEVICE_VENDOR, 0, nullptr, ¶mValueSizeRet); } - void vcallback(cl_function_id fid, cl_callback_data *callbackData, void *userData) override { + void vcallback(ClFunctionId fid, cl_callback_data *callbackData, void *userData) override { EXPECT_EQ(CL_FUNCTION_clGetDeviceInfo, fid); EXPECT_NE(nullptr, callbackData); @@ -853,7 +853,7 @@ struct IntelClGetDeviceInfoTracingChangeParamsTest : public IntelAllTracingTest status = clGetDeviceInfo(device, CL_DEVICE_VENDOR, 0, nullptr, ¶mValueSizeRet); } - void vcallback(cl_function_id fid, cl_callback_data *callbackData, void *userData) override { + void vcallback(ClFunctionId fid, cl_callback_data *callbackData, void *userData) override { if (callbackData->site == CL_CALLBACK_SITE_ENTER) { cl_params_clGetDeviceInfo *params = (cl_params_clGetDeviceInfo *)callbackData->functionParams; *params->paramValueSize = paramValueSize; @@ -886,7 +886,7 @@ struct IntelClGetDeviceInfoTracingChangeRetValTest : public IntelAllTracingTest status = clGetDeviceInfo(device, CL_DEVICE_VENDOR, 0, nullptr, ¶mValueSizeRet); } - void vcallback(cl_function_id fid, cl_callback_data *callbackData, void *userData) override { + void vcallback(ClFunctionId fid, cl_callback_data *callbackData, void *userData) override { if (callbackData->site == CL_CALLBACK_SITE_EXIT) { cl_int *retVal = reinterpret_cast(callbackData->functionReturnValue); *retVal = CL_INVALID_VALUE; @@ -976,7 +976,7 @@ struct IntelClCreateContextFromTypeTracingTest : public IntelTracingTest, Platfo context = clCreateContextFromType(nullptr, CL_DEVICE_TYPE_GPU, nullptr, nullptr, nullptr); } - void vcallback(cl_function_id fid, cl_callback_data *callbackData, void *userData) override { + void vcallback(ClFunctionId fid, cl_callback_data *callbackData, void *userData) override { ASSERT_EQ(CL_FUNCTION_clCreateContextFromType, fid); if (callbackData->site == CL_CALLBACK_SITE_ENTER) { ++enterCount; @@ -1039,7 +1039,7 @@ struct IntelClLinkProgramTracingTest : public IntelTracingTest, PlatformFixture ASSERT_EQ(CL_SUCCESS, retVal); } - void vcallback(cl_function_id fid, cl_callback_data *callbackData, void *userData) override { + void vcallback(ClFunctionId fid, cl_callback_data *callbackData, void *userData) override { ASSERT_EQ(CL_FUNCTION_clLinkProgram, fid); if (callbackData->site == CL_CALLBACK_SITE_ENTER) { ++enterCount; @@ -1103,7 +1103,7 @@ struct IntelClCloneKernelTracingTest : public IntelTracingTest, PlatformFixture ASSERT_EQ(CL_SUCCESS, retVal); } - void vcallback(cl_function_id fid, cl_callback_data *callbackData, void *userData) override { + void vcallback(ClFunctionId fid, cl_callback_data *callbackData, void *userData) override { ASSERT_EQ(CL_FUNCTION_clCloneKernel, fid); if (callbackData->site == CL_CALLBACK_SITE_ENTER) { ++enterCount; @@ -1162,7 +1162,7 @@ struct IntelClCreateSubDevicesTracingTest : public IntelTracingTest { ASSERT_EQ(CL_SUCCESS, retVal); } - void vcallback(cl_function_id fid, cl_callback_data *callbackData, void *userData) override { + void vcallback(ClFunctionId fid, cl_callback_data *callbackData, void *userData) override { ASSERT_EQ(CL_FUNCTION_clCreateSubDevices, fid); if (callbackData->site == CL_CALLBACK_SITE_ENTER) { ++enterCount; diff --git a/opencl/test/unit_test/api/gl/cl_gl_intel_tracing_tests.cpp b/opencl/test/unit_test/api/gl/cl_gl_intel_tracing_tests.cpp index 5c08c703c217b..0adbf644ae12d 100644 --- a/opencl/test/unit_test/api/gl/cl_gl_intel_tracing_tests.cpp +++ b/opencl/test/unit_test/api/gl/cl_gl_intel_tracing_tests.cpp @@ -25,7 +25,7 @@ struct IntelGlTracingTest : public ApiTests { ASSERT_EQ(CL_SUCCESS, status); for (uint32_t i = 0; i < CL_FUNCTION_COUNT; ++i) { - status = clSetTracingPointINTEL(handle, static_cast(i), CL_TRUE); + status = clSetTracingPointINTEL(handle, static_cast(i), CL_TRUE); ASSERT_EQ(CL_SUCCESS, status); } @@ -44,13 +44,13 @@ struct IntelGlTracingTest : public ApiTests { } protected: - static void callback(cl_function_id fid, cl_callback_data *callbackData, void *userData) { + static void callback(ClFunctionId fid, cl_callback_data *callbackData, void *userData) { ASSERT_NE(nullptr, userData); IntelGlTracingTest *base = reinterpret_cast(userData); base->vcallback(fid, callbackData, nullptr); } - virtual void vcallback(cl_function_id fid, cl_callback_data *callbackData, void *userData) { + virtual void vcallback(ClFunctionId fid, cl_callback_data *callbackData, void *userData) { if (fid == functionId) { if (callbackData->site == CL_CALLBACK_SITE_ENTER) { ++enterCount; @@ -108,7 +108,7 @@ struct IntelGlTracingTest : public ApiTests { uint16_t enterCount = 0; uint16_t exitCount = 0; - cl_function_id functionId = CL_FUNCTION_COUNT; + ClFunctionId functionId = CL_FUNCTION_COUNT; }; TEST_F(IntelGlTracingTest, GivenAllFunctionsWhenSettingTracingPointThenTracingOnAllFunctionsIsPerformed) { @@ -119,7 +119,7 @@ TEST_F(IntelGlTracingTest, GivenAllFunctionsWhenSettingTracingPointThenTracingOn TEST_F(IntelGlTracingTest, GivenNoFunctionsWhenSettingTracingPointThenNoTracingIsPerformed) { for (uint32_t i = 0; i < CL_FUNCTION_COUNT; ++i) { - status = clSetTracingPointINTEL(handle, static_cast(i), CL_FALSE); + status = clSetTracingPointINTEL(handle, static_cast(i), CL_FALSE); EXPECT_EQ(CL_SUCCESS, status); } 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 1fa4a51000697..af0c926fd7b43 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 @@ -961,7 +961,7 @@ HWTEST_F(EnqueueAuxKernelTests, givenMultipleArgsWhenAuxTranslationIsRequiredThe mockKernel.mockKernel->setArgBuffer(2, sizeof(cl_mem *), &clMem2); // stateless on compressed BUFFER - insert mockKernel.mockKernel->setArgBuffer(3, sizeof(cl_mem *), &clMem3); // stateful on compressed BUFFER - dont insert mockKernel.mockKernel->setArgBuffer(4, sizeof(cl_mem *), nullptr); // nullptr - dont insert - mockKernel.mockKernel->kernelArguments.at(5).type = Kernel::kernelArgType::IMAGE_OBJ; // non-buffer arg - dont insert + mockKernel.mockKernel->kernelArguments.at(5).type = Kernel::KernelArgType::IMAGE_OBJ; // non-buffer arg - dont insert cmdQ.enqueueKernel(mockKernel.mockKernel, 1, nullptr, gws, nullptr, 0, nullptr, nullptr); EXPECT_EQ(2u, cmdQ.dispatchAuxTranslationInputs.size()); diff --git a/opencl/test/unit_test/gmm_helper/gmm_helper_tests_ocl.cpp b/opencl/test/unit_test/gmm_helper/gmm_helper_tests_ocl.cpp index d24dee659b8fc..62489630a00b0 100644 --- a/opencl/test/unit_test/gmm_helper/gmm_helper_tests_ocl.cpp +++ b/opencl/test/unit_test/gmm_helper/gmm_helper_tests_ocl.cpp @@ -107,7 +107,7 @@ TEST_F(GmmTests, given2DimageFromBufferParametersWhenGmmResourceIsCreatedThenItH imgDesc.imageRowPitch = 5312; imgDesc.fromParent = true; - SurfaceFormatInfo surfaceFormat = {GMM_FORMAT_R32G32B32A32_FLOAT_TYPE, (GFX3DSTATE_SURFACEFORMAT)0, 0, 4, 4, 16}; + SurfaceFormatInfo surfaceFormat = {GMM_FORMAT_R32G32B32A32_FLOAT_TYPE, (SurfaceFormat)0, 0, 4, 4, 16}; auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, &surfaceFormat); auto queryGmm = MockGmm::queryImgParams(getGmmHelper(), imgInfo, false); diff --git a/opencl/test/unit_test/kernel/kernel_tests.cpp b/opencl/test/unit_test/kernel/kernel_tests.cpp index 39a05d99d28dc..a13d7a1fd9c42 100644 --- a/opencl/test/unit_test/kernel/kernel_tests.cpp +++ b/opencl/test/unit_test/kernel/kernel_tests.cpp @@ -1365,7 +1365,7 @@ HWTEST_F(KernelResidencyTest, givenSharedUnifiedMemoryAndNotRequiredMemSyncWhenM unifiedMemoryAllocation, 4096u, gpuAllocation, - Kernel::kernelArgType::SVM_ALLOC_OBJ}; + Kernel::KernelArgType::SVM_ALLOC_OBJ}; mockKernel.mockKernel->setUnifiedMemorySyncRequirement(false); mockKernel.mockKernel->makeResident(commandStreamReceiver); @@ -1402,7 +1402,7 @@ HWTEST_F(KernelResidencyTest, givenSvmArgWhenKernelDoesNotRequireUnifiedMemorySy unifiedMemoryAllocation, 4096u, gpuAllocation, - Kernel::kernelArgType::SVM_ALLOC_OBJ}; + Kernel::KernelArgType::SVM_ALLOC_OBJ}; mockKernel.mockKernel->setUnifiedMemorySyncRequirement(false); std::vector residencySurfaces; mockKernel.mockKernel->getResidency(residencySurfaces); @@ -1431,7 +1431,7 @@ HWTEST_F(KernelResidencyTest, givenSvmArgWhenKernelRequireUnifiedMemorySyncThenS unifiedMemoryAllocation, 4096u, gpuAllocation, - Kernel::kernelArgType::SVM_ALLOC_OBJ}; + Kernel::KernelArgType::SVM_ALLOC_OBJ}; mockKernel.mockKernel->setUnifiedMemorySyncRequirement(true); std::vector residencySurfaces; mockKernel.mockKernel->getResidency(residencySurfaces); @@ -1462,7 +1462,7 @@ HWTEST_F(KernelResidencyTest, givenSharedUnifiedMemoryRequiredMemSyncWhenMakeRes unifiedMemoryAllocation, 4096u, gpuAllocation, - Kernel::kernelArgType::SVM_ALLOC_OBJ}; + Kernel::KernelArgType::SVM_ALLOC_OBJ}; mockKernel.mockKernel->setUnifiedMemorySyncRequirement(true); mockKernel.mockKernel->makeResident(commandStreamReceiver); @@ -2070,7 +2070,7 @@ HWTEST_F(KernelResidencyTest, givenSimpleKernelWhenExecEnvDoesNotHavePageFaultMa Kernel::SimpleKernelArgInfo kernelArgInfo; kernelArgInfo.object = unifiedMemoryGraphicsAllocation->gpuAllocations.getDefaultGraphicsAllocation(); - kernelArgInfo.type = Kernel::kernelArgType::SVM_ALLOC_OBJ; + kernelArgInfo.type = Kernel::KernelArgType::SVM_ALLOC_OBJ; std::vector kernelArguments; kernelArguments.resize(1); @@ -2096,7 +2096,7 @@ HWTEST_F(KernelResidencyTest, givenSimpleKernelWhenIsUnifiedMemorySyncRequiredIs Kernel::SimpleKernelArgInfo kernelArgInfo; kernelArgInfo.object = unifiedMemoryGraphicsAllocation->gpuAllocations.getDefaultGraphicsAllocation(); - kernelArgInfo.type = Kernel::kernelArgType::SVM_ALLOC_OBJ; + kernelArgInfo.type = Kernel::KernelArgType::SVM_ALLOC_OBJ; std::vector kernelArguments; kernelArguments.resize(1); 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 439c4972cdde5..f06716df5f6ff 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 @@ -374,7 +374,7 @@ HWTEST_F(ImageSetArgTest, WhenSettingKernelArgThenPropertiesAreSetCorrectly) { EXPECT_EQ(srcImage->getImageDesc().image_depth, surfaceState->getRenderTargetViewExtent()); EXPECT_EQ(rPitch, surfaceState->getSurfacePitch()); EXPECT_EQ(0u, surfaceState->getSurfaceQpitch() % 4); - EXPECT_EQ(srcImage->getSurfaceFormatInfo().surfaceFormat.genxSurfaceFormat, (GFX3DSTATE_SURFACEFORMAT)surfaceState->getSurfaceFormat()); + EXPECT_EQ(srcImage->getSurfaceFormatInfo().surfaceFormat.genxSurfaceFormat, (SurfaceFormat)surfaceState->getSurfaceFormat()); EXPECT_EQ(RENDER_SURFACE_STATE::SURFACE_TYPE_SURFTYPE_3D, surfaceState->getSurfaceType()); EXPECT_EQ(expectedChannelRed, surfaceState->getShaderChannelSelectRed()); EXPECT_EQ(expectedChannelGreen, surfaceState->getShaderChannelSelectGreen()); @@ -446,9 +446,9 @@ HWTEST_F(ImageSetArgTest, Given2dArrayWhenSettingKernelArgThenPropertiesAreSetCo EXPECT_EQ(image2Darray->getImageDesc().image_array_size, surfaceState->getRenderTargetViewExtent()); EXPECT_EQ(rPitch, surfaceState->getSurfacePitch()); EXPECT_EQ(0u, surfaceState->getSurfaceQpitch() % 4); - EXPECT_EQ(image2Darray->getSurfaceFormatInfo().surfaceFormat.genxSurfaceFormat, (GFX3DSTATE_SURFACEFORMAT)surfaceState->getSurfaceFormat()); + EXPECT_EQ(image2Darray->getSurfaceFormatInfo().surfaceFormat.genxSurfaceFormat, (SurfaceFormat)surfaceState->getSurfaceFormat()); EXPECT_EQ(RENDER_SURFACE_STATE::SURFACE_TYPE_SURFTYPE_2D, surfaceState->getSurfaceType()); - EXPECT_TRUE((GFX3DSTATE_SURFACEFORMAT)surfaceState->getSurfaceArray()); + EXPECT_TRUE((SurfaceFormat)surfaceState->getSurfaceArray()); EXPECT_EQ(expectedChannelRed, surfaceState->getShaderChannelSelectRed()); EXPECT_EQ(expectedChannelGreen, surfaceState->getShaderChannelSelectGreen()); @@ -494,9 +494,9 @@ HWTEST_F(ImageSetArgTest, Given1dArrayWhenSettingKernelArgThenPropertiesAreSetCo EXPECT_EQ(0u, surfaceState->getSurfaceQpitch() % 4); EXPECT_EQ(graphicsAllocation->getDefaultGmm()->queryQPitch(GMM_RESOURCE_TYPE::RESOURCE_1D), surfaceState->getSurfaceQpitch()); - EXPECT_EQ(image1Darray->getSurfaceFormatInfo().surfaceFormat.genxSurfaceFormat, (GFX3DSTATE_SURFACEFORMAT)surfaceState->getSurfaceFormat()); + EXPECT_EQ(image1Darray->getSurfaceFormatInfo().surfaceFormat.genxSurfaceFormat, (SurfaceFormat)surfaceState->getSurfaceFormat()); EXPECT_EQ(RENDER_SURFACE_STATE::SURFACE_TYPE_SURFTYPE_1D, surfaceState->getSurfaceType()); - EXPECT_TRUE((GFX3DSTATE_SURFACEFORMAT)surfaceState->getSurfaceArray()); + EXPECT_TRUE((SurfaceFormat)surfaceState->getSurfaceArray()); EXPECT_EQ(expectedChannelRed, surfaceState->getShaderChannelSelectRed()); EXPECT_EQ(expectedChannelGreen, surfaceState->getShaderChannelSelectGreen()); @@ -829,9 +829,9 @@ HWTEST_F(ImageSetArgTest, GivenImageFrom1dBufferWhenSettingKernelArgThenProperti EXPECT_EQ(0u, surfaceState->getSurfaceQpitch() % 4); EXPECT_EQ(0u, surfaceState->getSurfaceQpitch()); - EXPECT_EQ(image->getSurfaceFormatInfo().surfaceFormat.genxSurfaceFormat, (GFX3DSTATE_SURFACEFORMAT)surfaceState->getSurfaceFormat()); + EXPECT_EQ(image->getSurfaceFormatInfo().surfaceFormat.genxSurfaceFormat, (SurfaceFormat)surfaceState->getSurfaceFormat()); EXPECT_EQ(RENDER_SURFACE_STATE::SURFACE_TYPE_SURFTYPE_BUFFER, surfaceState->getSurfaceType()); - EXPECT_FALSE((GFX3DSTATE_SURFACEFORMAT)surfaceState->getSurfaceArray()); + EXPECT_FALSE((SurfaceFormat)surfaceState->getSurfaceArray()); EXPECT_EQ(RENDER_SURFACE_STATE::SHADER_CHANNEL_SELECT_RED, surfaceState->getShaderChannelSelectRed()); EXPECT_EQ(RENDER_SURFACE_STATE::SHADER_CHANNEL_SELECT_GREEN, surfaceState->getShaderChannelSelectGreen()); @@ -995,7 +995,7 @@ HWTEST_F(ImageMediaBlockSetArgTest, WhenSettingKernelArgImageThenPropertiesAreCo EXPECT_EQ(srcImage->getImageDesc().image_depth, surfaceState->getRenderTargetViewExtent()); EXPECT_EQ(rPitch, surfaceState->getSurfacePitch()); EXPECT_EQ(0u, surfaceState->getSurfaceQpitch() % 4); - EXPECT_EQ(srcImage->getSurfaceFormatInfo().surfaceFormat.genxSurfaceFormat, (GFX3DSTATE_SURFACEFORMAT)surfaceState->getSurfaceFormat()); + EXPECT_EQ(srcImage->getSurfaceFormatInfo().surfaceFormat.genxSurfaceFormat, (SurfaceFormat)surfaceState->getSurfaceFormat()); EXPECT_EQ(RENDER_SURFACE_STATE::SURFACE_TYPE_SURFTYPE_3D, surfaceState->getSurfaceType()); EXPECT_EQ(expectedChannelRed, surfaceState->getShaderChannelSelectRed()); EXPECT_EQ(expectedChannelGreen, surfaceState->getShaderChannelSelectGreen()); diff --git a/opencl/test/unit_test/mt_tests/api/cl_intel_tracing_tests_mt.inl b/opencl/test/unit_test/mt_tests/api/cl_intel_tracing_tests_mt.inl index 20bb31064eef4..ac354e3ea3c5e 100644 --- a/opencl/test/unit_test/mt_tests/api/cl_intel_tracing_tests_mt.inl +++ b/opencl/test/unit_test/mt_tests/api/cl_intel_tracing_tests_mt.inl @@ -63,13 +63,13 @@ struct IntelTracingMtTest : public Test { } } - static void callback(cl_function_id fid, cl_callback_data *callbackData, void *userData) { + static void callback(ClFunctionId fid, cl_callback_data *callbackData, void *userData) { ASSERT_NE(nullptr, userData); IntelTracingMtTest *base = (IntelTracingMtTest *)userData; base->vcallback(fid, callbackData, nullptr); } - virtual void vcallback(cl_function_id fid, cl_callback_data *callbackData, void *userData) { + virtual void vcallback(ClFunctionId fid, cl_callback_data *callbackData, void *userData) { if (fid == CL_FUNCTION_clGetDeviceInfo || fid == CL_FUNCTION_clGetPlatformInfo) { ++count; diff --git a/opencl/test/unit_test/offline_compiler/decoder/mock/mock_zebin_decoder.h b/opencl/test/unit_test/offline_compiler/decoder/mock/mock_zebin_decoder.h index 85df316970a2f..1c2d6ef010503 100644 --- a/opencl/test/unit_test/offline_compiler/decoder/mock/mock_zebin_decoder.h +++ b/opencl/test/unit_test/offline_compiler/decoder/mock/mock_zebin_decoder.h @@ -9,7 +9,7 @@ #include "shared/offline_compiler/source/decoder/zebin_manipulator.h" #include "shared/source/device_binary_format/elf/elf_decoder.h" -template +template struct MockZebinDecoder : public NEO::Zebin::Manipulator::ZebinDecoder { using Base = NEO::Zebin::Manipulator::ZebinDecoder; using ErrorCode = NEO::Zebin::Manipulator::ErrorCode; diff --git a/opencl/test/unit_test/offline_compiler/decoder/mock/mock_zebin_encoder.h b/opencl/test/unit_test/offline_compiler/decoder/mock/mock_zebin_encoder.h index a4bad25155fb2..3bbc3f9a00d36 100644 --- a/opencl/test/unit_test/offline_compiler/decoder/mock/mock_zebin_encoder.h +++ b/opencl/test/unit_test/offline_compiler/decoder/mock/mock_zebin_encoder.h @@ -11,7 +11,7 @@ #include "opencl/test/unit_test/offline_compiler/decoder/mock/mock_iga_wrapper.h" -template +template struct MockZebinEncoder : public NEO::Zebin::Manipulator::ZebinEncoder { using Base = NEO::Zebin::Manipulator::ZebinEncoder; using ErrorCode = NEO::Zebin::Manipulator::ErrorCode; diff --git a/opencl/test/unit_test/offline_compiler/decoder/zebin_manipulator_tests.cpp b/opencl/test/unit_test/offline_compiler/decoder/zebin_manipulator_tests.cpp index 7ef2c5058345d..34b45d8eb4b8a 100644 --- a/opencl/test/unit_test/offline_compiler/decoder/zebin_manipulator_tests.cpp +++ b/opencl/test/unit_test/offline_compiler/decoder/zebin_manipulator_tests.cpp @@ -24,12 +24,12 @@ #include #include -template +template struct MockZebin { MockZebin() { NEO::Elf::ElfEncoder encoder; - encoder.getElfFileHeader().machine = NEO::Elf::ELF_MACHINE::EM_INTELGT; - encoder.getElfFileHeader().type = NEO::Zebin::Elf::ELF_TYPE_ZEBIN::ET_ZEBIN_EXE; + encoder.getElfFileHeader().machine = NEO::Elf::ElfMachine::EM_INTELGT; + encoder.getElfFileHeader().type = NEO::Zebin::Elf::ElfTypeZebin::ET_ZEBIN_EXE; uint8_t kernelData[] = {0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38}; encoder.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Zebin::Elf::SectionNames::textPrefix.str() + "exit_kernel", {kernelData, 8}); @@ -68,7 +68,7 @@ version: '1.15' NEO::Elf::ElfRel dataRelocation; dataRelocation.offset = 0x4; - dataRelocation.setRelocationType(NEO::Zebin::Elf::RELOC_TYPE_ZEBIN::R_ZE_SYM_ADDR); + dataRelocation.setRelocationType(NEO::Zebin::Elf::RelocTypeZebin::R_ZE_SYM_ADDR); dataRelocation.setSymbolTableIndex(2); auto &dataRelSec = encoder.appendSection(NEO::Elf::SHT_REL, NEO::Elf::SpecialSectionNames::relPrefix.str() + NEO::Zebin::Elf::SectionNames::dataGlobal.str(), {reinterpret_cast(&dataRelocation), sizeof(dataRelocation)}); @@ -77,7 +77,7 @@ version: '1.15' NEO::Elf::ElfRela debugRelocation; debugRelocation.offset = 0x4; - debugRelocation.setRelocationType(NEO::Zebin::Elf::RELOC_TYPE_ZEBIN::R_ZE_SYM_ADDR); + debugRelocation.setRelocationType(NEO::Zebin::Elf::RelocTypeZebin::R_ZE_SYM_ADDR); debugRelocation.setSymbolTableIndex(1); auto &debugDataRelaSec = encoder.appendSection(NEO::Elf::SHT_RELA, NEO::Elf::SpecialSectionNames::relaPrefix.str() + NEO::Zebin::Elf::SectionNames::debugInfo.str(), {reinterpret_cast(&debugRelocation), sizeof(debugRelocation)}); @@ -88,14 +88,14 @@ version: '1.15' symbols[1].shndx = 1; symbols[1].value = 0x0; symbols[1].name = encoder.appendSectionName("exit_kernel"); - symbols[1].setBinding(NEO::Elf::SYMBOL_TABLE_BIND::STB_LOCAL); - symbols[1].setType(NEO::Elf::SYMBOL_TABLE_TYPE::STT_FUNC); + symbols[1].setBinding(NEO::Elf::SymbolTableBind::STB_LOCAL); + symbols[1].setType(NEO::Elf::SymbolTableType::STT_FUNC); symbols[2].shndx = 2; symbols[2].value = 0x0; symbols[2].name = encoder.appendSectionName("var_x"); - symbols[2].setBinding(NEO::Elf::SYMBOL_TABLE_BIND::STB_GLOBAL); - symbols[2].setType(NEO::Elf::SYMBOL_TABLE_TYPE::STT_OBJECT); + symbols[2].setBinding(NEO::Elf::SymbolTableBind::STB_GLOBAL); + symbols[2].setType(NEO::Elf::SymbolTableType::STT_OBJECT); auto &symtabSec = encoder.appendSection(NEO::Elf::SHT_SYMTAB, NEO::Zebin::Elf::SectionNames::symtab, {reinterpret_cast(symbols), sizeof(symbols)}); @@ -354,7 +354,7 @@ TEST(ZebinManipulatorTests, GivenInvalidSectionsInfoWhenCheckingIfIs64BitZebinTh EXPECT_FALSE(retVal); } -template +template struct ZebinDecoderFixture { ZebinDecoderFixture() : argHelper(filesMap), decoder(&argHelper) { argHelper.messagePrinter.setSuppressMessages(true); @@ -501,7 +501,7 @@ TEST_F(ZebinDecoderTests, WhenPrintHelpIsCalledThenHelpIsPrinted) { EXPECT_FALSE(getOutput().empty()); } -template +template struct ZebinEncoderFixture { ZebinEncoderFixture() : argHelper(filesMap), encoder(&argHelper) { argHelper.messagePrinter.setSuppressMessages(true); 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 8a9f129e98b30..a6bdd95a56514 100644 --- a/opencl/test/unit_test/os_interface/mock_performance_counters.h +++ b/opencl/test/unit_test/os_interface/mock_performance_counters.h @@ -46,23 +46,11 @@ struct MI_REPORT_PERF_COUNT { // NOLINT(readability-identifier-naming) uint64_t memoryAddress : BITFIELD_RANGE(6, 63); uint32_t reportId; - typedef enum tagDWORD_LENGTH { - DWORD_LENGTH_EXCLUDES_DWORD_0_1 = 0x2, - } DWORD_LENGTH; - - typedef enum tagMI_COMMAND_OPCODE { - MI_COMMAND_OPCODE_MI_REPORT_PERF_COUNT = 0x28, - } MI_COMMAND_OPCODE; - - typedef enum tagCOMMAND_TYPE { - COMMAND_TYPE_MI_COMMAND = 0x0, - } COMMAND_TYPE; - inline void init(void) { memset(this, 0, sizeof(MI_REPORT_PERF_COUNT)); - dwordLength = DWORD_LENGTH_EXCLUDES_DWORD_0_1; - miCommandOpcode = MI_COMMAND_OPCODE_MI_REPORT_PERF_COUNT; - commandType = COMMAND_TYPE_MI_COMMAND; + dwordLength = 0x2; // DWORD_LENGTH_EXCLUDES_DWORD_0_1; + miCommandOpcode = 0x28; // MI_COMMAND_OPCODE_MI_REPORT_PERF_COUNT; + commandType = 0x0; // COMMAND_TYPE_MI_COMMAND; } }; diff --git a/opencl/test/unit_test/program/process_elf_binary_tests.cpp b/opencl/test/unit_test/program/process_elf_binary_tests.cpp index c7e45ff649f02..e271adff516a3 100644 --- a/opencl/test/unit_test/program/process_elf_binary_tests.cpp +++ b/opencl/test/unit_test/program/process_elf_binary_tests.cpp @@ -91,7 +91,7 @@ TEST_F(ProcessElfBinaryTests, GivenValidSpirBinaryWhenCreatingProgramFromBinaryT auto header = elf.elfFileHeader; ASSERT_NE(nullptr, header); - // check if ELF binary contains section SECTION_HEADER_TYPE_SPIRV + // check if ELF binary contains section SectionHeaderType_SPIRV bool hasSpirvSection = false; for (const auto &elfSectionHeader : elf.sectionHeaders) { if (elfSectionHeader.header->type == NEO::Elf::SHT_OPENCL_SPIRV) { @@ -126,7 +126,7 @@ class ProcessElfBinaryTestsWithBinaryType : public ::testing::TestWithParam>(device->getHardwareInfo()); + auto mockElf = std::make_unique>(device->getHardwareInfo()); auto pBinary = mockElf->storage; auto binarySize = mockElf->storage.size(); diff --git a/opencl/test/unit_test/program/program_tests.cpp b/opencl/test/unit_test/program/program_tests.cpp index a25bf5e9aff82..04378b840031d 100644 --- a/opencl/test/unit_test/program/program_tests.cpp +++ b/opencl/test/unit_test/program/program_tests.cpp @@ -3715,7 +3715,7 @@ TEST(ProgramPopulateZebinExtendedArgsMetadataTests, givenZebinaryFormatAndDecode constexpr auto numBits = is32bit ? Elf::EI_CLASS_32 : Elf::EI_CLASS_64; MockElfEncoder elfEncoder; elfEncoder.getElfFileHeader().type = NEO::Elf::ET_REL; - elfEncoder.appendSection(Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(invalidZeInfo.data(), invalidZeInfo.size())); + elfEncoder.appendSection(Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(invalidZeInfo.data(), invalidZeInfo.size())); auto storage = elfEncoder.encode(); buildInfo.unpackedDeviceBinary.reset(reinterpret_cast(storage.data())); buildInfo.unpackedDeviceBinarySize = storage.size(); @@ -3755,7 +3755,7 @@ TEST(ProgramPopulateZebinExtendedArgsMetadataTests, givenZebinaryFormatWithValid constexpr auto numBits = is32bit ? Elf::EI_CLASS_32 : Elf::EI_CLASS_64; MockElfEncoder elfEncoder; elfEncoder.getElfFileHeader().type = NEO::Elf::ET_REL; - elfEncoder.appendSection(Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(zeInfo.data(), zeInfo.size())); + elfEncoder.appendSection(Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(zeInfo.data(), zeInfo.size())); auto storage = elfEncoder.encode(); buildInfo.unpackedDeviceBinary.reset(reinterpret_cast(storage.data())); buildInfo.unpackedDeviceBinarySize = storage.size(); diff --git a/opencl/test/unit_test/test_files/patch_list.h b/opencl/test/unit_test/test_files/patch_list.h index f11f23a643155..66e55dec06431 100644 --- a/opencl/test/unit_test/test_files/patch_list.h +++ b/opencl/test/unit_test/test_files/patch_list.h @@ -10,41 +10,42 @@ #pragma pack( push, 1 ) #include +// NOLINTBEGIN(readability-identifier-naming) -const uint32_t MAGIC_CL = 0x494E5443; // NOLINT(readability-identifier-naming) +const uint32_t MAGIC_CL = 0x494E5443; struct SProgramBinaryHeader { - uint32_t Magic; // NOLINT(readability-identifier-naming) - uint32_t Version; // NOLINT(readability-identifier-naming) + uint32_t Magic; + uint32_t Version; - uint32_t Device; // NOLINT(readability-identifier-naming) - uint32_t GPUPointerSizeInBytes; // NOLINT(readability-identifier-naming) + uint32_t Device; + uint32_t GPUPointerSizeInBytes; - uint32_t NumberOfKernels; // NOLINT(readability-identifier-naming) + uint32_t NumberOfKernels; - uint32_t SteppingId; // NOLINT(readability-identifier-naming) + uint32_t SteppingId; - uint32_t PatchListSize; // NOLINT(readability-identifier-naming) + uint32_t PatchListSize; }; static_assert( sizeof( SProgramBinaryHeader ) == 28 , "The size of SProgramBinaryHeader is not what is expected" ); struct SKernelBinaryHeader { - uint32_t CheckSum; // NOLINT(readability-identifier-naming) - uint64_t ShaderHashCode; // NOLINT(readability-identifier-naming) - uint32_t KernelNameSize; // NOLINT(readability-identifier-naming) - uint32_t PatchListSize; // NOLINT(readability-identifier-naming) + uint32_t CheckSum; + uint64_t ShaderHashCode; + uint32_t KernelNameSize; + uint32_t PatchListSize; }; static_assert( sizeof( SKernelBinaryHeader ) == 20 , "The size of SKernelBinaryHeader is not what is expected" ); struct SKernelBinaryHeaderCommon : SKernelBinaryHeader { - uint32_t KernelHeapSize; // NOLINT(readability-identifier-naming) - uint32_t GeneralStateHeapSize; // NOLINT(readability-identifier-naming) - uint32_t DynamicStateHeapSize; // NOLINT(readability-identifier-naming) - uint32_t SurfaceStateHeapSize; // NOLINT(readability-identifier-naming) - uint32_t KernelUnpaddedSize; // NOLINT(readability-identifier-naming) + uint32_t KernelHeapSize; + uint32_t GeneralStateHeapSize; + uint32_t DynamicStateHeapSize; + uint32_t SurfaceStateHeapSize; + uint32_t KernelUnpaddedSize; }; static_assert( sizeof( SKernelBinaryHeaderCommon ) == ( 20 + sizeof( SKernelBinaryHeader ) ) , "The size of SKernelBinaryHeaderCommon is not what is expected" ); @@ -109,49 +110,50 @@ enum PATCH_TOKEN struct SPatchItemHeader { - uint32_t Token; // NOLINT(readability-identifier-naming) - uint32_t Size; // NOLINT(readability-identifier-naming) + uint32_t Token; + uint32_t Size; }; struct SPatchDataParameterBuffer : SPatchItemHeader { - uint32_t Type; // NOLINT(readability-identifier-naming) - uint32_t ArgumentNumber; // NOLINT(readability-identifier-naming) - uint32_t Offset; // NOLINT(readability-identifier-naming) - uint32_t DataSize; // NOLINT(readability-identifier-naming) - uint32_t SourceOffset; // NOLINT(readability-identifier-naming) - uint32_t LocationIndex; // NOLINT(readability-identifier-naming) - uint32_t LocationIndex2; // NOLINT(readability-identifier-naming) - uint32_t IsEmulationArgument; // NOLINT(readability-identifier-naming) + uint32_t Type; + uint32_t ArgumentNumber; + uint32_t Offset; + uint32_t DataSize; + uint32_t SourceOffset; + uint32_t LocationIndex; + uint32_t LocationIndex2; + uint32_t IsEmulationArgument; }; struct SPatchMediaInterfaceDescriptorLoad : SPatchItemHeader { - uint32_t InterfaceDescriptorDataOffset; // NOLINT(readability-identifier-naming) + uint32_t InterfaceDescriptorDataOffset; }; static_assert( sizeof( SPatchMediaInterfaceDescriptorLoad ) == ( 4 + sizeof( SPatchItemHeader ) ) , "The size of SPatchMediaInterfaceDescriptorLoad is not what is expected" ); struct SPatchStateSIP : SPatchItemHeader { - uint32_t SystemKernelOffset; // NOLINT(readability-identifier-naming) + uint32_t SystemKernelOffset; }; struct SPatchSamplerStateArray : SPatchItemHeader { - uint32_t Offset; // NOLINT(readability-identifier-naming) - uint32_t Count; // NOLINT(readability-identifier-naming) - uint32_t BorderColorOffset; // NOLINT(readability-identifier-naming) + uint32_t Offset; + uint32_t Count; + uint32_t BorderColorOffset; }; struct SPatchAllocateConstantMemorySurfaceProgramBinaryInfo : SPatchItemHeader { - uint32_t ConstantBufferIndex; // NOLINT(readability-identifier-naming) - uint32_t InlineDataSize; // NOLINT(readability-identifier-naming) + uint32_t ConstantBufferIndex; + uint32_t InlineDataSize; }; static_assert( sizeof( SPatchAllocateConstantMemorySurfaceProgramBinaryInfo ) == ( 8 + sizeof( SPatchItemHeader ) ) , "The size of SPatchAllocateConstantMemorySurfaceProgramBinaryInfo is not what is expected" ); +// NOLINTEND(readability-identifier-naming) #pragma pack( pop ) // clang-format on diff --git a/shared/offline_compiler/source/decoder/zebin_manipulator.cpp b/shared/offline_compiler/source/decoder/zebin_manipulator.cpp index a4c01106601b1..774090d12011b 100644 --- a/shared/offline_compiler/source/decoder/zebin_manipulator.cpp +++ b/shared/offline_compiler/source/decoder/zebin_manipulator.cpp @@ -149,7 +149,7 @@ BinaryFormats getBinaryFormatForDisassemble(OclocArgHelper *argHelper, const std template ZebinDecoder::ZebinDecoder(OclocArgHelper *argHelper); template ZebinDecoder::ZebinDecoder(OclocArgHelper *argHelper); -template +template ZebinDecoder::ZebinDecoder(OclocArgHelper *argHelper) : argHelper(argHelper), iga(new IgaWrapper) { iga->setMessagePrinter(argHelper->getPrinterRef()); @@ -157,12 +157,12 @@ ZebinDecoder::ZebinDecoder(OclocArgHelper *argHelper) : argHelper(argHe template ZebinDecoder::~ZebinDecoder(); template ZebinDecoder::~ZebinDecoder(); -template +template ZebinDecoder::~ZebinDecoder() {} template ErrorCode ZebinDecoder::decode(); template ErrorCode ZebinDecoder::decode(); -template +template ErrorCode ZebinDecoder::decode() { auto zebinBinary = argHelper->readBinaryFile(this->arguments.binaryFile); ArrayRef zebinBinaryRef = {reinterpret_cast(zebinBinary.data()), @@ -202,14 +202,14 @@ ErrorCode ZebinDecoder::decode() { template ErrorCode ZebinDecoder::validateInput(const std::vector &args); template ErrorCode ZebinDecoder::validateInput(const std::vector &args); -template +template ErrorCode ZebinDecoder::validateInput(const std::vector &args) { return Manipulator::validateInput(args, iga.get(), argHelper, arguments); } template void ZebinDecoder::printHelp(); template void ZebinDecoder::printHelp(); -template +template void ZebinDecoder::printHelp() { argHelper->printf(R"===(Disassembles Zebin. Output of such operation is a set of files that can be later used to reassemble back. @@ -230,13 +230,13 @@ Usage: ocloc disasm -file [-dump ] [-device ] [-sk )==="); } -template +template void ZebinDecoder::dump(ConstStringRef name, ArrayRef data) { auto outPath = arguments.pathToDump + name.str(); argHelper->saveOutput(outPath, data.begin(), data.size()); } -template +template void ZebinDecoder::dumpKernelData(ConstStringRef name, ArrayRef data) { std::string disassembledKernel; if (false == arguments.skipIGAdisassembly && @@ -247,7 +247,7 @@ void ZebinDecoder::dumpKernelData(ConstStringRef name, ArrayRef +template void ZebinDecoder::dumpSymtab(ElfT &elf, ArrayRef symtabData) { ArrayRef symbols(reinterpret_cast(symtabData.begin()), symtabData.size() / sizeof(ElfSymT)); @@ -277,7 +277,7 @@ void ZebinDecoder::dumpSymtab(ElfT &elf, ArrayRef symtab dump(Zebin::Elf::SectionNames::symtab, ArrayRef::fromAny(symbolsFileStr.data(), symbolsFileStr.size())); } -template +template std::vector ZebinDecoder::dumpElfSections(ElfT &elf) { std::vector sectionInfos; for (size_t secId = 1U; secId < elf.sectionHeaders.size(); secId++) { @@ -302,7 +302,7 @@ std::vector ZebinDecoder::dumpElfSections(ElfT &elf) { return sectionInfos; } -template +template void ZebinDecoder::dumpSectionInfo(const std::vector §ionInfos) { std::stringstream sectionsInfoStr; sectionsInfoStr << "ElfType " << (numBits == Elf::EI_CLASS_64 ? "64b" : "32b") << std::endl; @@ -314,7 +314,7 @@ void ZebinDecoder::dumpSectionInfo(const std::vector § dump(sectionsInfoFilename, ArrayRef::fromAny(sectionInfoStr.data(), sectionInfoStr.size())); } -template +template ErrorCode ZebinDecoder::decodeZebin(ArrayRef zebin, ElfT &outElf) { std::string errors, warnings; outElf = Elf::decodeElf(zebin, errors, warnings); @@ -327,7 +327,7 @@ ErrorCode ZebinDecoder::decodeZebin(ArrayRef zebin, ElfT return OCLOC_SUCCESS; } -template +template std::vector ZebinDecoder::getIntelGTNotes(ElfT &elf) { std::vector intelGTNotes; std::string errors, warnings; @@ -338,7 +338,7 @@ std::vector ZebinDecoder::getIntelGTNotes return intelGTNotes; } -template +template void ZebinDecoder::dumpRel(ConstStringRef name, ArrayRef data) { ArrayRef relocs = {reinterpret_cast(data.begin()), data.size() / sizeof(ElfRelT)}; @@ -353,7 +353,7 @@ void ZebinDecoder::dumpRel(ConstStringRef name, ArrayRef dump(name, ArrayRef::fromAny(relocsFileStr.data(), relocsFileStr.length())); } -template +template void ZebinDecoder::dumpRela(ConstStringRef name, ArrayRef data) { ArrayRef relocs = {reinterpret_cast(data.begin()), data.size() / sizeof(ElfRelaT)}; @@ -371,19 +371,19 @@ void ZebinDecoder::dumpRela(ConstStringRef name, ArrayRef::ZebinEncoder(OclocArgHelper *argHelper); template ZebinEncoder::ZebinEncoder(OclocArgHelper *argHelper); -template +template ZebinEncoder::ZebinEncoder(OclocArgHelper *argHelper) : argHelper(argHelper), iga(new IgaWrapper) { iga->setMessagePrinter(argHelper->getPrinterRef()); } template ZebinEncoder::~ZebinEncoder(); template ZebinEncoder::~ZebinEncoder(); -template +template ZebinEncoder::~ZebinEncoder() {} template ErrorCode ZebinEncoder::encode(); template ErrorCode ZebinEncoder::encode(); -template +template ErrorCode ZebinEncoder::encode() { ErrorCode retVal = OCLOC_SUCCESS; @@ -409,8 +409,8 @@ ErrorCode ZebinEncoder::encode() { } ElfEncoderT elfEncoder; - elfEncoder.getElfFileHeader().machine = Elf::ELF_MACHINE::EM_INTELGT; - elfEncoder.getElfFileHeader().type = Zebin::Elf::ELF_TYPE_ZEBIN::ET_ZEBIN_EXE; + elfEncoder.getElfFileHeader().machine = Elf::ElfMachine::EM_INTELGT; + elfEncoder.getElfFileHeader().type = Zebin::Elf::ElfTypeZebin::ET_ZEBIN_EXE; retVal = appendSections(elfEncoder, sectionInfos); if (retVal != OCLOC_SUCCESS) { @@ -426,14 +426,14 @@ ErrorCode ZebinEncoder::encode() { template ErrorCode ZebinEncoder::validateInput(const std::vector &args); template ErrorCode ZebinEncoder::validateInput(const std::vector &args); -template +template ErrorCode ZebinEncoder::validateInput(const std::vector &args) { return Manipulator::validateInput(args, iga.get(), argHelper, arguments); } template void ZebinEncoder::printHelp(); template void ZebinEncoder::printHelp(); -template +template void ZebinEncoder::printHelp() { argHelper->printf(R"===(Assembles Zebin from input files. It's expected that input files were previously generated by 'ocloc disasm' @@ -452,7 +452,7 @@ Usage: ocloc asm -file [-dump ] [-device ] [-skip- )==="); } -template +template std::vector ZebinEncoder::getIntelGTNotesSection(const std::vector §ionInfos) { bool containsIntelGTNoteSection = false; for (auto §ionInfo : sectionInfos) { @@ -469,7 +469,7 @@ std::vector ZebinEncoder::getIntelGTNotesSection(const std::vecto return argHelper->readBinaryFile(getFilePath(Zebin::Elf::SectionNames::noteIntelGT.data())); } -template +template std::vector ZebinEncoder::getIntelGTNotes(const std::vector &intelGtNotesSection) { std::vector intelGTNotes; std::string errors, warnings; @@ -482,7 +482,7 @@ std::vector ZebinEncoder::getIntelGTNotes return intelGTNotes; } -template +template ErrorCode ZebinEncoder::loadSectionsInfo(std::vector §ionInfos) { std::vector sectionsInfoLines; argHelper->readFileToVectorOfStrings(getFilePath(sectionsInfoFilename.data()), sectionsInfoLines); @@ -501,7 +501,7 @@ ErrorCode ZebinEncoder::loadSectionsInfo(std::vector § return OCLOC_SUCCESS; } -template +template ErrorCode ZebinEncoder::checkIfAllFilesExist(const std::vector §ionInfos) { for (auto §ionInfo : sectionInfos) { bool fileExists = argHelper->fileExists(getFilePath(sectionInfo.name)); @@ -517,7 +517,7 @@ ErrorCode ZebinEncoder::checkIfAllFilesExist(const std::vector +template ErrorCode ZebinEncoder::appendSections(ElfEncoderT &encoder, const std::vector §ionInfos) { SecNameToIdMapT secNameToId; size_t symtabIdx = std::numeric_limits::max(); @@ -545,7 +545,7 @@ ErrorCode ZebinEncoder::appendSections(ElfEncoderT &encoder, const std: return retVal; } -template +template ErrorCode ZebinEncoder::appendRel(ElfEncoderT &encoder, const SectionInfo §ion, size_t targetSecId, size_t symtabSecId) { std::vector relocationLines; argHelper->readFileToVectorOfStrings(getFilePath(section.name), relocationLines); @@ -560,7 +560,7 @@ ErrorCode ZebinEncoder::appendRel(ElfEncoderT &encoder, const SectionIn return OCLOC_SUCCESS; } -template +template ErrorCode ZebinEncoder::appendRela(ElfEncoderT &encoder, const SectionInfo §ion, size_t targetSecId, size_t symtabSecId) { std::vector relocationLines; argHelper->readFileToVectorOfStrings(getFilePath(section.name), relocationLines); @@ -575,12 +575,12 @@ ErrorCode ZebinEncoder::appendRela(ElfEncoderT &encoder, const SectionI return OCLOC_SUCCESS; } -template +template std::string ZebinEncoder::getFilePath(const std::string &filename) { return arguments.pathToDump + filename; } -template +template std::string ZebinEncoder::parseKernelAssembly(ArrayRef kernelAssembly) { std::string kernelAssemblyString(kernelAssembly.begin(), kernelAssembly.end()); std::string outBinary; @@ -590,7 +590,7 @@ std::string ZebinEncoder::parseKernelAssembly(ArrayRef kern return {}; } -template +template ErrorCode ZebinEncoder::appendKernel(ElfEncoderT &encoder, const SectionInfo §ion) { if (argHelper->fileExists(getFilePath(section.name + ".asm"))) { auto data = argHelper->readBinaryFile(getFilePath(section.name + ".asm")); @@ -604,7 +604,7 @@ ErrorCode ZebinEncoder::appendKernel(ElfEncoderT &encoder, const Sectio return OCLOC_SUCCESS; } -template +template ErrorCode ZebinEncoder::appendSymtab(ElfEncoderT &encoder, const SectionInfo §ion, size_t strtabSecId, SecNameToIdMapT secNameToId) { std::vector symTabLines; argHelper->readFileToVectorOfStrings(getFilePath(section.name), symTabLines); @@ -622,14 +622,14 @@ ErrorCode ZebinEncoder::appendSymtab(ElfEncoderT &encoder, const Sectio return OCLOC_SUCCESS; } -template +template ErrorCode ZebinEncoder::appendOther(ElfEncoderT &encoder, const SectionInfo §ion) { auto sectionData = argHelper->readBinaryFile(getFilePath(section.name)); encoder.appendSection(section.type, section.name, ArrayRef::fromAny(sectionData.data(), sectionData.size())); return OCLOC_SUCCESS; } -template +template std::vector ZebinEncoder::parseLine(const std::string &line) { std::vector out; auto ss = std::stringstream(line); @@ -640,7 +640,7 @@ std::vector ZebinEncoder::parseLine(const std::string &lin return out; } -template +template std::vector::ElfRelT> ZebinEncoder::parseRel(const std::vector &relocationsFile) { std::vector relocs; relocs.resize(relocationsFile.size() - 1); @@ -658,7 +658,7 @@ std::vector::ElfRelT> ZebinEncoder::pars return relocs; } -template +template std::vector::ElfRelaT> ZebinEncoder::parseRela(const std::vector &relocationsFile) { std::vector relocs; relocs.resize(relocationsFile.size() - 1); @@ -677,7 +677,7 @@ std::vector::ElfRelaT> ZebinEncoder::par return relocs; } -template +template std::vector::ElfSymT> ZebinEncoder::parseSymbols(const std::vector &symbolsFile, ElfEncoderT &encoder, size_t &outNumLocalSymbols, SecNameToIdMapT secNameToId) { std::vector symbols; symbols.resize(symbolsFile.size() - 1); diff --git a/shared/offline_compiler/source/decoder/zebin_manipulator.h b/shared/offline_compiler/source/decoder/zebin_manipulator.h index 5ae7d86171ecf..a1351cb594920 100644 --- a/shared/offline_compiler/source/decoder/zebin_manipulator.h +++ b/shared/offline_compiler/source/decoder/zebin_manipulator.h @@ -23,10 +23,10 @@ namespace NEO { namespace Elf { struct IntelGTNote; -template +template struct Elf; -template +template struct ElfEncoder; } // namespace Elf @@ -61,7 +61,7 @@ bool is64BitZebin(OclocArgHelper *argHelper, const std::string §ionsInfoFile constexpr ConstStringRef sectionsInfoFilename = "sections.txt"; -template +template class ZebinDecoder { public: using ElfT = Elf::Elf; @@ -95,7 +95,7 @@ class ZebinDecoder { std::unique_ptr iga; }; -template +template class ZebinEncoder { public: using ElfEncoderT = Elf::ElfEncoder; diff --git a/shared/offline_compiler/source/ocloc_api.h b/shared/offline_compiler/source/ocloc_api.h index 3f29648ca709c..c77e173380c56 100644 --- a/shared/offline_compiler/source/ocloc_api.h +++ b/shared/offline_compiler/source/ocloc_api.h @@ -18,6 +18,7 @@ #define OCLOC_MAKE_VERSION(_major, _minor) ((_major << 16) | (_minor & 0x0000ffff)) #endif // OCLOC_MAKE_VERSION +// NOLINTBEGIN(readability-identifier-naming) typedef enum _ocloc_version_t { OCLOC_VERSION_1_0 = OCLOC_MAKE_VERSION(1, 0), ///< version 1.0 OCLOC_VERSION_CURRENT = OCLOC_MAKE_VERSION(1, 0), ///< latest known version @@ -40,6 +41,7 @@ typedef struct _ocloc_name_version { unsigned int version; char name[OCLOC_NAME_VERSION_MAX_NAME_SIZE]; } ocloc_name_version; +// NOLINTEND(readability-identifier-naming) #ifdef _WIN32 #define SIGNATURE __declspec(dllexport) int __cdecl diff --git a/shared/offline_compiler/source/ocloc_concat.h b/shared/offline_compiler/source/ocloc_concat.h index 7a9c9ebdd4eb1..19256d77f8d55 100644 --- a/shared/offline_compiler/source/ocloc_concat.h +++ b/shared/offline_compiler/source/ocloc_concat.h @@ -15,7 +15,7 @@ #include namespace AOT { -enum PRODUCT_CONFIG : uint32_t; +enum PRODUCT_CONFIG : uint32_t; // NOLINT(readability-identifier-naming) } class OclocArgHelper; namespace NEO { diff --git a/shared/source/aub/aub_helper.cpp b/shared/source/aub/aub_helper.cpp index 461a7080a57cb..8209f70dabe6d 100644 --- a/shared/source/aub/aub_helper.cpp +++ b/shared/source/aub/aub_helper.cpp @@ -37,9 +37,9 @@ uint64_t AubHelper::getPTEntryBits(uint64_t pdEntryBits) { uint32_t AubHelper::getMemType(uint32_t addressSpace) { if (addressSpace == AubMemDump::AddressSpaceValues::TraceLocal) { - return mem_types::MEM_TYPE_LOCALMEM; + return MemType::local; } - return mem_types::MEM_TYPE_SYSTEM; + return MemType::system; } uint64_t AubHelper::getPerTileLocalMemorySize(const HardwareInfo *pHwInfo) { diff --git a/shared/source/compiler_interface/linker.cpp b/shared/source/compiler_interface/linker.cpp index d2c87d0aad989..2356ff8dcee9f 100644 --- a/shared/source/compiler_interface/linker.cpp +++ b/shared/source/compiler_interface/linker.cpp @@ -175,7 +175,7 @@ void LinkerInput::addElfTextSegmentRelocation(RelocationInfo relocationInfo, uin template bool LinkerInput::addRelocation(Elf::Elf &elf, const SectionNameToSegmentIdMap &nameToSegmentId, const typename Elf::Elf::RelocationInfo &reloc); template bool LinkerInput::addRelocation(Elf::Elf &elf, const SectionNameToSegmentIdMap &nameToSegmentId, const typename Elf::Elf::RelocationInfo &reloc); -template +template bool LinkerInput::addRelocation(Elf::Elf &elf, const SectionNameToSegmentIdMap &nameToSegmentId, const typename Elf::Elf::RelocationInfo &reloc) { auto sectionName = elf.getSectionName(reloc.targetSectionIndex); @@ -214,7 +214,7 @@ std::optional LinkerInput::getInstructionSegmentId(const SectionNameTo template bool LinkerInput::addSymbol(Elf::Elf &elf, const SectionNameToSegmentIdMap &nameToSegmentId, size_t symId); template bool LinkerInput::addSymbol(Elf::Elf &elf, const SectionNameToSegmentIdMap &nameToSegmentId, size_t symId); -template +template bool LinkerInput::addSymbol(Elf::Elf &elf, const SectionNameToSegmentIdMap &nameToSegmentId, size_t symId) { auto &elfSymbols = elf.getSymbols(); if (symId >= elfSymbols.size()) { @@ -271,7 +271,7 @@ bool LinkerInput::addSymbol(Elf::Elf &elf, const SectionNameToSegmentId template void LinkerInput::decodeElfSymbolTableAndRelocations(Elf::Elf &elf, const SectionNameToSegmentIdMap &nameToSegmentId); template void LinkerInput::decodeElfSymbolTableAndRelocations(Elf::Elf &elf, const SectionNameToSegmentIdMap &nameToSegmentId); -template +template void LinkerInput::decodeElfSymbolTableAndRelocations(Elf::Elf &elf, const SectionNameToSegmentIdMap &nameToSegmentId) { symbols.reserve(elf.getSymbols().size()); @@ -603,9 +603,9 @@ void Linker::applyDebugDataRelocations(const NEO::Elf::Elfoffset; auto relocLocation = reinterpret_cast(inputOutputElf.begin()) + targetSectionOffset + reloc.offset; - if (static_cast(reloc.relocType) == Elf::RELOCATION_X8664_TYPE::relocation64) { + if (static_cast(reloc.relocType) == Elf::RelocationX8664Type::relocation64) { *reinterpret_cast(relocLocation) = symbolAddress; - } else if (static_cast(reloc.relocType) == Elf::RELOCATION_X8664_TYPE::relocation32) { + } else if (static_cast(reloc.relocType) == Elf::RelocationX8664Type::relocation32) { *reinterpret_cast(relocLocation) = static_cast(symbolAddress & uint32_t(-1)); } } diff --git a/shared/source/compiler_interface/linker.h b/shared/source/compiler_interface/linker.h index 75bffdec5b744..c97bb3ecdd739 100644 --- a/shared/source/compiler_interface/linker.h +++ b/shared/source/compiler_interface/linker.h @@ -118,13 +118,13 @@ struct LinkerInput { void addElfTextSegmentRelocation(RelocationInfo relocationInfo, uint32_t instructionsSegmentId); - template + template void decodeElfSymbolTableAndRelocations(Elf::Elf &elf, const SectionNameToSegmentIdMap &nameToSegmentId); - template + template bool addSymbol(Elf::Elf &elf, const SectionNameToSegmentIdMap &nameToSegmentId, size_t symId); - template + template bool addRelocation(Elf::Elf &elf, const SectionNameToSegmentIdMap &nameToSegmentId, const typename Elf::Elf::RelocationInfo &relocation); std::optional getInstructionSegmentId(const SectionNameToSegmentIdMap &kernelNameToSegId, const std::string &kernelName); diff --git a/shared/source/device_binary_format/device_binary_format_zebin.cpp b/shared/source/device_binary_format/device_binary_format_zebin.cpp index 7d1a8364ce7ac..324add3de832c 100644 --- a/shared/source/device_binary_format/device_binary_format_zebin.cpp +++ b/shared/source/device_binary_format/device_binary_format_zebin.cpp @@ -21,7 +21,7 @@ namespace NEO { -template +template SingleDeviceBinary unpackSingleZebin(const ArrayRef archive, const ConstStringRef requestedProductAbbreviation, const TargetDevice &requestedTargetDevice, std::string &outErrReason, std::string &outWarning) { if (1 == NEO::debugManager.flags.DumpZEBin.get()) { @@ -58,7 +58,7 @@ SingleDeviceBinary unpackSingleZebin(const ArrayRef archive, cons } bool validForTarget = true; - if (elf.elfFileHeader->machine == Elf::ELF_MACHINE::EM_INTELGT) { + if (elf.elfFileHeader->machine == Elf::ElfMachine::EM_INTELGT) { validForTarget &= Zebin::validateTargetDevice(elf, requestedTargetDevice, outErrReason, outWarning, ret.generator); } else { const auto &flags = reinterpret_cast(elf.elfFileHeader->flags); @@ -92,7 +92,7 @@ SingleDeviceBinary unpackSingleDeviceBinary(cons : unpackSingleZebin(archive, requestedProductAbbreviation, requestedTargetDevice, outErrReason, outWarning); } -template +template void prepareLinkerInputForZebin(ProgramInfo &programInfo, Elf::Elf &elf) { programInfo.prepareLinkerInputStorage(); @@ -107,7 +107,7 @@ void prepareLinkerInputForZebin(ProgramInfo &programInfo, Elf::Elf &elf programInfo.linkerInput->decodeElfSymbolTableAndRelocations(elf, nameToKernelId); } -template +template DecodeError decodeSingleZebin(ProgramInfo &dst, const SingleDeviceBinary &src, std::string &outErrReason, std::string &outWarning) { auto elf = Elf::decodeElf(src.deviceBinary, outErrReason, outWarning); if (nullptr == elf.elfFileHeader) { diff --git a/shared/source/device_binary_format/elf/elf.h b/shared/source/device_binary_format/elf/elf.h index 36d7e75ff0e03..e18daae01e07c 100644 --- a/shared/source/device_binary_format/elf/elf.h +++ b/shared/source/device_binary_format/elf/elf.h @@ -17,46 +17,46 @@ namespace NEO { namespace Elf { // Elf identifier class -enum ELF_IDENTIFIER_CLASS : uint8_t { +enum ElfIdentifierClass : uint8_t { EI_CLASS_NONE = 0, // undefined EI_CLASS_32 = 1, // 32-bit elf file EI_CLASS_64 = 2, // 64-bit elf file }; // Elf identifier data -enum ELF_IDENTIFIER_DATA : uint8_t { +enum ElfIdentifierData : uint8_t { EI_DATA_NONE = 0, // undefined EI_DATA_LITTLE_ENDIAN = 1, // little-endian EI_DATA_BIG_ENDIAN = 2, // big-endian }; // Target machine -enum ELF_MACHINE : uint16_t { +enum ElfMachine : uint16_t { EM_NONE = 0, // No specific instruction set EM_INTELGT = 205, }; // Elf version -enum ELF_VERSION_ : uint8_t { +enum ElfVersion : uint8_t { EV_INVALID = 0, // undefined EV_CURRENT = 1, // current }; // Elf type -enum ELF_TYPE : uint16_t { +enum ElfType : uint16_t { ET_NONE = 0, // undefined ET_REL = 1, // relocatable ET_EXEC = 2, // executable ET_DYN = 3, // shared object ET_CORE = 4, // core file ET_LOPROC = 0xff00, // start of processor-specific type - ET_OPENCL_RESERVED_START = 0xff01, // start of Intel OCL ELF_TYPES - ET_OPENCL_RESERVED_END = 0xff05, // end of Intel OCL ELF_TYPES + ET_OPENCL_RESERVED_START = 0xff01, // start of Intel OCL ElfTypeS + ET_OPENCL_RESERVED_END = 0xff05, // end of Intel OCL ElfTypeS ET_HIPROC = 0xffff // end of processor-specific types }; // Section header type -enum SECTION_HEADER_TYPE : uint32_t { +enum SectionHeaderType : uint32_t { SHT_NULL = 0, // inactive section header SHT_PROGBITS = 1, // program data SHT_SYMTAB = 2, // symbol table @@ -80,11 +80,11 @@ enum SECTION_HEADER_TYPE : uint32_t { SHT_OPENCL_RESERVED_END = 0xff00000c // end of Intel OCL SHT_TYPES }; -enum SPECIAL_SECTION_HEADER_NUMBER : uint16_t { +enum SpecialSectionHeaderNumber : uint16_t { SHN_UNDEF = 0U, // undef section }; -enum SECTION_HEADER_FLAGS : uint32_t { +enum SectionHeaderFlags : uint32_t { SHF_NONE = 0x0, // no flags SHF_WRITE = 0x1, // writeable data SHF_ALLOC = 0x2, // occupies memory during execution @@ -100,7 +100,7 @@ enum SECTION_HEADER_FLAGS : uint32_t { SHF_MASKPROC = 0xf0000000, // processor-specific flags }; -enum PROGRAM_HEADER_TYPE { +enum ProgramHeaderType { PT_NULL = 0x0, // unused segment PT_LOAD = 0x1, // loadable segment PT_DYNAMIC = 0x2, // dynamic linking information @@ -115,7 +115,7 @@ enum PROGRAM_HEADER_TYPE { PT_HIPROC = 0x7FFFFFFF // end processor-specific segments }; -enum PROGRAM_HEADER_FLAGS : uint32_t { +enum ProgramHeaderFlags : uint32_t { PF_NONE = 0x0, // all access denied PF_X = 0x1, // execute PF_W = 0x2, // write @@ -125,14 +125,14 @@ enum PROGRAM_HEADER_FLAGS : uint32_t { }; -enum SYMBOL_TABLE_TYPE : uint32_t { +enum SymbolTableType : uint32_t { STT_NOTYPE = 0, STT_OBJECT = 1, STT_FUNC = 2, STT_SECTION = 3 }; -enum SYMBOL_TABLE_BIND : uint32_t { +enum SymbolTableBind : uint32_t { STB_LOCAL = 0, STB_GLOBAL = 1 }; @@ -140,7 +140,7 @@ enum SYMBOL_TABLE_BIND : uint32_t { inline constexpr const char elfMagic[4] = {0x7f, 'E', 'L', 'F'}; struct ElfFileHeaderIdentity { - ElfFileHeaderIdentity(ELF_IDENTIFIER_CLASS classBits) + ElfFileHeaderIdentity(ElfIdentifierClass classBits) : eClass(classBits) { } char magic[4] = {elfMagic[0], elfMagic[1], elfMagic[2], elfMagic[3]}; // should match elfMagic @@ -258,7 +258,7 @@ struct ElfSectionHeader { static_assert(sizeof(ElfSectionHeader) == 0x28, ""); static_assert(sizeof(ElfSectionHeader) == 0x40, ""); -template +template struct ElfFileHeaderTypes; template <> @@ -295,7 +295,7 @@ struct ElfFileHeaderTypes { using ShStrNdx = uint16_t; }; -template +template struct ElfFileHeader { ElfFileHeaderIdentity identity = ElfFileHeaderIdentity(numBits); // elf file identity typename ElfFileHeaderTypes::Type type = ET_NONE; // elf file type @@ -346,7 +346,7 @@ struct ElfSymbolEntryTypes { using Size = uint64_t; }; -template +template struct ElfSymbolEntry; template <> @@ -506,7 +506,7 @@ constexpr ElfRelocationEntryTypes::Info setRelocationType(ElfReloca } } // namespace RelocationFuncs -template +template struct ElfRel { using Offset = typename ElfRelocationEntryTypes::Offset; using Info = typename ElfRelocationEntryTypes::Info; diff --git a/shared/source/device_binary_format/elf/elf_decoder.cpp b/shared/source/device_binary_format/elf/elf_decoder.cpp index db2f8ddcf90b3..dc03da956fd2c 100644 --- a/shared/source/device_binary_format/elf/elf_decoder.cpp +++ b/shared/source/device_binary_format/elf/elf_decoder.cpp @@ -16,7 +16,7 @@ namespace NEO { namespace Elf { -template +template const ElfFileHeader *decodeElfFileHeader(const ArrayRef binary) { if (binary.size() < sizeof(ElfFileHeader)) { return nullptr; @@ -35,7 +35,7 @@ const ElfFileHeader *decodeElfFileHeader(const ArrayRef template const ElfFileHeader *decodeElfFileHeader(const ArrayRef); template const ElfFileHeader *decodeElfFileHeader(const ArrayRef); -template +template Elf decodeElf(const ArrayRef binary, std::string &outErrReason, std::string &outWarning) { Elf ret = {}; ret.elfFileHeader = decodeElfFileHeader(binary); @@ -86,9 +86,9 @@ Elf decodeElf(const ArrayRef binary, std::string &outErr return ret; } -template +template bool Elf::decodeSymTab(SectionHeaderAndData §ionHeaderData, std::string &outError) { - if (sectionHeaderData.header->type == SECTION_HEADER_TYPE::SHT_SYMTAB) { + if (sectionHeaderData.header->type == SectionHeaderType::SHT_SYMTAB) { auto symSize = sizeof(ElfSymbolEntry); if (symSize != sectionHeaderData.header->entsize) { outError.append("Invalid symbol table entries size - expected : " + std::to_string(symSize) + ", got : " + std::to_string(sectionHeaderData.header->entsize) + "\n"); @@ -106,9 +106,9 @@ bool Elf::decodeSymTab(SectionHeaderAndData §ionHeaderData, std::st return true; } -template +template bool Elf::decodeRelocations(SectionHeaderAndData §ionHeaderData, std::string &outError) { - if (sectionHeaderData.header->type == SECTION_HEADER_TYPE::SHT_RELA) { + if (sectionHeaderData.header->type == SectionHeaderType::SHT_RELA) { auto relaSize = sizeof(ElfRela); if (relaSize != sectionHeaderData.header->entsize) { outError.append("Invalid rela entries size - expected : " + std::to_string(relaSize) + ", got : " + std::to_string(sectionHeaderData.header->entsize) + "\n"); @@ -142,7 +142,7 @@ bool Elf::decodeRelocations(SectionHeaderAndData §ionHeaderData, st } } - if (sectionHeaderData.header->type == SECTION_HEADER_TYPE::SHT_REL) { + if (sectionHeaderData.header->type == SectionHeaderType::SHT_REL) { auto relSize = sizeof(ElfRel); if (relSize != sectionHeaderData.header->entsize) { outError.append("Invalid rel entries size - expected : " + std::to_string(relSize) + ", got : " + std::to_string(sectionHeaderData.header->entsize) + "\n"); @@ -179,7 +179,7 @@ bool Elf::decodeRelocations(SectionHeaderAndData §ionHeaderData, st return true; } -template +template bool Elf::decodeSections(std::string &outError) { bool success = true; for (size_t i = 0; i < sectionHeaders.size(); i++) { @@ -194,7 +194,7 @@ bool Elf::decodeSections(std::string &outError) { return success; } -template +template bool Elf::isDebugDataRelocation(ConstStringRef sectionName) { if (sectionName.startsWith(NEO::Elf::SpecialSectionNames::debug.data())) { return true; diff --git a/shared/source/device_binary_format/elf/elf_decoder.h b/shared/source/device_binary_format/elf/elf_decoder.h index 36de4c155b6a9..c0a9debc1a8a4 100644 --- a/shared/source/device_binary_format/elf/elf_decoder.h +++ b/shared/source/device_binary_format/elf/elf_decoder.h @@ -17,12 +17,12 @@ namespace NEO { namespace Elf { -enum class RELOCATION_X8664_TYPE : uint32_t { +enum class RelocationX8664Type : uint32_t { relocation64 = 0x1, relocation32 = 0xa }; -template +template struct Elf { struct ProgramHeaderAndData { const ElfProgramHeader *header = nullptr; @@ -111,17 +111,17 @@ struct Elf { Relocations debugInfoRelocations; }; -template +template const ElfFileHeader *decodeElfFileHeader(const ArrayRef binary); extern template const ElfFileHeader *decodeElfFileHeader(const ArrayRef); extern template const ElfFileHeader *decodeElfFileHeader(const ArrayRef); -template +template Elf decodeElf(const ArrayRef binary, std::string &outErrReason, std::string &outWarning); extern template Elf decodeElf(const ArrayRef, std::string &, std::string &); extern template Elf decodeElf(const ArrayRef, std::string &, std::string &); -template +template inline bool isElf(const ArrayRef binary) { return (nullptr != decodeElfFileHeader(binary)); } @@ -130,7 +130,7 @@ inline bool isElf(const ArrayRef binary) { return isElf(binary) || isElf(binary); } -inline ELF_IDENTIFIER_CLASS getElfNumBits(const ArrayRef binary) { +inline ElfIdentifierClass getElfNumBits(const ArrayRef binary) { if (isElf(binary)) { return EI_CLASS_32; } else if (isElf(binary)) { diff --git a/shared/source/device_binary_format/elf/elf_encoder.cpp b/shared/source/device_binary_format/elf/elf_encoder.cpp index 9f60bd8c5500e..909dbdca11b0d 100644 --- a/shared/source/device_binary_format/elf/elf_encoder.cpp +++ b/shared/source/device_binary_format/elf/elf_encoder.cpp @@ -15,7 +15,7 @@ namespace NEO { namespace Elf { -template +template ElfEncoder::ElfEncoder(bool addUndefSectionHeader, bool addHeaderSectionNamesSection, typename ElfSectionHeaderTypes::AddrAlign defaultDataAlignemnt) : addUndefSectionHeader(addUndefSectionHeader), addHeaderSectionNamesSection(addHeaderSectionNamesSection), defaultDataAlignment(defaultDataAlignemnt) { // add special strings @@ -28,7 +28,7 @@ ElfEncoder::ElfEncoder(bool addUndefSectionHeader, bool addHeaderSectio } } -template +template void ElfEncoder::appendSection(const ElfSectionHeader §ionHeader, const ArrayRef sectionData) { sectionHeaders.push_back(sectionHeader); if ((SHT_NOBITS != sectionHeader.type) && (false == sectionData.empty())) { @@ -44,7 +44,7 @@ void ElfEncoder::appendSection(const ElfSectionHeader §ion } } -template +template void ElfEncoder::appendSegment(const ElfProgramHeader &programHeader, const ArrayRef segmentData) { maxDataAlignmentNeeded = std::max(maxDataAlignmentNeeded, static_cast(programHeader.align)); programHeaders.push_back(programHeader); @@ -61,15 +61,15 @@ void ElfEncoder::appendSegment(const ElfProgramHeader &program } } -template +template uint32_t ElfEncoder::getSectionHeaderIndex(const ElfSectionHeader §ionHeader) { UNRECOVERABLE_IF(§ionHeader < sectionHeaders.begin()); UNRECOVERABLE_IF(§ionHeader >= sectionHeaders.begin() + sectionHeaders.size()); return static_cast(§ionHeader - &*sectionHeaders.begin()); } -template -ElfSectionHeader &ElfEncoder::appendSection(SECTION_HEADER_TYPE sectionType, ConstStringRef sectionLabel, const ArrayRef sectionData) { +template +ElfSectionHeader &ElfEncoder::appendSection(SectionHeaderType sectionType, ConstStringRef sectionLabel, const ArrayRef sectionData) { ElfSectionHeader section = {}; section.type = static_cast(sectionType); section.flags = static_cast(SHF_NONE); @@ -93,8 +93,8 @@ ElfSectionHeader &ElfEncoder::appendSection(SECTION_HEADER_TYP return *sectionHeaders.rbegin(); } -template -ElfProgramHeader &ElfEncoder::appendSegment(PROGRAM_HEADER_TYPE segmentType, const ArrayRef segmentData) { +template +ElfProgramHeader &ElfEncoder::appendSegment(ProgramHeaderType segmentType, const ArrayRef segmentData) { ElfProgramHeader segment = {}; segment.type = static_cast(segmentType); segment.flags = static_cast(PF_NONE); @@ -104,15 +104,15 @@ ElfProgramHeader &ElfEncoder::appendSegment(PROGRAM_HEADER_TYP return *programHeaders.rbegin(); } -template +template void ElfEncoder::appendProgramHeaderLoad(size_t sectionId, uint64_t vAddr, uint64_t segSize) { programSectionLookupTable.push_back({programHeaders.size(), sectionId}); - auto &programHeader = appendSegment(PROGRAM_HEADER_TYPE::PT_LOAD, {}); + auto &programHeader = appendSegment(ProgramHeaderType::PT_LOAD, {}); programHeader.vAddr = static_cast(vAddr); programHeader.memSz = static_cast(segSize); } -template +template uint32_t ElfEncoder::appendSectionName(ConstStringRef str) { if (false == addHeaderSectionNamesSection) { return strSecBuilder.undef(); @@ -120,7 +120,7 @@ uint32_t ElfEncoder::appendSectionName(ConstStringRef str) { return strSecBuilder.appendString(str); } -template +template std::vector ElfEncoder::encode() const { ElfFileHeader elfFileHeader = this->elfFileHeader; StackVec, 32> programHeaders = this->programHeaders; diff --git a/shared/source/device_binary_format/elf/elf_encoder.h b/shared/source/device_binary_format/elf/elf_encoder.h index 95e9860670209..ed584f82a1f42 100644 --- a/shared/source/device_binary_format/elf/elf_encoder.h +++ b/shared/source/device_binary_format/elf/elf_encoder.h @@ -49,7 +49,7 @@ struct StringSectionBuilder { uint32_t undefStringIdx; }; -template +template struct ElfEncoder { ElfEncoder(bool addUndefSectionHeader = true, bool addHeaderSectionNamesSection = true, typename ElfSectionHeaderTypes::AddrAlign defaultDataAlignment = 8U); @@ -57,19 +57,19 @@ struct ElfEncoder { void appendSection(const ElfSectionHeader §ionHeader, const ArrayRef sectionData); void appendSegment(const ElfProgramHeader &programHeader, const ArrayRef segmentData); - ElfSectionHeader &appendSection(SECTION_HEADER_TYPE sectionType, ConstStringRef sectionLabel, const ArrayRef sectionData); - ElfProgramHeader &appendSegment(PROGRAM_HEADER_TYPE segmentType, const ArrayRef segmentData); + ElfSectionHeader &appendSection(SectionHeaderType sectionType, ConstStringRef sectionLabel, const ArrayRef sectionData); + ElfProgramHeader &appendSegment(ProgramHeaderType segmentType, const ArrayRef segmentData); uint32_t getSectionHeaderIndex(const ElfSectionHeader §ionHeader); void appendProgramHeaderLoad(size_t sectionId, uint64_t vAddr, uint64_t segSize); template ElfSectionHeader &appendSection(SectionHeaderEnumT sectionType, ConstStringRef sectionLabel, const ArrayRef sectionData) { - return appendSection(static_cast(sectionType), sectionLabel, sectionData); + return appendSection(static_cast(sectionType), sectionLabel, sectionData); } template ElfSectionHeader &appendSection(SectionHeaderEnumT sectionType, ConstStringRef sectionLabel, const std::string §ionData) { - return appendSection(static_cast(sectionType), sectionLabel, + return appendSection(static_cast(sectionType), sectionLabel, ArrayRef(reinterpret_cast(sectionData.c_str()), sectionData.size() + 1)); } diff --git a/shared/source/device_binary_format/elf/ocl_elf.h b/shared/source/device_binary_format/elf/ocl_elf.h index 7ef06a7c8525b..28f946979ca14 100644 --- a/shared/source/device_binary_format/elf/ocl_elf.h +++ b/shared/source/device_binary_format/elf/ocl_elf.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -18,18 +18,18 @@ namespace NEO { namespace Elf { -enum ELF_TYPE_OPENCL : uint16_t { +enum ElfTypeOpencl : uint16_t { ET_OPENCL_SOURCE = 0xff01, // format used to pass CL text sections to FE ET_OPENCL_OBJECTS = 0xff02, // format used to pass LLVM objects / store LLVM binary output ET_OPENCL_LIBRARY = 0xff03, // format used to store LLVM archive output ET_OPENCL_EXECUTABLE = 0xff04, // format used to store executable output ET_OPENCL_DEBUG = 0xff05, // format used to store debug output }; -static_assert(sizeof(ELF_TYPE_OPENCL) == sizeof(ELF_TYPE), ""); +static_assert(sizeof(ElfTypeOpencl) == sizeof(ElfType), ""); static_assert(static_cast(ET_OPENCL_SOURCE) == static_cast(ET_OPENCL_RESERVED_START), ""); static_assert(static_cast(ET_OPENCL_DEBUG) == static_cast(ET_OPENCL_RESERVED_END), ""); -enum SHT_OPENCL : uint32_t { +enum SectionHeaderTypeOpencl : uint32_t { SHT_OPENCL_SOURCE = 0xff000000, // CL source to link into LLVM binary SHT_OPENCL_HEADER = 0xff000001, // CL header to link into LLVM binary SHT_OPENCL_LLVM_TEXT = 0xff000002, // LLVM text @@ -44,7 +44,7 @@ enum SHT_OPENCL : uint32_t { SHT_OPENCL_SPIRV_SC_IDS = 0xff00000b, // Specialization Constants IDs SHT_OPENCL_SPIRV_SC_VALUES = 0xff00000c // Specialization Constants values }; -static_assert(sizeof(SHT_OPENCL) == sizeof(SECTION_HEADER_TYPE), ""); +static_assert(sizeof(SectionHeaderTypeOpencl) == sizeof(SectionHeaderType), ""); static_assert(static_cast(SHT_OPENCL_SOURCE) == static_cast(SHT_OPENCL_RESERVED_START), ""); static_assert(static_cast(SHT_OPENCL_SPIRV_SC_VALUES) == static_cast(SHT_OPENCL_RESERVED_END), ""); diff --git a/shared/source/device_binary_format/zebin/debug_zebin.cpp b/shared/source/device_binary_format/zebin/debug_zebin.cpp index 960f9d0babb1b..fa28ecefc97c2 100644 --- a/shared/source/device_binary_format/zebin/debug_zebin.cpp +++ b/shared/source/device_binary_format/zebin/debug_zebin.cpp @@ -99,7 +99,7 @@ void patchWithValue(uintptr_t addr, T value) { } } -void DebugZebinCreator::applyRelocation(uintptr_t addr, uint64_t value, RELOC_TYPE_ZEBIN type) { +void DebugZebinCreator::applyRelocation(uintptr_t addr, uint64_t value, RelocTypeZebin type) { switch (type) { default: UNRECOVERABLE_IF(type != R_ZE_SYM_ADDR) @@ -138,7 +138,7 @@ void DebugZebinCreator::applyRelocations() { for (const auto *relocations : {&elf.getDebugInfoRelocations(), &elf.getRelocations()}) { for (const auto &reloc : *relocations) { - auto relocType = static_cast(reloc.relocType); + auto relocType = static_cast(reloc.relocType); if (isRelocTypeSupported(relocType) == false) { continue; } @@ -150,10 +150,10 @@ void DebugZebinCreator::applyRelocations() { } } -bool DebugZebinCreator::isRelocTypeSupported(RELOC_TYPE_ZEBIN type) { - return type == RELOC_TYPE_ZEBIN::R_ZE_SYM_ADDR || - type == RELOC_TYPE_ZEBIN::R_ZE_SYM_ADDR_32 || - type == RELOC_TYPE_ZEBIN::R_ZE_SYM_ADDR_32_HI; +bool DebugZebinCreator::isRelocTypeSupported(RelocTypeZebin type) { + return type == RelocTypeZebin::R_ZE_SYM_ADDR || + type == RelocTypeZebin::R_ZE_SYM_ADDR_32 || + type == RelocTypeZebin::R_ZE_SYM_ADDR_32_HI; } const Segments::Segment *DebugZebinCreator::getSegmentByName(ConstStringRef sectionName) { diff --git a/shared/source/device_binary_format/zebin/debug_zebin.h b/shared/source/device_binary_format/zebin/debug_zebin.h index c88794d6c1968..1146a72f167cf 100644 --- a/shared/source/device_binary_format/zebin/debug_zebin.h +++ b/shared/source/device_binary_format/zebin/debug_zebin.h @@ -48,8 +48,8 @@ class DebugZebinCreator { inline std::vector getDebugZebin() { return debugZebin; } protected: - void applyRelocation(uintptr_t addr, uint64_t value, NEO::Zebin::Elf::RELOC_TYPE_ZEBIN type); - bool isRelocTypeSupported(NEO::Zebin::Elf::RELOC_TYPE_ZEBIN type); + void applyRelocation(uintptr_t addr, uint64_t value, NEO::Zebin::Elf::RelocTypeZebin type); + bool isRelocTypeSupported(NEO::Zebin::Elf::RelocTypeZebin type); const Segments::Segment *getSegmentByName(ConstStringRef sectionName); const Segments::Segment *getTextSegmentByName(ConstStringRef textSegmentName); bool isCpuSegment(ConstStringRef sectionName); diff --git a/shared/source/device_binary_format/zebin/zebin_decoder.cpp b/shared/source/device_binary_format/zebin/zebin_decoder.cpp index 486461e905125..64bf15c8f3bf6 100644 --- a/shared/source/device_binary_format/zebin/zebin_decoder.cpp +++ b/shared/source/device_binary_format/zebin/zebin_decoder.cpp @@ -35,7 +35,7 @@ void setKernelMiscInfoPosition(ConstStringRef metadata, NEO::ProgramInfo &dst) { template bool isZebin(ArrayRef binary); template bool isZebin(ArrayRef binary); -template +template bool isZebin(ArrayRef binary) { auto fileHeader = Elf::decodeElfFileHeader(binary); return fileHeader != nullptr && @@ -43,7 +43,7 @@ bool isZebin(ArrayRef binary) { fileHeader->type == Elf::ET_ZEBIN_EXE); } -bool validateTargetDevice(const TargetDevice &targetDevice, Elf::ELF_IDENTIFIER_CLASS numBits, PRODUCT_FAMILY productFamily, GFXCORE_FAMILY gfxCore, AOT::PRODUCT_CONFIG productConfig, Elf::ZebinTargetFlags targetMetadata) { +bool validateTargetDevice(const TargetDevice &targetDevice, Elf::ElfIdentifierClass numBits, PRODUCT_FAMILY productFamily, GFXCORE_FAMILY gfxCore, AOT::PRODUCT_CONFIG productConfig, Elf::ZebinTargetFlags targetMetadata) { if (targetDevice.maxPointerSizeInBytes == 4 && static_cast(numBits == Elf::EI_CLASS_64)) { return false; } @@ -77,7 +77,7 @@ bool validateTargetDevice(const TargetDevice &targetDevice, Elf::ELF_IDENTIFIER_ template bool validateTargetDevice(const Elf::Elf &elf, const TargetDevice &targetDevice, std::string &outErrReason, std::string &outWarning, GeneratorType &generatorType); template bool validateTargetDevice(const Elf::Elf &elf, const TargetDevice &targetDevice, std::string &outErrReason, std::string &outWarning, GeneratorType &generatorType); -template +template bool validateTargetDevice(const Elf::Elf &elf, const TargetDevice &targetDevice, std::string &outErrReason, std::string &outWarning, GeneratorType &generatorType) { GFXCORE_FAMILY gfxCore = IGFX_UNKNOWN_CORE; PRODUCT_FAMILY productFamily = IGFX_UNKNOWN; @@ -143,7 +143,7 @@ bool validateTargetDevice(const Elf::Elf &elf, const TargetDevice &targ return validateTargetDevice(targetDevice, numBits, productFamily, gfxCore, productConfig, targetMetadata); } -template +template DecodeError decodeIntelGTNoteSection(ArrayRef intelGTNotesSection, std::vector &intelGTNotes, std::string &outErrReason, std::string &outWarning) { uint64_t currentPos = 0; auto sectionSize = intelGTNotesSection.size(); @@ -189,7 +189,7 @@ DecodeError decodeIntelGTNoteSection(ArrayRef intelGTNotesSection return DecodeError::success; } -template +template DecodeError getIntelGTNotes(const Elf::Elf &elf, std::vector &intelGTNotes, std::string &outErrReason, std::string &outWarning) { for (size_t i = 0; i < elf.sectionHeaders.size(); i++) { auto section = elf.sectionHeaders[i]; @@ -200,7 +200,7 @@ DecodeError getIntelGTNotes(const Elf::Elf &elf, std::vector +template DecodeError extractZebinSections(NEO::Elf::Elf &elf, ZebinSections &out, std::string &outErrReason, std::string &outWarning) { if ((elf.elfFileHeader->shStrNdx >= elf.sectionHeaders.size()) || (NEO::Elf::SHN_UNDEF == elf.elfFileHeader->shStrNdx)) { outErrReason.append("DeviceBinaryFormat::zebin : Invalid or missing shStrNdx in elf header\n"); @@ -305,7 +305,7 @@ bool validateZebinSectionsCountAtMost(const ContainerT §ionsContainer, Const template DecodeError validateZebinSectionsCount(const ZebinSections §ions, std::string &outErrReason, std::string &outWarning); template DecodeError validateZebinSectionsCount(const ZebinSections §ions, std::string &outErrReason, std::string &outWarning); -template +template DecodeError validateZebinSectionsCount(const ZebinSections §ions, std::string &outErrReason, std::string &outWarning) { bool valid = validateZebinSectionsCountAtMost(sections.zeInfoSections, Elf::SectionNames::zeInfo, 1U, outErrReason, outWarning); valid &= validateZebinSectionsCountAtMost(sections.globalDataSections, Elf::SectionNames::dataGlobal, 1U, outErrReason, outWarning); @@ -319,7 +319,7 @@ DecodeError validateZebinSectionsCount(const ZebinSections §ions, s return valid ? DecodeError::success : DecodeError::invalidBinary; } -template +template ConstStringRef extractZeInfoMetadataString(const ArrayRef zebin, std::string &outErrReason, std::string &outWarning) { auto decodedElf = NEO::Elf::decodeElf(zebin, outErrReason, outWarning); for (const auto §ionHeader : decodedElf.sectionHeaders) { @@ -339,7 +339,7 @@ ConstStringRef getZeInfoFromZebin(const ArrayRef zebin, std::stri template DecodeError decodeZebin(ProgramInfo &dst, NEO::Elf::Elf &elf, std::string &outErrReason, std::string &outWarning); template DecodeError decodeZebin(ProgramInfo &dst, NEO::Elf::Elf &elf, std::string &outErrReason, std::string &outWarning); -template +template DecodeError decodeZebin(ProgramInfo &dst, NEO::Elf::Elf &elf, std::string &outErrReason, std::string &outWarning) { ZebinSections zebinSections; auto extractError = extractZebinSections(elf, zebinSections, outErrReason, outWarning); @@ -428,7 +428,7 @@ DecodeError decodeZebin(ProgramInfo &dst, NEO::Elf::Elf &elf, std::stri template ArrayRef getKernelHeap(ConstStringRef &kernelName, Elf::Elf &elf, const ZebinSections &zebinSections); template ArrayRef getKernelHeap(ConstStringRef &kernelName, Elf::Elf &elf, const ZebinSections &zebinSections); -template +template ArrayRef getKernelHeap(ConstStringRef &kernelName, Elf::Elf &elf, const ZebinSections &zebinSections) { auto sectionHeaderNamesData = elf.sectionHeaders[elf.elfFileHeader->shStrNdx].data; ConstStringRef sectionHeaderNamesString(reinterpret_cast(sectionHeaderNamesData.begin()), sectionHeaderNamesData.size()); @@ -444,7 +444,7 @@ ArrayRef getKernelHeap(ConstStringRef &kernelName, Elf::Elf getKernelGtpinInfo(ConstStringRef &kernelName, Elf::Elf &elf, const ZebinSections &zebinSections); template ArrayRef getKernelGtpinInfo(ConstStringRef &kernelName, Elf::Elf &elf, const ZebinSections &zebinSections); -template +template ArrayRef getKernelGtpinInfo(ConstStringRef &kernelName, Elf::Elf &elf, const ZebinSections &zebinSections) { auto sectionHeaderNamesData = elf.sectionHeaders[elf.elfFileHeader->shStrNdx].data; ConstStringRef sectionHeaderNamesString(reinterpret_cast(sectionHeaderNamesData.begin()), sectionHeaderNamesData.size()); diff --git a/shared/source/device_binary_format/zebin/zebin_decoder.h b/shared/source/device_binary_format/zebin/zebin_decoder.h index 0fef76f57b1ce..711dd008ae4b8 100644 --- a/shared/source/device_binary_format/zebin/zebin_decoder.h +++ b/shared/source/device_binary_format/zebin/zebin_decoder.h @@ -15,19 +15,19 @@ #include namespace AOT { -enum PRODUCT_CONFIG : uint32_t; +enum PRODUCT_CONFIG : uint32_t; // NOLINT(readability-identifier-naming) } namespace NEO { namespace Elf { -template +template struct Elf; } struct ProgramInfo; namespace Zebin { -template +template struct ZebinSections { using SectionHeaderData = typename NEO::Elf::Elf::SectionHeaderAndData; StackVec textKernelSections; @@ -44,33 +44,33 @@ struct ZebinSections { StackVec buildOptionsSection; }; -template +template bool isZebin(ArrayRef binary); -bool validateTargetDevice(const TargetDevice &targetDevice, Elf::ELF_IDENTIFIER_CLASS numBits, PRODUCT_FAMILY productFamily, GFXCORE_FAMILY gfxCore, AOT::PRODUCT_CONFIG productConfig, Zebin::Elf::ZebinTargetFlags targetMetadata); +bool validateTargetDevice(const TargetDevice &targetDevice, Elf::ElfIdentifierClass numBits, PRODUCT_FAMILY productFamily, GFXCORE_FAMILY gfxCore, AOT::PRODUCT_CONFIG productConfig, Zebin::Elf::ZebinTargetFlags targetMetadata); -template +template bool validateTargetDevice(const Elf::Elf &elf, const TargetDevice &targetDevice, std::string &outErrReason, std::string &outWarning, GeneratorType &generatorType); -template +template DecodeError decodeIntelGTNoteSection(ArrayRef intelGTNotesSection, std::vector &intelGTNotes, std::string &outErrReason, std::string &outWarning); -template +template DecodeError getIntelGTNotes(const Elf::Elf &elf, std::vector &intelGTNotes, std::string &outErrReason, std::string &outWarning); -template +template DecodeError extractZebinSections(Elf::Elf &elf, ZebinSections &out, std::string &outErrReason, std::string &outWarning); -template +template DecodeError validateZebinSectionsCount(const ZebinSections §ions, std::string &outErrReason, std::string &outWarning); -template +template DecodeError decodeZebin(ProgramInfo &dst, Elf::Elf &elf, std::string &outErrReason, std::string &outWarning); -template +template ArrayRef getKernelHeap(ConstStringRef &kernelName, Elf::Elf &elf, const ZebinSections &zebinSections); -template +template ArrayRef getKernelGtpinInfo(ConstStringRef &kernelName, Elf::Elf &elf, const ZebinSections &zebinSections); void setKernelMiscInfoPosition(ConstStringRef metadata, ProgramInfo &dst); diff --git a/shared/source/device_binary_format/zebin/zebin_elf.h b/shared/source/device_binary_format/zebin/zebin_elf.h index 0d7eae8faf763..71496415b3b6c 100644 --- a/shared/source/device_binary_format/zebin/zebin_elf.h +++ b/shared/source/device_binary_format/zebin/zebin_elf.h @@ -12,13 +12,13 @@ namespace NEO::Zebin::Elf { using namespace NEO::Elf; -enum ELF_TYPE_ZEBIN : uint16_t { +enum ElfTypeZebin : uint16_t { ET_ZEBIN_REL = 0xff11, // A relocatable ZE binary file ET_ZEBIN_EXE = 0xff12, // An executable ZE binary file ET_ZEBIN_DYN = 0xff13, // A shared object ZE binary file }; -enum SHT_ZEBIN : uint32_t { +enum SectionHeaderTypeZebin : uint32_t { SHT_ZEBIN_SPIRV = 0xff000009, // .spv.kernel section, value the same as SHT_OPENCL_SPIRV SHT_ZEBIN_ZEINFO = 0xff000011, // .ze_info section SHT_ZEBIN_GTPIN_INFO = 0xff000012, // .gtpin_info section @@ -26,7 +26,7 @@ enum SHT_ZEBIN : uint32_t { SHT_ZEBIN_MISC = 0xff000014 // .misc section }; -enum RELOC_TYPE_ZEBIN : uint32_t { +enum RelocTypeZebin : uint32_t { R_ZE_NONE, R_ZE_SYM_ADDR, R_ZE_SYM_ADDR_32, diff --git a/shared/source/helpers/product_config_helper.h b/shared/source/helpers/product_config_helper.h index 0bfc2c9e91e1e..2ced20a721588 100644 --- a/shared/source/helpers/product_config_helper.h +++ b/shared/source/helpers/product_config_helper.h @@ -18,7 +18,7 @@ #include namespace AOT { -enum PRODUCT_CONFIG : uint32_t; +enum PRODUCT_CONFIG : uint32_t; // NOLINT(readability-identifier-naming) enum RELEASE : uint32_t; enum FAMILY : uint32_t; } // namespace AOT diff --git a/shared/source/helpers/surface_format_info.h b/shared/source/helpers/surface_format_info.h index 530d8b3ee3f7d..c160477d8346c 100644 --- a/shared/source/helpers/surface_format_info.h +++ b/shared/source/helpers/surface_format_info.h @@ -11,7 +11,7 @@ #include "third_party/opencl_headers/CL/cl_ext.h" namespace NEO { -enum GFX3DSTATE_SURFACEFORMAT : unsigned short { +enum SurfaceFormat : unsigned short { GFX3DSTATE_SURFACEFORMAT_R32G32B32A32_FLOAT = 0x000, GFX3DSTATE_SURFACEFORMAT_R32G32B32A32_SINT = 0x001, GFX3DSTATE_SURFACEFORMAT_R32G32B32A32_UINT = 0x002, @@ -196,7 +196,7 @@ enum class ImagePlane { struct SurfaceFormatInfo { GMM_RESOURCE_FORMAT gmmSurfaceFormat; - GFX3DSTATE_SURFACEFORMAT genxSurfaceFormat; + SurfaceFormat genxSurfaceFormat; uint32_t gmmTileWalk; uint32_t numChannels; uint32_t perChannelSizeInBytes; diff --git a/shared/source/os_interface/linux/drm_command_stream.h b/shared/source/os_interface/linux/drm_command_stream.h index f414d1aac0645..250d84b796c28 100644 --- a/shared/source/os_interface/linux/drm_command_stream.h +++ b/shared/source/os_interface/linux/drm_command_stream.h @@ -41,7 +41,7 @@ class DrmCommandStreamReceiver : public DeviceCommandStreamReceiver { DrmCommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, const DeviceBitfield deviceBitfield, - gemCloseWorkerMode mode = gemCloseWorkerMode::gemCloseWorkerActive); + GemCloseWorkerMode mode = GemCloseWorkerMode::gemCloseWorkerActive); ~DrmCommandStreamReceiver() override; SubmissionStatus flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override; @@ -54,12 +54,12 @@ class DrmCommandStreamReceiver : public DeviceCommandStreamReceiver { DrmMemoryManager *getMemoryManager() const; GmmPageTableMngr *createPageTableManager() override; - gemCloseWorkerMode peekGemCloseWorkerOperationMode() const { + GemCloseWorkerMode peekGemCloseWorkerOperationMode() const { return this->gemCloseWorkerOperationMode; } void initializeDefaultsForInternalEngine() override { - gemCloseWorkerOperationMode = gemCloseWorkerMode::gemCloseWorkerInactive; + gemCloseWorkerOperationMode = GemCloseWorkerMode::gemCloseWorkerInactive; } SubmissionStatus printBOsForSubmit(ResidencyContainer &allocationsForResidency, GraphicsAllocation &cmdBufferAllocation); @@ -77,7 +77,7 @@ class DrmCommandStreamReceiver : public DeviceCommandStreamReceiver { std::vector residency; std::vector execObjectsStorage; Drm *drm; - gemCloseWorkerMode gemCloseWorkerOperationMode; + GemCloseWorkerMode gemCloseWorkerOperationMode; volatile uint32_t reserved = 0; int32_t kmdWaitTimeout = -1; diff --git a/shared/source/os_interface/linux/drm_command_stream.inl b/shared/source/os_interface/linux/drm_command_stream.inl index 639e8d3e5b0a4..c3014496d08cd 100644 --- a/shared/source/os_interface/linux/drm_command_stream.inl +++ b/shared/source/os_interface/linux/drm_command_stream.inl @@ -33,7 +33,7 @@ template DrmCommandStreamReceiver::DrmCommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, const DeviceBitfield deviceBitfield, - gemCloseWorkerMode mode) + GemCloseWorkerMode mode) : BaseClass(executionEnvironment, rootDeviceIndex, deviceBitfield), gemCloseWorkerOperationMode(mode) { auto rootDeviceEnvironment = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex].get(); @@ -43,11 +43,11 @@ DrmCommandStreamReceiver::DrmCommandStreamReceiver(ExecutionEnvironme execObjectsStorage.reserve(512); if (this->drm->isVmBindAvailable()) { - gemCloseWorkerOperationMode = gemCloseWorkerMode::gemCloseWorkerInactive; + gemCloseWorkerOperationMode = GemCloseWorkerMode::gemCloseWorkerInactive; } if (debugManager.flags.EnableGemCloseWorker.get() != -1) { - gemCloseWorkerOperationMode = debugManager.flags.EnableGemCloseWorker.get() ? gemCloseWorkerMode::gemCloseWorkerActive : gemCloseWorkerMode::gemCloseWorkerInactive; + gemCloseWorkerOperationMode = debugManager.flags.EnableGemCloseWorker.get() ? GemCloseWorkerMode::gemCloseWorkerActive : GemCloseWorkerMode::gemCloseWorkerInactive; } auto hwInfo = rootDeviceEnvironment->getHardwareInfo(); @@ -175,7 +175,7 @@ SubmissionStatus DrmCommandStreamReceiver::flush(BatchBuffer &batchBu auto ret = this->flushInternal(batchBuffer, allocationsForResidency); - if (this->gemCloseWorkerOperationMode == gemCloseWorkerMode::gemCloseWorkerActive) { + if (this->gemCloseWorkerOperationMode == GemCloseWorkerMode::gemCloseWorkerActive) { bb->reference(); this->getMemoryManager()->peekGemCloseWorker()->push(bb); } diff --git a/shared/source/os_interface/linux/drm_gem_close_worker.h b/shared/source/os_interface/linux/drm_gem_close_worker.h index 77cba0c4f26d5..b9e7605751b91 100644 --- a/shared/source/os_interface/linux/drm_gem_close_worker.h +++ b/shared/source/os_interface/linux/drm_gem_close_worker.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -19,7 +19,7 @@ class DrmMemoryManager; class BufferObject; class Thread; -enum class gemCloseWorkerMode { +enum class GemCloseWorkerMode { gemCloseWorkerInactive, gemCloseWorkerActive }; diff --git a/shared/source/os_interface/linux/drm_memory_manager.cpp b/shared/source/os_interface/linux/drm_memory_manager.cpp index d9f45e9f0f06a..737703f22477a 100644 --- a/shared/source/os_interface/linux/drm_memory_manager.cpp +++ b/shared/source/os_interface/linux/drm_memory_manager.cpp @@ -53,7 +53,7 @@ namespace NEO { using AllocationStatus = MemoryManager::AllocationStatus; -DrmMemoryManager::DrmMemoryManager(gemCloseWorkerMode mode, +DrmMemoryManager::DrmMemoryManager(GemCloseWorkerMode mode, bool forcePinAllowed, bool validateHostPtrMemory, ExecutionEnvironment &executionEnvironment) : MemoryManager(executionEnvironment), @@ -73,7 +73,7 @@ DrmMemoryManager::DrmMemoryManager(gemCloseWorkerMode mode, initialize(mode); } -void DrmMemoryManager::initialize(gemCloseWorkerMode mode) { +void DrmMemoryManager::initialize(GemCloseWorkerMode mode) { bool disableGemCloseWorker = true; for (uint32_t rootDeviceIndex = 0; rootDeviceIndex < gfxPartitions.size(); ++rootDeviceIndex) { @@ -87,14 +87,14 @@ void DrmMemoryManager::initialize(gemCloseWorkerMode mode) { } if (disableGemCloseWorker) { - mode = gemCloseWorkerMode::gemCloseWorkerInactive; + mode = GemCloseWorkerMode::gemCloseWorkerInactive; } if (debugManager.flags.EnableGemCloseWorker.get() != -1) { - mode = debugManager.flags.EnableGemCloseWorker.get() ? gemCloseWorkerMode::gemCloseWorkerActive : gemCloseWorkerMode::gemCloseWorkerInactive; + mode = debugManager.flags.EnableGemCloseWorker.get() ? GemCloseWorkerMode::gemCloseWorkerActive : GemCloseWorkerMode::gemCloseWorkerInactive; } - if (mode != gemCloseWorkerMode::gemCloseWorkerInactive) { + if (mode != GemCloseWorkerMode::gemCloseWorkerInactive) { gemCloseWorker.reset(new DrmGemCloseWorker(*this)); } @@ -1491,7 +1491,7 @@ std::unique_ptr DrmMemoryManager::create(ExecutionEnvironment &ex validateHostPtr = debugManager.flags.EnableHostPtrValidation.get(); } - return std::make_unique(gemCloseWorkerMode::gemCloseWorkerActive, + return std::make_unique(GemCloseWorkerMode::gemCloseWorkerActive, debugManager.flags.EnableForcePin.get(), validateHostPtr, executionEnvironment); diff --git a/shared/source/os_interface/linux/drm_memory_manager.h b/shared/source/os_interface/linux/drm_memory_manager.h index b80c0979cd94c..6b1c932a042ab 100644 --- a/shared/source/os_interface/linux/drm_memory_manager.h +++ b/shared/source/os_interface/linux/drm_memory_manager.h @@ -22,17 +22,17 @@ class DrmAllocation; class OsContextLinux; enum class AtomicAccessMode : uint32_t; -enum class gemCloseWorkerMode; +enum class GemCloseWorkerMode; class DrmMemoryManager : public MemoryManager { public: - DrmMemoryManager(gemCloseWorkerMode mode, + DrmMemoryManager(GemCloseWorkerMode mode, bool forcePinAllowed, bool validateHostPtrMemory, ExecutionEnvironment &executionEnvironment); ~DrmMemoryManager() override; - void initialize(gemCloseWorkerMode mode); + void initialize(GemCloseWorkerMode mode); void addAllocationToHostPtrManager(GraphicsAllocation *gfxAllocation) override; void removeAllocationFromHostPtrManager(GraphicsAllocation *gfxAllocation) override; void freeGraphicsMemoryImpl(GraphicsAllocation *gfxAllocation) override; diff --git a/shared/source/os_interface/windows/device_time_wddm.cpp b/shared/source/os_interface/windows/device_time_wddm.cpp index 5ef2a0d1cdbce..c840140737581 100644 --- a/shared/source/os_interface/windows/device_time_wddm.cpp +++ b/shared/source/os_interface/windows/device_time_wddm.cpp @@ -22,19 +22,19 @@ namespace NEO { bool DeviceTimeWddm::runEscape(Wddm *wddm, TimeStampDataHeader &escapeInfo) { if (wddm) { - D3DKMT_ESCAPE escapeCommand = {0}; + D3DKMT_ESCAPE escapeCommand = {}; - GTDIGetGpuCpuTimestampsIn in = {GTDI_FNC_GET_GPU_CPU_TIMESTAMPS}; - uint32_t outSize = sizeof(GTDIGetGpuCpuTimestampsOut); + GetGpuCpuTimestampsIn in{}; + uint32_t outSize = sizeof(GetGpuCpuTimestampsOut); escapeInfo.header.EscapeCode = static_cast(GFX_ESCAPE_IGPA_INSTRUMENTATION_CONTROL); escapeInfo.header.Size = outSize; escapeInfo.data.in = in; escapeCommand.Flags.Value = 0; - escapeCommand.hAdapter = (D3DKMT_HANDLE)0; - escapeCommand.hContext = (D3DKMT_HANDLE)0; - escapeCommand.hDevice = (D3DKMT_HANDLE)wddm->getDeviceHandle(); + escapeCommand.hAdapter = 0; + escapeCommand.hContext = 0; + escapeCommand.hDevice = static_cast(wddm->getDeviceHandle()); escapeCommand.pPrivateDriverData = &escapeInfo; escapeCommand.PrivateDriverDataSize = sizeof(escapeInfo); escapeCommand.Type = D3DKMT_ESCAPE_DRIVERPRIVATE; diff --git a/shared/source/os_interface/windows/device_time_wddm.h b/shared/source/os_interface/windows/device_time_wddm.h index 37a01477f4ac0..dc800d5043d52 100644 --- a/shared/source/os_interface/windows/device_time_wddm.h +++ b/shared/source/os_interface/windows/device_time_wddm.h @@ -29,44 +29,23 @@ class DeviceTimeWddm : public DeviceTime { Wddm *wddm = nullptr; }; -typedef enum GTDI_ESCAPE_FUNCTION_ENUM { - GTDI_FNC_GET_GPU_CPU_TIMESTAMPS = 25 -} GTDI_ESCAPE_FUNCTION; - -typedef struct GTDIBaseInStruct { - GTDI_ESCAPE_FUNCTION function; -} GTDIHeaderIn; - -typedef GTDIHeaderIn GTDIGetGpuCpuTimestampsIn; - -typedef enum GTDI_RETURN_CODE_ENUM { - GTDI_RET_OK = 0, - GTDI_RET_FAILED, - GTDI_RET_NOT_CONNECTED, - GTDI_RET_HW_METRICS_NOT_ENABLED, - GTDI_RET_CONTEXT_ID_MISMATCH, - GTDI_RET_NOT_SUPPORTED, - GTDI_RET_PENDING, - GTDI_RET_INVALID_CONFIGURATION, - GTDI_RET_CONCURRENT_API_ENABLED, - GTDI_RET_NO_INFORMATION, // for GTDI_FNC_GET_ERROR_INFO escape only - // ... - GTDI_RET_MAX = 0xFFFFFFFF -} GTDI_RETURN_CODE; +struct GetGpuCpuTimestampsIn { + int function = 25; // GTDI_FNC_GET_GPU_CPU_TIMESTAMPS +}; -typedef struct GTDIGetGpuCpuTimestampsOutStruct { - GTDI_RETURN_CODE retCode; // Result of the call - uint64_t gpuPerfTicks; // in GPU_timestamp_ticks - uint64_t cpuPerfTicks; // in CPU_timestamp_ticks - uint64_t gpuPerfFreq; // in GPU_timestamp_ticks/s - uint64_t cpuPerfFreq; // in CPU_timestamp_ticks/s -} GTDIGetGpuCpuTimestampsOut; +struct GetGpuCpuTimestampsOut { + int retCode; // Result of the call + uint64_t gpuPerfTicks; // in GPU_timestamp_ticks + uint64_t cpuPerfTicks; // in CPU_timestamp_ticks + uint64_t gpuPerfFreq; // in GPU_timestamp_ticks/s + uint64_t cpuPerfFreq; // in CPU_timestamp_ticks/s +}; struct TimeStampDataHeader { GFX_ESCAPE_HEADER_T header; union { - GTDIGetGpuCpuTimestampsIn in; - GTDIGetGpuCpuTimestampsOut out; + GetGpuCpuTimestampsIn in; + GetGpuCpuTimestampsOut out; } data; }; diff --git a/shared/source/tbx/tbx_proto.h b/shared/source/tbx/tbx_proto.h index 87e2e02a254e5..05908e1626f03 100644 --- a/shared/source/tbx/tbx_proto.h +++ b/shared/source/tbx/tbx_proto.h @@ -11,7 +11,7 @@ namespace NEO { -enum HAS_MSG_TYPE { +enum HasMsgType { HAS_MMIO_REQ_TYPE = 0, HAS_MMIO_RES_TYPE = 1, HAS_GTT_REQ_TYPE = 2, @@ -53,7 +53,7 @@ enum HAS_MSG_TYPE { struct HasHdr { union { uint32_t msgType; - HAS_MSG_TYPE type; + HasMsgType type; }; uint32_t transID; uint32_t size; @@ -77,7 +77,7 @@ struct HasMmioReq { uint32_t data; enum { - HAS_MSG_TYPE = HAS_MMIO_REQ_TYPE + HasMsgType = HAS_MMIO_REQ_TYPE }; }; @@ -86,7 +86,7 @@ struct HasMmioExtReq { uint32_t sourceid : 8; uint32_t reserved1 : 24; enum { - HAS_MSG_TYPE = HAS_MMIO_REQ_TYPE + HasMsgType = HAS_MMIO_REQ_TYPE }; }; @@ -94,7 +94,7 @@ struct HasMmioRes { uint32_t data; enum { - HAS_MSG_TYPE = HAS_MMIO_RES_TYPE + HasMsgType = HAS_MMIO_RES_TYPE }; }; @@ -106,7 +106,7 @@ struct HasGtt32Req { uint32_t data; enum { - HAS_MSG_TYPE = HAS_GTT_REQ_TYPE + HasMsgType = HAS_GTT_REQ_TYPE }; }; @@ -114,7 +114,7 @@ struct HasGtt32Res { uint32_t data; enum { - HAS_MSG_TYPE = HAS_GTT_RES_TYPE + HasMsgType = HAS_GTT_RES_TYPE }; }; @@ -127,7 +127,7 @@ struct HasGtt64Req { uint32_t dataH; enum { - HAS_MSG_TYPE = HAS_GTT_REQ_TYPE + HasMsgType = HAS_GTT_REQ_TYPE }; }; @@ -136,7 +136,7 @@ struct HasGtt64Res { uint32_t dataH; enum { - HAS_MSG_TYPE = HAS_GTT_RES_TYPE + HasMsgType = HAS_GTT_RES_TYPE }; }; @@ -154,7 +154,7 @@ struct HasWriteDataReq { uint32_t size; enum { - HAS_MSG_TYPE = HAS_WRITE_DATA_REQ_TYPE + HasMsgType = HAS_WRITE_DATA_REQ_TYPE }; }; @@ -170,7 +170,7 @@ struct HasReadDataReq { uint32_t size; enum { - HAS_MSG_TYPE = HAS_READ_DATA_REQ_TYPE + HasMsgType = HAS_READ_DATA_REQ_TYPE }; }; @@ -185,7 +185,7 @@ struct HasReadDataRes { uint32_t size; enum { - HAS_MSG_TYPE = HAS_READ_DATA_RES_TYPE + HasMsgType = HAS_READ_DATA_RES_TYPE }; }; @@ -221,7 +221,7 @@ struct HasControlReq { uint32_t reservedMask : 3; // [31:29] enum { - HAS_MSG_TYPE = HAS_CONTROL_REQ_TYPE + HasMsgType = HAS_CONTROL_REQ_TYPE }; }; @@ -229,7 +229,7 @@ struct HasReportRendEndReq { uint32_t timeout; enum { - HAS_MSG_TYPE = HAS_REPORT_REND_END_REQ_TYPE + HasMsgType = HAS_REPORT_REND_END_REQ_TYPE }; }; @@ -238,7 +238,7 @@ struct HasReportRendEndRes { uint32_t reserved : 31; enum { - HAS_MSG_TYPE = HAS_REPORT_REND_END_RES_TYPE + HasMsgType = HAS_REPORT_REND_END_RES_TYPE }; }; @@ -253,7 +253,7 @@ struct HasPcicfgReq { uint32_t data; enum { - HAS_MSG_TYPE = HAS_PCICFG_REQ_TYPE + HasMsgType = HAS_PCICFG_REQ_TYPE }; }; @@ -267,7 +267,7 @@ struct HasGttParamsReq { uint32_t size : 24; enum { - HAS_MSG_TYPE = HAS_GTT_PARAMS_REQ_TYPE + HasMsgType = HAS_GTT_PARAMS_REQ_TYPE }; }; @@ -276,7 +276,7 @@ struct HasEventObsoleteReq { uint32_t data; enum { - HAS_MSG_TYPE = HAS_EVENT_REQ_TYPE + HasMsgType = HAS_EVENT_REQ_TYPE }; }; @@ -287,7 +287,7 @@ struct HasEventReq { uint32_t reserved : 30; enum { - HAS_MSG_TYPE = HAS_EVENT_REQ_TYPE + HasMsgType = HAS_EVENT_REQ_TYPE }; }; @@ -299,7 +299,7 @@ struct HasInnerVarReq { uint32_t data; enum { - HAS_MSG_TYPE = HAS_INNER_VAR_REQ_TYPE + HasMsgType = HAS_INNER_VAR_REQ_TYPE }; }; @@ -307,7 +307,7 @@ struct HasInnerVarRes { uint32_t data; enum { - HAS_MSG_TYPE = HAS_INNER_VAR_RES_TYPE + HasMsgType = HAS_INNER_VAR_RES_TYPE }; }; @@ -315,7 +315,7 @@ struct HasInnerVarListRes { uint32_t size; enum { - HAS_MSG_TYPE = HAS_INNER_VAR_LIST_RES_TYPE + HasMsgType = HAS_INNER_VAR_LIST_RES_TYPE }; }; @@ -334,7 +334,7 @@ struct HasFunnyIoReq { uint32_t value; enum { - HAS_MSG_TYPE = HAS_FUNNY_IO_REQ_TYPE + HasMsgType = HAS_FUNNY_IO_REQ_TYPE }; }; @@ -342,7 +342,7 @@ struct HasFunnyIoRes { uint32_t data; enum { - HAS_MSG_TYPE = HAS_FUNNY_IO_RES_TYPE + HasMsgType = HAS_FUNNY_IO_RES_TYPE }; }; @@ -355,7 +355,7 @@ struct HasIoReq { uint32_t value; enum { - HAS_MSG_TYPE = HAS_IO_REQ_TYPE + HasMsgType = HAS_IO_REQ_TYPE }; }; @@ -363,7 +363,7 @@ struct HasIoRes { uint32_t data; enum { - HAS_MSG_TYPE = HAS_IO_RES_TYPE + HasMsgType = HAS_IO_RES_TYPE }; }; @@ -371,7 +371,7 @@ struct HasRpcReq { uint32_t size; enum { - HAS_MSG_TYPE = HAS_RPC_REQ_TYPE + HasMsgType = HAS_RPC_REQ_TYPE }; }; @@ -380,7 +380,7 @@ struct HasRpcRes { uint32_t size; enum { - HAS_MSG_TYPE = HAS_RPC_RES_TYPE + HasMsgType = HAS_RPC_RES_TYPE }; }; @@ -393,7 +393,7 @@ struct HasClFlushReq { uint32_t delay; enum { - HAS_MSG_TYPE = HAS_CL_FLUSH_REQ_TYPE + HasMsgType = HAS_CL_FLUSH_REQ_TYPE }; }; @@ -401,7 +401,7 @@ struct HasClFlushRes { uint32_t data; enum { - HAS_MSG_TYPE = HAS_CL_FLUSH_RES_TYPE + HasMsgType = HAS_CL_FLUSH_RES_TYPE }; }; @@ -410,7 +410,7 @@ struct HasSimtimeRes { uint32_t dataH; enum { - HAS_MSG_TYPE = HAS_SIMTIME_RES_TYPE + HasMsgType = HAS_SIMTIME_RES_TYPE }; }; @@ -419,7 +419,7 @@ struct HasGd2Message { uint32_t data[1]; enum { - HAS_MSG_TYPE = HAS_GD2_MESSAGE_TYPE + HasMsgType = HAS_GD2_MESSAGE_TYPE }; }; @@ -460,10 +460,9 @@ struct HasMsg { union HasMsgBody u; }; -enum mem_types : uint32_t { - MEM_TYPE_SYSTEM = 0, - MEM_TYPE_LOCALMEM = 1, - MEM_TYPE_MAX = 4 +enum MemType : uint32_t { + system = 0, + local = 1, }; } // namespace NEO diff --git a/shared/test/common/device_binary_format/elf/elf_tests_data.h b/shared/test/common/device_binary_format/elf/elf_tests_data.h index fb9785e0c2e21..5ce3234ee8c24 100644 --- a/shared/test/common/device_binary_format/elf/elf_tests_data.h +++ b/shared/test/common/device_binary_format/elf/elf_tests_data.h @@ -18,13 +18,13 @@ using namespace NEO; -enum class enabledIrFormat { +enum class EnabledIrFormat { none, - enableSpirv, - enableLlvm + spirv, + llvm }; -template +template struct MockElfBinaryPatchtokens { MockElfBinaryPatchtokens(const HardwareInfo &hwInfo) : MockElfBinaryPatchtokens(std::string{}, hwInfo){}; MockElfBinaryPatchtokens(const std::string &buildOptions, const HardwareInfo &inputHwInfo) { @@ -54,9 +54,9 @@ struct MockElfBinaryPatchtokens { enc.getElfFileHeader().identity = Elf::ElfFileHeaderIdentity(Elf::EI_CLASS_64); enc.getElfFileHeader().type = NEO::Elf::ET_OPENCL_EXECUTABLE; enc.appendSection(Elf::SHT_OPENCL_DEV_BINARY, Elf::SectionNamesOpenCl::deviceBinary, ArrayRef::fromAny(mockDevBinaryData, mockDevBinaryDataSize)); - if (irFormat == enabledIrFormat::enableSpirv) + if (irFormat == EnabledIrFormat::spirv) enc.appendSection(Elf::SHT_OPENCL_SPIRV, Elf::SectionNamesOpenCl::spirvObject, ArrayRef::fromAny(mockSpirvBinaryData, mockSpirvBinaryDataSize)); - else if (irFormat == enabledIrFormat::enableLlvm) + else if (irFormat == EnabledIrFormat::llvm) enc.appendSection(Elf::SHT_OPENCL_LLVM_BINARY, Elf::SectionNamesOpenCl::llvmObject, ArrayRef::fromAny(mockLlvmBinaryData, mockLlvmBinaryDataSize)); if (false == buildOptions.empty()) enc.appendSection(Elf::SHT_OPENCL_OPTIONS, Elf::SectionNamesOpenCl::buildOptions, ArrayRef::fromAny(buildOptions.data(), buildOptions.size())); diff --git a/shared/test/common/mock_gdi/mock_gdi.cpp b/shared/test/common/mock_gdi/mock_gdi.cpp index 469a51288da9a..7901d8db91ed9 100644 --- a/shared/test/common/mock_gdi/mock_gdi.cpp +++ b/shared/test/common/mock_gdi/mock_gdi.cpp @@ -29,11 +29,11 @@ NTSTATUS gGetDeviceStatePageFaultReturnValue = STATUS_SUCCESS; NTSTATUS __stdcall mockD3DKMTEscape(IN CONST D3DKMT_ESCAPE *pData) { static int perfTicks = 0; ++perfTicks; - ((NEO::TimeStampDataHeader *)pData->pPrivateDriverData)->data.out.retCode = NEO::GTDI_RET_OK; - ((NEO::TimeStampDataHeader *)pData->pPrivateDriverData)->data.out.gpuPerfTicks = ++perfTicks; - ((NEO::TimeStampDataHeader *)pData->pPrivateDriverData)->data.out.cpuPerfTicks = perfTicks; - ((NEO::TimeStampDataHeader *)pData->pPrivateDriverData)->data.out.gpuPerfFreq = 1; - ((NEO::TimeStampDataHeader *)pData->pPrivateDriverData)->data.out.cpuPerfFreq = 1; + auto &getGpuCpuOut = reinterpret_cast(pData->pPrivateDriverData)->data.out; + getGpuCpuOut.gpuPerfTicks = ++perfTicks; + getGpuCpuOut.cpuPerfTicks = perfTicks; + getGpuCpuOut.gpuPerfFreq = 1; + getGpuCpuOut.cpuPerfFreq = 1; return STATUS_SUCCESS; } diff --git a/shared/test/common/mocks/linux/mock_drm_command_stream_receiver.h b/shared/test/common/mocks/linux/mock_drm_command_stream_receiver.h index d92b910fde7a2..c677a4230240a 100644 --- a/shared/test/common/mocks/linux/mock_drm_command_stream_receiver.h +++ b/shared/test/common/mocks/linux/mock_drm_command_stream_receiver.h @@ -46,7 +46,7 @@ class TestedDrmCommandStreamReceiver : public DrmCommandStreamReceiver::blitterDirectSubmission; using CommandStreamReceiverHw::CommandStreamReceiver::lastSentSliceCount; - TestedDrmCommandStreamReceiver(gemCloseWorkerMode mode, + TestedDrmCommandStreamReceiver(GemCloseWorkerMode mode, ExecutionEnvironment &executionEnvironment, const DeviceBitfield deviceBitfield) : DrmCommandStreamReceiver(executionEnvironment, 0, deviceBitfield, mode) { @@ -54,7 +54,7 @@ class TestedDrmCommandStreamReceiver : public DrmCommandStreamReceiver(executionEnvironment, rootDeviceIndex, deviceBitfield, gemCloseWorkerMode::gemCloseWorkerInactive) { + : DrmCommandStreamReceiver(executionEnvironment, rootDeviceIndex, deviceBitfield, GemCloseWorkerMode::gemCloseWorkerInactive) { } void overrideDispatchPolicy(DispatchMode overrideValue) { @@ -136,7 +136,7 @@ class TestedDrmCommandStreamReceiver : public DrmCommandStreamReceiver class TestedDrmCommandStreamReceiverWithFailingExec : public TestedDrmCommandStreamReceiver { public: - TestedDrmCommandStreamReceiverWithFailingExec(gemCloseWorkerMode mode, + TestedDrmCommandStreamReceiverWithFailingExec(GemCloseWorkerMode mode, ExecutionEnvironment &executionEnvironment, const DeviceBitfield deviceBitfield) : TestedDrmCommandStreamReceiver(mode, diff --git a/shared/test/common/mocks/linux/mock_drm_memory_manager.cpp b/shared/test/common/mocks/linux/mock_drm_memory_manager.cpp index 87104335efced..2673aed71a97a 100644 --- a/shared/test/common/mocks/linux/mock_drm_memory_manager.cpp +++ b/shared/test/common/mocks/linux/mock_drm_memory_manager.cpp @@ -22,7 +22,7 @@ namespace NEO { std::atomic closeInputFd(0); std::atomic closeCalledCount(0); -TestedDrmMemoryManager::TestedDrmMemoryManager(ExecutionEnvironment &executionEnvironment) : MemoryManagerCreate(gemCloseWorkerMode::gemCloseWorkerInactive, +TestedDrmMemoryManager::TestedDrmMemoryManager(ExecutionEnvironment &executionEnvironment) : MemoryManagerCreate(GemCloseWorkerMode::gemCloseWorkerInactive, false, false, executionEnvironment) { @@ -38,7 +38,7 @@ TestedDrmMemoryManager::TestedDrmMemoryManager(bool enableLocalMemory, bool allowForcePin, bool validateHostPtrMemory, ExecutionEnvironment &executionEnvironment) : MemoryManagerCreate(false, enableLocalMemory, - gemCloseWorkerMode::gemCloseWorkerInactive, + GemCloseWorkerMode::gemCloseWorkerInactive, allowForcePin, validateHostPtrMemory, executionEnvironment) { diff --git a/shared/test/common/mocks/mock_elf.h b/shared/test/common/mocks/mock_elf.h index 3e0c6153d53c6..16d5d841d14b2 100644 --- a/shared/test/common/mocks/mock_elf.h +++ b/shared/test/common/mocks/mock_elf.h @@ -11,7 +11,7 @@ #include -template +template struct MockElf : public NEO::Elf::Elf { using BaseClass = NEO::Elf::Elf; @@ -67,7 +67,7 @@ struct MockElf : public NEO::Elf::Elf { bool overrideSymbolName = false; }; -template +template struct MockElfEncoder : public NEO::Elf::ElfEncoder { using NEO::Elf::ElfEncoder::sectionHeaders; @@ -82,16 +82,16 @@ struct MockElfEncoder : public NEO::Elf::ElfEncoder { static std::vector createRelocateableDebugDataElf() { MockElfEncoder<> elfEncoder; - elfEncoder.getElfFileHeader().type = NEO::Elf::ELF_TYPE::ET_REL; - elfEncoder.getElfFileHeader().machine = NEO::Elf::ELF_MACHINE::EM_NONE; + elfEncoder.getElfFileHeader().type = NEO::Elf::ElfType::ET_REL; + elfEncoder.getElfFileHeader().machine = NEO::Elf::ElfMachine::EM_NONE; uint8_t dummyData[16]; elfEncoder.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Elf::SpecialSectionNames::text.str(), ArrayRef(dummyData, sizeof(dummyData))); auto textSectionIndex = elfEncoder.getLastSectionHeaderIndex(); - NEO::Elf::ElfRela relocationsWithAddend; + NEO::Elf::ElfRela relocationsWithAddend; relocationsWithAddend.addend = 0x1a8; - relocationsWithAddend.info = static_cast(textSectionIndex) << 32 | uint32_t(NEO::Elf::RELOCATION_X8664_TYPE::relocation64); + relocationsWithAddend.info = static_cast(textSectionIndex) << 32 | uint32_t(NEO::Elf::RelocationX8664Type::relocation64); relocationsWithAddend.offset = 8; elfEncoder.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Elf::SpecialSectionNames::debugInfo, ArrayRef(dummyData, sizeof(dummyData))); @@ -108,7 +108,7 @@ struct MockElfEncoder : public NEO::Elf::ElfEncoder { relaDebugSection->info = debugSectionIndex; relocationsWithAddend.addend = 0; - relocationsWithAddend.info = static_cast(textSectionIndex) << 32 | uint32_t(NEO::Elf::RELOCATION_X8664_TYPE::relocation64); + relocationsWithAddend.info = static_cast(textSectionIndex) << 32 | uint32_t(NEO::Elf::RelocationX8664Type::relocation64); relocationsWithAddend.offset = 0; elfEncoder.appendSection(NEO::Elf::SHT_RELA, NEO::Elf::SpecialSectionNames::relaPrefix.str() + NEO::Elf::SpecialSectionNames::debug.str() + "_line", @@ -118,9 +118,9 @@ struct MockElfEncoder : public NEO::Elf::ElfEncoder { relaDebugLineSection->info = debugLineSectionIndex; std::vector symbolTable; - symbolTable.resize(2 * sizeof(NEO::Elf::ElfSymbolEntry)); + symbolTable.resize(2 * sizeof(NEO::Elf::ElfSymbolEntry)); - auto symbols = reinterpret_cast *>(symbolTable.data()); + auto symbols = reinterpret_cast *>(symbolTable.data()); symbols[0].name = 0; // undef symbols[0].info = 0; symbols[0].shndx = 0; @@ -128,7 +128,7 @@ struct MockElfEncoder : public NEO::Elf::ElfEncoder { symbols[0].value = 0; symbols[1].name = elfEncoder.appendSectionName(NEO::ConstStringRef(".text")); - symbols[1].info = NEO::Elf::SYMBOL_TABLE_TYPE::STT_SECTION | NEO::Elf::SYMBOL_TABLE_BIND::STB_LOCAL << 4; + symbols[1].info = NEO::Elf::SymbolTableType::STT_SECTION | NEO::Elf::SymbolTableBind::STB_LOCAL << 4; symbols[1].shndx = static_cast(textSectionIndex); symbols[1].size = 0; symbols[1].value = 0; diff --git a/shared/test/common/mocks/mock_gmm.h b/shared/test/common/mocks/mock_gmm.h index 9974d5754db13..db13621d683ca 100644 --- a/shared/test/common/mocks/mock_gmm.h +++ b/shared/test/common/mocks/mock_gmm.h @@ -15,7 +15,7 @@ namespace NEO { namespace MockGmmParams { -static SurfaceFormatInfo mockSurfaceFormat = {GMM_FORMAT_R8G8B8A8_UNORM_TYPE, GFX3DSTATE_SURFACEFORMAT::GFX3DSTATE_SURFACEFORMAT_R8G8B8A8_UNORM, 0, 4, 1, 4}; +static SurfaceFormatInfo mockSurfaceFormat = {GMM_FORMAT_R8G8B8A8_UNORM_TYPE, SurfaceFormat::GFX3DSTATE_SURFACEFORMAT_R8G8B8A8_UNORM, 0, 4, 1, 4}; } class MockGmm : public Gmm { diff --git a/shared/test/common/mocks/mock_modules_zebin.cpp b/shared/test/common/mocks/mock_modules_zebin.cpp index 9adf4266b2f68..29252119a16b6 100644 --- a/shared/test/common/mocks/mock_modules_zebin.cpp +++ b/shared/test/common/mocks/mock_modules_zebin.cpp @@ -14,14 +14,14 @@ #include "shared/test/common/mocks/mock_elf.h" namespace ZebinTestData { -using ELF_IDENTIFIER_CLASS = NEO::Elf::ELF_IDENTIFIER_CLASS; +using ElfIdentifierClass = NEO::Elf::ElfIdentifierClass; -template struct ValidEmptyProgram; -template struct ValidEmptyProgram; +template struct ValidEmptyProgram; +template struct ValidEmptyProgram; -template ValidEmptyProgram::ValidEmptyProgram(); -template ValidEmptyProgram::ValidEmptyProgram(); -template +template ValidEmptyProgram::ValidEmptyProgram(); +template ValidEmptyProgram::ValidEmptyProgram(); +template ValidEmptyProgram::ValidEmptyProgram() { NEO::Elf::ElfEncoder enc; enc.getElfFileHeader().type = NEO::Zebin::Elf::ET_ZEBIN_EXE; @@ -33,14 +33,14 @@ ValidEmptyProgram::ValidEmptyProgram() { recalcPtr(); } -template +template void ValidEmptyProgram::recalcPtr() { elfHeader = reinterpret_cast *>(storage.data()); } -template NEO::Elf::ElfSectionHeader &ValidEmptyProgram::appendSection(uint32_t sectionType, NEO::ConstStringRef sectionLabel, const ArrayRef sectionData); -template NEO::Elf::ElfSectionHeader &ValidEmptyProgram::appendSection(uint32_t sectionType, NEO::ConstStringRef sectionLabel, const ArrayRef sectionData); -template +template NEO::Elf::ElfSectionHeader &ValidEmptyProgram::appendSection(uint32_t sectionType, NEO::ConstStringRef sectionLabel, const ArrayRef sectionData); +template NEO::Elf::ElfSectionHeader &ValidEmptyProgram::appendSection(uint32_t sectionType, NEO::ConstStringRef sectionLabel, const ArrayRef sectionData); +template NEO::Elf::ElfSectionHeader &ValidEmptyProgram::appendSection(uint32_t sectionType, NEO::ConstStringRef sectionLabel, const ArrayRef sectionData) { std::string err, warn; auto decoded = NEO::Elf::decodeElf(storage, err, warn); @@ -78,9 +78,9 @@ NEO::Elf::ElfSectionHeader &ValidEmptyProgram::appendSection(u UNREACHABLE(); } -template void ValidEmptyProgram::removeSection(uint32_t sectionType, NEO::ConstStringRef sectionLabel); -template void ValidEmptyProgram::removeSection(uint32_t sectionType, NEO::ConstStringRef sectionLabel); -template +template void ValidEmptyProgram::removeSection(uint32_t sectionType, NEO::ConstStringRef sectionLabel); +template void ValidEmptyProgram::removeSection(uint32_t sectionType, NEO::ConstStringRef sectionLabel); +template void ValidEmptyProgram::removeSection(uint32_t sectionType, NEO::ConstStringRef sectionLabel) { std::string err, warn; auto decoded = NEO::Elf::decodeElf(storage, err, warn); @@ -132,13 +132,13 @@ ZebinWithExternalFunctionsInfo::ZebinWithExternalFunctionsInfo() { NEO::Elf::ElfSymbolEntry symbols[2]; symbols[0].name = decltype(symbols[0].name)(elfEncoder.appendSectionName(fun0Name)); - symbols[0].info = NEO::Elf::SYMBOL_TABLE_TYPE::STT_FUNC | NEO::Elf::SYMBOL_TABLE_BIND::STB_GLOBAL << 4; + symbols[0].info = NEO::Elf::SymbolTableType::STT_FUNC | NEO::Elf::SymbolTableBind::STB_GLOBAL << 4; symbols[0].shndx = decltype(symbols[0].shndx)(externalFunctionsIdx); symbols[0].size = 16; symbols[0].value = 0; symbols[1].name = decltype(symbols[1].name)(elfEncoder.appendSectionName(fun1Name)); - symbols[1].info = NEO::Elf::SYMBOL_TABLE_TYPE::STT_FUNC | NEO::Elf::SYMBOL_TABLE_BIND::STB_GLOBAL << 4; + symbols[1].info = NEO::Elf::SymbolTableType::STT_FUNC | NEO::Elf::SymbolTableBind::STB_GLOBAL << 4; symbols[1].shndx = decltype(symbols[1].shndx)(externalFunctionsIdx); symbols[1].size = 16; symbols[1].value = 16; @@ -147,7 +147,7 @@ ZebinWithExternalFunctionsInfo::ZebinWithExternalFunctionsInfo() { NEO::Elf::ElfRel extFuncSegReloc = {}; // fun0 calls fun1 extFuncSegReloc.offset = 0x8; - extFuncSegReloc.info = (uint64_t(1) << 32) | NEO::Zebin::Elf::RELOC_TYPE_ZEBIN::R_ZE_SYM_ADDR; + extFuncSegReloc.info = (uint64_t(1) << 32) | NEO::Zebin::Elf::RelocTypeZebin::R_ZE_SYM_ADDR; auto &extFuncRelSection = elfEncoder.appendSection(NEO::Elf::SHT_REL, NEO::Elf::SpecialSectionNames::relPrefix.str() + NEO::Zebin::Elf::SectionNames::textPrefix.str() + NEO::Zebin::Elf::SectionNames::externalFunctions.str(), {reinterpret_cast(&extFuncSegReloc), sizeof(extFuncSegReloc)}); extFuncRelSection.info = externalFunctionsIdx; @@ -155,7 +155,7 @@ ZebinWithExternalFunctionsInfo::ZebinWithExternalFunctionsInfo() { NEO::Elf::ElfRel kernelSegReloc = {}; // kernel calls fun0 kernelSegReloc.offset = 0x8; - kernelSegReloc.info = (uint64_t(0) << 32) | NEO::Zebin::Elf::RELOC_TYPE_ZEBIN::R_ZE_SYM_ADDR; + kernelSegReloc.info = (uint64_t(0) << 32) | NEO::Zebin::Elf::RelocTypeZebin::R_ZE_SYM_ADDR; auto &kernelRelSection = elfEncoder.appendSection(NEO::Elf::SHT_REL, NEO::Elf::SpecialSectionNames::relPrefix.str() + NEO::Zebin::Elf::SectionNames::textPrefix.str() + "kernel", {reinterpret_cast(&kernelSegReloc), sizeof(kernelSegReloc)}); kernelRelSection.info = kernelSectionIdx; @@ -181,7 +181,7 @@ NEO::Elf::Elf ZebinWithExternalFunctionsInfo::getElf() { return elf; } -ZebinWithL0TestCommonModule::ZebinWithL0TestCommonModule(const NEO::HardwareInfo &hwInfo, std::initializer_list additionalSections, bool forceRecompilation) { +ZebinWithL0TestCommonModule::ZebinWithL0TestCommonModule(const NEO::HardwareInfo &hwInfo, std::initializer_list additionalSections, bool forceRecompilation) { MockElfEncoder<> elfEncoder; auto &elfHeader = elfEncoder.getElfFileHeader(); elfHeader.type = NEO::Zebin::Elf::ET_ZEBIN_EXE; @@ -201,16 +201,16 @@ ZebinWithL0TestCommonModule::ZebinWithL0TestCommonModule(const NEO::HardwareInfo const uint8_t testAdditionalSectionsData[0x10] = {0u}; for (const auto &s : additionalSections) { switch (s) { - case appendElfAdditionalSection::spirv: + case AppendElfAdditionalSection::spirv: elfEncoder.appendSection(NEO::Zebin::Elf::SHT_ZEBIN_SPIRV, NEO::Zebin::Elf::SectionNames::spv, testAdditionalSectionsData); break; - case appendElfAdditionalSection::global: + case AppendElfAdditionalSection::global: elfEncoder.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Zebin::Elf::SectionNames::dataGlobal, testAdditionalSectionsData); break; - case appendElfAdditionalSection::constant: + case AppendElfAdditionalSection::constant: elfEncoder.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Zebin::Elf::SectionNames::dataConst, testAdditionalSectionsData); break; - case appendElfAdditionalSection::constantString: + case AppendElfAdditionalSection::constantString: elfEncoder.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Zebin::Elf::SectionNames::dataConstString.str(), testAdditionalSectionsData); break; default: @@ -225,10 +225,10 @@ void ZebinWithL0TestCommonModule::recalcPtr() { elfHeader = reinterpret_cast *>(storage.data()); } -template ZebinCopyBufferSimdModule::ZebinCopyBufferSimdModule(const NEO::HardwareInfo &hwInfo, uint8_t simdSize); -template ZebinCopyBufferSimdModule::ZebinCopyBufferSimdModule(const NEO::HardwareInfo &hwInfo, uint8_t simdSize); +template ZebinCopyBufferSimdModule::ZebinCopyBufferSimdModule(const NEO::HardwareInfo &hwInfo, uint8_t simdSize); +template ZebinCopyBufferSimdModule::ZebinCopyBufferSimdModule(const NEO::HardwareInfo &hwInfo, uint8_t simdSize); -template +template ZebinCopyBufferSimdModule::ZebinCopyBufferSimdModule(const NEO::HardwareInfo &hwInfo, uint8_t simdSize) { zeInfoSize = static_cast(snprintf(nullptr, 0, zeInfoCopyBufferSimdPlaceholder.c_str(), simdSize, simdSize, getLocalIdSize(hwInfo, simdSize)) + 1); zeInfoCopyBuffer.resize(zeInfoSize); diff --git a/shared/test/common/mocks/mock_modules_zebin.h b/shared/test/common/mocks/mock_modules_zebin.h index 46dd61a77f1e5..e8a1b69e2d864 100644 --- a/shared/test/common/mocks/mock_modules_zebin.h +++ b/shared/test/common/mocks/mock_modules_zebin.h @@ -27,7 +27,7 @@ inline std::string versionToString(NEO::Zebin::ZeInfo::Types::Version version) { namespace ZebinTestData { -enum class appendElfAdditionalSection { +enum class AppendElfAdditionalSection { none, spirv, global, @@ -35,7 +35,7 @@ enum class appendElfAdditionalSection { constantString }; -template +template struct ValidEmptyProgram { static constexpr char kernelName[19] = "valid_empty_kernel"; @@ -84,8 +84,8 @@ struct ZebinWithExternalFunctionsInfo { }; struct ZebinWithL0TestCommonModule { - ZebinWithL0TestCommonModule(const NEO::HardwareInfo &hwInfo) : ZebinWithL0TestCommonModule(hwInfo, std::initializer_list{}) {} - ZebinWithL0TestCommonModule(const NEO::HardwareInfo &hwInfo, std::initializer_list additionalSections, bool forceRecompilation = false); + ZebinWithL0TestCommonModule(const NEO::HardwareInfo &hwInfo) : ZebinWithL0TestCommonModule(hwInfo, std::initializer_list{}) {} + ZebinWithL0TestCommonModule(const NEO::HardwareInfo &hwInfo, std::initializer_list additionalSections, bool forceRecompilation = false); void recalcPtr(); @@ -263,7 +263,7 @@ struct ZebinWithL0TestCommonModule { -)==="; }; -template +template struct ZebinCopyBufferSimdModule { ZebinCopyBufferSimdModule(const NEO::HardwareInfo &hwInfo, uint8_t simdSize); inline size_t getLocalIdSize(const NEO::HardwareInfo &hwInfo, uint8_t simdSize) { 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 8807bc541fe65..0963dd736ef69 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 @@ -57,12 +57,12 @@ class DrmCommandStreamTest : public ::testing::Test { PreemptionHelper::getDefaultPreemptionMode(*hwInfo))); osContext->ensureContextInitialized(); - csr = new MockDrmCsr(executionEnvironment, 0, 1, gemCloseWorkerMode::gemCloseWorkerActive); + csr = new MockDrmCsr(executionEnvironment, 0, 1, GemCloseWorkerMode::gemCloseWorkerActive); ASSERT_NE(nullptr, csr); csr->setupContext(*osContext); mock->ioctlCallsCount = 0u; - memoryManager = new DrmMemoryManager(gemCloseWorkerMode::gemCloseWorkerActive, + memoryManager = new DrmMemoryManager(GemCloseWorkerMode::gemCloseWorkerActive, debugManager.flags.EnableForcePin.get(), true, executionEnvironment); @@ -130,7 +130,7 @@ class DrmCommandStreamEnhancedTemplate : public ::testing::Test { csr = new TestedDrmCommandStreamReceiver(*executionEnvironment, rootDeviceIndex, 1); ASSERT_NE(nullptr, csr); - mm = new DrmMemoryManager(gemCloseWorkerMode::gemCloseWorkerInactive, + mm = new DrmMemoryManager(GemCloseWorkerMode::gemCloseWorkerInactive, debugManager.flags.EnableForcePin.get(), true, *executionEnvironment); @@ -211,7 +211,7 @@ class DrmCommandStreamEnhancedWithFailingExecTemplate : public ::testing::Test { csr = new TestedDrmCommandStreamReceiverWithFailingExec(*executionEnvironment, rootDeviceIndex, 1); ASSERT_NE(nullptr, csr); - mm = new DrmMemoryManager(gemCloseWorkerMode::gemCloseWorkerInactive, + mm = new DrmMemoryManager(GemCloseWorkerMode::gemCloseWorkerInactive, debugManager.flags.EnableForcePin.get(), true, *executionEnvironment); diff --git a/shared/test/unit_test/aub/aub_helper_tests.cpp b/shared/test/unit_test/aub/aub_helper_tests.cpp index a455e6fec2280..92f5f437cc10f 100644 --- a/shared/test/unit_test/aub/aub_helper_tests.cpp +++ b/shared/test/unit_test/aub/aub_helper_tests.cpp @@ -67,10 +67,10 @@ TEST(AubHelper, WhenMaskPTEntryBitsIsCalledThenLocalMemoryBitIsMasked) { TEST(AubHelper, WhenGetMemTypeIsCalledWithAGivenAddressSpaceThenCorrectMemTypeIsReturned) { uint32_t addressSpace = AubHelper::getMemType(AubMemDump::AddressSpaceValues::TraceLocal); - EXPECT_EQ(mem_types::MEM_TYPE_LOCALMEM, addressSpace); + EXPECT_EQ(MemType::local, addressSpace); addressSpace = AubHelper::getMemType(AubMemDump::AddressSpaceValues::TraceNonlocal); - EXPECT_EQ(mem_types::MEM_TYPE_SYSTEM, addressSpace); + EXPECT_EQ(MemType::system, addressSpace); } TEST(AubHelper, WhenHBMSizePerTileInGigabytesIsSetThenGetMemBankSizeReturnsCorrectValue) { diff --git a/shared/test/unit_test/command_stream/tbx_stream_tests.cpp b/shared/test/unit_test/command_stream/tbx_stream_tests.cpp index 95d31e4c3a3ff..0c5e7dcb2c35a 100644 --- a/shared/test/unit_test/command_stream/tbx_stream_tests.cpp +++ b/shared/test/unit_test/command_stream/tbx_stream_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -23,17 +23,17 @@ TEST(TbxStreamTests, givenTbxStreamWhenWriteMemoryIsCalledThenMemTypeIsSetCorrec uint32_t addressSpace = AubMemDump::AddressSpaceValues::TraceLocal; mockTbxStream->writeMemory(0, nullptr, 0, addressSpace, 0); - EXPECT_EQ(mem_types::MEM_TYPE_LOCALMEM, mockTbxSocket->typeCapturedFromWriteMemory); + EXPECT_EQ(MemType::local, mockTbxSocket->typeCapturedFromWriteMemory); addressSpace = AubMemDump::AddressSpaceValues::TraceNonlocal; mockTbxStream->writeMemory(0, nullptr, 0, addressSpace, 0); - EXPECT_EQ(mem_types::MEM_TYPE_SYSTEM, mockTbxSocket->typeCapturedFromWriteMemory); + EXPECT_EQ(MemType::system, mockTbxSocket->typeCapturedFromWriteMemory); addressSpace = AubMemDump::AddressSpaceValues::TraceLocal; mockTbxStream->writePTE(0, 0, addressSpace); - EXPECT_EQ(mem_types::MEM_TYPE_LOCALMEM, mockTbxSocket->typeCapturedFromWriteMemory); + EXPECT_EQ(MemType::local, mockTbxSocket->typeCapturedFromWriteMemory); addressSpace = AubMemDump::AddressSpaceValues::TraceNonlocal; mockTbxStream->writePTE(0, 0, addressSpace); - EXPECT_EQ(mem_types::MEM_TYPE_SYSTEM, mockTbxSocket->typeCapturedFromWriteMemory); + EXPECT_EQ(MemType::system, mockTbxSocket->typeCapturedFromWriteMemory); } diff --git a/shared/test/unit_test/compiler_interface/linker_tests.cpp b/shared/test/unit_test/compiler_interface/linker_tests.cpp index f0423635d224a..61be520447c3f 100644 --- a/shared/test/unit_test/compiler_interface/linker_tests.cpp +++ b/shared/test/unit_test/compiler_interface/linker_tests.cpp @@ -1826,7 +1826,7 @@ TEST_F(LinkerTests, GivenDebugDataWhenApplyingDebugDataRelocationsThenRelocation NEO::Elf::Elf::RelocationInfo reloc0 = {}; reloc0.offset = 64; - reloc0.relocType = static_cast(Elf::RELOCATION_X8664_TYPE::relocation64); + reloc0.relocType = static_cast(Elf::RelocationX8664Type::relocation64); reloc0.symbolName = ".debug_abbrev"; reloc0.symbolSectionIndex = 3; reloc0.symbolTableIndex = 0; @@ -1837,7 +1837,7 @@ TEST_F(LinkerTests, GivenDebugDataWhenApplyingDebugDataRelocationsThenRelocation NEO::Elf::Elf::RelocationInfo reloc1 = {}; reloc1.offset = 32; - reloc1.relocType = static_cast(Elf::RELOCATION_X8664_TYPE::relocation32); + reloc1.relocType = static_cast(Elf::RelocationX8664Type::relocation32); reloc1.symbolName = ".debug_line"; reloc1.symbolSectionIndex = 4; reloc1.symbolTableIndex = 0; @@ -1848,7 +1848,7 @@ TEST_F(LinkerTests, GivenDebugDataWhenApplyingDebugDataRelocationsThenRelocation NEO::Elf::Elf::RelocationInfo reloc2 = {}; reloc2.offset = 32; - reloc2.relocType = static_cast(Elf::RELOCATION_X8664_TYPE::relocation64); + reloc2.relocType = static_cast(Elf::RelocationX8664Type::relocation64); reloc2.symbolName = ".text"; reloc2.symbolSectionIndex = 0; reloc2.symbolTableIndex = 0; @@ -1859,7 +1859,7 @@ TEST_F(LinkerTests, GivenDebugDataWhenApplyingDebugDataRelocationsThenRelocation NEO::Elf::Elf::RelocationInfo reloc3 = {}; reloc3.offset = 0; - reloc3.relocType = static_cast(Elf::RELOCATION_X8664_TYPE::relocation64); + reloc3.relocType = static_cast(Elf::RelocationX8664Type::relocation64); reloc3.symbolName = ".data"; reloc3.symbolSectionIndex = 1; reloc3.symbolTableIndex = 0; diff --git a/shared/test/unit_test/device_binary_format/device_binary_format_zebin_tests.cpp b/shared/test/unit_test/device_binary_format/device_binary_format_zebin_tests.cpp index 68bfdd67ce877..fb19910c38b9f 100644 --- a/shared/test/unit_test/device_binary_format/device_binary_format_zebin_tests.cpp +++ b/shared/test/unit_test/device_binary_format/device_binary_format_zebin_tests.cpp @@ -356,7 +356,7 @@ TEST(UnpackSingleDeviceBinaryZebin, WhenRequestedThenValidateRevision) { TEST(UnpackSingleDeviceBinaryZebin, WhenMachineIsIntelGTAndIntelGTNoteSectionIsValidThenReturnSelf) { ZebinTestData::ValidEmptyProgram zebin; zebin.elfHeader->type = NEO::Elf::ET_REL; - zebin.elfHeader->machine = NEO::Elf::ELF_MACHINE::EM_INTELGT; + zebin.elfHeader->machine = NEO::Elf::ElfMachine::EM_INTELGT; NEO::TargetDevice targetDevice; targetDevice.maxPointerSizeInBytes = 8; diff --git a/shared/test/unit_test/device_binary_format/device_binary_formats_tests.cpp b/shared/test/unit_test/device_binary_format/device_binary_formats_tests.cpp index bebf6d2043255..8c86bbd130c4b 100644 --- a/shared/test/unit_test/device_binary_format/device_binary_formats_tests.cpp +++ b/shared/test/unit_test/device_binary_format/device_binary_formats_tests.cpp @@ -410,8 +410,8 @@ TEST(DecodeSingleDeviceBinary, GivenBindlessKernelInZebinWhenDecodingThenKernelD uint8_t kernelIsa[8]{0U}; ZebinTestData::ValidEmptyProgram zebin; - zebin.removeSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); - zebin.appendSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(validZeInfo.data(), validZeInfo.size())); + zebin.removeSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); + zebin.appendSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(validZeInfo.data(), validZeInfo.size())); zebin.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Zebin::Elf::SectionNames::textPrefix.str() + "kernel_bindless", {kernelIsa, sizeof(kernelIsa)}); zebin.elfHeader->machine = NEO::defaultHwInfo->platform.eProductFamily; diff --git a/shared/test/unit_test/device_binary_format/elf/elf_decoder_tests.cpp b/shared/test/unit_test/device_binary_format/elf/elf_decoder_tests.cpp index 939dd2625378a..648092827ab36 100644 --- a/shared/test/unit_test/device_binary_format/elf/elf_decoder_tests.cpp +++ b/shared/test/unit_test/device_binary_format/elf/elf_decoder_tests.cpp @@ -18,7 +18,7 @@ using namespace NEO::Elf; -using ELF_CLASS = NEO::Elf::ELF_IDENTIFIER_CLASS; +using ELF_CLASS = NEO::Elf::ElfIdentifierClass; class TestElf { public: @@ -29,19 +29,19 @@ class TestElf { std::vector createRelocateableElfWithDebugData() { MockElfEncoder<> elfEncoder; - elfEncoder.getElfFileHeader().type = ELF_TYPE::ET_REL; - elfEncoder.getElfFileHeader().machine = ELF_MACHINE::EM_NONE; + elfEncoder.getElfFileHeader().type = ElfType::ET_REL; + elfEncoder.getElfFileHeader().machine = ElfMachine::EM_NONE; elfEncoder.appendSection(SHT_PROGBITS, SpecialSectionNames::text.str(), ArrayRef(dummyData, sizeof(dummyData))); auto textSectionIndex = elfEncoder.getLastSectionHeaderIndex(); ElfRela relocationsWithAddend[2]; relocationsWithAddend[0].addend = relaAddend; - relocationsWithAddend[0].info = relaSymbolIndexes[0] << 32 | uint32_t(RELOCATION_X8664_TYPE::relocation64); + relocationsWithAddend[0].info = relaSymbolIndexes[0] << 32 | uint32_t(RelocationX8664Type::relocation64); relocationsWithAddend[0].offset = relaOffsets[0]; relocationsWithAddend[1].addend = relaAddend; - relocationsWithAddend[1].info = relaSymbolIndexes[1] << 32 | uint32_t(RELOCATION_X8664_TYPE::relocation32); + relocationsWithAddend[1].info = relaSymbolIndexes[1] << 32 | uint32_t(RelocationX8664Type::relocation32); relocationsWithAddend[1].offset = relaOffsets[1]; elfEncoder.appendSection(SHT_PROGBITS, SpecialSectionNames::debug, ArrayRef(dummyData, sizeof(dummyData))); @@ -55,10 +55,10 @@ class TestElf { relaDebugSection->info = debugSectionIndex; ElfRel relocations[2]; - relocations[0].info = relSymbolIndex << 32 | uint64_t(RELOCATION_X8664_TYPE::relocation64); + relocations[0].info = relSymbolIndex << 32 | uint64_t(RelocationX8664Type::relocation64); relocations[0].offset = relOffsets[0]; - relocations[1].info = relSymbolIndex << 32 | uint64_t(RELOCATION_X8664_TYPE::relocation64); + relocations[1].info = relSymbolIndex << 32 | uint64_t(RelocationX8664Type::relocation64); relocations[1].offset = relOffsets[1]; elfEncoder.appendSection(SHT_PROGBITS, SpecialSectionNames::line, std::string{"dummy_line_data______________________"}); @@ -91,21 +91,21 @@ class TestElf { symbols[0].value = 0; symbols[1].name = elfEncoder.appendSectionName(NEO::ConstStringRef("local_function_symbol_1")); - symbols[1].info = SYMBOL_TABLE_TYPE::STT_FUNC | SYMBOL_TABLE_BIND::STB_LOCAL << 4; + symbols[1].info = SymbolTableType::STT_FUNC | SymbolTableBind::STB_LOCAL << 4; symbols[1].shndx = textSectionIndex; symbols[1].size = 8; symbols[1].value = 0; symbols[1].other = 0; symbols[2].name = elfEncoder.appendSectionName(NEO::ConstStringRef("section_symbol_2")); - symbols[2].info = SYMBOL_TABLE_TYPE::STT_SECTION | SYMBOL_TABLE_BIND::STB_LOCAL << 4; + symbols[2].info = SymbolTableType::STT_SECTION | SymbolTableBind::STB_LOCAL << 4; symbols[2].shndx = textSectionIndex; symbols[2].size = 0; symbols[2].value = 0; symbols[2].other = 0; symbols[3].name = elfEncoder.appendSectionName(NEO::ConstStringRef("global_object_symbol_0")); - symbols[3].info = SYMBOL_TABLE_TYPE::STT_OBJECT | SYMBOL_TABLE_BIND::STB_GLOBAL << 4; + symbols[3].info = SymbolTableType::STT_OBJECT | SymbolTableBind::STB_GLOBAL << 4; symbols[3].shndx = dataSectionIndex; symbols[3].size = 4; symbols[3].value = 7; // offset to "data" string in data section @@ -474,7 +474,7 @@ TEST(ElfDecoder, WhenElfContainsInvalidSymbolSectionHeaderThenDecodingFailsAndEr header.shNum = 1; storage.insert(storage.end(), reinterpret_cast(&header), reinterpret_cast(&header + 1)); ElfSectionHeader sectionHeader0; - sectionHeader0.type = SECTION_HEADER_TYPE::SHT_SYMTAB; + sectionHeader0.type = SectionHeaderType::SHT_SYMTAB; sectionHeader0.size = sizeof(sectionHeader0); sectionHeader0.offset = header.shOff; sectionHeader0.entsize = sizeof(ElfSymbolEntry) + 4; // invalid entSize @@ -504,7 +504,7 @@ TEST(ElfDecoder, WhenElfContainsInvalidRelocationSectionHeaderThenDecodingFailsA sectionHeader0.size = sizeof(sectionHeader0); sectionHeader0.offset = header.shOff; - SECTION_HEADER_TYPE types[] = {SECTION_HEADER_TYPE::SHT_REL, SECTION_HEADER_TYPE::SHT_RELA}; + SectionHeaderType types[] = {SectionHeaderType::SHT_REL, SectionHeaderType::SHT_RELA}; size_t entSizes[] = {sizeof(ElfRel) + 4, sizeof(ElfRela) + 4}; std::string errors[] = {"Invalid rel entries size - expected : ", "Invalid rela entries size - expected : "}; @@ -536,19 +536,19 @@ TEST(ElfDecoder, GivenElf64WhenExtractingDataFromElfRelocationThenCorrectRelocTy elf.elfFileHeader = &header64; ElfRela rela; - rela.info = decltype(ElfRela::info)(RELOCATION_X8664_TYPE::relocation64) | decltype(ElfRela::info)(5) << 32; + rela.info = decltype(ElfRela::info)(RelocationX8664Type::relocation64) | decltype(ElfRela::info)(5) << 32; auto type = elf.extractRelocType(rela); auto symbolIndex = elf.extractSymbolIndex(rela); - EXPECT_EQ(uint32_t(RELOCATION_X8664_TYPE::relocation64), type); + EXPECT_EQ(uint32_t(RelocationX8664Type::relocation64), type); EXPECT_EQ(5, symbolIndex); ElfRel rel; - rel.info = decltype(ElfRela::info)(RELOCATION_X8664_TYPE::relocation32) | decltype(ElfRela::info)(6) << 32; + rel.info = decltype(ElfRela::info)(RelocationX8664Type::relocation32) | decltype(ElfRela::info)(6) << 32; type = elf.extractRelocType(rel); symbolIndex = elf.extractSymbolIndex(rel); - EXPECT_EQ(uint32_t(RELOCATION_X8664_TYPE::relocation32), type); + EXPECT_EQ(uint32_t(RelocationX8664Type::relocation32), type); EXPECT_EQ(6, symbolIndex); } @@ -558,19 +558,19 @@ TEST(ElfDecoder, GivenElf32WhenExtractingDataFromElfRelocationThenCorrectRelocTy elf.elfFileHeader = &header64; ElfRela rela; - rela.info = decltype(ElfRela::info)(RELOCATION_X8664_TYPE::relocation32) | decltype(ElfRela::info)(5) << 8; + rela.info = decltype(ElfRela::info)(RelocationX8664Type::relocation32) | decltype(ElfRela::info)(5) << 8; auto type = elf.extractRelocType(rela); auto symbolIndex = elf.extractSymbolIndex(rela); - EXPECT_EQ(uint32_t(RELOCATION_X8664_TYPE::relocation32), type); + EXPECT_EQ(uint32_t(RelocationX8664Type::relocation32), type); EXPECT_EQ(5, symbolIndex); ElfRel rel; - rel.info = decltype(ElfRel::info)(RELOCATION_X8664_TYPE::relocation32) | decltype(ElfRel::info)(6) << 8; + rel.info = decltype(ElfRel::info)(RelocationX8664Type::relocation32) | decltype(ElfRel::info)(6) << 8; type = elf.extractRelocType(rel); symbolIndex = elf.extractSymbolIndex(rel); - EXPECT_EQ(uint32_t(RELOCATION_X8664_TYPE::relocation32), type); + EXPECT_EQ(uint32_t(RelocationX8664Type::relocation32), type); EXPECT_EQ(6, symbolIndex); } @@ -580,12 +580,12 @@ TEST(ElfDecoder, GivenElfWhenExtractingDataFromElfSymbolThenCorrectTypeAndBindIs elf.elfFileHeader = &header64; ElfSymbolEntry symbolEntry; - symbolEntry.info = SYMBOL_TABLE_TYPE::STT_OBJECT | SYMBOL_TABLE_BIND::STB_GLOBAL << 4; + symbolEntry.info = SymbolTableType::STT_OBJECT | SymbolTableBind::STB_GLOBAL << 4; auto type = elf.extractSymbolType(symbolEntry); auto symbolBind = elf.extractSymbolBind(symbolEntry); - EXPECT_EQ(SYMBOL_TABLE_TYPE::STT_OBJECT, type); - EXPECT_EQ(SYMBOL_TABLE_BIND::STB_GLOBAL, symbolBind); + EXPECT_EQ(SymbolTableType::STT_OBJECT, type); + EXPECT_EQ(SymbolTableBind::STB_GLOBAL, symbolBind); } TEST(ElfDecoder, GivenElfWithStringTableSectionWhenGettingSectionNameThenCorrectNameIsReturned) { @@ -731,7 +731,7 @@ TEST(ElfDecoder, GivenElfWithStringTableSectionWhenGettingSymbolNameThenCorrectN TEST(ElfDecoder, WhenGettingSymbolAddressThenCorectValueIsReturned) { MockElf elf; ElfSymbolEntry symbol; - symbol.info = SYMBOL_TABLE_TYPE::STT_OBJECT; + symbol.info = SymbolTableType::STT_OBJECT; symbol.name = 0; symbol.shndx = 1; symbol.size = 8; @@ -767,7 +767,7 @@ TEST(ElfDecoder, GivenElfWithRelocationsWhenDecodedThenCorrectRelocationsAndSymo EXPECT_EQ(testElf.relaAddend, debugRelocations[0].addend); EXPECT_EQ(testElf.relaOffsets[0], debugRelocations[0].offset); - EXPECT_EQ(uint32_t(RELOCATION_X8664_TYPE::relocation64), debugRelocations[0].relocType); + EXPECT_EQ(uint32_t(RelocationX8664Type::relocation64), debugRelocations[0].relocType); EXPECT_STREQ("global_object_symbol_0", debugRelocations[0].symbolName.c_str()); EXPECT_EQ(7, debugRelocations[0].symbolSectionIndex); EXPECT_EQ(3, debugRelocations[0].symbolTableIndex); @@ -775,7 +775,7 @@ TEST(ElfDecoder, GivenElfWithRelocationsWhenDecodedThenCorrectRelocationsAndSymo EXPECT_EQ(testElf.relaAddend, debugRelocations[1].addend); EXPECT_EQ(testElf.relaOffsets[1], debugRelocations[1].offset); - EXPECT_EQ(uint32_t(RELOCATION_X8664_TYPE::relocation32), debugRelocations[1].relocType); + EXPECT_EQ(uint32_t(RelocationX8664Type::relocation32), debugRelocations[1].relocType); EXPECT_STREQ("local_function_symbol_1", debugRelocations[1].symbolName.c_str()); EXPECT_EQ(1, debugRelocations[1].symbolSectionIndex); EXPECT_EQ(1, debugRelocations[1].symbolTableIndex); @@ -783,7 +783,7 @@ TEST(ElfDecoder, GivenElfWithRelocationsWhenDecodedThenCorrectRelocationsAndSymo EXPECT_EQ(0u, debugRelocations[2].addend); EXPECT_EQ(testElf.relOffsets[1], debugRelocations[2].offset); - EXPECT_EQ(uint32_t(RELOCATION_X8664_TYPE::relocation64), debugRelocations[2].relocType); + EXPECT_EQ(uint32_t(RelocationX8664Type::relocation64), debugRelocations[2].relocType); EXPECT_STREQ("section_symbol_2", debugRelocations[2].symbolName.c_str()); EXPECT_EQ(1, debugRelocations[2].symbolSectionIndex); EXPECT_EQ(2, debugRelocations[2].symbolTableIndex); @@ -791,7 +791,7 @@ TEST(ElfDecoder, GivenElfWithRelocationsWhenDecodedThenCorrectRelocationsAndSymo EXPECT_EQ(0u, relocations[0].addend); EXPECT_EQ(testElf.relOffsets[0], relocations[0].offset); - EXPECT_EQ(uint32_t(RELOCATION_X8664_TYPE::relocation64), relocations[0].relocType); + EXPECT_EQ(uint32_t(RelocationX8664Type::relocation64), relocations[0].relocType); EXPECT_STREQ("section_symbol_2", relocations[0].symbolName.c_str()); EXPECT_EQ(1, relocations[0].symbolSectionIndex); EXPECT_EQ(2, relocations[0].symbolTableIndex); @@ -800,15 +800,15 @@ TEST(ElfDecoder, GivenElfWithRelocationsWhenDecodedThenCorrectRelocationsAndSymo auto symbolTable = elf64.getSymbols(); ASSERT_EQ(4u, symbolTable.size()); - EXPECT_EQ(SYMBOL_TABLE_TYPE::STT_NOTYPE, elf64.extractSymbolType(symbolTable[0])); - EXPECT_EQ(SYMBOL_TABLE_BIND::STB_LOCAL, elf64.extractSymbolBind(symbolTable[0])); + EXPECT_EQ(SymbolTableType::STT_NOTYPE, elf64.extractSymbolType(symbolTable[0])); + EXPECT_EQ(SymbolTableBind::STB_LOCAL, elf64.extractSymbolBind(symbolTable[0])); - EXPECT_EQ(SYMBOL_TABLE_TYPE::STT_FUNC, elf64.extractSymbolType(symbolTable[1])); - EXPECT_EQ(SYMBOL_TABLE_BIND::STB_LOCAL, elf64.extractSymbolBind(symbolTable[1])); + EXPECT_EQ(SymbolTableType::STT_FUNC, elf64.extractSymbolType(symbolTable[1])); + EXPECT_EQ(SymbolTableBind::STB_LOCAL, elf64.extractSymbolBind(symbolTable[1])); - EXPECT_EQ(SYMBOL_TABLE_TYPE::STT_SECTION, elf64.extractSymbolType(symbolTable[2])); - EXPECT_EQ(SYMBOL_TABLE_BIND::STB_LOCAL, elf64.extractSymbolBind(symbolTable[2])); + EXPECT_EQ(SymbolTableType::STT_SECTION, elf64.extractSymbolType(symbolTable[2])); + EXPECT_EQ(SymbolTableBind::STB_LOCAL, elf64.extractSymbolBind(symbolTable[2])); - EXPECT_EQ(SYMBOL_TABLE_TYPE::STT_OBJECT, elf64.extractSymbolType(symbolTable[3])); - EXPECT_EQ(SYMBOL_TABLE_BIND::STB_GLOBAL, elf64.extractSymbolBind(symbolTable[3])); + EXPECT_EQ(SymbolTableType::STT_OBJECT, elf64.extractSymbolType(symbolTable[3])); + EXPECT_EQ(SymbolTableBind::STB_GLOBAL, elf64.extractSymbolBind(symbolTable[3])); } diff --git a/shared/test/unit_test/device_binary_format/zebin_debug_binary_tests.cpp b/shared/test/unit_test/device_binary_format/zebin_debug_binary_tests.cpp index 14eed6d213138..6eccfa9de37c3 100644 --- a/shared/test/unit_test/device_binary_format/zebin_debug_binary_tests.cpp +++ b/shared/test/unit_test/device_binary_format/zebin_debug_binary_tests.cpp @@ -41,42 +41,42 @@ TEST(DebugZebinTest, givenValidZebinThenDebugZebinIsGenerated) { auto zeInfoSectionIndex = elfEncoder.getLastSectionHeaderIndex(); elfEncoder.appendSection(SHT_ZEBIN_SPIRV, SectionNames::spv, std::string{}); - using SymbolEntry = ElfSymbolEntry; - using Relocation = ElfRela; + using SymbolEntry = ElfSymbolEntry; + using Relocation = ElfRela; SymbolEntry symbols[7]{}; symbols[0].name = elfEncoder.appendSectionName("kernel"); - symbols[0].info = SYMBOL_TABLE_TYPE::STT_SECTION | SYMBOL_TABLE_BIND::STB_LOCAL << 4; + symbols[0].info = SymbolTableType::STT_SECTION | SymbolTableBind::STB_LOCAL << 4; symbols[0].shndx = static_cast(kernelSectionIndex); symbols[0].value = 0U; symbols[1].name = elfEncoder.appendSectionName("constData"); - symbols[1].info = SYMBOL_TABLE_TYPE::STT_SECTION | SYMBOL_TABLE_BIND::STB_LOCAL << 4; + symbols[1].info = SymbolTableType::STT_SECTION | SymbolTableBind::STB_LOCAL << 4; symbols[1].shndx = static_cast(constDataSectionIndex); symbols[1].value = 0U; symbols[2].name = elfEncoder.appendSectionName("varData"); - symbols[2].info = SYMBOL_TABLE_TYPE::STT_SECTION | SYMBOL_TABLE_BIND::STB_LOCAL << 4; + symbols[2].info = SymbolTableType::STT_SECTION | SymbolTableBind::STB_LOCAL << 4; symbols[2].shndx = static_cast(varDataSectionIndex); symbols[2].value = 0U; symbols[3].name = elfEncoder.appendSectionName("debugInfo"); - symbols[3].info = SYMBOL_TABLE_TYPE::STT_SECTION | SYMBOL_TABLE_BIND::STB_LOCAL << 4; + symbols[3].info = SymbolTableType::STT_SECTION | SymbolTableBind::STB_LOCAL << 4; symbols[3].shndx = static_cast(debugAbbrevSectionIndex); symbols[3].value = 0x1U; symbols[4].name = elfEncoder.appendSectionName("zeInfo"); - symbols[4].info = SYMBOL_TABLE_TYPE::STT_SECTION | SYMBOL_TABLE_BIND::STB_LOCAL << 4; + symbols[4].info = SymbolTableType::STT_SECTION | SymbolTableBind::STB_LOCAL << 4; symbols[4].shndx = static_cast(zeInfoSectionIndex); symbols[4].value = 0U; symbols[5].name = elfEncoder.appendSectionName(SectionNames::textPrefix.str() + "kernel"); - symbols[5].info = SYMBOL_TABLE_TYPE::STT_SECTION | SYMBOL_TABLE_BIND::STB_LOCAL << 4; + symbols[5].info = SymbolTableType::STT_SECTION | SymbolTableBind::STB_LOCAL << 4; symbols[5].shndx = static_cast(debugInfoSectionIndex); symbols[5].value = 0U; symbols[6].name = elfEncoder.appendSectionName("kernel_payload_offset"); - symbols[6].info = SYMBOL_TABLE_TYPE::STT_SECTION | SYMBOL_TABLE_BIND::STB_LOCAL << 4; + symbols[6].info = SymbolTableType::STT_SECTION | SymbolTableBind::STB_LOCAL << 4; symbols[6].shndx = static_cast(kernelSectionIndex); symbols[6].value = 0x10U; @@ -261,12 +261,12 @@ TEST(DebugZebinTest, givenSymTabShndxUndefinedThenDoNotApplyRelocations) { elfEncoder.appendSection(SHT_PROGBITS, SectionNames::textPrefix.str() + "kernel", ArrayRef(kernelISA, sizeof(kernelISA))); auto kernelSectionIndex = elfEncoder.getLastSectionHeaderIndex(); - using SymbolEntry = ElfSymbolEntry; - using Relocation = ElfRela; + using SymbolEntry = ElfSymbolEntry; + using Relocation = ElfRela; SymbolEntry symbol{}; symbol.name = elfEncoder.appendSectionName("kernel"); - symbol.info = SYMBOL_TABLE_TYPE::STT_SECTION | SYMBOL_TABLE_BIND::STB_LOCAL << 4; + symbol.info = SymbolTableType::STT_SECTION | SymbolTableBind::STB_LOCAL << 4; symbol.shndx = static_cast(kernelSectionIndex); symbol.value = 0xAU; diff --git a/shared/test/unit_test/device_binary_format/zebin_decoder_tests.cpp b/shared/test/unit_test/device_binary_format/zebin_decoder_tests.cpp index ae04e60d55433..65bd09d132c65 100644 --- a/shared/test/unit_test/device_binary_format/zebin_decoder_tests.cpp +++ b/shared/test/unit_test/device_binary_format/zebin_decoder_tests.cpp @@ -405,7 +405,7 @@ TEST(DecodeSingleDeviceBinaryZebin, WhenZeInfoSectionIsEmptyThenEmitsWarning) { NEO::MockExecutionEnvironment mockExecutionEnvironment{}; auto &gfxCoreHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); ZebinTestData::ValidEmptyProgram zebin; - zebin.removeSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); + zebin.removeSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); NEO::ProgramInfo programInfo; NEO::SingleDeviceBinary singleBinary; @@ -3007,9 +3007,9 @@ TEST(DecodeSingleDeviceBinaryZebin, WhenYamlParserForZeInfoFailsThenDecodingFail NEO::MockExecutionEnvironment mockExecutionEnvironment{}; auto &gfxCoreHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); ZebinTestData::ValidEmptyProgram zebin; - zebin.removeSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); + zebin.removeSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); auto brokenZeInfo = NEO::ConstStringRef("unterminated_string : \""); - zebin.appendSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(brokenZeInfo.data(), brokenZeInfo.size())); + zebin.appendSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(brokenZeInfo.data(), brokenZeInfo.size())); NEO::ProgramInfo programInfo; NEO::SingleDeviceBinary singleBinary; @@ -3033,9 +3033,9 @@ TEST(DecodeSingleDeviceBinaryZebin, GivenEmptyInZeInfoThenEmitsWarning) { NEO::MockExecutionEnvironment mockExecutionEnvironment{}; auto &gfxCoreHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); ZebinTestData::ValidEmptyProgram zebin; - zebin.removeSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); + zebin.removeSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); auto brokenZeInfo = NEO::ConstStringRef("#no data\n"); - zebin.appendSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(brokenZeInfo.data(), brokenZeInfo.size())); + zebin.appendSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(brokenZeInfo.data(), brokenZeInfo.size())); NEO::ProgramInfo programInfo; NEO::SingleDeviceBinary singleBinary; @@ -3052,9 +3052,9 @@ TEST(DecodeSingleDeviceBinaryZebin, GivenUnknownEntryInZeInfoGlobalScopeThenEmit NEO::MockExecutionEnvironment mockExecutionEnvironment{}; auto &gfxCoreHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); ZebinTestData::ValidEmptyProgram zebin; - zebin.removeSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); + zebin.removeSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); auto brokenZeInfo = std::string("some_entry : a\nkernels : \n - name : valid_empty_kernel\n execution_env : \n simd_size : 32\n grf_count : 128\nversion:\'") + versionToString(NEO::Zebin::ZeInfo::zeInfoDecoderVersion) + "\'\n"; - zebin.appendSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(brokenZeInfo.data(), brokenZeInfo.size())); + zebin.appendSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(brokenZeInfo.data(), brokenZeInfo.size())); NEO::ProgramInfo programInfo; NEO::SingleDeviceBinary singleBinary; @@ -3071,9 +3071,9 @@ TEST(DecodeSingleDeviceBinaryZebin, WhenZeInfoDoesNotContainKernelsSectionThenEm NEO::MockExecutionEnvironment mockExecutionEnvironment{}; auto &gfxCoreHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); ZebinTestData::ValidEmptyProgram zebin; - zebin.removeSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); + zebin.removeSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); auto brokenZeInfo = std::string("version:\'") + versionToString(Zebin::ZeInfo::zeInfoDecoderVersion) + "\'\na:b\n"; - zebin.appendSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(brokenZeInfo.data(), brokenZeInfo.size())); + zebin.appendSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(brokenZeInfo.data(), brokenZeInfo.size())); NEO::ProgramInfo programInfo; NEO::SingleDeviceBinary singleBinary; @@ -3090,9 +3090,9 @@ TEST(DecodeSingleDeviceBinaryZebin, WhenZeInfoContainsMultipleKernelSectionsThen NEO::MockExecutionEnvironment mockExecutionEnvironment{}; auto &gfxCoreHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); ZebinTestData::ValidEmptyProgram zebin; - zebin.removeSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); + zebin.removeSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); auto brokenZeInfo = std::string("version:\'") + versionToString(Zebin::ZeInfo::zeInfoDecoderVersion) + "\'\nkernels : \n - name : valid_empty_kernel\n execution_env : \n simd_size : 32\n grf_count : 128\n" + "\nkernels : \n - name : valid_empty_kernel\n execution_env : \n simd_size : 32\n grf_count : 128\n...\n"; - zebin.appendSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(brokenZeInfo.data(), brokenZeInfo.size())); + zebin.appendSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(brokenZeInfo.data(), brokenZeInfo.size())); NEO::ProgramInfo programInfo; NEO::SingleDeviceBinary singleBinary; @@ -3109,9 +3109,9 @@ TEST(DecodeSingleDeviceBinaryZebin, WhenZeInfoContainsMultipleVersionSectionsThe NEO::MockExecutionEnvironment mockExecutionEnvironment{}; auto &gfxCoreHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); ZebinTestData::ValidEmptyProgram zebin; - zebin.removeSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); + zebin.removeSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); auto brokenZeInfo = std::string("version:\'") + versionToString(Zebin::ZeInfo::zeInfoDecoderVersion) + "\'\nversion:\'5.4\'\nkernels:\n"; - zebin.appendSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(brokenZeInfo.data(), brokenZeInfo.size())); + zebin.appendSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(brokenZeInfo.data(), brokenZeInfo.size())); NEO::ProgramInfo programInfo; NEO::SingleDeviceBinary singleBinary; @@ -3128,9 +3128,9 @@ TEST(DecodeSingleDeviceBinaryZebin, WhenZeInfoDoesNotContainVersionSectionsThenE NEO::MockExecutionEnvironment mockExecutionEnvironment{}; auto &gfxCoreHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); ZebinTestData::ValidEmptyProgram zebin; - zebin.removeSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); + zebin.removeSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); auto zeInfo = ConstStringRef("kernels:\n"); - zebin.appendSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(zeInfo.data(), zeInfo.size())); + zebin.appendSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(zeInfo.data(), zeInfo.size())); auto version = NEO::Zebin::ZeInfo::zeInfoDecoderVersion; auto expectedWarning = "DeviceBinaryFormat::zebin::.ze_info : No version info provided (i.e. no version entry in global scope of DeviceBinaryFormat::zebin::.ze_info) - will use decoder's default : '" + @@ -3151,9 +3151,9 @@ TEST(DecodeSingleDeviceBinaryZebin, WhenZeInfoVersionIsInvalidThenFails) { NEO::MockExecutionEnvironment mockExecutionEnvironment{}; auto &gfxCoreHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); ZebinTestData::ValidEmptyProgram zebin; - zebin.removeSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); + zebin.removeSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); auto zeInfo = ConstStringRef("version:\'1a\'\nkernels:\n"); - zebin.appendSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(zeInfo.data(), zeInfo.size())); + zebin.appendSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(zeInfo.data(), zeInfo.size())); NEO::ProgramInfo programInfo; NEO::SingleDeviceBinary singleBinary; @@ -3170,12 +3170,12 @@ TEST(DecodeSingleDeviceBinaryZebin, WhenZeInfoMinorVersionIsNewerThenEmitsWarnin NEO::MockExecutionEnvironment mockExecutionEnvironment{}; auto &gfxCoreHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); ZebinTestData::ValidEmptyProgram zebin; - zebin.removeSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); + zebin.removeSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); auto version = NEO::Zebin::ZeInfo::zeInfoDecoderVersion; std::string expectedWarning = "DeviceBinaryFormat::zebin::.ze_info : Minor version : " + std::to_string(version.minor + 1) + " is newer than available in decoder : " + std::to_string(version.minor) + " - some features may be skipped\n"; version.minor += 1; auto zeInfo = std::string("version:\'") + versionToString(version) + "\'\nkernels:\n"; - zebin.appendSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(zeInfo.data(), zeInfo.size())); + zebin.appendSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(zeInfo.data(), zeInfo.size())); NEO::ProgramInfo programInfo; NEO::SingleDeviceBinary singleBinary; @@ -3193,11 +3193,11 @@ TEST(DecodeSingleDeviceBinaryZebin, WhenZeInfoMajorVersionIsMismatchedThenFails) auto &gfxCoreHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); { ZebinTestData::ValidEmptyProgram zebin; - zebin.removeSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); + zebin.removeSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); auto version = NEO::Zebin::ZeInfo::zeInfoDecoderVersion; version.major += 1; auto zeInfo = std::string("version:\'") + versionToString(version) + "\'\nkernels:\n"; - zebin.appendSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(zeInfo.data(), zeInfo.size())); + zebin.appendSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(zeInfo.data(), zeInfo.size())); NEO::ProgramInfo programInfo; NEO::SingleDeviceBinary singleBinary; @@ -3212,11 +3212,11 @@ TEST(DecodeSingleDeviceBinaryZebin, WhenZeInfoMajorVersionIsMismatchedThenFails) { ZebinTestData::ValidEmptyProgram zebin; - zebin.removeSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); + zebin.removeSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); auto version = NEO::Zebin::ZeInfo::zeInfoDecoderVersion; version.major -= 1; auto zeInfo = std::string("version:\'") + versionToString(version) + "\'\nkernels:\n"; - zebin.appendSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(zeInfo.data(), zeInfo.size())); + zebin.appendSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(zeInfo.data(), zeInfo.size())); NEO::ProgramInfo programInfo; NEO::SingleDeviceBinary singleBinary; @@ -3238,9 +3238,9 @@ TEST(DecodeSingleDeviceBinaryZebin, WhenDecodeZeInfoFailsThenDecodingFails) { - )==="; ZebinTestData::ValidEmptyProgram zebin; - zebin.removeSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); + zebin.removeSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); - zebin.appendSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(brokenZeInfo.data(), brokenZeInfo.size())); + zebin.appendSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(brokenZeInfo.data(), brokenZeInfo.size())); NEO::ProgramInfo programInfo; NEO::SingleDeviceBinary singleBinary; @@ -3268,8 +3268,8 @@ TEST(DecodeSingleDeviceBinaryZebin, GivenValidZeInfoThenPopulatesKernelDescripto uint8_t kernelIsa[8]{0U}; ZebinTestData::ValidEmptyProgram zebin; - zebin.removeSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); - zebin.appendSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(zeinfo.data(), zeinfo.size())); + zebin.removeSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); + zebin.appendSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(zeinfo.data(), zeinfo.size())); zebin.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Zebin::Elf::SectionNames::textPrefix.str() + "some_kernel", {kernelIsa, sizeof(kernelIsa)}); zebin.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Zebin::Elf::SectionNames::textPrefix.str() + "some_other_kernel", {kernelIsa, sizeof(kernelIsa)}); @@ -3312,8 +3312,8 @@ TEST(DecodeSingleDeviceBinaryZebin, GivenValidZeInfoAndExternalFunctionsMetadata uint8_t kernelIsa[8]{0U}; ZebinTestData::ValidEmptyProgram zebin; - zebin.removeSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); - zebin.appendSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(zeinfo.data(), zeinfo.size())); + zebin.removeSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); + zebin.appendSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(zeinfo.data(), zeinfo.size())); zebin.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Zebin::Elf::SectionNames::textPrefix.str() + "some_kernel", {kernelIsa, sizeof(kernelIsa)}); NEO::ProgramInfo programInfo; @@ -3351,8 +3351,8 @@ TEST(DecodeSingleDeviceBinaryZebin, GivenValidZeInfoAndInvalidExternalFunctionsM )==="; ZebinTestData::ValidEmptyProgram zebin; - zebin.removeSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); - zebin.appendSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(validZeInfo.data(), validZeInfo.size())); + zebin.removeSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); + zebin.appendSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(validZeInfo.data(), validZeInfo.size())); zebin.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Zebin::Elf::SectionNames::textPrefix.str() + "some_kernel", {}); NEO::ProgramInfo programInfo; @@ -3388,8 +3388,8 @@ TEST(DecodeSingleDeviceBinaryZebin, GivenZeInfoWithTwoExternalFunctionsEntriesTh )==="; ZebinTestData::ValidEmptyProgram zebin; - zebin.removeSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); - zebin.appendSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(validZeInfo.data(), validZeInfo.size())); + zebin.removeSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); + zebin.appendSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(validZeInfo.data(), validZeInfo.size())); zebin.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Zebin::Elf::SectionNames::textPrefix.str() + "some_kernel", {}); NEO::ProgramInfo programInfo; @@ -3428,8 +3428,8 @@ TEST(DecodeSingleDeviceBinaryZebin, givenZeInfoWithKernelsMiscInfoSectionWhenDec )==="; uint8_t kernelIsa[8]{0U}; ZebinTestData::ValidEmptyProgram zebin; - zebin.removeSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); - zebin.appendSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(zeinfo.data(), zeinfo.size())); + zebin.removeSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); + zebin.appendSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(zeinfo.data(), zeinfo.size())); zebin.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Zebin::Elf::SectionNames::textPrefix.str() + "some_kernel", {kernelIsa, sizeof(kernelIsa)}); NEO::ProgramInfo programInfo; @@ -4091,8 +4091,8 @@ TEST(DecodeZebinTest, GivenKernelWithoutCorrespondingTextSectionThenFail) { NEO::ProgramInfo programInfo; std::string errors, warnings; ZebinTestData::ValidEmptyProgram zebin; - zebin.removeSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); - zebin.appendSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(zeinfo.data(), zeinfo.size())); + zebin.removeSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); + zebin.appendSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(zeinfo.data(), zeinfo.size())); auto elf = NEO::Elf::decodeElf(zebin.storage, errors, warnings); ASSERT_NE(nullptr, elf.elfFileHeader) << errors << " " << warnings; @@ -5523,7 +5523,7 @@ class IntelGTNotesFixture : public ::testing::Test { protected: void SetUp() override { zebin.elfHeader->type = NEO::Elf::ET_REL; - zebin.elfHeader->machine = NEO::Elf::ELF_MACHINE::EM_INTELGT; + zebin.elfHeader->machine = NEO::Elf::ElfMachine::EM_INTELGT; } void appendSingleIntelGTSectionData(const NEO::Elf::ElfNoteSection &elfNoteSection, uint8_t *const intelGTSectionData, const uint8_t *descData, const char *ownerName, size_t spaceAvailable, size_t &offset) { @@ -5882,7 +5882,7 @@ TEST(ValidateTargetDevice32BitZebin, Given32BitZebinAndValidIntelGTNotesWhenVali ZebinTestData::ValidEmptyProgram zebin; zebin.elfHeader->type = NEO::Elf::ET_REL; - zebin.elfHeader->machine = NEO::Elf::ELF_MACHINE::EM_INTELGT; + zebin.elfHeader->machine = NEO::Elf::ElfMachine::EM_INTELGT; Zebin::Elf::ZebinTargetFlags targetMetadata; targetMetadata.validateRevisionId = true; @@ -5911,7 +5911,7 @@ TEST(ValidateTargetDeviceGeneratorZebin, GivenZebinAndValidIntelGTNotesWithGener ZebinTestData::ValidEmptyProgram zebin; zebin.elfHeader->type = NEO::Elf::ET_REL; - zebin.elfHeader->machine = NEO::Elf::ELF_MACHINE::EM_INTELGT; + zebin.elfHeader->machine = NEO::Elf::ElfMachine::EM_INTELGT; Zebin::Elf::ZebinTargetFlags targetMetadata; targetMetadata.validateRevisionId = true; @@ -6261,8 +6261,8 @@ TEST(PopulateGlobalDeviceHostNameMapping, givenValidZebinWithGlobalHostAccessTab uint8_t kernelIsa[8]{0U}; ZebinTestData::ValidEmptyProgram zebin; - zebin.removeSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); - zebin.appendSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(zeinfo.data(), zeinfo.size())); + zebin.removeSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); + zebin.appendSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(zeinfo.data(), zeinfo.size())); zebin.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Zebin::Elf::SectionNames::textPrefix.str() + "some_kernel", {kernelIsa, sizeof(kernelIsa)}); NEO::ProgramInfo programInfo; @@ -6303,8 +6303,8 @@ TEST(PopulateGlobalDeviceHostNameMapping, givenZebinWithGlobalHostAccessTableSec )==="}; for (auto &zeInfo : invalidZeInfos) { ZebinTestData::ValidEmptyProgram zebin; - zebin.removeSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); - zebin.appendSection(NEO::Zebin::Elf::SHT_ZEBIN::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(zeInfo.data(), zeInfo.size())); + zebin.removeSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo); + zebin.appendSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef::fromAny(zeInfo.data(), zeInfo.size())); zebin.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Zebin::Elf::SectionNames::textPrefix.str() + "some_kernel", {}); NEO::ProgramInfo programInfo; diff --git a/shared/test/unit_test/direct_submission/linux/drm_direct_submission_tests.cpp b/shared/test/unit_test/direct_submission/linux/drm_direct_submission_tests.cpp index 9a92911798df1..632ea38ad60dc 100644 --- a/shared/test/unit_test/direct_submission/linux/drm_direct_submission_tests.cpp +++ b/shared/test/unit_test/direct_submission/linux/drm_direct_submission_tests.cpp @@ -44,7 +44,7 @@ struct DrmDirectSubmissionTest : public DrmMemoryManagerBasic { DrmMemoryManagerBasic::SetUp(); executionEnvironment.incRefInternal(); - executionEnvironment.memoryManager = std::make_unique(gemCloseWorkerMode::gemCloseWorkerInactive, + executionEnvironment.memoryManager = std::make_unique(GemCloseWorkerMode::gemCloseWorkerInactive, debugManager.flags.EnableForcePin.get(), true, executionEnvironment); diff --git a/shared/test/unit_test/image/image_surface_state_tests.cpp b/shared/test/unit_test/image/image_surface_state_tests.cpp index 02c29af9259a6..7895b760ab3af 100644 --- a/shared/test/unit_test/image/image_surface_state_tests.cpp +++ b/shared/test/unit_test/image/image_surface_state_tests.cpp @@ -29,7 +29,7 @@ HWTEST_F(ImageSurfaceStateTests, givenImageInfoWhenSetImageSurfaceStateThenPrope imageInfo.imgDesc.numSamples = 9u; imageInfo.imgDesc.imageType = ImageType::image2DArray; SurfaceFormatInfo surfaceFormatInfo; - surfaceFormatInfo.genxSurfaceFormat = GFX3DSTATE_SURFACEFORMAT::GFX3DSTATE_SURFACEFORMAT_A32_FLOAT; + surfaceFormatInfo.genxSurfaceFormat = SurfaceFormat::GFX3DSTATE_SURFACEFORMAT_A32_FLOAT; imageInfo.surfaceFormat = &surfaceFormatInfo; SurfaceOffsets surfaceOffsets; surfaceOffsets.offset = 0u; @@ -126,7 +126,7 @@ HWTEST_F(ImageSurfaceStateTests, givenImage2DWhen2dImageWAIsEnabledThenArrayFlag SurfaceOffsets surfaceOffsets = {0, 0, 0, 0}; const uint32_t cubeFaceIndex = __GMM_NO_CUBE_MAP; SurfaceFormatInfo surfaceFormatInfo; - surfaceFormatInfo.genxSurfaceFormat = GFX3DSTATE_SURFACEFORMAT::GFX3DSTATE_SURFACEFORMAT_A32_FLOAT; + surfaceFormatInfo.genxSurfaceFormat = SurfaceFormat::GFX3DSTATE_SURFACEFORMAT_A32_FLOAT; imageInfo.surfaceFormat = &surfaceFormatInfo; const uint64_t gpuAddress = 0x000001a78a8a8000; @@ -150,7 +150,7 @@ HWTEST_F(ImageSurfaceStateTests, givenImage2DWhen2dImageWAIsDisabledThenArrayFla SurfaceOffsets surfaceOffsets = {0, 0, 0, 0}; const uint32_t cubeFaceIndex = __GMM_NO_CUBE_MAP; SurfaceFormatInfo surfaceFormatInfo; - surfaceFormatInfo.genxSurfaceFormat = GFX3DSTATE_SURFACEFORMAT::GFX3DSTATE_SURFACEFORMAT_A32_FLOAT; + surfaceFormatInfo.genxSurfaceFormat = SurfaceFormat::GFX3DSTATE_SURFACEFORMAT_A32_FLOAT; imageInfo.surfaceFormat = &surfaceFormatInfo; const uint64_t gpuAddress = 0x000001a78a8a8000; @@ -174,7 +174,7 @@ HWTEST_F(ImageSurfaceStateTests, givenImage2DArrayOfSize1When2dImageWAIsEnabledT SurfaceOffsets surfaceOffsets = {0, 0, 0, 0}; const uint32_t cubeFaceIndex = __GMM_NO_CUBE_MAP; SurfaceFormatInfo surfaceFormatInfo; - surfaceFormatInfo.genxSurfaceFormat = GFX3DSTATE_SURFACEFORMAT::GFX3DSTATE_SURFACEFORMAT_A32_FLOAT; + surfaceFormatInfo.genxSurfaceFormat = SurfaceFormat::GFX3DSTATE_SURFACEFORMAT_A32_FLOAT; imageInfo.surfaceFormat = &surfaceFormatInfo; const uint64_t gpuAddress = 0x000001a78a8a8000; @@ -198,7 +198,7 @@ HWTEST_F(ImageSurfaceStateTests, givenImage2DArrayOfSize1When2dImageWAIsDisabled SurfaceOffsets surfaceOffsets = {0, 0, 0, 0}; const uint32_t cubeFaceIndex = __GMM_NO_CUBE_MAP; SurfaceFormatInfo surfaceFormatInfo; - surfaceFormatInfo.genxSurfaceFormat = GFX3DSTATE_SURFACEFORMAT::GFX3DSTATE_SURFACEFORMAT_A32_FLOAT; + surfaceFormatInfo.genxSurfaceFormat = SurfaceFormat::GFX3DSTATE_SURFACEFORMAT_A32_FLOAT; imageInfo.surfaceFormat = &surfaceFormatInfo; const uint64_t gpuAddress = 0x000001a78a8a8000; @@ -222,7 +222,7 @@ HWTEST_F(ImageSurfaceStateTests, givenImage1DWhen2dImageWAIsEnabledThenArrayFlag SurfaceOffsets surfaceOffsets = {0, 0, 0, 0}; const uint32_t cubeFaceIndex = __GMM_NO_CUBE_MAP; SurfaceFormatInfo surfaceFormatInfo; - surfaceFormatInfo.genxSurfaceFormat = GFX3DSTATE_SURFACEFORMAT::GFX3DSTATE_SURFACEFORMAT_A32_FLOAT; + surfaceFormatInfo.genxSurfaceFormat = SurfaceFormat::GFX3DSTATE_SURFACEFORMAT_A32_FLOAT; imageInfo.surfaceFormat = &surfaceFormatInfo; const uint64_t gpuAddress = 0x000001a78a8a8000; diff --git a/shared/test/unit_test/os_interface/linux/device_command_stream_tests.cpp b/shared/test/unit_test/os_interface/linux/device_command_stream_tests.cpp index 00db1999d638f..7ccfbfdbd58a0 100644 --- a/shared/test/unit_test/os_interface/linux/device_command_stream_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/device_command_stream_tests.cpp @@ -50,13 +50,13 @@ HWTEST_F(DeviceCommandStreamLeaksTest, WhenCreatingDeviceCsrThenValidPointerIsRe HWTEST_F(DeviceCommandStreamLeaksTest, givenDefaultDrmCsrWhenItIsCreatedThenGemCloseWorkerInactiveModeIsSelected) { std::unique_ptr ptr(DeviceCommandStreamReceiver::create(false, *executionEnvironment, 0, 1)); auto drmCsr = (DrmCommandStreamReceiver *)ptr.get(); - EXPECT_EQ(drmCsr->peekGemCloseWorkerOperationMode(), gemCloseWorkerMode::gemCloseWorkerActive); + EXPECT_EQ(drmCsr->peekGemCloseWorkerOperationMode(), GemCloseWorkerMode::gemCloseWorkerActive); } HWTEST_F(DeviceCommandStreamLeaksTest, givenDefaultDrmCsrWithAubDumWhenItIsCreatedThenGemCloseWorkerInactiveModeIsSelected) { std::unique_ptr ptr(DeviceCommandStreamReceiver::create(true, *executionEnvironment, 0, 1)); auto drmCsrWithAubDump = (CommandStreamReceiverWithAUBDump> *)ptr.get(); - EXPECT_EQ(drmCsrWithAubDump->peekGemCloseWorkerOperationMode(), gemCloseWorkerMode::gemCloseWorkerActive); + EXPECT_EQ(drmCsrWithAubDump->peekGemCloseWorkerOperationMode(), GemCloseWorkerMode::gemCloseWorkerActive); auto aubCSR = static_cast> *>(ptr.get())->aubCSR.get(); EXPECT_NE(nullptr, aubCSR); } @@ -77,7 +77,7 @@ HWTEST_F(DeviceCommandStreamLeaksTest, givenDisabledGemCloseWorkerWhenCsrIsCreat std::unique_ptr ptr(DeviceCommandStreamReceiver::create(false, *executionEnvironment, 0, 1)); auto drmCsr = (DrmCommandStreamReceiver *)ptr.get(); - EXPECT_EQ(drmCsr->peekGemCloseWorkerOperationMode(), gemCloseWorkerMode::gemCloseWorkerInactive); + EXPECT_EQ(drmCsr->peekGemCloseWorkerOperationMode(), GemCloseWorkerMode::gemCloseWorkerInactive); } HWTEST_F(DeviceCommandStreamLeaksTest, givenEnabledGemCloseWorkerWhenCsrIsCreatedThenGemCloseWorkerActiveModeIsSelected) { @@ -87,14 +87,14 @@ HWTEST_F(DeviceCommandStreamLeaksTest, givenEnabledGemCloseWorkerWhenCsrIsCreate std::unique_ptr ptr(DeviceCommandStreamReceiver::create(false, *executionEnvironment, 0, 1)); auto drmCsr = (DrmCommandStreamReceiver *)ptr.get(); - EXPECT_EQ(drmCsr->peekGemCloseWorkerOperationMode(), gemCloseWorkerMode::gemCloseWorkerActive); + EXPECT_EQ(drmCsr->peekGemCloseWorkerOperationMode(), GemCloseWorkerMode::gemCloseWorkerActive); } HWTEST_F(DeviceCommandStreamLeaksTest, givenDefaultGemCloseWorkerWhenCsrIsCreatedThenGemCloseWorkerActiveModeIsSelected) { std::unique_ptr ptr(DeviceCommandStreamReceiver::create(false, *executionEnvironment, 0, 1)); auto drmCsr = (DrmCommandStreamReceiver *)ptr.get(); - EXPECT_EQ(drmCsr->peekGemCloseWorkerOperationMode(), gemCloseWorkerMode::gemCloseWorkerActive); + EXPECT_EQ(drmCsr->peekGemCloseWorkerOperationMode(), GemCloseWorkerMode::gemCloseWorkerActive); } using DeviceCommandStreamSetInternalUsageTests = DeviceCommandStreamLeaksTest; @@ -102,8 +102,8 @@ using DeviceCommandStreamSetInternalUsageTests = DeviceCommandStreamLeaksTest; HWTEST_F(DeviceCommandStreamSetInternalUsageTests, givenValidDrmCsrThenGemCloseWorkerOperationModeIsSetToInactiveWhenInternalUsageIsSet) { std::unique_ptr ptr(DeviceCommandStreamReceiver::create(false, *executionEnvironment, 0, 1)); auto drmCsr = (DrmCommandStreamReceiver *)ptr.get(); - EXPECT_EQ(drmCsr->peekGemCloseWorkerOperationMode(), gemCloseWorkerMode::gemCloseWorkerActive); + EXPECT_EQ(drmCsr->peekGemCloseWorkerOperationMode(), GemCloseWorkerMode::gemCloseWorkerActive); drmCsr->initializeDefaultsForInternalEngine(); - EXPECT_EQ(drmCsr->peekGemCloseWorkerOperationMode(), gemCloseWorkerMode::gemCloseWorkerInactive); + EXPECT_EQ(drmCsr->peekGemCloseWorkerOperationMode(), GemCloseWorkerMode::gemCloseWorkerInactive); } diff --git a/shared/test/unit_test/os_interface/linux/drm_command_stream_mm_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_command_stream_mm_tests.cpp index 104dd3b38227a..e28c99300aaa1 100644 --- a/shared/test/unit_test/os_interface/linux/drm_command_stream_mm_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_command_stream_mm_tests.cpp @@ -49,7 +49,7 @@ HWTEST_F(DrmCommandStreamMMTest, GivenForcePinThenMemoryManagerCreatesPinBb) { executionEnvironment.rootDeviceEnvironments[0]->memoryOperationsInterface = DrmMemoryOperationsHandler::create(*drm, 0u, false); executionEnvironment.rootDeviceEnvironments[0]->initGmm(); - DrmCommandStreamReceiver csr(executionEnvironment, 0, 1, gemCloseWorkerMode::gemCloseWorkerInactive); + DrmCommandStreamReceiver csr(executionEnvironment, 0, 1, GemCloseWorkerMode::gemCloseWorkerInactive); auto memoryManager = new TestedDrmMemoryManager(false, true, false, executionEnvironment); executionEnvironment.memoryManager.reset(memoryManager); @@ -69,7 +69,7 @@ HWTEST_F(DrmCommandStreamMMTest, givenForcePinDisabledWhenMemoryManagerIsCreated executionEnvironment.rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr(drm)); executionEnvironment.rootDeviceEnvironments[0]->initGmm(); - DrmCommandStreamReceiver csr(executionEnvironment, 0, 1, gemCloseWorkerMode::gemCloseWorkerInactive); + DrmCommandStreamReceiver csr(executionEnvironment, 0, 1, GemCloseWorkerMode::gemCloseWorkerInactive); auto memoryManager = new TestedDrmMemoryManager(false, true, false, executionEnvironment); executionEnvironment.memoryManager.reset(memoryManager); diff --git a/shared/test/unit_test/os_interface/linux/drm_command_stream_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_command_stream_tests.cpp index a3f02786fbb67..e4fbfcaf35370 100644 --- a/shared/test/unit_test/os_interface/linux/drm_command_stream_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_command_stream_tests.cpp @@ -26,7 +26,7 @@ using namespace NEO; HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenL0ApiConfigWhenCreatingDrmCsrThenEnableImmediateDispatch) { VariableBackup backup(&apiTypeForUlts, ApiSpecificConfig::L0); - MockDrmCsr csr(executionEnvironment, 0, 1, gemCloseWorkerMode::gemCloseWorkerInactive); + MockDrmCsr csr(executionEnvironment, 0, 1, GemCloseWorkerMode::gemCloseWorkerInactive); EXPECT_EQ(DispatchMode::immediateDispatch, csr.dispatchMode); } @@ -42,7 +42,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenEnabledDirectSubmissionWhenGetting debugManager.flags.EnableDrmCompletionFence.set(1); debugManager.flags.EnableDirectSubmission.set(1); debugManager.flags.DirectSubmissionDisableMonitorFence.set(0); - MockDrmCsr csr(executionEnvironment, 0, 1, gemCloseWorkerMode::gemCloseWorkerInactive); + MockDrmCsr csr(executionEnvironment, 0, 1, GemCloseWorkerMode::gemCloseWorkerInactive); csr.setupContext(*osContext); EXPECT_EQ(nullptr, csr.completionFenceValuePointer); @@ -102,7 +102,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenExecBufferErrorWhenFlushInternalTh } HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenDefaultDrmCSRWhenItIsCreatedThenGemCloseWorkerModeIsInactive) { - EXPECT_EQ(gemCloseWorkerMode::gemCloseWorkerInactive, static_cast *>(csr)->peekGemCloseWorkerOperationMode()); + EXPECT_EQ(GemCloseWorkerMode::gemCloseWorkerInactive, static_cast *>(csr)->peekGemCloseWorkerOperationMode()); } HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenCommandStreamWhenItIsFlushedWithGemCloseWorkerInDefaultModeThenWorkerDecreasesTheRefCount) { @@ -264,10 +264,10 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenDebugFlagSetWhenFlushingTh } HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenDrmCsrCreatedWithInactiveGemCloseWorkerPolicyThenThreadIsNotCreated) { - TestedDrmCommandStreamReceiver testedCsr(gemCloseWorkerMode::gemCloseWorkerInactive, + TestedDrmCommandStreamReceiver testedCsr(GemCloseWorkerMode::gemCloseWorkerInactive, *this->executionEnvironment, 1); - EXPECT_EQ(gemCloseWorkerMode::gemCloseWorkerInactive, testedCsr.peekGemCloseWorkerOperationMode()); + EXPECT_EQ(GemCloseWorkerMode::gemCloseWorkerInactive, testedCsr.peekGemCloseWorkerOperationMode()); } HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenDrmAllocationWhenGetBufferObjectToModifyIsCalledForAGivenHandleIdThenTheCorrespondingBufferObjectGetsModified) { @@ -968,7 +968,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, mock->isVmBindAvailableCall.returnValue = true; TestedDrmCommandStreamReceiver *testedCsr = - new TestedDrmCommandStreamReceiver(gemCloseWorkerMode::gemCloseWorkerInactive, + new TestedDrmCommandStreamReceiver(GemCloseWorkerMode::gemCloseWorkerInactive, *this->executionEnvironment, 1); EXPECT_TRUE(testedCsr->useUserFenceWait); @@ -999,7 +999,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, mock->isVmBindAvailableCall.returnValue = true; TestedDrmCommandStreamReceiver *testedCsr = - new TestedDrmCommandStreamReceiver(gemCloseWorkerMode::gemCloseWorkerInactive, + new TestedDrmCommandStreamReceiver(GemCloseWorkerMode::gemCloseWorkerInactive, *this->executionEnvironment, 1); EXPECT_FALSE(testedCsr->useUserFenceWait); @@ -1033,7 +1033,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, mock->isVmBindAvailableCall.returnValue = false; TestedDrmCommandStreamReceiver *testedCsr = - new TestedDrmCommandStreamReceiver(gemCloseWorkerMode::gemCloseWorkerInactive, + new TestedDrmCommandStreamReceiver(GemCloseWorkerMode::gemCloseWorkerInactive, *this->executionEnvironment, 1); EXPECT_TRUE(testedCsr->useUserFenceWait); @@ -1063,7 +1063,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenWaitUserFenceFlagNotSetWhe debugManager.flags.EnableUserFenceForCompletionWait.set(0); TestedDrmCommandStreamReceiver *testedCsr = - new TestedDrmCommandStreamReceiver(gemCloseWorkerMode::gemCloseWorkerInactive, + new TestedDrmCommandStreamReceiver(GemCloseWorkerMode::gemCloseWorkerInactive, *this->executionEnvironment, 1); EXPECT_FALSE(testedCsr->useUserFenceWait); @@ -1086,7 +1086,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenGemWaitUsedWhenKmdTimeoutU debugManager.flags.EnableUserFenceForCompletionWait.set(0); TestedDrmCommandStreamReceiver *testedCsr = - new TestedDrmCommandStreamReceiver(gemCloseWorkerMode::gemCloseWorkerInactive, + new TestedDrmCommandStreamReceiver(GemCloseWorkerMode::gemCloseWorkerInactive, *this->executionEnvironment, 1); EXPECT_FALSE(testedCsr->useUserFenceWait); @@ -1113,7 +1113,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, mock->isVmBindAvailableCall.returnValue = true; TestedDrmCommandStreamReceiver *testedCsr = - new TestedDrmCommandStreamReceiver(gemCloseWorkerMode::gemCloseWorkerInactive, + new TestedDrmCommandStreamReceiver(GemCloseWorkerMode::gemCloseWorkerInactive, *this->executionEnvironment, 1); EXPECT_TRUE(testedCsr->useUserFenceWait); @@ -1154,7 +1154,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, mock->isVmBindAvailableCall.returnValue = false; TestedDrmCommandStreamReceiver *testedCsr = - new TestedDrmCommandStreamReceiver(gemCloseWorkerMode::gemCloseWorkerInactive, + new TestedDrmCommandStreamReceiver(GemCloseWorkerMode::gemCloseWorkerInactive, *this->executionEnvironment, 1); EXPECT_TRUE(testedCsr->useUserFenceWait); @@ -1183,7 +1183,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, mock->isVmBindAvailableCall.returnValue = true; TestedDrmCommandStreamReceiver *testedCsr = - new TestedDrmCommandStreamReceiver(gemCloseWorkerMode::gemCloseWorkerInactive, + new TestedDrmCommandStreamReceiver(GemCloseWorkerMode::gemCloseWorkerInactive, *this->executionEnvironment, 1); EXPECT_FALSE(testedCsr->useUserFenceWait); @@ -1214,7 +1214,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, mock->isVmBindAvailableCall.returnValue = true; TestedDrmCommandStreamReceiver *testedCsr = - new TestedDrmCommandStreamReceiver(gemCloseWorkerMode::gemCloseWorkerInactive, + new TestedDrmCommandStreamReceiver(GemCloseWorkerMode::gemCloseWorkerInactive, *this->executionEnvironment, 1); EXPECT_TRUE(testedCsr->useUserFenceWait); @@ -1245,7 +1245,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, mock->isVmBindAvailableCall.returnValue = true; std::unique_ptr> testedCsr = - std::make_unique>(gemCloseWorkerMode::gemCloseWorkerInactive, + std::make_unique>(GemCloseWorkerMode::gemCloseWorkerInactive, *this->executionEnvironment, 1); @@ -1262,7 +1262,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, mock->isVmBindAvailableCall.returnValue = true; std::unique_ptr> testedCsr = - std::make_unique>(gemCloseWorkerMode::gemCloseWorkerInactive, + std::make_unique>(GemCloseWorkerMode::gemCloseWorkerInactive, *this->executionEnvironment, 1); @@ -1279,7 +1279,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, mock->isVmBindAvailableCall.returnValue = true; std::unique_ptr> testedCsr = - std::make_unique>(gemCloseWorkerMode::gemCloseWorkerInactive, + std::make_unique>(GemCloseWorkerMode::gemCloseWorkerInactive, *this->executionEnvironment, 1); @@ -1297,7 +1297,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, mock->isVmBindAvailableCall.returnValue = true; std::unique_ptr> testedCsr = - std::make_unique>(gemCloseWorkerMode::gemCloseWorkerInactive, + std::make_unique>(GemCloseWorkerMode::gemCloseWorkerInactive, *this->executionEnvironment, 1); @@ -1315,7 +1315,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, mock->isVmBindAvailableCall.returnValue = true; std::unique_ptr> testedCsr = - std::make_unique>(gemCloseWorkerMode::gemCloseWorkerInactive, + std::make_unique>(GemCloseWorkerMode::gemCloseWorkerInactive, *this->executionEnvironment, 1); @@ -1390,7 +1390,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenMergeWithResidencyContaine EncodeNoop::alignToCacheLine(cs); BatchBuffer batchBuffer = BatchBufferHelper::createDefaultBatchBuffer(cs.getGraphicsAllocation(), &cs, cs.getUsed()); - MockDrmCsr mockCsr(*executionEnvironment, rootDeviceIndex, 1, gemCloseWorkerMode::gemCloseWorkerInactive); + MockDrmCsr mockCsr(*executionEnvironment, rootDeviceIndex, 1, GemCloseWorkerMode::gemCloseWorkerInactive); mockCsr.setupContext(*osContext.get()); auto res = mockCsr.flush(batchBuffer, mockCsr.getResidencyAllocations()); EXPECT_GT(operationHandler->mergeWithResidencyContainerCalled, 0u); @@ -1421,7 +1421,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenMergeWithResidencyContaine EncodeNoop::alignToCacheLine(cs); BatchBuffer batchBuffer = BatchBufferHelper::createDefaultBatchBuffer(cs.getGraphicsAllocation(), &cs, cs.getUsed()); - MockDrmCsr mockCsr(*executionEnvironment, rootDeviceIndex, 1, gemCloseWorkerMode::gemCloseWorkerInactive); + MockDrmCsr mockCsr(*executionEnvironment, rootDeviceIndex, 1, GemCloseWorkerMode::gemCloseWorkerInactive); mockCsr.setupContext(*osContext.get()); auto res = mockCsr.flush(batchBuffer, mockCsr.getResidencyAllocations()); EXPECT_GT(operationHandler->mergeWithResidencyContainerCalled, 0u); @@ -1455,7 +1455,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenNoAllocsInMemoryOperationH EncodeNoop::alignToCacheLine(cs); BatchBuffer batchBuffer = BatchBufferHelper::createDefaultBatchBuffer(cs.getGraphicsAllocation(), &cs, cs.getUsed()); - MockDrmCsr mockCsr(*executionEnvironment, rootDeviceIndex, 1, gemCloseWorkerMode::gemCloseWorkerInactive); + MockDrmCsr mockCsr(*executionEnvironment, rootDeviceIndex, 1, GemCloseWorkerMode::gemCloseWorkerInactive); mockCsr.setupContext(*osContext.get()); mockCsr.flush(batchBuffer, mockCsr.getResidencyAllocations()); @@ -1489,7 +1489,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenAllocsInMemoryOperationHan EncodeNoop::alignToCacheLine(cs); BatchBuffer batchBuffer = BatchBufferHelper::createDefaultBatchBuffer(cs.getGraphicsAllocation(), &cs, cs.getUsed()); - MockDrmCsr mockCsr(*executionEnvironment, rootDeviceIndex, 1, gemCloseWorkerMode::gemCloseWorkerInactive); + MockDrmCsr mockCsr(*executionEnvironment, rootDeviceIndex, 1, GemCloseWorkerMode::gemCloseWorkerInactive); mockCsr.setupContext(*osContext.get()); mockCsr.flush(batchBuffer, mockCsr.getResidencyAllocations()); diff --git a/shared/test/unit_test/os_interface/linux/drm_command_stream_tests_1.cpp b/shared/test/unit_test/os_interface/linux/drm_command_stream_tests_1.cpp index 0a9e978fd0697..f7adf3bdf085f 100644 --- a/shared/test/unit_test/os_interface/linux/drm_command_stream_tests_1.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_command_stream_tests_1.cpp @@ -1003,7 +1003,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenDrmCommandStreamReceiverWhenCreate executionEnvironment.rootDeviceEnvironments[1]->initGmm(); executionEnvironment.rootDeviceEnvironments[1]->osInterface = std::make_unique(); executionEnvironment.rootDeviceEnvironments[1]->osInterface->setDriverModel(std::unique_ptr(new DrmMockCustom(*executionEnvironment.rootDeviceEnvironments[0]))); - auto csr = std::make_unique>(executionEnvironment, 1, 1, gemCloseWorkerMode::gemCloseWorkerActive); + auto csr = std::make_unique>(executionEnvironment, 1, 1, GemCloseWorkerMode::gemCloseWorkerActive); auto pageTableManager = csr->createPageTableManager(); EXPECT_EQ(csr->pageTableManager.get(), pageTableManager); } @@ -1013,11 +1013,11 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenLocalMemoryEnabledWhenCreatingDrmC DebugManagerStateRestore restore; debugManager.flags.EnableLocalMemory.set(1); - MockDrmCsr csr1(executionEnvironment, 0, 1, gemCloseWorkerMode::gemCloseWorkerInactive); + MockDrmCsr csr1(executionEnvironment, 0, 1, GemCloseWorkerMode::gemCloseWorkerInactive); EXPECT_EQ(DispatchMode::batchedDispatch, csr1.dispatchMode); debugManager.flags.CsrDispatchMode.set(static_cast(DispatchMode::immediateDispatch)); - MockDrmCsr csr2(executionEnvironment, 0, 1, gemCloseWorkerMode::gemCloseWorkerInactive); + MockDrmCsr csr2(executionEnvironment, 0, 1, GemCloseWorkerMode::gemCloseWorkerInactive); EXPECT_EQ(DispatchMode::immediateDispatch, csr2.dispatchMode); } @@ -1025,11 +1025,11 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenLocalMemoryEnabledWhenCreatingDrmC DebugManagerStateRestore restore; debugManager.flags.EnableLocalMemory.set(0); - MockDrmCsr csr1(executionEnvironment, 0, 1, gemCloseWorkerMode::gemCloseWorkerInactive); + MockDrmCsr csr1(executionEnvironment, 0, 1, GemCloseWorkerMode::gemCloseWorkerInactive); EXPECT_EQ(DispatchMode::immediateDispatch, csr1.dispatchMode); debugManager.flags.CsrDispatchMode.set(static_cast(DispatchMode::batchedDispatch)); - MockDrmCsr csr2(executionEnvironment, 0, 1, gemCloseWorkerMode::gemCloseWorkerInactive); + MockDrmCsr csr2(executionEnvironment, 0, 1, GemCloseWorkerMode::gemCloseWorkerInactive); EXPECT_EQ(DispatchMode::batchedDispatch, csr2.dispatchMode); } } diff --git a/shared/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_prelim_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_prelim_tests.cpp index eee24fc8ea1b3..8157c7608c800 100644 --- a/shared/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_prelim_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_prelim_tests.cpp @@ -293,7 +293,7 @@ class DrmCommandStreamForceTileTest : public ::testing::Test { } MockDrmCommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, DeviceBitfield deviceBitfield, - gemCloseWorkerMode mode, uint32_t inputHandleId) + GemCloseWorkerMode mode, uint32_t inputHandleId) : DrmCommandStreamReceiver(executionEnvironment, rootDeviceIndex, deviceBitfield, mode), expectedHandleId(inputHandleId) { } @@ -326,12 +326,12 @@ class DrmCommandStreamForceTileTest : public ::testing::Test { csr = new MockDrmCommandStreamReceiver(executionEnvironment, rootDeviceIndex, 3, - gemCloseWorkerMode::gemCloseWorkerActive, + GemCloseWorkerMode::gemCloseWorkerActive, expectedHandleId); ASSERT_NE(nullptr, csr); csr->setupContext(*osContext); - memoryManager = new DrmMemoryManager(gemCloseWorkerMode::gemCloseWorkerActive, + memoryManager = new DrmMemoryManager(GemCloseWorkerMode::gemCloseWorkerActive, debugManager.flags.EnableForcePin.get(), true, executionEnvironment); @@ -434,7 +434,7 @@ struct DrmImplicitScalingCommandStreamTest : ::testing::Test { PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), DeviceBitfield(0b11))); osContext->ensureContextInitialized(); - memoryManager = new DrmMemoryManager(gemCloseWorkerMode::gemCloseWorkerActive, debugManager.flags.EnableForcePin.get(), true, *executionEnvironment); + memoryManager = new DrmMemoryManager(GemCloseWorkerMode::gemCloseWorkerActive, debugManager.flags.EnableForcePin.get(), true, *executionEnvironment); executionEnvironment->memoryManager.reset(memoryManager); } @@ -447,7 +447,7 @@ struct DrmImplicitScalingCommandStreamTest : ::testing::Test { template std::unique_ptr> createCsr() { - auto csr = std::make_unique>(*executionEnvironment, 0, 0b11, gemCloseWorkerMode::gemCloseWorkerActive); + auto csr = std::make_unique>(*executionEnvironment, 0, 0b11, GemCloseWorkerMode::gemCloseWorkerActive); csr->setupContext(*osContext); return csr; } @@ -532,7 +532,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmImplicitScalingCommandStreamTest, whenForceExecu PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo))); osContext->ensureContextInitialized(); auto csr = std::make_unique(*executionEnvironment, 0, osContext->getDeviceBitfield(), - gemCloseWorkerMode::gemCloseWorkerActive); + GemCloseWorkerMode::gemCloseWorkerActive); csr->setupContext(*osContext); auto tileInstancedBo0 = new BufferObject(0u, drm, 3, 40, 0, 1); @@ -575,7 +575,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmImplicitScalingCommandStreamTest, whenForceExecu uint32_t execCalled = 0; }; auto csr = std::make_unique(*executionEnvironment, 0, osContext->getDeviceBitfield(), - gemCloseWorkerMode::gemCloseWorkerActive); + GemCloseWorkerMode::gemCloseWorkerActive); csr->setupContext(*osContext); auto tileInstancedBo0 = new BufferObject(0u, drm, 3, 40, 0, 1); @@ -623,7 +623,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmImplicitScalingCommandStreamTest, givenDisabledI uint32_t processResidencyCalled = 0; }; auto csr = std::make_unique(*executionEnvironment, 0, osContext->getDeviceBitfield(), - gemCloseWorkerMode::gemCloseWorkerActive); + GemCloseWorkerMode::gemCloseWorkerActive); csr->setupContext(*osContext); const auto size = 1024u; @@ -657,7 +657,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmImplicitScalingCommandStreamTest, givenMultiTile uint32_t execCalled = 0; }; auto csr = std::make_unique(*executionEnvironment, 0, osContext->getDeviceBitfield(), - gemCloseWorkerMode::gemCloseWorkerActive); + GemCloseWorkerMode::gemCloseWorkerActive); csr->setupContext(*osContext); const auto size = 1024u; diff --git a/shared/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_tests.cpp index ed12b12e9918d..c9ccf6750ca41 100644 --- a/shared/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_tests.cpp @@ -45,7 +45,7 @@ struct DrmCommandStreamMultiTileMemExecFixture { executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr(mock)); executionEnvironment->rootDeviceEnvironments[0]->memoryOperationsInterface = DrmMemoryOperationsHandler::create(*mock, 0, false); - memoryManager = new DrmMemoryManager(gemCloseWorkerMode::gemCloseWorkerInactive, + memoryManager = new DrmMemoryManager(GemCloseWorkerMode::gemCloseWorkerInactive, debugManager.flags.EnableForcePin.get(), true, *executionEnvironment); diff --git a/shared/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp index d6206fa794485..236d2c4a52d60 100644 --- a/shared/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp @@ -69,7 +69,7 @@ class DrmGemCloseWorkerFixture { executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->osInterface->setDriverModel(std::unique_ptr(drmMock)); executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->memoryOperationsInterface = DrmMemoryOperationsHandler::create(*drmMock, 0u, false); - this->mm = new DrmMemoryManager(gemCloseWorkerMode::gemCloseWorkerInactive, + this->mm = new DrmMemoryManager(GemCloseWorkerMode::gemCloseWorkerInactive, false, false, executionEnvironment); diff --git a/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_prelim_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_prelim_tests.cpp index 272ba2228bc55..c5365346e1b9a 100644 --- a/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_prelim_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_prelim_tests.cpp @@ -2191,7 +2191,7 @@ using DrmMemoryManagerCopyMemoryToAllocationPrelimTest = DrmMemoryManagerLocalMe struct DrmMemoryManagerToTestCopyMemoryToAllocation : public DrmMemoryManager { using DrmMemoryManager::allocateGraphicsMemoryInDevicePool; DrmMemoryManagerToTestCopyMemoryToAllocation(ExecutionEnvironment &executionEnvironment, bool localMemoryEnabled, size_t lockableLocalMemorySize) - : DrmMemoryManager(gemCloseWorkerMode::gemCloseWorkerInactive, false, false, executionEnvironment) { + : DrmMemoryManager(GemCloseWorkerMode::gemCloseWorkerInactive, false, false, executionEnvironment) { std::fill(this->localMemorySupported.begin(), this->localMemorySupported.end(), localMemoryEnabled); lockedLocalMemorySize = lockableLocalMemorySize; } diff --git a/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_upstream_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_upstream_tests.cpp index 8afb542e24429..f7513cde54a4f 100644 --- a/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_upstream_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_upstream_tests.cpp @@ -710,7 +710,7 @@ using DrmMemoryManagerCopyMemoryToAllocationTest = DrmMemoryManagerLocalMemoryTe struct DrmMemoryManagerToTestCopyMemoryToAllocation : public DrmMemoryManager { using DrmMemoryManager::allocateGraphicsMemoryInDevicePool; DrmMemoryManagerToTestCopyMemoryToAllocation(ExecutionEnvironment &executionEnvironment, bool localMemoryEnabled, size_t lockableLocalMemorySize) - : DrmMemoryManager(gemCloseWorkerMode::gemCloseWorkerInactive, false, false, executionEnvironment) { + : DrmMemoryManager(GemCloseWorkerMode::gemCloseWorkerInactive, false, false, executionEnvironment) { std::fill(this->localMemorySupported.begin(), this->localMemorySupported.end(), localMemoryEnabled); lockedLocalMemorySize = lockableLocalMemorySize; } diff --git a/shared/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp index e51ed0d0a1114..e664c32fe518f 100644 --- a/shared/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp @@ -590,7 +590,7 @@ TEST_F(DrmMemoryManagerTest, givenDefaultDrmMemoryManagerWhenItIsCreatedAndGfxPa auto failedInitGfxPartition = std::make_unique(); memoryManager->gfxPartitions[0].reset(failedInitGfxPartition.release()); - memoryManager->initialize(gemCloseWorkerMode::gemCloseWorkerInactive); + memoryManager->initialize(GemCloseWorkerMode::gemCloseWorkerInactive); EXPECT_FALSE(memoryManager->isInitialized()); auto mockGfxPartitionBasic = std::make_unique(); @@ -1047,12 +1047,12 @@ TEST_F(DrmMemoryManagerTest, GivenNullptrWhenUnreferenceIsCalledThenCallSucceeds } TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenDrmMemoryManagerCreatedWithGemCloseWorkerModeInactiveThenGemCloseWorkerIsNotCreated) { - DrmMemoryManager drmMemoryManger(gemCloseWorkerMode::gemCloseWorkerInactive, false, false, *executionEnvironment); + DrmMemoryManager drmMemoryManger(GemCloseWorkerMode::gemCloseWorkerInactive, false, false, *executionEnvironment); EXPECT_EQ(nullptr, drmMemoryManger.peekGemCloseWorker()); } TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenDrmMemoryManagerCreatedWithGemCloseWorkerActiveThenGemCloseWorkerIsCreated) { - DrmMemoryManager drmMemoryManger(gemCloseWorkerMode::gemCloseWorkerActive, false, false, *executionEnvironment); + DrmMemoryManager drmMemoryManger(GemCloseWorkerMode::gemCloseWorkerActive, false, false, *executionEnvironment); EXPECT_NE(nullptr, drmMemoryManger.peekGemCloseWorker()); } @@ -2440,7 +2440,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenUnlockResourceIsCalledOnAl struct DrmMemoryManagerToTestUnlockResource : public DrmMemoryManager { using DrmMemoryManager::unlockResourceImpl; DrmMemoryManagerToTestUnlockResource(ExecutionEnvironment &executionEnvironment, bool localMemoryEnabled, size_t lockableLocalMemorySize) - : DrmMemoryManager(gemCloseWorkerMode::gemCloseWorkerInactive, false, false, executionEnvironment) { + : DrmMemoryManager(GemCloseWorkerMode::gemCloseWorkerInactive, false, false, executionEnvironment) { } void unlockBufferObject(BufferObject *bo) override { unlockResourceInLocalMemoryImplParam.bo = bo; @@ -2776,7 +2776,7 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenDefaultDrmMemoryManage } TEST_F(DrmMemoryManagerBasic, givenDefaultMemoryManagerWhenItIsCreatedThenAsyncDeleterEnabledIsTrue) { - DrmMemoryManager memoryManager(gemCloseWorkerMode::gemCloseWorkerInactive, false, true, executionEnvironment); + DrmMemoryManager memoryManager(GemCloseWorkerMode::gemCloseWorkerInactive, false, true, executionEnvironment); EXPECT_FALSE(memoryManager.isAsyncDeleterEnabled()); EXPECT_EQ(nullptr, memoryManager.getDeferredDeleter()); memoryManager.commonCleanup(); @@ -2801,7 +2801,7 @@ TEST_F(DrmMemoryManagerBasic, givenEnabledGemCloseWorkerWhenMemoryManagerIsCreat } TEST_F(DrmMemoryManagerBasic, givenDefaultGemCloseWorkerWhenMemoryManagerIsCreatedThenGemCloseWorker) { - MemoryManagerCreate memoryManager(false, false, gemCloseWorkerMode::gemCloseWorkerActive, false, false, executionEnvironment); + MemoryManagerCreate memoryManager(false, false, GemCloseWorkerMode::gemCloseWorkerActive, false, false, executionEnvironment); EXPECT_NE(memoryManager.peekGemCloseWorker(), nullptr); } @@ -2809,7 +2809,7 @@ TEST_F(DrmMemoryManagerBasic, givenDefaultGemCloseWorkerWhenMemoryManagerIsCreat TEST_F(DrmMemoryManagerBasic, givenEnabledAsyncDeleterFlagWhenMemoryManagerIsCreatedThenAsyncDeleterEnabledIsFalseAndDeleterIsNullptr) { DebugManagerStateRestore dbgStateRestore; debugManager.flags.EnableDeferredDeleter.set(true); - DrmMemoryManager memoryManager(gemCloseWorkerMode::gemCloseWorkerInactive, false, true, executionEnvironment); + DrmMemoryManager memoryManager(GemCloseWorkerMode::gemCloseWorkerInactive, false, true, executionEnvironment); EXPECT_FALSE(memoryManager.isAsyncDeleterEnabled()); EXPECT_EQ(nullptr, memoryManager.getDeferredDeleter()); memoryManager.commonCleanup(); @@ -2818,14 +2818,14 @@ TEST_F(DrmMemoryManagerBasic, givenEnabledAsyncDeleterFlagWhenMemoryManagerIsCre TEST_F(DrmMemoryManagerBasic, givenDisabledAsyncDeleterFlagWhenMemoryManagerIsCreatedThenAsyncDeleterEnabledIsFalseAndDeleterIsNullptr) { DebugManagerStateRestore dbgStateRestore; debugManager.flags.EnableDeferredDeleter.set(false); - DrmMemoryManager memoryManager(gemCloseWorkerMode::gemCloseWorkerInactive, false, true, executionEnvironment); + DrmMemoryManager memoryManager(GemCloseWorkerMode::gemCloseWorkerInactive, false, true, executionEnvironment); EXPECT_FALSE(memoryManager.isAsyncDeleterEnabled()); EXPECT_EQ(nullptr, memoryManager.getDeferredDeleter()); memoryManager.commonCleanup(); } TEST_F(DrmMemoryManagerBasic, givenWorkerToCloseWhenCommonCleanupIsCalledThenClosingIsBlocking) { - MockDrmMemoryManager memoryManager(gemCloseWorkerMode::gemCloseWorkerInactive, false, true, executionEnvironment); + MockDrmMemoryManager memoryManager(GemCloseWorkerMode::gemCloseWorkerInactive, false, true, executionEnvironment); memoryManager.gemCloseWorker.reset(new MockDrmGemCloseWorker(memoryManager)); auto pWorker = static_cast(memoryManager.gemCloseWorker.get()); @@ -6735,7 +6735,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenDebugVar struct DrmMemoryManagerToTestCopyMemoryToAllocationBanks : public DrmMemoryManager { DrmMemoryManagerToTestCopyMemoryToAllocationBanks(ExecutionEnvironment &executionEnvironment, size_t lockableLocalMemorySize) - : DrmMemoryManager(gemCloseWorkerMode::gemCloseWorkerInactive, false, false, executionEnvironment) { + : DrmMemoryManager(GemCloseWorkerMode::gemCloseWorkerInactive, false, false, executionEnvironment) { lockedLocalMemorySize = lockableLocalMemorySize; } void *lockBufferObject(BufferObject *bo) override { diff --git a/shared/wsl_compute_helper/source/wsl_compute_helper_types_demarshall.h b/shared/wsl_compute_helper/source/wsl_compute_helper_types_demarshall.h index 0a30e188e1f33..1798e345ee6bb 100644 --- a/shared/wsl_compute_helper/source/wsl_compute_helper_types_demarshall.h +++ b/shared/wsl_compute_helper/source/wsl_compute_helper_types_demarshall.h @@ -12892,329 +12892,3 @@ struct Demarshaller { return true; } }; - -template <> -struct Demarshaller { - template - static bool demarshall(GFX_ESCAPE_HEADERT &dst, const TokenHeader *srcTokensBeg, const TokenHeader *srcTokensEnd) { - const TokenHeader *tok = srcTokensBeg; - while (tok < srcTokensEnd) { - if (false == tok->flags.flag4IsVariableLength) { - switch (tok->id) { - default: - if (tok->flags.flag3IsMandatory) { - return false; - } - break; - case TOK_FBD_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4430__SIZE: { - dst.Size = readTokValue(*tok); - } break; - case TOK_FBD_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4430__CHECK_SUM: { - dst.CheckSum = readTokValue(*tok); - } break; - case TOK_FE_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4430__ESCAPE_CODE: { - dst.EscapeCode = readTokValue(*tok); - } break; - case TOK_FBD_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4430__UL_RESERVED: { - dst.ulReserved = readTokValue(*tok); - } break; - case TOK_FBD_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4963__UL_RESERVED1: { - dst.ulReserved1 = readTokValue(*tok); - } break; - case TOK_FBW_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4963__US_ESCAPE_VERSION: { - dst.usEscapeVersion = readTokValue(*tok); - } break; - case TOK_FBW_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4963__US_FILE_VERSION: { - dst.usFileVersion = readTokValue(*tok); - } break; - case TOK_FE_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4963__UL_MAJOR_ESCAPE_CODE: { - dst.ulMajorEscapeCode = readTokValue(*tok); - } break; - case TOK_FBD_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4963__UI_MINOR_ESCAPE_CODE: { - dst.uiMinorEscapeCode = readTokValue(*tok); - } break; - }; - tok = tok + 1 + tok->valueDwordCount; - } else { - auto varLen = reinterpret_cast(tok); - switch (tok->id) { - default: - if (tok->flags.flag3IsMandatory) { - return false; - } - break; - case TOK_S_GFX_ESCAPE_HEADER: - if (false == demarshall(dst, varLen->getValue(), varLen->getValue() + varLen->valueLengthInBytes / sizeof(TokenHeader))) { - return false; - } - break; - }; - tok = tok + sizeof(TokenVariableLength) / sizeof(uint32_t) + varLen->valuePaddedSizeInDwords; - } - } - WCH_ASSERT(tok == srcTokensEnd); - return true; - } -}; - -template <> -struct Demarshaller { - template - static bool demarshall(GTDIBaseInStructT &dst, const TokenHeader *srcTokensBeg, const TokenHeader *srcTokensEnd) { - const TokenHeader *tok = srcTokensBeg; - while (tok < srcTokensEnd) { - if (false == tok->flags.flag4IsVariableLength) { - switch (tok->id) { - default: - if (tok->flags.flag3IsMandatory) { - return false; - } - break; - case TOK_FE_GTDIBASE_IN_STRUCT__FUNCTION: { - dst.Function = readTokValue(*tok); - } break; - }; - tok = tok + 1 + tok->valueDwordCount; - } else { - auto varLen = reinterpret_cast(tok); - switch (tok->id) { - default: - if (tok->flags.flag3IsMandatory) { - return false; - } - break; - case TOK_S_GTDIBASE_IN_STRUCT: - if (false == demarshall(dst, varLen->getValue(), varLen->getValue() + varLen->valueLengthInBytes / sizeof(TokenHeader))) { - return false; - } - break; - }; - tok = tok + sizeof(TokenVariableLength) / sizeof(uint32_t) + varLen->valuePaddedSizeInDwords; - } - } - WCH_ASSERT(tok == srcTokensEnd); - return true; - } -}; - -template <> -struct Demarshaller { - template - static bool demarshall(GTDIGetGpuCpuTimestampsOutStructT &dst, const TokenHeader *srcTokensBeg, const TokenHeader *srcTokensEnd) { - const TokenHeader *tok = srcTokensBeg; - while (tok < srcTokensEnd) { - if (false == tok->flags.flag4IsVariableLength) { - switch (tok->id) { - default: - if (tok->flags.flag3IsMandatory) { - return false; - } - break; - case TOK_FE_GTDIGET_GPU_CPU_TIMESTAMPS_OUT_STRUCT__RET_CODE: { - dst.RetCode = readTokValue(*tok); - } break; - case TOK_FBQ_GTDIGET_GPU_CPU_TIMESTAMPS_OUT_STRUCT__GPU_PERF_TICKS: { - dst.gpuPerfTicks = readTokValue(*tok); - } break; - case TOK_FBQ_GTDIGET_GPU_CPU_TIMESTAMPS_OUT_STRUCT__CPU_PERF_TICKS: { - dst.cpuPerfTicks = readTokValue(*tok); - } break; - case TOK_FBQ_GTDIGET_GPU_CPU_TIMESTAMPS_OUT_STRUCT__GPU_PERF_FREQ: { - dst.gpuPerfFreq = readTokValue(*tok); - } break; - case TOK_FBQ_GTDIGET_GPU_CPU_TIMESTAMPS_OUT_STRUCT__CPU_PERF_FREQ: { - dst.cpuPerfFreq = readTokValue(*tok); - } break; - }; - tok = tok + 1 + tok->valueDwordCount; - } else { - auto varLen = reinterpret_cast(tok); - switch (tok->id) { - default: - if (tok->flags.flag3IsMandatory) { - return false; - } - break; - case TOK_S_GTDIGET_GPU_CPU_TIMESTAMPS_OUT_STRUCT: - if (false == demarshall(dst, varLen->getValue(), varLen->getValue() + varLen->valueLengthInBytes / sizeof(TokenHeader))) { - return false; - } - break; - }; - tok = tok + sizeof(TokenVariableLength) / sizeof(uint32_t) + varLen->valuePaddedSizeInDwords; - } - } - WCH_ASSERT(tok == srcTokensEnd); - return true; - } -}; - -template <> -struct Demarshaller { - template - static bool demarshall(TimeStampDataHeaderT &dst, const TokenHeader *srcTokensBeg, const TokenHeader *srcTokensEnd) { - const TokenHeader *tok = srcTokensBeg; - while (tok < srcTokensEnd) { - if (false == tok->flags.flag4IsVariableLength) { - if (tok->flags.flag3IsMandatory) { - return false; - } - tok = tok + 1 + tok->valueDwordCount; - } else { - auto varLen = reinterpret_cast(tok); - switch (tok->id) { - default: - if (tok->flags.flag3IsMandatory) { - return false; - } - break; - case TOK_S_TIME_STAMP_DATA_HEADER: - if (false == demarshall(dst, varLen->getValue(), varLen->getValue() + varLen->valueLengthInBytes / sizeof(TokenHeader))) { - return false; - } - break; - case TOK_FS_TIME_STAMP_DATA_HEADER__M_HEADER: { - const TokenHeader *tokMHeader = varLen->getValue(); - const TokenHeader *tokMHeaderEnd = varLen->getValue() + varLen->valueLengthInBytes / sizeof(TokenHeader); - while (tokMHeader < tokMHeaderEnd) { - if (false == tokMHeader->flags.flag4IsVariableLength) { - switch (tokMHeader->id) { - default: - if (tokMHeader->flags.flag3IsMandatory) { - return false; - } - break; - case TOK_FBD_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4430__SIZE: { - dst.m_Header.Size = readTokValue(*tokMHeader); - } break; - case TOK_FBD_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4430__CHECK_SUM: { - dst.m_Header.CheckSum = readTokValue(*tokMHeader); - } break; - case TOK_FE_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4430__ESCAPE_CODE: { - dst.m_Header.EscapeCode = readTokValue(*tokMHeader); - } break; - case TOK_FBD_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4430__UL_RESERVED: { - dst.m_Header.ulReserved = readTokValue(*tokMHeader); - } break; - case TOK_FBD_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4963__UL_RESERVED1: { - dst.m_Header.ulReserved1 = readTokValue(*tokMHeader); - } break; - case TOK_FBW_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4963__US_ESCAPE_VERSION: { - dst.m_Header.usEscapeVersion = readTokValue(*tokMHeader); - } break; - case TOK_FBW_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4963__US_FILE_VERSION: { - dst.m_Header.usFileVersion = readTokValue(*tokMHeader); - } break; - case TOK_FE_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4963__UL_MAJOR_ESCAPE_CODE: { - dst.m_Header.ulMajorEscapeCode = readTokValue(*tokMHeader); - } break; - case TOK_FBD_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4963__UI_MINOR_ESCAPE_CODE: { - dst.m_Header.uiMinorEscapeCode = readTokValue(*tokMHeader); - } break; - }; - tokMHeader = tokMHeader + 1 + tokMHeader->valueDwordCount; - } else { - auto varLen = reinterpret_cast(tokMHeader); - if (tokMHeader->flags.flag3IsMandatory) { - return false; - } - tokMHeader = tokMHeader + sizeof(TokenVariableLength) / sizeof(uint32_t) + varLen->valuePaddedSizeInDwords; - } - } - WCH_ASSERT(tokMHeader == tokMHeaderEnd); - } break; - case TOK_FS_TIME_STAMP_DATA_HEADER__M_DATA: { - const TokenHeader *tokMData = varLen->getValue(); - const TokenHeader *tokMDataEnd = varLen->getValue() + varLen->valueLengthInBytes / sizeof(TokenHeader); - while (tokMData < tokMDataEnd) { - if (false == tokMData->flags.flag4IsVariableLength) { - if (tokMData->flags.flag3IsMandatory) { - return false; - } - tokMData = tokMData + 1 + tokMData->valueDwordCount; - } else { - auto varLen = reinterpret_cast(tokMData); - switch (tokMData->id) { - default: - if (tokMData->flags.flag3IsMandatory) { - return false; - } - break; - case TOK_FXS_TIME_STAMP_DATA_HEADER__ANONYMOUS2466__M_IN: { - const TokenHeader *tokMIn = varLen->getValue(); - const TokenHeader *tokMInEnd = varLen->getValue() + varLen->valueLengthInBytes / sizeof(TokenHeader); - while (tokMIn < tokMInEnd) { - if (false == tokMIn->flags.flag4IsVariableLength) { - switch (tokMIn->id) { - default: - if (tokMIn->flags.flag3IsMandatory) { - return false; - } - break; - case TOK_FE_GTDIBASE_IN_STRUCT__FUNCTION: { - dst.m_Data.m_In.Function = readTokValue(*tokMIn); - } break; - }; - tokMIn = tokMIn + 1 + tokMIn->valueDwordCount; - } else { - auto varLen = reinterpret_cast(tokMIn); - if (tokMIn->flags.flag3IsMandatory) { - return false; - } - tokMIn = tokMIn + sizeof(TokenVariableLength) / sizeof(uint32_t) + varLen->valuePaddedSizeInDwords; - } - } - WCH_ASSERT(tokMIn == tokMInEnd); - } break; - case TOK_FS_TIME_STAMP_DATA_HEADER__ANONYMOUS2466__M_OUT: { - const TokenHeader *tokMOut = varLen->getValue(); - const TokenHeader *tokMOutEnd = varLen->getValue() + varLen->valueLengthInBytes / sizeof(TokenHeader); - while (tokMOut < tokMOutEnd) { - if (false == tokMOut->flags.flag4IsVariableLength) { - switch (tokMOut->id) { - default: - if (tokMOut->flags.flag3IsMandatory) { - return false; - } - break; - case TOK_FE_GTDIGET_GPU_CPU_TIMESTAMPS_OUT_STRUCT__RET_CODE: { - dst.m_Data.m_Out.RetCode = readTokValue(*tokMOut); - } break; - case TOK_FBQ_GTDIGET_GPU_CPU_TIMESTAMPS_OUT_STRUCT__GPU_PERF_TICKS: { - dst.m_Data.m_Out.gpuPerfTicks = readTokValue(*tokMOut); - } break; - case TOK_FBQ_GTDIGET_GPU_CPU_TIMESTAMPS_OUT_STRUCT__CPU_PERF_TICKS: { - dst.m_Data.m_Out.cpuPerfTicks = readTokValue(*tokMOut); - } break; - case TOK_FBQ_GTDIGET_GPU_CPU_TIMESTAMPS_OUT_STRUCT__GPU_PERF_FREQ: { - dst.m_Data.m_Out.gpuPerfFreq = readTokValue(*tokMOut); - } break; - case TOK_FBQ_GTDIGET_GPU_CPU_TIMESTAMPS_OUT_STRUCT__CPU_PERF_FREQ: { - dst.m_Data.m_Out.cpuPerfFreq = readTokValue(*tokMOut); - } break; - }; - tokMOut = tokMOut + 1 + tokMOut->valueDwordCount; - } else { - auto varLen = reinterpret_cast(tokMOut); - if (tokMOut->flags.flag3IsMandatory) { - return false; - } - tokMOut = tokMOut + sizeof(TokenVariableLength) / sizeof(uint32_t) + varLen->valuePaddedSizeInDwords; - } - } - WCH_ASSERT(tokMOut == tokMOutEnd); - } break; - }; - tokMData = tokMData + sizeof(TokenVariableLength) / sizeof(uint32_t) + varLen->valuePaddedSizeInDwords; - } - } - WCH_ASSERT(tokMData == tokMDataEnd); - } break; - }; - tok = tok + sizeof(TokenVariableLength) / sizeof(uint32_t) + varLen->valuePaddedSizeInDwords; - } - } - WCH_ASSERT(tok == srcTokensEnd); - return true; - } -}; diff --git a/shared/wsl_compute_helper/source/wsl_compute_helper_types_marshall.h b/shared/wsl_compute_helper/source/wsl_compute_helper_types_marshall.h index e9bde2618a541..6328be02b8bb0 100644 --- a/shared/wsl_compute_helper/source/wsl_compute_helper_types_marshall.h +++ b/shared/wsl_compute_helper/source/wsl_compute_helper_types_marshall.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -3992,89 +3992,3 @@ struct Marshaller { return ret; } }; - -template -inline void marshall(TOKSTR_GFX_ESCAPE_HEADER &dst, const GFX_ESCAPE_HEADERT &src) { - dst = {}; - dst.Size.setValue(src.Size); - dst.CheckSum.setValue(src.CheckSum); - dst.EscapeCode.setValue(src.EscapeCode); - dst.ulReserved.setValue(src.ulReserved); - dst.ulReserved1.setValue(src.ulReserved1); - dst.usEscapeVersion.setValue(src.usEscapeVersion); - dst.usFileVersion.setValue(src.usFileVersion); - dst.ulMajorEscapeCode.setValue(src.ulMajorEscapeCode); - dst.uiMinorEscapeCode.setValue(src.uiMinorEscapeCode); -} -template <> -struct Marshaller { - template - static TOKSTR_GFX_ESCAPE_HEADER marshall(const GFX_ESCAPE_HEADERT &src) { - TOKSTR_GFX_ESCAPE_HEADER ret = {}; - ::marshall(ret, src); - return ret; - } -}; - -template -inline void marshall(TOKSTR_GTDIBaseInStruct &dst, const GTDIBaseInStructT &src) { - dst = {}; - dst.Function.setValue(src.Function); -} -template <> -struct Marshaller { - template - static TOKSTR_GTDIBaseInStruct marshall(const GTDIBaseInStructT &src) { - TOKSTR_GTDIBaseInStruct ret = {}; - ::marshall(ret, src); - return ret; - } -}; - -template -inline void marshall(TOKSTR_GTDIGetGpuCpuTimestampsOutStruct &dst, const GTDIGetGpuCpuTimestampsOutStructT &src) { - dst = {}; - dst.RetCode.setValue(src.RetCode); - dst.gpuPerfTicks.setValue(src.gpuPerfTicks); - dst.cpuPerfTicks.setValue(src.cpuPerfTicks); - dst.gpuPerfFreq.setValue(src.gpuPerfFreq); - dst.cpuPerfFreq.setValue(src.cpuPerfFreq); -} -template <> -struct Marshaller { - template - static TOKSTR_GTDIGetGpuCpuTimestampsOutStruct marshall(const GTDIGetGpuCpuTimestampsOutStructT &src) { - TOKSTR_GTDIGetGpuCpuTimestampsOutStruct ret = {}; - ::marshall(ret, src); - return ret; - } -}; - -template -inline void marshall(TOKSTR_TimeStampDataHeader &dst, const TimeStampDataHeaderT &src) { - dst = {}; - dst.m_Header.Size.setValue(src.m_Header.Size); - dst.m_Header.CheckSum.setValue(src.m_Header.CheckSum); - dst.m_Header.EscapeCode.setValue(src.m_Header.EscapeCode); - dst.m_Header.ulReserved.setValue(src.m_Header.ulReserved); - dst.m_Header.ulReserved1.setValue(src.m_Header.ulReserved1); - dst.m_Header.usEscapeVersion.setValue(src.m_Header.usEscapeVersion); - dst.m_Header.usFileVersion.setValue(src.m_Header.usFileVersion); - dst.m_Header.ulMajorEscapeCode.setValue(src.m_Header.ulMajorEscapeCode); - dst.m_Header.uiMinorEscapeCode.setValue(src.m_Header.uiMinorEscapeCode); - dst.m_Data.m_In.Function.setValue(src.m_Data.m_In.Function); - dst.m_Data.m_Out.RetCode.setValue(src.m_Data.m_Out.RetCode); - dst.m_Data.m_Out.gpuPerfTicks.setValue(src.m_Data.m_Out.gpuPerfTicks); - dst.m_Data.m_Out.cpuPerfTicks.setValue(src.m_Data.m_Out.cpuPerfTicks); - dst.m_Data.m_Out.gpuPerfFreq.setValue(src.m_Data.m_Out.gpuPerfFreq); - dst.m_Data.m_Out.cpuPerfFreq.setValue(src.m_Data.m_Out.cpuPerfFreq); -} -template <> -struct Marshaller { - template - static TOKSTR_TimeStampDataHeader marshall(const TimeStampDataHeaderT &src) { - TOKSTR_TimeStampDataHeader ret = {}; - ::marshall(ret, src); - return ret; - } -}; diff --git a/shared/wsl_compute_helper/source/wsl_compute_helper_types_tokens_structs.h b/shared/wsl_compute_helper/source/wsl_compute_helper_types_tokens_structs.h index 9f9d967acb36f..901eec2912d49 100644 --- a/shared/wsl_compute_helper/source/wsl_compute_helper_types_tokens_structs.h +++ b/shared/wsl_compute_helper/source/wsl_compute_helper_types_tokens_structs.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -1606,144 +1606,3 @@ struct TOKSTR_GmmResourceInfoWinStruct { }; static_assert(std::is_standard_layout_v, ""); static_assert(sizeof(TOKSTR_GmmResourceInfoWinStruct) % sizeof(uint32_t) == 0, ""); - -struct TOKSTR_GFX_ESCAPE_HEADER { - TokenVariableLength base; - - TOKSTR_GFX_ESCAPE_HEADER(uint16_t tokenId, uint32_t elementId = 0) - : base(tokenId, elementId, offsetof(TOKSTR_GFX_ESCAPE_HEADER, uiMinorEscapeCode) + sizeof(uiMinorEscapeCode) - offsetof(TOKSTR_GFX_ESCAPE_HEADER, Size), (sizeof(*this) - sizeof(base)) / sizeof(uint32_t)) {} - - TOKSTR_GFX_ESCAPE_HEADER() - : base(TOK_S_GFX_ESCAPE_HEADER, 0, sizeof(*this) - sizeof(base)) {} - - struct TOKSTR_ANONYMOUS4410 { - TokenVariableLength base; - - TOKSTR_ANONYMOUS4410(uint16_t tokenId, uint32_t elementId = 0) - : base(tokenId, elementId, offsetof(TOKSTR_ANONYMOUS4410, uiMinorEscapeCode) + sizeof(uiMinorEscapeCode) - offsetof(TOKSTR_ANONYMOUS4410, Size), (sizeof(*this) - sizeof(base)) / sizeof(uint32_t)) {} - - TOKSTR_ANONYMOUS4410() - : base(TOK_S_GFX_ESCAPE_HEADER__ANONYMOUS4410, 0, sizeof(*this) - sizeof(base)) {} - - struct TOKSTR_ANONYMOUS4430 { - TokenVariableLength base; - - TOKSTR_ANONYMOUS4430(uint16_t tokenId, uint32_t elementId = 0) - : base(tokenId, elementId, offsetof(TOKSTR_ANONYMOUS4430, ulReserved) + sizeof(ulReserved) - offsetof(TOKSTR_ANONYMOUS4430, Size), (sizeof(*this) - sizeof(base)) / sizeof(uint32_t)) {} - - TOKSTR_ANONYMOUS4430() - : base(TOK_S_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4430, 0, sizeof(*this) - sizeof(base)) {} - - TokenDword Size = {TOK_FBD_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4430__SIZE}; - TokenDword CheckSum = {TOK_FBD_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4430__CHECK_SUM}; - TokenDword EscapeCode = {TOK_FE_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4430__ESCAPE_CODE}; - TokenDword ulReserved = {TOK_FBD_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4430__UL_RESERVED}; - }; - static_assert(std::is_standard_layout_v, ""); - static_assert(sizeof(TOKSTR_ANONYMOUS4430) % sizeof(uint32_t) == 0, ""); - - struct TOKSTR_ANONYMOUS4963 { - TokenVariableLength base; - - TOKSTR_ANONYMOUS4963(uint16_t tokenId, uint32_t elementId = 0) - : base(tokenId, elementId, offsetof(TOKSTR_ANONYMOUS4963, uiMinorEscapeCode) + sizeof(uiMinorEscapeCode) - offsetof(TOKSTR_ANONYMOUS4963, ulReserved1), (sizeof(*this) - sizeof(base)) / sizeof(uint32_t)) {} - - TOKSTR_ANONYMOUS4963() - : base(TOK_S_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4963, 0, sizeof(*this) - sizeof(base)) {} - - TokenDword ulReserved1 = {TOK_FBD_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4963__UL_RESERVED1}; - TokenDword usEscapeVersion = {TOK_FBW_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4963__US_ESCAPE_VERSION}; - TokenDword usFileVersion = {TOK_FBW_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4963__US_FILE_VERSION}; - TokenDword ulMajorEscapeCode = {TOK_FE_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4963__UL_MAJOR_ESCAPE_CODE}; - TokenDword uiMinorEscapeCode = {TOK_FBD_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4963__UI_MINOR_ESCAPE_CODE}; - }; - static_assert(std::is_standard_layout_v, ""); - static_assert(sizeof(TOKSTR_ANONYMOUS4963) % sizeof(uint32_t) == 0, ""); - - TokenDword Size = {TOK_FBD_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4430__SIZE}; // Indirect field from anonymous struct - TokenDword CheckSum = {TOK_FBD_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4430__CHECK_SUM}; // Indirect field from anonymous struct - TokenDword EscapeCode = {TOK_FE_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4430__ESCAPE_CODE}; // Indirect field from anonymous struct - TokenDword ulReserved = {TOK_FBD_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4430__UL_RESERVED}; // Indirect field from anonymous struct - TokenDword ulReserved1 = {TOK_FBD_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4963__UL_RESERVED1}; // Indirect field from anonymous struct - TokenDword usEscapeVersion = {TOK_FBW_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4963__US_ESCAPE_VERSION}; // Indirect field from anonymous struct - TokenDword usFileVersion = {TOK_FBW_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4963__US_FILE_VERSION}; // Indirect field from anonymous struct - TokenDword ulMajorEscapeCode = {TOK_FE_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4963__UL_MAJOR_ESCAPE_CODE}; // Indirect field from anonymous struct - TokenDword uiMinorEscapeCode = {TOK_FBD_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4963__UI_MINOR_ESCAPE_CODE}; // Indirect field from anonymous struct - }; - static_assert(std::is_standard_layout_v, ""); - static_assert(sizeof(TOKSTR_ANONYMOUS4410) % sizeof(uint32_t) == 0, ""); - - TokenDword Size = {TOK_FBD_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4430__SIZE}; // Indirect field from anonymous struct - TokenDword CheckSum = {TOK_FBD_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4430__CHECK_SUM}; // Indirect field from anonymous struct - TokenDword EscapeCode = {TOK_FE_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4430__ESCAPE_CODE}; // Indirect field from anonymous struct - TokenDword ulReserved = {TOK_FBD_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4430__UL_RESERVED}; // Indirect field from anonymous struct - TokenDword ulReserved1 = {TOK_FBD_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4963__UL_RESERVED1}; // Indirect field from anonymous struct - TokenDword usEscapeVersion = {TOK_FBW_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4963__US_ESCAPE_VERSION}; // Indirect field from anonymous struct - TokenDword usFileVersion = {TOK_FBW_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4963__US_FILE_VERSION}; // Indirect field from anonymous struct - TokenDword ulMajorEscapeCode = {TOK_FE_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4963__UL_MAJOR_ESCAPE_CODE}; // Indirect field from anonymous struct - TokenDword uiMinorEscapeCode = {TOK_FBD_GFX_ESCAPE_HEADER__ANONYMOUS4410__ANONYMOUS4963__UI_MINOR_ESCAPE_CODE}; // Indirect field from anonymous struct -}; -static_assert(std::is_standard_layout_v, ""); -static_assert(sizeof(TOKSTR_GFX_ESCAPE_HEADER) % sizeof(uint32_t) == 0, ""); - -struct TOKSTR_GTDIBaseInStruct { - TokenVariableLength base; - - TOKSTR_GTDIBaseInStruct(uint16_t tokenId, uint32_t elementId = 0) - : base(tokenId, elementId, offsetof(TOKSTR_GTDIBaseInStruct, Function) + sizeof(Function) - offsetof(TOKSTR_GTDIBaseInStruct, Function), (sizeof(*this) - sizeof(base)) / sizeof(uint32_t)) {} - - TOKSTR_GTDIBaseInStruct() - : base(TOK_S_GTDIBASE_IN_STRUCT, 0, sizeof(*this) - sizeof(base)) {} - - TokenDword Function = {TOK_FE_GTDIBASE_IN_STRUCT__FUNCTION}; -}; -static_assert(std::is_standard_layout_v, ""); -static_assert(sizeof(TOKSTR_GTDIBaseInStruct) % sizeof(uint32_t) == 0, ""); - -struct TOKSTR_GTDIGetGpuCpuTimestampsOutStruct { - TokenVariableLength base; - - TOKSTR_GTDIGetGpuCpuTimestampsOutStruct(uint16_t tokenId, uint32_t elementId = 0) - : base(tokenId, elementId, offsetof(TOKSTR_GTDIGetGpuCpuTimestampsOutStruct, cpuPerfFreq) + sizeof(cpuPerfFreq) - offsetof(TOKSTR_GTDIGetGpuCpuTimestampsOutStruct, RetCode), (sizeof(*this) - sizeof(base)) / sizeof(uint32_t)) {} - - TOKSTR_GTDIGetGpuCpuTimestampsOutStruct() - : base(TOK_S_GTDIGET_GPU_CPU_TIMESTAMPS_OUT_STRUCT, 0, sizeof(*this) - sizeof(base)) {} - - TokenDword RetCode = {TOK_FE_GTDIGET_GPU_CPU_TIMESTAMPS_OUT_STRUCT__RET_CODE}; - TokenQword gpuPerfTicks = {TOK_FBQ_GTDIGET_GPU_CPU_TIMESTAMPS_OUT_STRUCT__GPU_PERF_TICKS}; - TokenQword cpuPerfTicks = {TOK_FBQ_GTDIGET_GPU_CPU_TIMESTAMPS_OUT_STRUCT__CPU_PERF_TICKS}; - TokenQword gpuPerfFreq = {TOK_FBQ_GTDIGET_GPU_CPU_TIMESTAMPS_OUT_STRUCT__GPU_PERF_FREQ}; - TokenQword cpuPerfFreq = {TOK_FBQ_GTDIGET_GPU_CPU_TIMESTAMPS_OUT_STRUCT__CPU_PERF_FREQ}; -}; -static_assert(std::is_standard_layout_v, ""); -static_assert(sizeof(TOKSTR_GTDIGetGpuCpuTimestampsOutStruct) % sizeof(uint32_t) == 0, ""); - -struct TOKSTR_TimeStampDataHeader { - TokenVariableLength base; - - TOKSTR_TimeStampDataHeader(uint16_t tokenId, uint32_t elementId = 0) - : base(tokenId, elementId, offsetof(TOKSTR_TimeStampDataHeader, m_Data) + sizeof(m_Data) - offsetof(TOKSTR_TimeStampDataHeader, m_Header), (sizeof(*this) - sizeof(base)) / sizeof(uint32_t)) {} - - TOKSTR_TimeStampDataHeader() - : base(TOK_S_TIME_STAMP_DATA_HEADER, 0, sizeof(*this) - sizeof(base)) {} - - struct TOKSTR_ANONYMOUS2466 { - TokenVariableLength base; - - TOKSTR_ANONYMOUS2466(uint16_t tokenId, uint32_t elementId = 0) - : base(tokenId, elementId, offsetof(TOKSTR_ANONYMOUS2466, m_Out) + sizeof(m_Out) - offsetof(TOKSTR_ANONYMOUS2466, m_In), (sizeof(*this) - sizeof(base)) / sizeof(uint32_t)) {} - - TOKSTR_ANONYMOUS2466() - : base(TOK_S_TIME_STAMP_DATA_HEADER__ANONYMOUS2466, 0, sizeof(*this) - sizeof(base)) {} - - TOKSTR_GTDIBaseInStruct m_In = {TOK_FXS_TIME_STAMP_DATA_HEADER__ANONYMOUS2466__M_IN}; - TOKSTR_GTDIGetGpuCpuTimestampsOutStruct m_Out = {TOK_FS_TIME_STAMP_DATA_HEADER__ANONYMOUS2466__M_OUT}; - }; - static_assert(std::is_standard_layout_v, ""); - static_assert(sizeof(TOKSTR_ANONYMOUS2466) % sizeof(uint32_t) == 0, ""); - - TOKSTR_GFX_ESCAPE_HEADER m_Header = {TOK_FS_TIME_STAMP_DATA_HEADER__M_HEADER}; - TOKSTR_ANONYMOUS2466 m_Data = {TOK_FS_TIME_STAMP_DATA_HEADER__M_DATA}; -}; -static_assert(std::is_standard_layout_v, ""); -static_assert(sizeof(TOKSTR_TimeStampDataHeader) % sizeof(uint32_t) == 0, "");