|
1 | 1 | /*
|
2 |
| - * Copyright (C) 2020-2022 Intel Corporation |
| 2 | + * Copyright (C) 2020-2023 Intel Corporation |
3 | 3 | *
|
4 | 4 | * SPDX-License-Identifier: MIT
|
5 | 5 | *
|
@@ -518,6 +518,48 @@ HWTEST_F(ModuleWithDebuggerL0Test, GivenDebugDataWithRelocationsWhenInitializing
|
518 | 518 | EXPECT_EQ(reinterpret_cast<char *>(kernelInfo->kernelDescriptor.external.relocatedDebugData.get()), getMockDebuggerL0Hw<FamilyType>()->lastReceivedElf);
|
519 | 519 | }
|
520 | 520 |
|
| 521 | +HWTEST_F(ModuleWithDebuggerL0Test, GivenBuiltinModuleWhenInitializingModuleThenModuleAndElfNOtificationsAreNotCalled) { |
| 522 | + auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); |
| 523 | + neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface.reset(cip); |
| 524 | + |
| 525 | + uint8_t binary[10]; |
| 526 | + ze_module_desc_t moduleDesc = {}; |
| 527 | + moduleDesc.format = ZE_MODULE_FORMAT_IL_SPIRV; |
| 528 | + moduleDesc.pInputModule = binary; |
| 529 | + moduleDesc.inputSize = 10; |
| 530 | + ModuleBuildLog *moduleBuildLog = nullptr; |
| 531 | + |
| 532 | + std::unique_ptr<MockModule> moduleMock = std::make_unique<MockModule>(device, moduleBuildLog, ModuleType::Builtin); |
| 533 | + moduleMock->translationUnit = std::make_unique<MockModuleTranslationUnit>(device); |
| 534 | + |
| 535 | + uint32_t kernelHeap = 0; |
| 536 | + auto kernelInfo = new KernelInfo(); |
| 537 | + kernelInfo->heapInfo.KernelHeapSize = 1; |
| 538 | + kernelInfo->heapInfo.pKernelHeap = &kernelHeap; |
| 539 | + |
| 540 | + Mock<::L0::Kernel> kernelMock; |
| 541 | + kernelMock.module = moduleMock.get(); |
| 542 | + kernelMock.immutableData.kernelInfo = kernelInfo; |
| 543 | + kernelInfo->kernelDescriptor.payloadMappings.implicitArgs.systemThreadSurfaceAddress.bindful = 0; |
| 544 | + moduleMock->kernelImmData = &kernelMock.immutableData; |
| 545 | + moduleMock->translationUnit->programInfo.kernelInfos.push_back(kernelInfo); |
| 546 | + kernelInfo->kernelDescriptor.external.debugData = std::make_unique<NEO::DebugData>(); |
| 547 | + |
| 548 | + auto debugData = MockElfEncoder<>::createRelocateableDebugDataElf(); |
| 549 | + kernelInfo->kernelDescriptor.external.debugData->vIsaSize = static_cast<uint32_t>(debugData.size()); |
| 550 | + kernelInfo->kernelDescriptor.external.debugData->vIsa = reinterpret_cast<char *>(debugData.data()); |
| 551 | + kernelInfo->kernelDescriptor.external.debugData->genIsa = nullptr; |
| 552 | + kernelInfo->kernelDescriptor.external.debugData->genIsaSize = 0; |
| 553 | + |
| 554 | + EXPECT_EQ(0u, getMockDebuggerL0Hw<FamilyType>()->registerElfCount); |
| 555 | + EXPECT_EQ(moduleMock->initialize(&moduleDesc, neoDevice), ZE_RESULT_SUCCESS); |
| 556 | + EXPECT_EQ(0u, getMockDebuggerL0Hw<FamilyType>()->registerElfAndLinkCount); |
| 557 | + EXPECT_EQ(0u, getMockDebuggerL0Hw<FamilyType>()->notifyModuleCreateCount); |
| 558 | + |
| 559 | + EXPECT_NE(nullptr, kernelInfo->kernelDescriptor.external.relocatedDebugData.get()); |
| 560 | + EXPECT_EQ(nullptr, getMockDebuggerL0Hw<FamilyType>()->lastReceivedElf); |
| 561 | +} |
| 562 | + |
521 | 563 | HWTEST_F(ModuleWithDebuggerL0Test, GivenDebugDataWithoutRelocationsWhenInitializingModuleThenRegisterElfWithUnrelocatedElfAndModuleCreateNotified) {
|
522 | 564 |
|
523 | 565 | auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions();
|
|
0 commit comments