/* * Copyright (C) 2020-2021 Intel Corporation * * SPDX-License-Identifier: MIT * */ #include "shared/source/device_binary_format/patchtokens_decoder.h" #include "shared/source/kernel/kernel_descriptor_from_patchtokens.h" #include "shared/source/program/kernel_info.h" #include "shared/source/program/kernel_info_from_patchtokens.h" #include "shared/test/common/helpers/unit_test_helper.h" #include "shared/test/common/mocks/mock_compilers.h" #include "shared/test/common/mocks/mock_elf.h" #include "shared/test/common/test_macros/matchers.h" #include "shared/test/common/test_macros/test.h" #include "shared/test/unit_test/compiler_interface/linker_mock.h" #include "level_zero/core/source/module/module_imp.h" #include "level_zero/core/test/unit_tests/fixtures/module_fixture.h" #include "level_zero/core/test/unit_tests/mocks/mock_l0_debugger.h" #include "level_zero/core/test/unit_tests/mocks/mock_module.h" #include "level_zero/core/test/unit_tests/sources/debugger/l0_debugger_fixture.h" #include "active_debugger_fixture.h" namespace L0 { namespace ult { using DeviceWithDebuggerEnabledTest = Test; TEST_F(DeviceWithDebuggerEnabledTest, givenDebuggingEnabledWhenModuleIsCreatedThenDebugOptionsAreUsed) { NEO::MockCompilerEnableGuard mock(true); auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); device->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface.reset(cip); debugger->isOptDisabled = true; uint8_t binary[10]; ze_module_desc_t moduleDesc = {}; moduleDesc.format = ZE_MODULE_FORMAT_IL_SPIRV; moduleDesc.pInputModule = binary; moduleDesc.inputSize = 10; ModuleBuildLog *moduleBuildLog = nullptr; auto module = std::unique_ptr(new L0::ModuleImp(deviceL0, moduleBuildLog, ModuleType::User)); ASSERT_NE(nullptr, module.get()); module->initialize(&moduleDesc, device); EXPECT_TRUE(CompilerOptions::contains(cip->buildInternalOptions, L0::BuildOptions::debugKernelEnable)); EXPECT_TRUE(CompilerOptions::contains(cip->buildOptions, NEO::CompilerOptions::generateDebugInfo)); EXPECT_TRUE(CompilerOptions::contains(cip->buildOptions, L0::BuildOptions::optDisable)); }; TEST_F(DeviceWithDebuggerEnabledTest, GivenDebugVarDebuggerOptDisableZeroWhenOptDisableIsTrueFromDebuggerThenOptDisableIsNotAdded) { DebugManagerStateRestore dgbRestorer; NEO::DebugManager.flags.DebuggerOptDisable.set(0); NEO::MockCompilerEnableGuard mock(true); auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); device->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface.reset(cip); debugger->isOptDisabled = true; uint8_t binary[10]; ze_module_desc_t moduleDesc = {}; moduleDesc.format = ZE_MODULE_FORMAT_IL_SPIRV; moduleDesc.pInputModule = binary; moduleDesc.inputSize = 10; ModuleBuildLog *moduleBuildLog = nullptr; auto module = std::unique_ptr(new L0::ModuleImp(deviceL0, moduleBuildLog, ModuleType::User)); ASSERT_NE(nullptr, module.get()); module->initialize(&moduleDesc, device); EXPECT_FALSE(CompilerOptions::contains(cip->buildOptions, L0::BuildOptions::optDisable)); }; TEST_F(DeviceWithDebuggerEnabledTest, GivenDebugVarDebuggerOptDisableOneWhenOptDisableIsFalseFromDebuggerThenOptDisableIsAdded) { DebugManagerStateRestore dgbRestorer; NEO::DebugManager.flags.DebuggerOptDisable.set(1); NEO::MockCompilerEnableGuard mock(true); auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); device->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface.reset(cip); debugger->isOptDisabled = false; uint8_t binary[10]; ze_module_desc_t moduleDesc = {}; moduleDesc.format = ZE_MODULE_FORMAT_IL_SPIRV; moduleDesc.pInputModule = binary; moduleDesc.inputSize = 10; ModuleBuildLog *moduleBuildLog = nullptr; auto module = std::unique_ptr(new L0::ModuleImp(deviceL0, moduleBuildLog, ModuleType::User)); ASSERT_NE(nullptr, module.get()); module->initialize(&moduleDesc, device); EXPECT_TRUE(CompilerOptions::contains(cip->buildOptions, L0::BuildOptions::optDisable)); }; TEST_F(DeviceWithDebuggerEnabledTest, GivenDebuggeableKernelWhenModuleIsInitializedThenDebugEnabledIsTrue) { NEO::MockCompilerEnableGuard mock(true); auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); device->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface.reset(cip); uint8_t binary[10]; ze_module_desc_t moduleDesc = {}; moduleDesc.format = ZE_MODULE_FORMAT_IL_SPIRV; moduleDesc.pInputModule = binary; moduleDesc.inputSize = 10; ModuleBuildLog *moduleBuildLog = nullptr; auto module = std::make_unique>(deviceL0, moduleBuildLog, ModuleType::User); ASSERT_NE(nullptr, module.get()); NEO::PatchTokenBinary::KernelFromPatchtokens kernelTokens; iOpenCL::SKernelBinaryHeaderCommon kernelHeader; kernelTokens.header = &kernelHeader; iOpenCL::SPatchAllocateSystemThreadSurface systemThreadSurface = {}; systemThreadSurface.Offset = 2; systemThreadSurface.PerThreadSystemThreadSurfaceSize = 3; kernelTokens.tokens.allocateSystemThreadSurface = &systemThreadSurface; auto kernelInfo = std::make_unique(); populateKernelInfo(*kernelInfo, kernelTokens, sizeof(size_t)); module->translationUnit->programInfo.kernelInfos.push_back(kernelInfo.release()); module->initialize(&moduleDesc, device); EXPECT_TRUE(module->isDebugEnabled()); } TEST_F(DeviceWithDebuggerEnabledTest, GivenNonDebuggeableKernelWhenModuleIsInitializedThenDebugEnabledIsFalse) { NEO::MockCompilerEnableGuard mock(true); auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); device->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface.reset(cip); uint8_t binary[10]; ze_module_desc_t moduleDesc = {}; moduleDesc.format = ZE_MODULE_FORMAT_IL_SPIRV; moduleDesc.pInputModule = binary; moduleDesc.inputSize = 10; ModuleBuildLog *moduleBuildLog = nullptr; auto module = std::make_unique>(deviceL0, moduleBuildLog, ModuleType::User); ASSERT_NE(nullptr, module.get()); NEO::PatchTokenBinary::KernelFromPatchtokens kernelTokens; iOpenCL::SKernelBinaryHeaderCommon kernelHeader; kernelTokens.header = &kernelHeader; kernelTokens.tokens.allocateSystemThreadSurface = nullptr; auto kernelInfo = std::make_unique(); populateKernelInfo(*kernelInfo, kernelTokens, sizeof(size_t)); module->translationUnit->programInfo.kernelInfos.push_back(kernelInfo.release()); module->initialize(&moduleDesc, device); EXPECT_FALSE(module->isDebugEnabled()); } using ModuleWithSLDTest = Test; TEST_F(ModuleWithSLDTest, GivenNoDebugDataWhenInitializingModuleThenRelocatedDebugDataIsNotCreated) { NEO::MockCompilerEnableGuard mock(true); auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface.reset(cip); auto debugger = new MockActiveSourceLevelDebugger(new MockOsLibrary); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->debugger.reset(debugger); uint8_t binary[10]; ze_module_desc_t moduleDesc = {}; moduleDesc.format = ZE_MODULE_FORMAT_IL_SPIRV; moduleDesc.pInputModule = binary; moduleDesc.inputSize = 10; ModuleBuildLog *moduleBuildLog = nullptr; std::unique_ptr module = std::make_unique(device, moduleBuildLog, ModuleType::User); module->translationUnit = std::make_unique(device); uint32_t kernelHeap = 0; auto kernelInfo = new KernelInfo(); kernelInfo->heapInfo.KernelHeapSize = 1; kernelInfo->heapInfo.pKernelHeap = &kernelHeap; Mock<::L0::Kernel> kernel; kernel.module = module.get(); kernel.immutableData.kernelInfo = kernelInfo; kernel.immutableData.surfaceStateHeapSize = 64; kernel.immutableData.surfaceStateHeapTemplate.reset(new uint8_t[64]); kernelInfo->kernelDescriptor.payloadMappings.implicitArgs.systemThreadSurfaceAddress.bindful = 0; module->kernelImmData = &kernel.immutableData; module->translationUnit->programInfo.kernelInfos.push_back(kernelInfo); EXPECT_EQ(nullptr, module->translationUnit->debugData.get()); auto result = module->initialize(&moduleDesc, neoDevice); EXPECT_TRUE(result); EXPECT_EQ(nullptr, kernelInfo->kernelDescriptor.external.relocatedDebugData); } TEST_F(ModuleWithSLDTest, GivenDebugDataWithSingleRelocationWhenInitializingModuleThenRelocatedDebugDataIsNotCreated) { NEO::MockCompilerEnableGuard mock(true); auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface.reset(cip); auto debugger = new MockActiveSourceLevelDebugger(new MockOsLibrary); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->debugger.reset(debugger); createKernel(); uint8_t binary[10]; ze_module_desc_t moduleDesc = {}; moduleDesc.format = ZE_MODULE_FORMAT_IL_SPIRV; moduleDesc.pInputModule = binary; moduleDesc.inputSize = 10; ModuleBuildLog *moduleBuildLog = nullptr; std::unique_ptr moduleMock = std::make_unique(device, moduleBuildLog, ModuleType::User); moduleMock->translationUnit = std::make_unique(device); uint32_t kernelHeap = 0; auto kernelInfo = new KernelInfo(); kernelInfo->heapInfo.KernelHeapSize = 1; kernelInfo->heapInfo.pKernelHeap = &kernelHeap; Mock<::L0::Kernel> kernelMock; kernelMock.module = moduleMock.get(); kernelMock.immutableData.kernelInfo = kernelInfo; kernelMock.immutableData.surfaceStateHeapSize = 64; kernelMock.immutableData.surfaceStateHeapTemplate.reset(new uint8_t[64]); kernelInfo->kernelDescriptor.payloadMappings.implicitArgs.systemThreadSurfaceAddress.bindful = 0; moduleMock->kernelImmData = &kernelMock.immutableData; moduleMock->translationUnit->programInfo.kernelInfos.push_back(kernelInfo); kernelInfo->kernelDescriptor.external.debugData = std::make_unique(); kernelInfo->kernelDescriptor.external.debugData->vIsa = kernel->getKernelDescriptor().external.debugData->vIsa; kernelInfo->kernelDescriptor.external.debugData->vIsaSize = kernel->getKernelDescriptor().external.debugData->vIsaSize; kernelInfo->kernelDescriptor.external.debugData->genIsa = nullptr; kernelInfo->kernelDescriptor.external.debugData->genIsaSize = 0; auto result = moduleMock->initialize(&moduleDesc, neoDevice); EXPECT_TRUE(result); EXPECT_EQ(nullptr, kernelInfo->kernelDescriptor.external.relocatedDebugData); } TEST_F(ModuleWithSLDTest, GivenDebugDataWithMultipleRelocationsWhenInitializingModuleThenRelocatedDebugDataIsCreated) { NEO::MockCompilerEnableGuard mock(true); auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface.reset(cip); auto debugger = new MockActiveSourceLevelDebugger(new MockOsLibrary); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->debugger.reset(debugger); uint8_t binary[10]; ze_module_desc_t moduleDesc = {}; moduleDesc.format = ZE_MODULE_FORMAT_IL_SPIRV; moduleDesc.pInputModule = binary; moduleDesc.inputSize = 10; ModuleBuildLog *moduleBuildLog = nullptr; std::unique_ptr moduleMock = std::make_unique(device, moduleBuildLog, ModuleType::User); moduleMock->translationUnit = std::make_unique(device); uint32_t kernelHeap = 0; auto kernelInfo = new KernelInfo(); kernelInfo->heapInfo.KernelHeapSize = 1; kernelInfo->heapInfo.pKernelHeap = &kernelHeap; Mock<::L0::Kernel> kernelMock; kernelMock.module = moduleMock.get(); kernelMock.immutableData.kernelInfo = kernelInfo; kernelInfo->kernelDescriptor.payloadMappings.implicitArgs.systemThreadSurfaceAddress.bindful = 0; moduleMock->kernelImmData = &kernelMock.immutableData; moduleMock->translationUnit->programInfo.kernelInfos.push_back(kernelInfo); kernelInfo->kernelDescriptor.external.debugData = std::make_unique(); auto debugData = MockElfEncoder<>::createRelocateableDebugDataElf(); kernelInfo->kernelDescriptor.external.debugData->vIsaSize = static_cast(debugData.size()); kernelInfo->kernelDescriptor.external.debugData->vIsa = reinterpret_cast(debugData.data()); kernelInfo->kernelDescriptor.external.debugData->genIsa = nullptr; kernelInfo->kernelDescriptor.external.debugData->genIsaSize = 0; EXPECT_EQ(nullptr, kernelInfo->kernelDescriptor.external.relocatedDebugData); auto result = moduleMock->initialize(&moduleDesc, neoDevice); EXPECT_TRUE(result); EXPECT_NE(nullptr, kernelInfo->kernelDescriptor.external.relocatedDebugData); } using ModuleWithZebinAndSLDTest = Test; TEST_F(ModuleWithZebinAndSLDTest, GivenZebinThenCreateDebugZebinAndPassToSLD) { module->addEmptyZebin(); auto debugger = new MockActiveSourceLevelDebugger(new MockOsLibrary); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->debugger.reset(debugger); module->passDebugData(); EXPECT_TRUE(module->translationUnit->debugData); } using KernelDebugSurfaceTest = Test; HWTEST_F(KernelDebugSurfaceTest, givenDebuggerAndBindfulKernelWhenAppendingKernelToCommandListThenBindfulSurfaceStateForDebugSurfaceIsProgrammed) { NEO::MockCompilerEnableGuard mock(true); using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE; auto debugger = MockDebuggerL0Hw::allocate(neoDevice); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->debugger.reset(debugger); auto debugSurface = neoDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties( {device->getRootDeviceIndex(), true, NEO::SipKernel::maxDbgSurfaceSize, NEO::GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA, false, false, device->getNEODevice()->getDeviceBitfield()}); static_cast(device)->setDebugSurface(debugSurface); uint8_t binary[10]; ze_module_desc_t moduleDesc = {}; moduleDesc.format = ZE_MODULE_FORMAT_NATIVE; moduleDesc.pInputModule = binary; moduleDesc.inputSize = 10; ModuleBuildLog *moduleBuildLog = nullptr; std::unique_ptr module = std::make_unique(device, moduleBuildLog, ModuleType::User); module->debugEnabled = true; uint32_t kernelHeap = 0; KernelInfo kernelInfo; kernelInfo.heapInfo.KernelHeapSize = 1; kernelInfo.heapInfo.pKernelHeap = &kernelHeap; Mock<::L0::Kernel> kernel; kernel.module = module.get(); kernel.immutableData.kernelInfo = &kernelInfo; ze_kernel_desc_t desc = {}; kernel.immutableData.kernelDescriptor->payloadMappings.implicitArgs.systemThreadSurfaceAddress.bindful = sizeof(RENDER_SURFACE_STATE); kernel.immutableData.surfaceStateHeapSize = 2 * sizeof(RENDER_SURFACE_STATE); kernel.immutableData.surfaceStateHeapTemplate.reset(new uint8_t[2 * sizeof(RENDER_SURFACE_STATE)]); module->kernelImmData = &kernel.immutableData; kernel.initialize(&desc); auto debugSurfaceState = reinterpret_cast(kernel.surfaceStateHeapData.get()); debugSurfaceState = ptrOffset(debugSurfaceState, sizeof(RENDER_SURFACE_STATE)); SURFACE_STATE_BUFFER_LENGTH length; length.Length = static_cast(debugSurface->getUnderlyingBufferSize() - 1); EXPECT_EQ(length.SurfaceState.Depth + 1u, debugSurfaceState->getDepth()); EXPECT_EQ(length.SurfaceState.Width + 1u, debugSurfaceState->getWidth()); EXPECT_EQ(length.SurfaceState.Height + 1u, debugSurfaceState->getHeight()); EXPECT_EQ(debugSurface->getGpuAddress(), debugSurfaceState->getSurfaceBaseAddress()); EXPECT_EQ(RENDER_SURFACE_STATE::SURFACE_TYPE_SURFTYPE_BUFFER, debugSurfaceState->getSurfaceType()); } using ModuleWithDebuggerL0Test = Test; TEST_F(ModuleWithDebuggerL0Test, givenDebuggingEnabledWhenModuleIsCreatedThenDebugOptionsAreNotUsed) { NEO::MockCompilerEnableGuard mock(true); auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[neoDevice->getRootDeviceIndex()]->compilerInterface.reset(cip); uint8_t binary[10]; ze_module_desc_t moduleDesc = {}; moduleDesc.format = ZE_MODULE_FORMAT_IL_SPIRV; moduleDesc.pInputModule = binary; moduleDesc.inputSize = 10; ModuleBuildLog *moduleBuildLog = nullptr; auto module = std::unique_ptr(new L0::ModuleImp(device, moduleBuildLog, ModuleType::User)); ASSERT_NE(nullptr, module.get()); module->initialize(&moduleDesc, neoDevice); EXPECT_TRUE(module->isDebugEnabled()); EXPECT_FALSE(CompilerOptions::contains(cip->buildInternalOptions, L0::BuildOptions::debugKernelEnable)); EXPECT_FALSE(CompilerOptions::contains(cip->buildOptions, NEO::CompilerOptions::generateDebugInfo)); EXPECT_FALSE(CompilerOptions::contains(cip->buildOptions, L0::BuildOptions::optDisable)); } TEST_F(ModuleWithDebuggerL0Test, givenDebuggingEnabledWhenKernelsAreInitializedThenAllocationsAreNotResidentAndNotCopied) { uint32_t kernelHeap = 0xDEAD; KernelInfo kernelInfo; kernelInfo.heapInfo.KernelHeapSize = 4; kernelInfo.heapInfo.pKernelHeap = &kernelHeap; KernelImmutableData kernelImmutableData(device); memoryOperationsHandler->makeResidentCalledCount = 0; kernelImmutableData.initialize(&kernelInfo, device, 0, nullptr, nullptr, false); EXPECT_EQ(0, memoryOperationsHandler->makeResidentCalledCount); auto isa = kernelImmutableData.getIsaGraphicsAllocation()->getUnderlyingBuffer(); EXPECT_THAT(isa, testing::Not(MemCompare(&kernelHeap, sizeof(kernelHeap)))); }; using ModuleTest = Test; HWTEST_F(ModuleTest, givenDebuggingEnabledWhenModuleIsCreatedAndFullyLinkedThenIsaAllocationsAreCopiedAndResident) { NEO::MockCompilerEnableGuard mock(true); auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[neoDevice->getRootDeviceIndex()]->compilerInterface.reset(cip); auto memoryOperationsHandler = new NEO::MockMemoryOperations(); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->memoryOperationsInterface.reset(memoryOperationsHandler); auto debugger = MockDebuggerL0Hw::allocate(neoDevice); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->debugger.reset(debugger); std::string testFile; retrieveBinaryKernelFilenameNoRevision(testFile, binaryFilename + "_", ".bin"); size_t size = 0; auto src = loadDataFromFile(testFile.c_str(), size); ASSERT_NE(0u, size); ASSERT_NE(nullptr, src); ze_module_desc_t moduleDesc = {}; moduleDesc.format = ZE_MODULE_FORMAT_NATIVE; moduleDesc.pInputModule = reinterpret_cast(src.get()); moduleDesc.inputSize = size; ModuleBuildLog *moduleBuildLog = nullptr; auto module = std::unique_ptr(new L0::ModuleImp(device, moduleBuildLog, ModuleType::User)); ASSERT_NE(nullptr, module.get()); memoryOperationsHandler->makeResidentCalledCount = 0; module->initialize(&moduleDesc, neoDevice); EXPECT_EQ(4, memoryOperationsHandler->makeResidentCalledCount); for (auto &ki : module->getKernelImmutableDataVector()) { EXPECT_TRUE(ki->isIsaCopiedToAllocation()); } } HWTEST_F(ModuleTest, givenDebuggingEnabledWhenModuleWithUnresolvedSymbolsIsCreatedThenIsaAllocationsAreNotCopiedAndNotResident) { NEO::MockCompilerEnableGuard mock(true); auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[neoDevice->getRootDeviceIndex()]->compilerInterface.reset(cip); auto memoryOperationsHandler = new NEO::MockMemoryOperations(); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->memoryOperationsInterface.reset(memoryOperationsHandler); auto debugger = MockDebuggerL0Hw::allocate(neoDevice); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->debugger.reset(debugger); std::string testFile; retrieveBinaryKernelFilenameNoRevision(testFile, binaryFilename + "_", ".bin"); size_t size = 0; auto src = loadDataFromFile(testFile.c_str(), size); ASSERT_NE(0u, size); ASSERT_NE(nullptr, src); ze_module_desc_t moduleDesc = {}; moduleDesc.format = ZE_MODULE_FORMAT_NATIVE; moduleDesc.pInputModule = reinterpret_cast(src.get()); moduleDesc.inputSize = size; ModuleBuildLog *moduleBuildLog = nullptr; auto module = std::unique_ptr(new Module(device, moduleBuildLog, ModuleType::User)); ASSERT_NE(nullptr, module.get()); NEO::Linker::RelocationInfo unresolvedRelocation; unresolvedRelocation.symbolName = "unresolved"; auto linkerInput = std::make_unique<::WhiteBox>(); linkerInput->dataRelocations.push_back(unresolvedRelocation); linkerInput->traits.requiresPatchingOfGlobalVariablesBuffer = true; module->unresolvedExternalsInfo.push_back({unresolvedRelocation}); module->translationUnit->programInfo.linkerInput = std::move(linkerInput); memoryOperationsHandler->makeResidentCalledCount = 0; module->initialize(&moduleDesc, neoDevice); EXPECT_EQ(0, memoryOperationsHandler->makeResidentCalledCount); for (auto &ki : module->getKernelImmutableDataVector()) { EXPECT_FALSE(ki->isIsaCopiedToAllocation()); } EXPECT_FALSE(module->isFullyLinked); } } // namespace ult } // namespace L0