diff --git a/opencl/source/api/api.cpp b/opencl/source/api/api.cpp index a42504d6a8..a8b87ea390 100644 --- a/opencl/source/api/api.cpp +++ b/opencl/source/api/api.cpp @@ -16,6 +16,7 @@ #include "shared/source/helpers/hw_info.h" #include "shared/source/helpers/kernel_helpers.h" #include "shared/source/memory_manager/unified_memory_manager.h" +#include "shared/source/os_interface/device_factory.h" #include "shared/source/os_interface/os_context.h" #include "shared/source/utilities/api_intercept.h" #include "shared/source/utilities/stackvec.h" diff --git a/opencl/source/built_ins/builtins_dispatch_builder.cpp b/opencl/source/built_ins/builtins_dispatch_builder.cpp index 433e0078ac..098ba2913b 100644 --- a/opencl/source/built_ins/builtins_dispatch_builder.cpp +++ b/opencl/source/built_ins/builtins_dispatch_builder.cpp @@ -714,7 +714,7 @@ class BuiltInOp : public BuiltinDispatchInfoBuilder { BuiltinDispatchInfoBuilder &BuiltInDispatchBuilderOp::getBuiltinDispatchInfoBuilder(EBuiltInOps::Type operation, Device &device) { uint32_t operationId = static_cast(operation); - auto kernelsLib = device.getExecutionEnvironment()->getBuiltIns(); + auto kernelsLib = device.getBuiltIns(); auto &operationBuilder = kernelsLib->BuiltinOpsBuilders[operationId]; switch (operation) { case EBuiltInOps::CopyBufferToBuffer: diff --git a/opencl/source/built_ins/vme_builtin.cpp b/opencl/source/built_ins/vme_builtin.cpp index 021f1b8b91..7f833532bd 100644 --- a/opencl/source/built_ins/vme_builtin.cpp +++ b/opencl/source/built_ins/vme_builtin.cpp @@ -100,7 +100,7 @@ const char *getAdditionalBuiltinAsString(EBuiltInOps::Type builtin) { } BuiltinDispatchInfoBuilder &Vme::getBuiltinDispatchInfoBuilder(EBuiltInOps::Type operation, Device &device) { - auto &builtins = *device.getExecutionEnvironment()->getBuiltIns(); + auto &builtins = *device.getBuiltIns(); uint32_t operationId = static_cast(operation); auto &operationBuilder = builtins.BuiltinOpsBuilders[operationId]; switch (operation) { diff --git a/opencl/source/helpers/built_ins_helper.cpp b/opencl/source/helpers/built_ins_helper.cpp index e0386026a5..88c416f95f 100644 --- a/opencl/source/helpers/built_ins_helper.cpp +++ b/opencl/source/helpers/built_ins_helper.cpp @@ -13,7 +13,7 @@ namespace NEO { const SipKernel &initSipKernel(SipKernelType type, Device &device) { - return device.getExecutionEnvironment()->getBuiltIns()->getSipKernel(type, device); + return device.getBuiltIns()->getSipKernel(type, device); } Program *createProgramForSip(ExecutionEnvironment &executionEnvironment, Context *context, diff --git a/opencl/source/platform/platform.cpp b/opencl/source/platform/platform.cpp index 80c91c4e21..08bb639402 100644 --- a/opencl/source/platform/platform.cpp +++ b/opencl/source/platform/platform.cpp @@ -164,12 +164,12 @@ bool Platform::initialize(std::vector> devices) { } } - auto hwInfo = clDevices[0]->getHardwareInfo(); - - const bool debuggerActive = executionEnvironment.debugger && executionEnvironment.debugger->isDebuggerActive(); - if (clDevices[0]->getPreemptionMode() == PreemptionMode::MidThread || debuggerActive) { - auto sipType = SipKernel::getSipKernelType(hwInfo.platform.eRenderCoreFamily, clDevices[0]->isDebuggerActive()); - initSipKernel(sipType, clDevices[0]->getDevice()); + for (auto &clDevice : clDevices) { + auto hwInfo = clDevice->getHardwareInfo(); + if (clDevice->getPreemptionMode() == PreemptionMode::MidThread || clDevice->isDebuggerActive()) { + auto sipType = SipKernel::getSipKernelType(hwInfo.platform.eRenderCoreFamily, clDevice->isDebuggerActive()); + initSipKernel(sipType, clDevice->getDevice()); + } } this->fillGlobalDispatchTable(); diff --git a/opencl/source/program/build.cpp b/opencl/source/program/build.cpp index 15ffb92c9a..a3a99251c7 100644 --- a/opencl/source/program/build.cpp +++ b/opencl/source/program/build.cpp @@ -70,7 +70,7 @@ cl_int Program::build( extractInternalOptions(options); applyAdditionalOptions(); - CompilerInterface *pCompilerInterface = this->executionEnvironment.getCompilerInterface(); + CompilerInterface *pCompilerInterface = pDevice->getCompilerInterface(); if (!pCompilerInterface) { retVal = CL_OUT_OF_HOST_MEMORY; break; diff --git a/opencl/source/program/compile.cpp b/opencl/source/program/compile.cpp index 97de32eb20..c52f5e6030 100644 --- a/opencl/source/program/compile.cpp +++ b/opencl/source/program/compile.cpp @@ -120,7 +120,7 @@ cl_int Program::compile( std::vector compileData = elfEncoder.encode(); - CompilerInterface *pCompilerInterface = this->executionEnvironment.getCompilerInterface(); + CompilerInterface *pCompilerInterface = pDevice->getCompilerInterface(); if (!pCompilerInterface) { retVal = CL_OUT_OF_HOST_MEMORY; break; diff --git a/opencl/source/program/link.cpp b/opencl/source/program/link.cpp index eda14d5ff8..cecbe1c67a 100644 --- a/opencl/source/program/link.cpp +++ b/opencl/source/program/link.cpp @@ -105,7 +105,7 @@ cl_int Program::link( auto clLinkInput = elfEncoder.encode(); - CompilerInterface *pCompilerInterface = this->executionEnvironment.getCompilerInterface(); + CompilerInterface *pCompilerInterface = pDevice->getCompilerInterface(); if (!pCompilerInterface) { retVal = CL_OUT_OF_HOST_MEMORY; break; diff --git a/opencl/source/program/program.cpp b/opencl/source/program/program.cpp index b75e8cb179..92e43e327c 100644 --- a/opencl/source/program/program.cpp +++ b/opencl/source/program/program.cpp @@ -224,7 +224,7 @@ cl_int Program::setProgramSpecializationConstant(cl_uint specId, size_t specSize std::lock_guard lock(mutex); if (!areSpecializationConstantsInitialized) { - auto pCompilerInterface = this->executionEnvironment.getCompilerInterface(); + auto pCompilerInterface = this->pDevice->getCompilerInterface(); if (nullptr == pCompilerInterface) { return CL_OUT_OF_HOST_MEMORY; } diff --git a/opencl/test/unit_test/api/cl_get_device_ids_tests.inl b/opencl/test/unit_test/api/cl_get_device_ids_tests.inl index b3a3a970b2..6fc7d3d83a 100644 --- a/opencl/test/unit_test/api/cl_get_device_ids_tests.inl +++ b/opencl/test/unit_test/api/cl_get_device_ids_tests.inl @@ -5,6 +5,7 @@ * */ +#include "shared/source/os_interface/device_factory.h" #include "shared/test/unit_test/helpers/debug_manager_state_restore.h" #include "shared/test/unit_test/helpers/ult_hw_config.h" diff --git a/opencl/test/unit_test/api/cl_get_platform_ids_tests.inl b/opencl/test/unit_test/api/cl_get_platform_ids_tests.inl index 5cb35af558..5a11dfe6c2 100644 --- a/opencl/test/unit_test/api/cl_get_platform_ids_tests.inl +++ b/opencl/test/unit_test/api/cl_get_platform_ids_tests.inl @@ -5,6 +5,7 @@ * */ +#include "shared/source/os_interface/device_factory.h" #include "shared/test/unit_test/helpers/ult_hw_config.h" #include "opencl/source/context/context.h" diff --git a/opencl/test/unit_test/built_ins/built_in_tests.cpp b/opencl/test/unit_test/built_ins/built_in_tests.cpp index 17b9897c00..00af91423a 100644 --- a/opencl/test/unit_test/built_ins/built_in_tests.cpp +++ b/opencl/test/unit_test/built_ins/built_in_tests.cpp @@ -936,7 +936,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, BuiltInTests, getSchedulerKernelForSecondTimeDoesNot } TEST_F(BuiltInTests, BuiltinDispatchInfoBuilderReturnFalseIfUnsupportedBuildType) { - auto &bs = *pDevice->getExecutionEnvironment()->getBuiltIns(); + auto &bs = *pDevice->getBuiltIns(); BuiltinDispatchInfoBuilder bdib{bs}; MultiDispatchInfo multiDispatchInfo; BuiltinOpParams params; @@ -951,14 +951,14 @@ TEST_F(BuiltInTests, BuiltinDispatchInfoBuilderReturnFalseIfUnsupportedBuildType } TEST_F(BuiltInTests, GeivenDefaultBuiltinDispatchInfoBuilderWhendValidateDispatchIsCalledThenClSuccessIsReturned) { - auto &bs = *pDevice->getExecutionEnvironment()->getBuiltIns(); + auto &bs = *pDevice->getBuiltIns(); BuiltinDispatchInfoBuilder bdib{bs}; auto ret = bdib.validateDispatch(nullptr, 1, Vec3{0, 0, 0}, Vec3{0, 0, 0}, Vec3{0, 0, 0}); EXPECT_EQ(CL_SUCCESS, ret); } TEST_F(BuiltInTests, BuiltinDispatchInfoBuilderReturnTrueIfExplicitKernelArgNotTakenCareOfInBuiltinDispatchBInfoBuilder) { - auto &bs = *pDevice->getExecutionEnvironment()->getBuiltIns(); + auto &bs = *pDevice->getBuiltIns(); BuiltinDispatchInfoBuilder bdib{bs}; MultiDispatchInfo multiDispatchInfo; BuiltinOpParams params; @@ -2002,7 +2002,7 @@ TEST_F(BuiltInTests, createBuiltInProgramForInvalidBuiltinKernelName) { TEST_F(BuiltInTests, getSipKernelReturnsProgramCreatedOutOfIsaAcquiredFromCompilerInterface) { MockBuiltins mockBuiltins; auto mockCompilerInterface = new MockCompilerInterface(); - pDevice->getExecutionEnvironment()->compilerInterface.reset(mockCompilerInterface); + pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->compilerInterface.reset(mockCompilerInterface); mockCompilerInterface->sipKernelBinaryOverride = mockCompilerInterface->getDummyGenBinary(); cl_int errCode = CL_BUILD_PROGRAM_FAILURE; auto p = Program::createFromGenBinary(*pDevice->getExecutionEnvironment(), pContext, mockCompilerInterface->sipKernelBinaryOverride.data(), mockCompilerInterface->sipKernelBinaryOverride.size(), @@ -2026,13 +2026,13 @@ TEST_F(BuiltInTests, getSipKernelReturnsProgramCreatedOutOfIsaAcquiredFromCompil } TEST_F(BuiltInTests, givenSipKernelWhenItIsCreatedThenItHasGraphicsAllocationForKernel) { - const SipKernel &sipKern = pDevice->getExecutionEnvironment()->getBuiltIns()->getSipKernel(SipKernelType::Csr, pContext->getDevice(0)->getDevice()); + const SipKernel &sipKern = pDevice->getBuiltIns()->getSipKernel(SipKernelType::Csr, pContext->getDevice(0)->getDevice()); auto sipAllocation = sipKern.getSipAllocation(); EXPECT_NE(nullptr, sipAllocation); } TEST_F(BuiltInTests, givenSameDeviceIsUsedWhenUsingStaticGetterThenExpectRetrieveSameAllocation) { - const SipKernel &sipKern = pDevice->getExecutionEnvironment()->getBuiltIns()->getSipKernel(SipKernelType::Csr, pContext->getDevice(0)->getDevice()); + const SipKernel &sipKern = pDevice->getBuiltIns()->getSipKernel(SipKernelType::Csr, pContext->getDevice(0)->getDevice()); auto sipAllocation = sipKern.getSipAllocation(); EXPECT_NE(nullptr, sipAllocation); auto staticSipAllocation = SipKernel::getSipKernelAllocation(*pDevice); diff --git a/opencl/test/unit_test/built_ins/sip_tests.cpp b/opencl/test/unit_test/built_ins/sip_tests.cpp index 0ce2179273..2c7727de72 100644 --- a/opencl/test/unit_test/built_ins/sip_tests.cpp +++ b/opencl/test/unit_test/built_ins/sip_tests.cpp @@ -134,7 +134,7 @@ TEST(DebugSip, DISABLED_givenBuiltInsWhenDbgCsrSipIsRequestedThanCorrectSipKerne igcDebugVars.fileName = builtInGenFile; gEnvironment->igcPushDebugVars(igcDebugVars); - auto &builtins = *mockDevice->getExecutionEnvironment()->getBuiltIns(); + auto &builtins = *mockDevice->getBuiltIns(); auto &sipKernel = builtins.getSipKernel(SipKernelType::DbgCsr, *mockDevice); EXPECT_NE(nullptr, &sipKernel); diff --git a/opencl/test/unit_test/command_queue/command_queue_hw_tests.cpp b/opencl/test/unit_test/command_queue/command_queue_hw_tests.cpp index e2e7e2a307..af45c66a17 100644 --- a/opencl/test/unit_test/command_queue/command_queue_hw_tests.cpp +++ b/opencl/test/unit_test/command_queue/command_queue_hw_tests.cpp @@ -750,7 +750,7 @@ struct BuiltinParamsCommandQueueHwTests : public CommandQueueHwTest { void SetUpImpl(EBuiltInOps::Type operation) { auto builtIns = new MockBuiltins(); - pCmdQ->getDevice().getExecutionEnvironment()->builtins.reset(builtIns); + pCmdQ->getDevice().getExecutionEnvironment()->rootDeviceEnvironments[pCmdQ->getDevice().getRootDeviceIndex()]->builtins.reset(builtIns); auto swapBuilder = builtIns->setBuiltinDispatchInfoBuilder( operation, @@ -971,7 +971,7 @@ HWTEST_F(CommandQueueHwTest, GivenBuiltinKernelWhenBuiltinDispatchInfoBuilderIsP CommandQueueHw *cmdQHw = static_cast *>(this->pCmdQ); MockKernelWithInternals mockKernelToUse(*pClDevice); - MockBuilder builder(*pDevice->getExecutionEnvironment()->getBuiltIns()); + MockBuilder builder(*pDevice->getBuiltIns()); builder.paramsToUse.gws.x = 11; builder.paramsToUse.elws.x = 13; builder.paramsToUse.offset.x = 17; diff --git a/opencl/test/unit_test/command_queue/enqueue_copy_buffer_to_image_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_copy_buffer_to_image_tests.cpp index 3cc1056a5b..faa1668ca4 100644 --- a/opencl/test/unit_test/command_queue/enqueue_copy_buffer_to_image_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_copy_buffer_to_image_tests.cpp @@ -193,7 +193,7 @@ typedef EnqueueCopyBufferToImageMipMapTest MipMapCopyBufferToImageTest; HWTEST_P(MipMapCopyBufferToImageTest, GivenImageWithMipLevelNonZeroWhenCopyBufferToImageIsCalledThenProperMipLevelIsSet) { auto image_type = (cl_mem_object_type)GetParam(); auto builtIns = new MockBuiltins(); - pCmdQ->getDevice().getExecutionEnvironment()->builtins.reset(builtIns); + pCmdQ->getDevice().getExecutionEnvironment()->rootDeviceEnvironments[pCmdQ->getDevice().getRootDeviceIndex()]->builtins.reset(builtIns); auto &origBuilder = BuiltInDispatchBuilderOp::getBuiltinDispatchInfoBuilder( EBuiltInOps::CopyBufferToImage3d, pCmdQ->getDevice()); diff --git a/opencl/test/unit_test/command_queue/enqueue_copy_image_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_copy_image_tests.cpp index 28ea1d4c30..5a9a0faf45 100644 --- a/opencl/test/unit_test/command_queue/enqueue_copy_image_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_copy_image_tests.cpp @@ -202,7 +202,7 @@ HWTEST_P(MipMapCopyImageTest, GivenImagesWithNonZeroMipLevelsWhenCopyImageIsCall cl_mem_object_type srcImageType, dstImageType; std::tie(srcImageType, dstImageType) = GetParam(); auto builtIns = new MockBuiltins(); - pCmdQ->getDevice().getExecutionEnvironment()->builtins.reset(builtIns); + pCmdQ->getDevice().getExecutionEnvironment()->rootDeviceEnvironments[pCmdQ->getDevice().getRootDeviceIndex()]->builtins.reset(builtIns); auto &origBuilder = BuiltInDispatchBuilderOp::getBuiltinDispatchInfoBuilder( EBuiltInOps::CopyImageToImage3d, pCmdQ->getDevice()); diff --git a/opencl/test/unit_test/command_queue/enqueue_copy_image_to_buffer_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_copy_image_to_buffer_tests.cpp index d4ce2beddc..1c055d67e6 100644 --- a/opencl/test/unit_test/command_queue/enqueue_copy_image_to_buffer_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_copy_image_to_buffer_tests.cpp @@ -194,7 +194,7 @@ typedef EnqueueCopyImageToBufferMipMapTest MipMapCopyImageToBufferTest; HWTEST_P(MipMapCopyImageToBufferTest, GivenImageWithMipLevelNonZeroWhenCopyImageToBufferIsCalledThenProperMipLevelIsSet) { auto image_type = (cl_mem_object_type)GetParam(); auto builtIns = new MockBuiltins(); - pCmdQ->getDevice().getExecutionEnvironment()->builtins.reset(builtIns); + pCmdQ->getDevice().getExecutionEnvironment()->rootDeviceEnvironments[pCmdQ->getDevice().getRootDeviceIndex()]->builtins.reset(builtIns); auto &origBuilder = BuiltInDispatchBuilderOp::getBuiltinDispatchInfoBuilder( EBuiltInOps::CopyImage3dToBuffer, pCmdQ->getDevice()); diff --git a/opencl/test/unit_test/command_queue/enqueue_kernel_1_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_kernel_1_tests.cpp index 74ad359741..d975f51cd0 100644 --- a/opencl/test/unit_test/command_queue/enqueue_kernel_1_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_kernel_1_tests.cpp @@ -405,7 +405,7 @@ TEST_F(EnqueueKernelTest, GivenKernelWithBuiltinDispatchInfoBuilderWhenBeingDisp mutable bool wasValidateDispatchCalled = false; }; - MockBuiltinDispatchBuilder mockNuiltinDispatchBuilder(*pCmdQ->getDevice().getExecutionEnvironment()->getBuiltIns()); + MockBuiltinDispatchBuilder mockNuiltinDispatchBuilder(*pCmdQ->getDevice().getBuiltIns()); MockKernelWithInternals mockKernel(*pClDevice); mockKernel.kernelInfo.builtinDispatchBuilder = &mockNuiltinDispatchBuilder; diff --git a/opencl/test/unit_test/command_queue/enqueue_read_image_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_read_image_tests.cpp index 4b105bcfba..7c0ee5dd02 100644 --- a/opencl/test/unit_test/command_queue/enqueue_read_image_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_read_image_tests.cpp @@ -243,7 +243,7 @@ HWTEST_F(EnqueueReadImageTest, GivenImage1DarrayWhenReadImageIsCalledThenHostPtr HWTEST_F(EnqueueReadImageTest, GivenImage1DarrayWhenReadImageIsCalledThenRowPitchIsSetToSlicePitch) { auto builtIns = new MockBuiltins(); - pCmdQ->getDevice().getExecutionEnvironment()->builtins.reset(builtIns); + pCmdQ->getDevice().getExecutionEnvironment()->rootDeviceEnvironments[pCmdQ->getDevice().getRootDeviceIndex()]->builtins.reset(builtIns); EBuiltInOps::Type copyBuiltIn = EBuiltInOps::CopyImage3dToBuffer; auto &origBuilder = BuiltInDispatchBuilderOp::getBuiltinDispatchInfoBuilder( copyBuiltIn, @@ -489,7 +489,7 @@ typedef EnqueueReadImageMipMapTest MipMapReadImageTest; HWTEST_P(MipMapReadImageTest, GivenImageWithMipLevelNonZeroWhenReadImageIsCalledThenProperMipLevelIsSet) { auto builtIns = new MockBuiltins(); - pCmdQ->getDevice().getExecutionEnvironment()->builtins.reset(builtIns); + pCmdQ->getDevice().getExecutionEnvironment()->rootDeviceEnvironments[pCmdQ->getDevice().getRootDeviceIndex()]->builtins.reset(builtIns); auto image_type = (cl_mem_object_type)GetParam(); auto &origBuilder = BuiltInDispatchBuilderOp::getBuiltinDispatchInfoBuilder( EBuiltInOps::CopyImage3dToBuffer, diff --git a/opencl/test/unit_test/command_queue/enqueue_svm_mem_copy_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_svm_mem_copy_tests.cpp index bc3ffe593f..cacda70c22 100644 --- a/opencl/test/unit_test/command_queue/enqueue_svm_mem_copy_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_svm_mem_copy_tests.cpp @@ -69,7 +69,7 @@ HWTEST_F(EnqueueSvmMemCopyTest, givenEnqueueSVMMemcpyWhenUsingCopyBufferToBuffer } pDevice->mockMemoryManager.reset(new MockMemoryManager()); auto builtIns = new MockBuiltins(); - pCmdQ->getDevice().getExecutionEnvironment()->builtins.reset(builtIns); + pCmdQ->getDevice().getExecutionEnvironment()->rootDeviceEnvironments[pCmdQ->getDevice().getRootDeviceIndex()]->builtins.reset(builtIns); // retrieve original builder auto &origBuilder = BuiltInDispatchBuilderOp::getBuiltinDispatchInfoBuilder( EBuiltInOps::CopyBufferToBuffer, @@ -143,7 +143,7 @@ HWTEST_F(EnqueueSvmMemCopyTest, givenEnqueueSVMMemcpyWhenUsingCopyBufferToBuffer } auto builtIns = new MockBuiltins(); - pCmdQ->getDevice().getExecutionEnvironment()->builtins.reset(builtIns); + pCmdQ->getDevice().getExecutionEnvironment()->rootDeviceEnvironments[pCmdQ->getDevice().getRootDeviceIndex()]->builtins.reset(builtIns); void *srcHostPtr = alignedMalloc(512, 64); size_t hostPtrOffset = 2; @@ -225,7 +225,7 @@ HWTEST_F(EnqueueSvmMemCopyTest, givenEnqueueSVMMemcpyWhenUsingCopyBufferToBuffer } auto builtIns = new MockBuiltins(); - pCmdQ->getDevice().getExecutionEnvironment()->builtins.reset(builtIns); + pCmdQ->getDevice().getExecutionEnvironment()->rootDeviceEnvironments[pCmdQ->getDevice().getRootDeviceIndex()]->builtins.reset(builtIns); auto dstHostPtr = alignedMalloc(512, 64); size_t hostPtrOffset = 2; diff --git a/opencl/test/unit_test/command_queue/enqueue_svm_mem_fill_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_svm_mem_fill_tests.cpp index 48cd39a7ee..084884ff57 100644 --- a/opencl/test/unit_test/command_queue/enqueue_svm_mem_fill_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_svm_mem_fill_tests.cpp @@ -75,7 +75,7 @@ HWTEST_P(EnqueueSvmMemFillTest, givenEnqueueSVMMemFillWhenUsingFillBufferBuilder }; auto builtIns = new MockBuiltins(); - pCmdQ->getDevice().getExecutionEnvironment()->builtins.reset(builtIns); + pCmdQ->getDevice().getExecutionEnvironment()->rootDeviceEnvironments[pCmdQ->getDevice().getRootDeviceIndex()]->builtins.reset(builtIns); // retrieve original builder auto &origBuilder = BuiltInDispatchBuilderOp::getBuiltinDispatchInfoBuilder( diff --git a/opencl/test/unit_test/command_queue/enqueue_write_image_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_write_image_tests.cpp index 2f3c059889..64823af235 100644 --- a/opencl/test/unit_test/command_queue/enqueue_write_image_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_write_image_tests.cpp @@ -222,7 +222,7 @@ HWTEST_F(EnqueueWriteImageTest, GivenImage1DarrayWhenReadWriteImageIsCalledThenH HWTEST_F(EnqueueWriteImageTest, GivenImage1DarrayWhenWriteImageIsCalledThenRowPitchIsSetToSlicePitch) { auto builtIns = new MockBuiltins(); - pCmdQ->getDevice().getExecutionEnvironment()->builtins.reset(builtIns); + pCmdQ->getDevice().getExecutionEnvironment()->rootDeviceEnvironments[pCmdQ->getDevice().getRootDeviceIndex()]->builtins.reset(builtIns); EBuiltInOps::Type copyBuiltIn = EBuiltInOps::CopyBufferToImage3d; auto &origBuilder = BuiltInDispatchBuilderOp::getBuiltinDispatchInfoBuilder( @@ -418,7 +418,7 @@ typedef EnqueueWriteImageMipMapTest MipMapWriteImageTest; HWTEST_P(MipMapWriteImageTest, GivenImageWithMipLevelNonZeroWhenReadImageIsCalledThenProperMipLevelIsSet) { auto image_type = (cl_mem_object_type)GetParam(); auto builtIns = new MockBuiltins(); - pCmdQ->getDevice().getExecutionEnvironment()->builtins.reset(builtIns); + pCmdQ->getDevice().getExecutionEnvironment()->rootDeviceEnvironments[pCmdQ->getDevice().getRootDeviceIndex()]->builtins.reset(builtIns); auto &origBuilder = BuiltInDispatchBuilderOp::getBuiltinDispatchInfoBuilder( EBuiltInOps::CopyBufferToImage3d, diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_1_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_1_tests.cpp index a3682222f1..8b21619c13 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_1_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_1_tests.cpp @@ -183,7 +183,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeAndMidThread *pDevice); auto cmdBuffer = mockedSubmissionsAggregator->peekCommandBuffers().peekHead(); - auto sipAllocation = pDevice->getExecutionEnvironment()->getBuiltIns()->getSipKernel(SipKernelType::Csr, *pDevice).getSipAllocation(); + auto sipAllocation = pDevice->getBuiltIns()->getSipKernel(SipKernelType::Csr, *pDevice).getSipAllocation(); bool found = false; for (auto allocation : cmdBuffer->surfaces) { if (allocation == sipAllocation) { @@ -213,7 +213,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInDefaultModeAndMidThreadP dispatchFlags, *pDevice); - auto sipAllocation = pDevice->getExecutionEnvironment()->getBuiltIns()->getSipKernel(SipKernelType::Csr, *pDevice).getSipAllocation(); + auto sipAllocation = pDevice->getBuiltIns()->getSipKernel(SipKernelType::Csr, *pDevice).getSipAllocation(); bool found = false; for (auto allocation : mockCsr->copyOfAllocations) { if (allocation == sipAllocation) { diff --git a/opencl/test/unit_test/device/device_caps_tests.cpp b/opencl/test/unit_test/device/device_caps_tests.cpp index 7be0802eeb..a8ad382b12 100644 --- a/opencl/test/unit_test/device/device_caps_tests.cpp +++ b/opencl/test/unit_test/device/device_caps_tests.cpp @@ -228,9 +228,9 @@ TEST_F(DeviceGetCapsTest, givenDeviceWithMidThreadPreemptionWhenDeviceIsCreatedT auto executionEnvironment = new ExecutionEnvironment(); executionEnvironment->prepareRootDeviceEnvironments(1); - executionEnvironment->builtins.reset(builtIns); + executionEnvironment->rootDeviceEnvironments[0u]->builtins.reset(builtIns); auto device = std::unique_ptr(MockDevice::createWithExecutionEnvironment(platformDevices[0], executionEnvironment, 0u)); - ASSERT_EQ(builtIns, device->getExecutionEnvironment()->getBuiltIns()); + ASSERT_EQ(builtIns, device->getBuiltIns()); EXPECT_FALSE(MockSipData::called); } } diff --git a/opencl/test/unit_test/execution_environment/execution_environment_tests.cpp b/opencl/test/unit_test/execution_environment/execution_environment_tests.cpp index d4c8c2484d..e99726a027 100644 --- a/opencl/test/unit_test/execution_environment/execution_environment_tests.cpp +++ b/opencl/test/unit_test/execution_environment/execution_environment_tests.cpp @@ -12,6 +12,7 @@ #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/gmm_helper/gmm_helper.h" #include "shared/source/helpers/hw_helper.h" +#include "shared/source/os_interface/device_factory.h" #include "shared/source/os_interface/os_interface.h" #include "shared/test/unit_test/helpers/debug_manager_state_restore.h" #include "shared/test/unit_test/utilities/destructor_counted.h" @@ -150,21 +151,20 @@ TEST(ExecutionEnvironment, givenExecutionEnvironmentWhenInitializeMemoryManagerI executionEnvironment->initializeMemoryManager(); EXPECT_NE(nullptr, executionEnvironment->memoryManager); } -static_assert(sizeof(ExecutionEnvironment) == sizeof(std::mutex) + - sizeof(std::unique_ptr) + +static_assert(sizeof(ExecutionEnvironment) == sizeof(std::unique_ptr) + sizeof(std::vector) + - (is64bit ? 48 : 28), + (is64bit ? 32 : 20), "New members detected in ExecutionEnvironment, please ensure that destruction sequence of objects is correct"); TEST(ExecutionEnvironment, givenExecutionEnvironmentWithVariousMembersWhenItIsDestroyedThenDeleteSequenceIsSpecified) { uint32_t destructorId = 0u; - struct GmmHelperMock : public DestructorCounted { - GmmHelperMock(uint32_t &destructorId, const HardwareInfo *hwInfo) : DestructorCounted(destructorId, nullptr, hwInfo) {} - }; struct MemoryMangerMock : public DestructorCounted { MemoryMangerMock(uint32_t &destructorId, ExecutionEnvironment &executionEnvironment) : DestructorCounted(destructorId, executionEnvironment) {} }; + struct GmmHelperMock : public DestructorCounted { + GmmHelperMock(uint32_t &destructorId, const HardwareInfo *hwInfo) : DestructorCounted(destructorId, nullptr, hwInfo) {} + }; struct OsInterfaceMock : public DestructorCounted { OsInterfaceMock(uint32_t &destructorId) : DestructorCounted(destructorId) {} }; @@ -174,12 +174,12 @@ TEST(ExecutionEnvironment, givenExecutionEnvironmentWithVariousMembersWhenItIsDe struct AubCenterMock : public DestructorCounted { AubCenterMock(uint32_t &destructorId) : DestructorCounted(destructorId, platformDevices[0], false, "", CommandStreamReceiverType::CSR_AUB) {} }; - struct BuiltinsMock : public DestructorCounted { - BuiltinsMock(uint32_t &destructorId) : DestructorCounted(destructorId) {} - }; - struct CompilerInterfaceMock : public DestructorCounted { + struct CompilerInterfaceMock : public DestructorCounted { CompilerInterfaceMock(uint32_t &destructorId) : DestructorCounted(destructorId) {} }; + struct BuiltinsMock : public DestructorCounted { + BuiltinsMock(uint32_t &destructorId) : DestructorCounted(destructorId) {} + }; struct SourceLevelDebuggerMock : public DestructorCounted { SourceLevelDebuggerMock(uint32_t &destructorId) : DestructorCounted(destructorId, nullptr) {} }; @@ -192,8 +192,8 @@ TEST(ExecutionEnvironment, givenExecutionEnvironmentWithVariousMembersWhenItIsDe executionEnvironment->rootDeviceEnvironments[0]->memoryOperationsInterface = std::make_unique(destructorId); executionEnvironment->memoryManager = std::make_unique(destructorId, *executionEnvironment); executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::make_unique(destructorId); - executionEnvironment->builtins = std::make_unique(destructorId); - executionEnvironment->compilerInterface = std::make_unique(destructorId); + executionEnvironment->rootDeviceEnvironments[0]->builtins = std::make_unique(destructorId); + executionEnvironment->rootDeviceEnvironments[0]->compilerInterface = std::make_unique(destructorId); executionEnvironment->debugger = std::make_unique(destructorId); executionEnvironment.reset(nullptr); diff --git a/opencl/test/unit_test/fixtures/built_in_fixture.cpp b/opencl/test/unit_test/fixtures/built_in_fixture.cpp index 3857466be0..a0ae3a3fe5 100644 --- a/opencl/test/unit_test/fixtures/built_in_fixture.cpp +++ b/opencl/test/unit_test/fixtures/built_in_fixture.cpp @@ -21,7 +21,7 @@ BuiltInFixture::BuiltInFixture() : pBuiltIns(nullptr) { void BuiltInFixture::SetUp(Device *pDevice) { // create an instance of the builtins - pBuiltIns = pDevice->getExecutionEnvironment()->getBuiltIns(); + pBuiltIns = pDevice->getBuiltIns(); pBuiltIns->setCacheingEnableState(false); // set mock compiler to return expected kernel... diff --git a/opencl/test/unit_test/gen9/sip_tests_gen9.cpp b/opencl/test/unit_test/gen9/sip_tests_gen9.cpp index b272ce93d4..3389c239f0 100644 --- a/opencl/test/unit_test/gen9/sip_tests_gen9.cpp +++ b/opencl/test/unit_test/gen9/sip_tests_gen9.cpp @@ -35,7 +35,7 @@ GEN9TEST_F(gen9SipTests, DISABLED_givenDebugCsrSipKernelWithLocalMemoryWhenAsked igcDebugVars.fileName = builtInGenFile; gEnvironment->igcPushDebugVars(igcDebugVars); - auto &builtins = *mockDevice->getExecutionEnvironment()->getBuiltIns(); + auto &builtins = *mockDevice->getBuiltIns(); auto &sipKernel = builtins.getSipKernel(SipKernelType::DbgCsrLocal, *mockDevice); EXPECT_NE(nullptr, &sipKernel); diff --git a/opencl/test/unit_test/gmm_helper/gmm_helper_tests.cpp b/opencl/test/unit_test/gmm_helper/gmm_helper_tests.cpp index 9e3c0d099a..f7f16f7431 100644 --- a/opencl/test/unit_test/gmm_helper/gmm_helper_tests.cpp +++ b/opencl/test/unit_test/gmm_helper/gmm_helper_tests.cpp @@ -9,6 +9,7 @@ #include "shared/source/gmm_helper/gmm_helper.h" #include "shared/source/helpers/hw_info.h" #include "shared/source/helpers/ptr_math.h" +#include "shared/source/os_interface/device_factory.h" #include "shared/source/sku_info/operations/sku_info_transfer.h" #include "shared/test/unit_test/helpers/debug_manager_state_restore.h" diff --git a/opencl/test/unit_test/kernel/kernel_tests.cpp b/opencl/test/unit_test/kernel/kernel_tests.cpp index 573a691085..cb5d1a6af3 100644 --- a/opencl/test/unit_test/kernel/kernel_tests.cpp +++ b/opencl/test/unit_test/kernel/kernel_tests.cpp @@ -2576,7 +2576,7 @@ TEST(KernelTest, setKernelArgUsesBuiltinDispatchInfoBuilderIfAvailable) { kernel.kernelInfo.resizeKernelArgInfoAndRegisterParameter(1); kernel.mockKernel->initialize(); - MockBuiltinDispatchBuilder mockBuilder(*device->getExecutionEnvironment()->getBuiltIns()); + MockBuiltinDispatchBuilder mockBuilder(*device->getBuiltIns()); kernel.kernelInfo.builtinDispatchBuilder = &mockBuilder; mockBuilder.valueToReturn = false; diff --git a/opencl/test/unit_test/mocks/mock_device.h b/opencl/test/unit_test/mocks/mock_device.h index a05f2f8dd9..32c61b1aca 100644 --- a/opencl/test/unit_test/mocks/mock_device.h +++ b/opencl/test/unit_test/mocks/mock_device.h @@ -157,6 +157,7 @@ class MockClDevice : public ClDevice { } SubDevice *createSubDevice(uint32_t subDeviceIndex) { return device.createSubDevice(subDeviceIndex); } std::unique_ptr createCommandStreamReceiver() const { return device.createCommandStreamReceiver(); } + BuiltIns *getBuiltIns() const { return getDevice().getBuiltIns(); } MockDevice &device; DeviceInfo &deviceInfo; diff --git a/opencl/test/unit_test/mocks/mock_platform.cpp b/opencl/test/unit_test/mocks/mock_platform.cpp index 0ed9b2cd73..5f2ac7c03d 100644 --- a/opencl/test/unit_test/mocks/mock_platform.cpp +++ b/opencl/test/unit_test/mocks/mock_platform.cpp @@ -8,6 +8,7 @@ #include "opencl/test/unit_test/mocks/mock_platform.h" #include "shared/source/device/device.h" +#include "shared/source/os_interface/device_factory.h" namespace NEO { diff --git a/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp index 583a11cfcf..bbe6a3fd62 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp @@ -11,6 +11,7 @@ #include "shared/source/gmm_helper/gmm_helper.h" #include "shared/source/helpers/aligned_memory.h" #include "shared/source/helpers/array_count.h" +#include "shared/source/os_interface/device_factory.h" #include "shared/source/os_interface/os_library.h" #include "shared/source/os_interface/windows/os_context_win.h" #include "shared/source/os_interface/windows/wddm_residency_controller.h" diff --git a/opencl/test/unit_test/platform/platform_tests.cpp b/opencl/test/unit_test/platform/platform_tests.cpp index 63342a1c0e..d2e504e27a 100644 --- a/opencl/test/unit_test/platform/platform_tests.cpp +++ b/opencl/test/unit_test/platform/platform_tests.cpp @@ -7,6 +7,7 @@ #include "shared/source/device/device.h" #include "shared/source/helpers/hw_info.h" +#include "shared/source/os_interface/device_factory.h" #include "shared/test/unit_test/helpers/debug_manager_state_restore.h" #include "shared/test/unit_test/helpers/ult_hw_config.h" @@ -113,7 +114,9 @@ TEST_F(PlatformTest, givenMidThreadPreemptionWhenInitializingPlatformThenCallGet DebugManager.flags.ForcePreemptionMode.set(static_cast(PreemptionMode::MidThread)); auto builtIns = new MockBuiltins(); - pPlatform->peekExecutionEnvironment()->builtins.reset(builtIns); + auto executionEnvironment = pPlatform->peekExecutionEnvironment(); + executionEnvironment->prepareRootDeviceEnvironments(1); + executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(builtIns); EXPECT_EQ(SipKernelType::COUNT, MockSipData::calledType); EXPECT_FALSE(MockSipData::called); @@ -127,7 +130,9 @@ TEST_F(PlatformTest, givenDisabledPreemptionAndNoSourceLevelDebuggerWhenInitiali DebugManager.flags.ForcePreemptionMode.set(static_cast(PreemptionMode::Disabled)); auto builtIns = new MockBuiltins(); - pPlatform->peekExecutionEnvironment()->builtins.reset(builtIns); + auto executionEnvironment = pPlatform->peekExecutionEnvironment(); + executionEnvironment->prepareRootDeviceEnvironments(1); + executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(builtIns); EXPECT_EQ(SipKernelType::COUNT, MockSipData::calledType); EXPECT_FALSE(MockSipData::called); @@ -141,7 +146,9 @@ TEST_F(PlatformTest, givenDisabledPreemptionInactiveSourceLevelDebuggerWhenIniti DebugManager.flags.ForcePreemptionMode.set(static_cast(PreemptionMode::Disabled)); auto builtIns = new MockBuiltins(); - pPlatform->peekExecutionEnvironment()->builtins.reset(builtIns); + auto executionEnvironment = pPlatform->peekExecutionEnvironment(); + executionEnvironment->prepareRootDeviceEnvironments(1); + executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(builtIns); auto sourceLevelDebugger = new MockSourceLevelDebugger(); sourceLevelDebugger->setActive(false); pPlatform->peekExecutionEnvironment()->debugger.reset(sourceLevelDebugger); @@ -158,7 +165,9 @@ TEST_F(PlatformTest, givenDisabledPreemptionActiveSourceLevelDebuggerWhenInitial DebugManager.flags.ForcePreemptionMode.set(static_cast(PreemptionMode::Disabled)); auto builtIns = new MockBuiltins(); - pPlatform->peekExecutionEnvironment()->builtins.reset(builtIns); + auto executionEnvironment = pPlatform->peekExecutionEnvironment(); + executionEnvironment->prepareRootDeviceEnvironments(1); + executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(builtIns); pPlatform->peekExecutionEnvironment()->debugger.reset(new MockActiveSourceLevelDebugger()); EXPECT_EQ(SipKernelType::COUNT, MockSipData::calledType); diff --git a/opencl/test/unit_test/program/program_tests.cpp b/opencl/test/unit_test/program/program_tests.cpp index faf0f1b761..5c8c58715e 100644 --- a/opencl/test/unit_test/program/program_tests.cpp +++ b/opencl/test/unit_test/program/program_tests.cpp @@ -85,16 +85,14 @@ std::vector KernelNames{ "CopyBuffer", }; -class MockCompIfaceExecutionEnvironment : public ExecutionEnvironment { +class NoCompilerInterfaceRootDeviceEnvironment : public RootDeviceEnvironment { public: - MockCompIfaceExecutionEnvironment(CompilerInterface *compilerInterface) : compilerInterface(compilerInterface) {} - - CompilerInterface *getCompilerInterface() override { - return compilerInterface; + NoCompilerInterfaceRootDeviceEnvironment(ExecutionEnvironment &executionEnvironment) : RootDeviceEnvironment(executionEnvironment) { } - protected: - CompilerInterface *compilerInterface; + CompilerInterface *getCompilerInterface() override { + return nullptr; + } }; class FailingGenBinaryProgram : public MockProgram { @@ -680,6 +678,7 @@ HWTEST_P(ProgramFromBinaryTest, givenIsaAllocationUsedByMultipleCsrsWhenItIsDele TEST_P(ProgramFromSourceTest, CreateWithSource_Build) { KernelBinaryHelper kbHelper(BinaryFileName, true); + auto device = pPlatform->getClDevice(0); cl_device_id deviceList = {0}; char data[4] = {0}; @@ -718,12 +717,16 @@ TEST_P(ProgramFromSourceTest, CreateWithSource_Build) { pMockProgram->SetBuildStatus(CL_BUILD_NONE); // fail build - CompilerInterface cannot be obtained - auto noCompilerInterfaceExecutionEnvironment = std::make_unique(nullptr); - auto p2 = std::make_unique(*noCompilerInterfaceExecutionEnvironment); + + auto executionEnvironment = device->getExecutionEnvironment(); + std::unique_ptr rootDeviceEnvironment = std::make_unique(*executionEnvironment); + std::swap(rootDeviceEnvironment, executionEnvironment->rootDeviceEnvironments[device->getRootDeviceIndex()]); + auto p2 = std::make_unique(*executionEnvironment); + p2->setDevice(&device->getDevice()); retVal = p2->build(0, nullptr, nullptr, nullptr, nullptr, false); EXPECT_EQ(CL_OUT_OF_HOST_MEMORY, retVal); p2.reset(nullptr); - noCompilerInterfaceExecutionEnvironment.reset(); + std::swap(rootDeviceEnvironment, executionEnvironment->rootDeviceEnvironments[device->getRootDeviceIndex()]); // fail build - any build error (here caused by specifying unrecognized option) retVal = pProgram->build(0, nullptr, "-invalid-option", nullptr, nullptr, false); @@ -731,7 +734,6 @@ TEST_P(ProgramFromSourceTest, CreateWithSource_Build) { // fail build - linked code is corrupted and cannot be postprocessed auto p3 = std::make_unique(*pPlatform->getDevice(0)->getExecutionEnvironment()); - ClDevice *device = pPlatform->getClDevice(0); p3->setDevice(&device->getDevice()); std::string testFile; size_t sourceSize; @@ -985,12 +987,16 @@ TEST_P(ProgramFromSourceTest, CreateWithSource_Compile) { delete p3; // fail compilation - CompilerInterface cannot be obtained - auto noCompilerInterfaceExecutionEnvironment = std::make_unique(nullptr); - auto p2 = std::make_unique(*noCompilerInterfaceExecutionEnvironment); + auto device = pContext->getDevice(0); + auto executionEnvironment = device->getExecutionEnvironment(); + std::unique_ptr rootDeviceEnvironment = std::make_unique(*executionEnvironment); + std::swap(rootDeviceEnvironment, executionEnvironment->rootDeviceEnvironments[device->getRootDeviceIndex()]); + auto p2 = std::make_unique(*executionEnvironment); + p2->setDevice(&device->getDevice()); retVal = p2->compile(0, nullptr, nullptr, 0, nullptr, nullptr, nullptr, nullptr); EXPECT_EQ(CL_OUT_OF_HOST_MEMORY, retVal); p2.reset(nullptr); - noCompilerInterfaceExecutionEnvironment.reset(); + std::swap(rootDeviceEnvironment, executionEnvironment->rootDeviceEnvironments[device->getRootDeviceIndex()]); // fail compilation - any compilation error (here caused by specifying unrecognized option) retVal = pProgram->compile(0, nullptr, "-invalid-option", 0, nullptr, nullptr, nullptr, nullptr); @@ -1029,11 +1035,10 @@ struct MockCompilerInterfaceCaptureBuildOptions : CompilerInterface { }; TEST_P(ProgramFromSourceTest, CompileProgramWithInternalFlags) { - auto cip = std::make_unique(); - MockCompIfaceExecutionEnvironment executionEnvironment(cip.get()); - auto program = std::make_unique(executionEnvironment); - cl_device_id deviceId = pContext->getDevice(0); - ClDevice *pDevice = castToObject(deviceId); + auto cip = new MockCompilerInterfaceCaptureBuildOptions(); + auto pDevice = pContext->getDevice(0); + pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->compilerInterface.reset(cip); + auto program = std::make_unique(*pDevice->getExecutionEnvironment()); program->setDevice(&pDevice->getDevice()); program->sourceCode = "__kernel mock() {}"; @@ -1214,8 +1219,6 @@ TEST_P(ProgramFromSourceTest, CreateWithSource_Link) { } TEST_P(ProgramFromSourceTest, CreateWithSource_CreateLibrary) { - auto noCompilerInterfaceExecutionEnvironment = std::make_unique(nullptr); - auto p = std::make_unique(*noCompilerInterfaceExecutionEnvironment); cl_program program = pProgram; // Order of following microtests is important - do not change. @@ -1233,9 +1236,16 @@ TEST_P(ProgramFromSourceTest, CreateWithSource_CreateLibrary) { retVal = pProgram->link(0, nullptr, CompilerOptions::concatenate(CompilerOptions::createLibrary, "-invalid-option").c_str(), 1, &program, nullptr, nullptr); EXPECT_EQ(CL_LINK_PROGRAM_FAILURE, retVal); + auto device = pContext->getDevice(0); + auto executionEnvironment = device->getExecutionEnvironment(); + std::unique_ptr rootDeviceEnvironment = std::make_unique(*executionEnvironment); + std::swap(rootDeviceEnvironment, executionEnvironment->rootDeviceEnvironments[device->getRootDeviceIndex()]); + auto failingProgram = std::make_unique(*executionEnvironment); + failingProgram->setDevice(&device->getDevice()); // fail library creation - CompilerInterface cannot be obtained - retVal = p->link(0, nullptr, CompilerOptions::createLibrary, 1, &program, nullptr, nullptr); + retVal = failingProgram->link(0, nullptr, CompilerOptions::createLibrary, 1, &program, nullptr, nullptr); EXPECT_EQ(CL_OUT_OF_HOST_MEMORY, retVal); + std::swap(rootDeviceEnvironment, executionEnvironment->rootDeviceEnvironments[device->getRootDeviceIndex()]); } class PatchTokenFromBinaryTest : public ProgramSimpleFixture { @@ -1901,11 +1911,12 @@ TEST_F(ProgramTests, givenProgramFromGenBinaryWhenSLMSizeIsBiggerThenDeviceLimit } TEST_F(ProgramTests, RebuildBinaryButNoCompilerInterface) { - auto noCompilerInterfaceExecutionEnvironment = std::make_unique(nullptr); - auto program = std::make_unique(*noCompilerInterfaceExecutionEnvironment); + auto pDevice = pContext->getDevice(0); + auto executionEnvironment = pDevice->getExecutionEnvironment(); + std::unique_ptr rootDeviceEnvironment = std::make_unique(*executionEnvironment); + std::swap(rootDeviceEnvironment, executionEnvironment->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); + auto program = std::make_unique(*executionEnvironment); EXPECT_NE(nullptr, program); - cl_device_id deviceId = pContext->getDevice(0); - ClDevice *pDevice = castToObject(deviceId); program->setDevice(&pDevice->getDevice()); // Load a binary program file @@ -1922,14 +1933,14 @@ TEST_F(ProgramTests, RebuildBinaryButNoCompilerInterface) { // Ask to rebuild program from its IR binary - it should fail (no Compiler Interface) retVal = program->rebuildProgramFromIr(); EXPECT_NE(CL_SUCCESS, retVal); + std::swap(rootDeviceEnvironment, executionEnvironment->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); } TEST_F(ProgramTests, BuildProgramWithReraFlag) { - auto cip = std::make_unique(); - MockCompIfaceExecutionEnvironment executionEnvironment(cip.get()); - auto program = std::make_unique(executionEnvironment); - cl_device_id deviceId = pContext->getDevice(0); - ClDevice *pDevice = castToObject(deviceId); + auto cip = new MockCompilerInterfaceCaptureBuildOptions(); + auto pDevice = pContext->getDevice(0); + pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->compilerInterface.reset(cip); + auto program = std::make_unique(*pDevice->getExecutionEnvironment()); program->setDevice(&pDevice->getDevice()); program->sourceCode = "__kernel mock() {}"; program->createdFrom = Program::CreatedFrom::SOURCE; @@ -2472,7 +2483,7 @@ TEST_F(ProgramTests, givenProgramWithSpirvWhenRebuildProgramIsCalledThenSpirvPat compilerInterface->SetIgcMain(compilerMain); compilerMain->setDefaultCreatorFunc(NEO::MockIgcOclDeviceCtx::Create); compilerMain->setDefaultCreatorFunc(NEO::MockFclOclDeviceCtx::Create); - pDevice->getExecutionEnvironment()->compilerInterface.reset(compilerInterface); + pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->compilerInterface.reset(compilerInterface); std::string receivedInput; MockCompilerDebugVars debugVars = {}; @@ -2500,7 +2511,7 @@ TEST_F(ProgramTests, whenRebuildingProgramThenStoreDeviceBinaryProperly) { auto device = castToObject(pContext->getDevice(0)); auto compilerInterface = new MockCompilerInterface(); - pDevice->getExecutionEnvironment()->compilerInterface.reset(compilerInterface); + pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->compilerInterface.reset(compilerInterface); auto compilerMain = new MockCIFMain(); compilerInterface->SetIgcMain(compilerMain); compilerMain->setDefaultCreatorFunc(NEO::MockIgcOclDeviceCtx::Create); @@ -2608,6 +2619,7 @@ class AdditionalOptionsMockProgram : public MockProgram { TEST_F(ProgramTests, givenProgramWhenBuiltThenAdditionalOptionsAreApplied) { AdditionalOptionsMockProgram program; + program.setDevice(pDevice); cl_device_id device = pClDevice; program.build(1, &device, nullptr, nullptr, nullptr, false); @@ -2673,8 +2685,8 @@ struct SpecializationConstantCompilerInterfaceMock : public CompilerInterface { } }; -struct SpecializationConstantExecutionEnvironmentMock : public ExecutionEnvironment { - SpecializationConstantExecutionEnvironmentMock() { +struct SpecializationConstantRootDeviceEnvironemnt : public RootDeviceEnvironment { + SpecializationConstantRootDeviceEnvironemnt(ExecutionEnvironment &executionEnvironment) : RootDeviceEnvironment(executionEnvironment) { compilerInterface.reset(new SpecializationConstantCompilerInterfaceMock()); } CompilerInterface *getCompilerInterface() override { @@ -2684,18 +2696,20 @@ struct SpecializationConstantExecutionEnvironmentMock : public ExecutionEnvironm struct setProgramSpecializationConstantTests : public ::testing::Test { void SetUp() override { - mockProgram.reset(new SpecializationConstantProgramMock(executionEnvironment)); + mockCompiler = new SpecializationConstantCompilerInterfaceMock(); + auto rootDeviceEnvironment = device.getExecutionEnvironment()->rootDeviceEnvironments[0].get(); + rootDeviceEnvironment->compilerInterface.reset(mockCompiler); + mockProgram.reset(new SpecializationConstantProgramMock(*device.getExecutionEnvironment())); mockProgram->isSpirV = true; - mockProgram->SetDevice(&device.getDevice()); + mockProgram->setDevice(&device); EXPECT_FALSE(mockProgram->areSpecializationConstantsInitialized); EXPECT_EQ(0, mockCompiler->counter); } - SpecializationConstantExecutionEnvironmentMock executionEnvironment; - SpecializationConstantCompilerInterfaceMock *mockCompiler = reinterpret_cast(executionEnvironment.getCompilerInterface()); + SpecializationConstantCompilerInterfaceMock *mockCompiler = nullptr; std::unique_ptr mockProgram; - MockClDevice device{new MockDevice}; + MockDevice device; int specValue = 1; }; @@ -2715,7 +2729,7 @@ TEST_F(setProgramSpecializationConstantTests, whenSetProgramSpecializationConsta } TEST_F(setProgramSpecializationConstantTests, givenInvalidGetSpecConstantsInfoReturnValueWhenSetProgramSpecializationConstantThenErrorIsReturned) { - reinterpret_cast(executionEnvironment.getCompilerInterface())->returnError(); + mockCompiler->returnError(); auto retVal = mockProgram->setProgramSpecializationConstant(1, sizeof(int), &specValue); @@ -2725,14 +2739,12 @@ TEST_F(setProgramSpecializationConstantTests, givenInvalidGetSpecConstantsInfoRe } TEST(setProgramSpecializationConstantTest, givenUninitializedCompilerinterfaceWhenSetProgramSpecializationConstantThenErrorIsReturned) { - struct MockExecutionEnvironment : public ExecutionEnvironment { - CompilerInterface *getCompilerInterface() override { - return compilerInterface.get(); - } - }; + auto executionEnvironment = new MockExecutionEnvironment(); + executionEnvironment->rootDeviceEnvironments[0] = std::make_unique(*executionEnvironment); + MockDevice mockDevice(executionEnvironment, 0); + SpecializationConstantProgramMock mockProgram(*executionEnvironment); + mockProgram.setDevice(&mockDevice); - MockExecutionEnvironment executionEnvironment; - SpecializationConstantProgramMock mockProgram(executionEnvironment); mockProgram.isSpirV = true; int specValue = 1; diff --git a/opencl/test/unit_test/source_level_debugger/source_level_debugger_csr_tests.cpp b/opencl/test/unit_test/source_level_debugger/source_level_debugger_csr_tests.cpp index bdd0dc25e4..3d77ae3fbf 100644 --- a/opencl/test/unit_test/source_level_debugger/source_level_debugger_csr_tests.cpp +++ b/opencl/test/unit_test/source_level_debugger/source_level_debugger_csr_tests.cpp @@ -59,6 +59,8 @@ HWTEST_F(CommandStreamReceiverWithActiveDebuggerTest, givenCsrWithActiveDebugger std::unique_ptr allocation(new MockGraphicsAllocation(buffer, MemoryConstants::pageSize)); std::unique_ptr heap(new IndirectHeap(allocation.get())); + auto &baseDevice = device->getDevice(); + mockCsr->flushTask(commandStream, 0, *heap.get(), @@ -66,10 +68,10 @@ HWTEST_F(CommandStreamReceiverWithActiveDebuggerTest, givenCsrWithActiveDebugger *heap.get(), 0, dispatchFlags, - device->getDevice()); + baseDevice); - auto sipType = SipKernel::getSipKernelType(device->getHardwareInfo().platform.eRenderCoreFamily, true); - auto sipAllocation = device->getExecutionEnvironment()->getBuiltIns()->getSipKernel(sipType, device->getDevice()).getSipAllocation(); + auto sipType = SipKernel::getSipKernelType(baseDevice.getHardwareInfo().platform.eRenderCoreFamily, true); + auto sipAllocation = baseDevice.getBuiltIns()->getSipKernel(sipType, baseDevice).getSipAllocation(); bool found = false; for (auto allocation : mockCsr->copyOfAllocations) { if (allocation == sipAllocation) { @@ -109,7 +111,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverWithActiveDebuggerTest, givenCs device->getDevice()); auto sipType = SipKernel::getSipKernelType(device->getHardwareInfo().platform.eRenderCoreFamily, true); - auto sipAllocation = device->getExecutionEnvironment()->getBuiltIns()->getSipKernel(sipType, device->getDevice()).getSipAllocation(); + auto sipAllocation = device->getBuiltIns()->getSipKernel(sipType, device->getDevice()).getSipAllocation(); HardwareParse hwParser; hwParser.parseCommands(preambleStream); @@ -171,7 +173,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverWithActiveDebuggerTest, givenCs device->getDevice()); auto sipType = SipKernel::getSipKernelType(device->getHardwareInfo().platform.eRenderCoreFamily, true); - auto sipAllocation = device->getExecutionEnvironment()->getBuiltIns()->getSipKernel(sipType, device->getDevice()).getSipAllocation(); + auto sipAllocation = device->getBuiltIns()->getSipKernel(sipType, device->getDevice()).getSipAllocation(); HardwareParse hwParser; hwParser.parseCommands(preambleStream); diff --git a/shared/source/device/device.h b/shared/source/device/device.h index 26c545ae37..4c535c3a7b 100644 --- a/shared/source/device/device.h +++ b/shared/source/device/device.h @@ -137,10 +137,10 @@ inline GmmHelper *Device::getGmmHelper() const { } inline CompilerInterface *Device::getCompilerInterface() const { - return executionEnvironment->getCompilerInterface(); + return executionEnvironment->rootDeviceEnvironments[getRootDeviceIndex()]->getCompilerInterface(); } inline BuiltIns *Device::getBuiltIns() const { - return executionEnvironment->getBuiltIns(); + return executionEnvironment->rootDeviceEnvironments[getRootDeviceIndex()]->getBuiltIns(); } inline std::atomic &Device::getSelectorCopyEngine() { diff --git a/shared/source/execution_environment/execution_environment.cpp b/shared/source/execution_environment/execution_environment.cpp index 925361bb7a..2004c3ce8f 100644 --- a/shared/source/execution_environment/execution_environment.cpp +++ b/shared/source/execution_environment/execution_environment.cpp @@ -24,8 +24,9 @@ ExecutionEnvironment::ExecutionEnvironment() { ExecutionEnvironment::~ExecutionEnvironment() { debugger.reset(); - compilerInterface.reset(); - builtins.reset(); + for (auto &rootDeviceEnvironment : rootDeviceEnvironments) { + rootDeviceEnvironment->builtins.reset(); + } if (memoryManager) { memoryManager->commonCleanup(); } @@ -77,27 +78,6 @@ void ExecutionEnvironment::calculateMaxOsContextCount() { } } -CompilerInterface *ExecutionEnvironment::getCompilerInterface() { - if (this->compilerInterface.get() == nullptr) { - std::lock_guard autolock(this->mtx); - if (this->compilerInterface.get() == nullptr) { - auto cache = std::make_unique(getDefaultCompilerCacheConfig()); - this->compilerInterface.reset(CompilerInterface::createInstance(std::move(cache), true)); - } - } - return this->compilerInterface.get(); -} - -BuiltIns *ExecutionEnvironment::getBuiltIns() { - if (this->builtins.get() == nullptr) { - std::lock_guard autolock(this->mtx); - if (this->builtins.get() == nullptr) { - this->builtins = std::make_unique(); - } - } - return this->builtins.get(); -} - bool ExecutionEnvironment::isFullRangeSvm() const { return hwInfo->capabilityTable.gpuAddressSpace >= maxNBitValue(47); } diff --git a/shared/source/execution_environment/execution_environment.h b/shared/source/execution_environment/execution_environment.h index f0b9ded48e..f6562beb3c 100644 --- a/shared/source/execution_environment/execution_environment.h +++ b/shared/source/execution_environment/execution_environment.h @@ -6,25 +6,17 @@ */ #pragma once -#include "shared/source/os_interface/device_factory.h" #include "shared/source/utilities/reference_tracked_object.h" -#include #include namespace NEO { -class BuiltIns; -class CompilerInterface; -class GmmClientContext; -class GmmHelper; class MemoryManager; class Debugger; struct RootDeviceEnvironment; struct HardwareInfo; class ExecutionEnvironment : public ReferenceTrackedObject { - private: - std::mutex mtx; protected: std::unique_ptr hwInfo; @@ -42,13 +34,8 @@ class ExecutionEnvironment : public ReferenceTrackedObject bool isFullRangeSvm() const; void prepareRootDeviceEnvironments(uint32_t numRootDevices); - MOCKABLE_VIRTUAL CompilerInterface *getCompilerInterface(); - BuiltIns *getBuiltIns(); - std::unique_ptr memoryManager; std::vector> rootDeviceEnvironments; - std::unique_ptr builtins; - std::unique_ptr compilerInterface; std::unique_ptr debugger; }; } // namespace NEO diff --git a/shared/source/execution_environment/root_device_environment.cpp b/shared/source/execution_environment/root_device_environment.cpp index 75fad99a63..3ccfaa8bed 100644 --- a/shared/source/execution_environment/root_device_environment.cpp +++ b/shared/source/execution_environment/root_device_environment.cpp @@ -7,6 +7,9 @@ #include "shared/source/execution_environment/root_device_environment.h" +#include "shared/source/built_ins/built_ins.h" +#include "shared/source/compiler_interface/compiler_interface.h" +#include "shared/source/compiler_interface/default_cache_config.h" #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/gmm_helper/gmm_helper.h" #include "shared/source/gmm_helper/page_table_mngr.h" @@ -42,4 +45,24 @@ void RootDeviceEnvironment::initGmm() { } } +CompilerInterface *RootDeviceEnvironment::getCompilerInterface() { + if (this->compilerInterface.get() == nullptr) { + std::lock_guard autolock(this->mtx); + if (this->compilerInterface.get() == nullptr) { + auto cache = std::make_unique(getDefaultCompilerCacheConfig()); + this->compilerInterface.reset(CompilerInterface::createInstance(std::move(cache), true)); + } + } + return this->compilerInterface.get(); +} + +BuiltIns *RootDeviceEnvironment::getBuiltIns() { + if (this->builtins.get() == nullptr) { + std::lock_guard autolock(this->mtx); + if (this->builtins.get() == nullptr) { + this->builtins = std::make_unique(); + } + } + return this->builtins.get(); +} } // namespace NEO diff --git a/shared/source/execution_environment/root_device_environment.h b/shared/source/execution_environment/root_device_environment.h index 7c330a26e5..21cb7f6d9b 100644 --- a/shared/source/execution_environment/root_device_environment.h +++ b/shared/source/execution_environment/root_device_environment.h @@ -10,10 +10,13 @@ #include #include +#include #include namespace NEO { +class BuiltIns; +class CompilerInterface; class AubCenter; class GmmClientContext; class GmmHelper; @@ -35,12 +38,20 @@ struct RootDeviceEnvironment { void initGmm(); GmmHelper *getGmmHelper() const; GmmClientContext *getGmmClientContext() const; + MOCKABLE_VIRTUAL CompilerInterface *getCompilerInterface(); + BuiltIns *getBuiltIns(); std::unique_ptr gmmHelper; std::unique_ptr osInterface; std::unique_ptr pageTableManager; std::unique_ptr memoryOperationsInterface; std::unique_ptr aubCenter; + + std::unique_ptr builtins; + std::unique_ptr compilerInterface; ExecutionEnvironment &executionEnvironment; + + private: + std::mutex mtx; }; } // namespace NEO diff --git a/shared/test/unit_test/compiler_interface/compiler_interface_tests.cpp b/shared/test/unit_test/compiler_interface/compiler_interface_tests.cpp index 6fbc62fe41..72fb96a35c 100644 --- a/shared/test/unit_test/compiler_interface/compiler_interface_tests.cpp +++ b/shared/test/unit_test/compiler_interface/compiler_interface_tests.cpp @@ -41,7 +41,7 @@ class CompilerInterfaceTest : public DeviceFixture, this->pCompilerInterface = new MockCompilerInterface(); bool initRet = pCompilerInterface->initialize(std::make_unique(CompilerCacheConfig{}), true); ASSERT_TRUE(initRet); - pDevice->getExecutionEnvironment()->compilerInterface.reset(pCompilerInterface); + pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->compilerInterface.reset(pCompilerInterface); std::string testFile; diff --git a/shared/test/unit_test/gen11/test_preemption_gen11.cpp b/shared/test/unit_test/gen11/test_preemption_gen11.cpp index d6e9dcc4bd..cd8cb7c2e0 100644 --- a/shared/test/unit_test/gen11/test_preemption_gen11.cpp +++ b/shared/test/unit_test/gen11/test_preemption_gen11.cpp @@ -61,7 +61,7 @@ GEN11TEST_F(Gen11PreemptionTests, whenMidThreadPreemptionIsAvailableThenStateSip auto stateSipCmd = hwParsePreamble.getCommand(); ASSERT_NE(nullptr, stateSipCmd); - EXPECT_EQ(device->getExecutionEnvironment()->getBuiltIns()->getSipKernel(SipKernelType::Csr, device->getDevice()).getSipAllocation()->getGpuAddressToPatch(), stateSipCmd->getSystemInstructionPointer()); + EXPECT_EQ(device->getBuiltIns()->getSipKernel(SipKernelType::Csr, device->getDevice()).getSipAllocation()->getGpuAddressToPatch(), stateSipCmd->getSystemInstructionPointer()); } GEN11TEST_F(Gen11PreemptionTests, getRequiredCmdQSize) { diff --git a/shared/test/unit_test/gen9/test_preemption_gen9.cpp b/shared/test/unit_test/gen9/test_preemption_gen9.cpp index f0d0732b87..687b5269a7 100644 --- a/shared/test/unit_test/gen9/test_preemption_gen9.cpp +++ b/shared/test/unit_test/gen9/test_preemption_gen9.cpp @@ -83,7 +83,7 @@ GEN9TEST_F(Gen9PreemptionTests, whenMidThreadPreemptionIsAvailableThenStateSipIs auto stateSipCmd = hwParsePreamble.getCommand(); ASSERT_NE(nullptr, stateSipCmd); - EXPECT_EQ(device->getExecutionEnvironment()->getBuiltIns()->getSipKernel(SipKernelType::Csr, device->getDevice()).getSipAllocation()->getGpuAddressToPatch(), stateSipCmd->getSystemInstructionPointer()); + EXPECT_EQ(device->getBuiltIns()->getSipKernel(SipKernelType::Csr, device->getDevice()).getSipAllocation()->getGpuAddressToPatch(), stateSipCmd->getSystemInstructionPointer()); } GEN9TEST_F(Gen9ThreadGroupPreemptionEnqueueKernelTest, givenSecondEnqueueWithTheSamePreemptionRequestThenDontReprogramThreadGroupNoWa) { @@ -531,5 +531,5 @@ GEN9TEST_F(Gen9PreemptionTests, givenMidThreadPreemptionModeWhenStateSipIsProgra EXPECT_NE(nullptr, cmd); auto sipType = SipKernel::getSipKernelType(mockDevice->getHardwareInfo().platform.eRenderCoreFamily, mockDevice->isDebuggerActive()); - EXPECT_EQ(mockDevice->getExecutionEnvironment()->getBuiltIns()->getSipKernel(sipType, *mockDevice).getSipAllocation()->getGpuAddressToPatch(), cmd->getSystemInstructionPointer()); + EXPECT_EQ(mockDevice->getBuiltIns()->getSipKernel(sipType, *mockDevice).getSipAllocation()->getGpuAddressToPatch(), cmd->getSystemInstructionPointer()); } diff --git a/shared/test/unit_test/preemption/preemption_tests.cpp b/shared/test/unit_test/preemption/preemption_tests.cpp index d9228140fd..72f0926f1f 100644 --- a/shared/test/unit_test/preemption/preemption_tests.cpp +++ b/shared/test/unit_test/preemption/preemption_tests.cpp @@ -355,7 +355,7 @@ HWTEST_P(PreemptionHwTest, getRequiredCmdStreamSizeReturns0WhenPreemptionModeIsN auto builtIns = new MockBuiltins(); builtIns->overrideSipKernel(std::unique_ptr(new NEO::SipKernel{SipKernelType::Csr, GlobalMockSipProgram::getSipProgramWithCustomBinary()})); - mockDevice->getExecutionEnvironment()->builtins.reset(builtIns); + mockDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->builtins.reset(builtIns); PreemptionHelper::programCmdStream(cmdStream, mode, mode, nullptr); } EXPECT_EQ(0U, cmdStream.getUsed()); diff --git a/shared/test/unit_test/source_level_debugger/source_level_debugger_preamble_test.inl b/shared/test/unit_test/source_level_debugger/source_level_debugger_preamble_test.inl index 2b4fb35af9..b6da8fd828 100644 --- a/shared/test/unit_test/source_level_debugger/source_level_debugger_preamble_test.inl +++ b/shared/test/unit_test/source_level_debugger/source_level_debugger_preamble_test.inl @@ -30,7 +30,7 @@ void SourceLevelDebuggerPreambleTest::givenMidThreadPreemptionAndDebu auto sipAddress = stateSipCmd->getSystemInstructionPointer(); auto sipType = SipKernel::getSipKernelType(mockDevice->getHardwareInfo().platform.eRenderCoreFamily, mockDevice->isDebuggerActive()); - EXPECT_EQ(mockDevice->getExecutionEnvironment()->getBuiltIns()->getSipKernel(sipType, *mockDevice).getSipAllocation()->getGpuAddressToPatch(), sipAddress); + EXPECT_EQ(mockDevice->getBuiltIns()->getSipKernel(sipType, *mockDevice).getSipAllocation()->getGpuAddressToPatch(), sipAddress); } template @@ -56,7 +56,7 @@ void SourceLevelDebuggerPreambleTest::givenMidThreadPreemptionAndDisa auto sipAddress = stateSipCmd->getSystemInstructionPointer(); auto sipType = SipKernel::getSipKernelType(mockDevice->getHardwareInfo().platform.eRenderCoreFamily, mockDevice->isDebuggerActive()); - EXPECT_EQ(mockDevice->getExecutionEnvironment()->getBuiltIns()->getSipKernel(sipType, *mockDevice).getSipAllocation()->getGpuAddressToPatch(), sipAddress); + EXPECT_EQ(mockDevice->getBuiltIns()->getSipKernel(sipType, *mockDevice).getSipAllocation()->getGpuAddressToPatch(), sipAddress); } template @@ -82,7 +82,7 @@ void SourceLevelDebuggerPreambleTest::givenPreemptionDisabledAndDebug auto sipAddress = stateSipCmd->getSystemInstructionPointer(); auto sipType = SipKernel::getSipKernelType(mockDevice->getHardwareInfo().platform.eRenderCoreFamily, mockDevice->isDebuggerActive()); - EXPECT_EQ(mockDevice->getExecutionEnvironment()->getBuiltIns()->getSipKernel(sipType, *mockDevice).getSipAllocation()->getGpuAddressToPatch(), sipAddress); + EXPECT_EQ(mockDevice->getBuiltIns()->getSipKernel(sipType, *mockDevice).getSipAllocation()->getGpuAddressToPatch(), sipAddress); } template