diff --git a/opencl/source/program/build.cpp b/opencl/source/program/build.cpp index f61351a169..9ee3b0fbef 100644 --- a/opencl/source/program/build.cpp +++ b/opencl/source/program/build.cpp @@ -97,7 +97,8 @@ cl_int Program::build( appendAdditionalExtensions(extensions, options, internalOptions); CompilerOptions::concatenateAppend(internalOptions, extensions); - if (defaultDevice.getRootDeviceEnvironment().getAILConfigurationHelper()->handleDivergentBarriers()) { + auto ailHelper = defaultDevice.getRootDeviceEnvironment().getAILConfigurationHelper(); + if (ailHelper && ailHelper->handleDivergentBarriers()) { CompilerOptions::concatenateAppend(internalOptions, CompilerOptions::enableDivergentBarriers); } diff --git a/opencl/test/unit_test/api/cl_build_program_tests.inl b/opencl/test/unit_test/api/cl_build_program_tests.inl index 0dde23cfcd..1c5347d2a8 100644 --- a/opencl/test/unit_test/api/cl_build_program_tests.inl +++ b/opencl/test/unit_test/api/cl_build_program_tests.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2023 Intel Corporation + * Copyright (C) 2018-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -23,6 +23,7 @@ using namespace NEO; struct ClBuildProgramTests : public ApiTests { void SetUp() override { debugManager.flags.FailBuildProgramWithStatefulAccess.set(0); + debugManager.flags.EnableAIL.set(false); ApiTests::setUp(); } void TearDown() override { diff --git a/shared/source/helpers/gfx_core_helper_xehp_and_later.inl b/shared/source/helpers/gfx_core_helper_xehp_and_later.inl index 04349e633f..79400eb5c4 100644 --- a/shared/source/helpers/gfx_core_helper_xehp_and_later.inl +++ b/shared/source/helpers/gfx_core_helper_xehp_and_later.inl @@ -77,8 +77,9 @@ const EngineInstancesContainer GfxCoreHelperHw::getGpgpuEngineInstanc auto defaultEngine = getChosenEngineType(hwInfo); EngineInstancesContainer engines; - - if (hwInfo.featureTable.flags.ftrCCSNode && !rootDeviceEnvironment.getAILConfigurationHelper()->forceRcs()) { + auto ailHelper = rootDeviceEnvironment.getAILConfigurationHelper(); + auto forceRcs = ailHelper && ailHelper->forceRcs(); + if (hwInfo.featureTable.flags.ftrCCSNode && !forceRcs) { for (uint32_t i = 0; i < hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled; i++) { engines.push_back({static_cast(i + aub_stream::ENGINE_CCS), EngineUsage::regular}); } @@ -86,7 +87,7 @@ const EngineInstancesContainer GfxCoreHelperHw::getGpgpuEngineInstanc if ((debugManager.flags.NodeOrdinal.get() == static_cast(aub_stream::EngineType::ENGINE_RCS)) || hwInfo.featureTable.flags.ftrRcsNode || - rootDeviceEnvironment.getAILConfigurationHelper()->forceRcs()) { + forceRcs) { engines.push_back({aub_stream::ENGINE_RCS, EngineUsage::regular}); } diff --git a/shared/test/unit_test/device/neo_device_tests.cpp b/shared/test/unit_test/device/neo_device_tests.cpp index e5b89c68f4..8497510f4a 100644 --- a/shared/test/unit_test/device/neo_device_tests.cpp +++ b/shared/test/unit_test/device/neo_device_tests.cpp @@ -1728,3 +1728,14 @@ TEST_F(DeviceTests, givenDebuggerRequestedByUserWhenDeviceWithSubDevicesCreatedT EXPECT_EQ(1u, createDebuggerCallCount); EXPECT_NE(nullptr, deviceFactory.rootDevices[0]->getL0Debugger()); } + +TEST(DeviceWithoutAILTest, givenNoAILWhenCreateDeviceThenDeviceIsCreated) { + DebugManagerStateRestore dbgRestorer; + debugManager.flags.EnableAIL.set(false); + + auto hwInfo = *defaultHwInfo; + setupDefaultFeatureTableAndWorkaroundTable(&hwInfo); + auto device = std::unique_ptr(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); + + EXPECT_NE(nullptr, device.get()); +}