diff --git a/level_zero/CMakeLists.txt b/level_zero/CMakeLists.txt index 800bf5f052..5a0b34d040 100644 --- a/level_zero/CMakeLists.txt +++ b/level_zero/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2020 Intel Corporation +# Copyright (C) 2019-2021 Intel Corporation # # SPDX-License-Identifier: MIT # @@ -228,7 +228,7 @@ if(BUILD_WITH_L0) ${COMPUTE_RUNTIME_DIR}/opencl/source/dll/create_tbx_sockets.cpp ${COMPUTE_RUNTIME_DIR}/opencl/source/dll/get_devices.cpp ${COMPUTE_RUNTIME_DIR}/opencl/source/dll/source_level_debugger_dll.cpp - ${COMPUTE_RUNTIME_DIR}/opencl/source/helpers/built_ins_helper.cpp + ${COMPUTE_RUNTIME_DIR}/shared/source/helpers/built_ins_helper.cpp ${COMPUTE_RUNTIME_DIR}/shared/source/aub/aub_stream_interface.cpp ) diff --git a/level_zero/cmake/l0_tests.cmake b/level_zero/cmake/l0_tests.cmake index f0dd2b7e45..85915a3ef4 100644 --- a/level_zero/cmake/l0_tests.cmake +++ b/level_zero/cmake/l0_tests.cmake @@ -1,5 +1,5 @@ # -# Copyright (C) 2020 Intel Corporation +# Copyright (C) 2020-2021 Intel Corporation # # SPDX-License-Identifier: MIT # @@ -66,14 +66,15 @@ add_library(compute_runtime_mockable_extra EXCLUDE_FROM_ALL ${CMAKE_CURRENT_LIST_DIR}/l0_tests.cmake ${NEO_SHARED_TEST_DIRECTORY}/unit_test/utilities/cpuintrinsics.cpp + ${NEO_SHARED_TEST_DIRECTORY}/unit_test/helpers/built_ins_helper.cpp ${NEO_SHARED_TEST_DIRECTORY}/unit_test/helpers/test_files.cpp ${NEO_SHARED_TEST_DIRECTORY}/unit_test/mocks/mock_compiler_interface_spirv.cpp ${NEO_SHARED_TEST_DIRECTORY}/unit_test/mocks/mock_compiler_interface_spirv.h ${NEO_SHARED_TEST_DIRECTORY}/unit_test/mocks/mock_command_stream_receiver.cpp ${NEO_SHARED_TEST_DIRECTORY}/unit_test/mocks/mock_device.cpp + ${NEO_SHARED_TEST_DIRECTORY}/unit_test/mocks/mock_sip.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/aub_stream_mocks/aub_stream_interface_mock.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/abort.cpp - ${NEO_SOURCE_DIR}/opencl/test/unit_test/helpers/built_ins_helper.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/helpers/debug_helpers.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/libult/os_interface.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/libult/source_level_debugger_ult.cpp @@ -88,7 +89,6 @@ add_library(compute_runtime_mockable_extra ${NEO_SOURCE_DIR}/opencl/test/unit_test/mocks/mock_gmm_resource_info.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/mocks/mock_memory_manager.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/mocks/mock_program.cpp - ${NEO_SOURCE_DIR}/opencl/test/unit_test/mocks/mock_sip.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/utilities/debug_settings_reader_creator.cpp ${NEO_SOURCE_DIR}/shared/source/debug_settings/debug_settings_manager.cpp ) diff --git a/level_zero/core/source/device/device_imp.cpp b/level_zero/core/source/device/device_imp.cpp index dc0fab7730..840be6fb1b 100644 --- a/level_zero/core/source/device/device_imp.cpp +++ b/level_zero/core/source/device/device_imp.cpp @@ -14,6 +14,7 @@ #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/gmm_helper/gmm_helper.h" +#include "shared/source/helpers/built_ins_helper.h" #include "shared/source/helpers/constants.h" #include "shared/source/helpers/engine_node_helper.h" #include "shared/source/helpers/hw_helper.h" @@ -589,6 +590,11 @@ Device *Device::create(DriverHandle *driverHandle, NEO::Device *neoDevice, uint3 if (device->getHwInfo().capabilityTable.supportsImages) { device->getBuiltinFunctionsLib()->initImageFunctions(); } + auto hwInfo = neoDevice->getHardwareInfo(); + if (neoDevice->getPreemptionMode() == NEO::PreemptionMode::MidThread || neoDevice->isDebuggerActive()) { + auto sipType = NEO::SipKernel::getSipKernelType(hwInfo.platform.eRenderCoreFamily, neoDevice->isDebuggerActive()); + NEO::initSipKernel(sipType, *neoDevice); + } } auto supportDualStorageSharedMemory = neoDevice->getMemoryManager()->isLocalMemorySupported(device->neoDevice->getRootDeviceIndex()); diff --git a/level_zero/core/test/black_box_tests/zello_world_jitc_ocloc.cpp b/level_zero/core/test/black_box_tests/zello_world_jitc_ocloc.cpp index ddcdbd8bd0..1ee4305ed7 100644 --- a/level_zero/core/test/black_box_tests/zello_world_jitc_ocloc.cpp +++ b/level_zero/core/test/black_box_tests/zello_world_jitc_ocloc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation + * Copyright (C) 2020-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -25,7 +25,7 @@ std::vector compileToSpirV(const std::string &src, const std::string &o std::vector ret; const char *mainFileName = "main.cl"; - const char *argv[] = {"ocloc", "-q", "-device", "skl", "-file", mainFileName}; + const char *argv[] = {"ocloc", "-q", "-device", "skl", "-file", mainFileName, "-options", options.c_str()}; const unsigned char *sources[] = {reinterpret_cast(src.c_str())}; size_t sourcesLengths[] = {src.size() + 1}; const char *sourcesNames[] = {mainFileName}; diff --git a/level_zero/core/test/unit_tests/main.cpp b/level_zero/core/test/unit_tests/main.cpp index ad852ee532..3c8cb453fe 100644 --- a/level_zero/core/test/unit_tests/main.cpp +++ b/level_zero/core/test/unit_tests/main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation + * Copyright (C) 2020-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -13,13 +13,13 @@ #include "shared/test/unit_test/helpers/memory_leak_listener.h" #include "shared/test/unit_test/helpers/test_files.h" #include "shared/test/unit_test/helpers/ult_hw_config.inl" +#include "shared/test/unit_test/mocks/mock_sip.h" #include "opencl/source/program/kernel_info.h" #include "opencl/source/utilities/logger.h" #include "opencl/test/unit_test/custom_event_listener.h" #include "opencl/test/unit_test/global_environment.h" #include "opencl/test/unit_test/mocks/mock_gmm_client_context.h" -#include "opencl/test/unit_test/mocks/mock_sip.h" #include "level_zero/core/source/cmdlist/cmdlist.h" diff --git a/level_zero/core/test/unit_tests/sources/device/test_device.cpp b/level_zero/core/test/unit_tests/sources/device/test_device.cpp index 89dd6b9134..02318f6c52 100644 --- a/level_zero/core/test/unit_tests/sources/device/test_device.cpp +++ b/level_zero/core/test/unit_tests/sources/device/test_device.cpp @@ -24,6 +24,13 @@ using ::testing::Return; +namespace NEO { +namespace MockSipData { +extern SipKernelType calledType; +extern bool called; +} // namespace MockSipData +} // namespace NEO + namespace L0 { namespace ult { @@ -46,6 +53,46 @@ TEST(L0DeviceTest, GivenDualStorageSharedMemorySupportedWhenCreatingDeviceThenPa EXPECT_EQ(ZE_COMMAND_QUEUE_MODE_SYNCHRONOUS, static_cast(deviceImp->pageFaultCommandList->cmdQImmediate)->getSynchronousMode()); } +TEST(L0DeviceTest, givenMidThreadPreemptionWhenCreatingDeviceThenSipKernelIsInitialized) { + VariableBackup mockSipCalled(&NEO::MockSipData::called, false); + VariableBackup mockSipCalledType(&NEO::MockSipData::calledType, NEO::SipKernelType::COUNT); + + std::unique_ptr driverHandle(new DriverHandleImp); + auto hwInfo = *NEO::defaultHwInfo; + hwInfo.capabilityTable.defaultPreemptionMode = NEO::PreemptionMode::MidThread; + + auto neoDevice = std::unique_ptr(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); + + EXPECT_EQ(NEO::SipKernelType::COUNT, NEO::MockSipData::calledType); + EXPECT_FALSE(NEO::MockSipData::called); + + auto device = std::unique_ptr(Device::create(driverHandle.get(), neoDevice.release(), 1, false)); + ASSERT_NE(nullptr, device); + + EXPECT_EQ(NEO::SipKernelType::Csr, NEO::MockSipData::calledType); + EXPECT_TRUE(NEO::MockSipData::called); +} + +TEST(L0DeviceTest, givenDisabledPreemptionWhenCreatingDeviceThenSipKernelIsNotInitialized) { + VariableBackup mockSipCalled(&NEO::MockSipData::called, false); + VariableBackup mockSipCalledType(&NEO::MockSipData::calledType, NEO::SipKernelType::COUNT); + + std::unique_ptr driverHandle(new DriverHandleImp); + auto hwInfo = *NEO::defaultHwInfo; + hwInfo.capabilityTable.defaultPreemptionMode = NEO::PreemptionMode::Disabled; + + auto neoDevice = std::unique_ptr(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); + + EXPECT_EQ(NEO::SipKernelType::COUNT, NEO::MockSipData::calledType); + EXPECT_FALSE(NEO::MockSipData::called); + + auto device = std::unique_ptr(Device::create(driverHandle.get(), neoDevice.release(), 1, false)); + ASSERT_NE(nullptr, device); + + EXPECT_EQ(NEO::SipKernelType::COUNT, NEO::MockSipData::calledType); + EXPECT_FALSE(NEO::MockSipData::called); +} + struct DeviceTest : public ::testing::Test { void SetUp() override { DebugManager.flags.CreateMultipleRootDevices.set(numRootDevices); diff --git a/opencl/source/built_ins/builtins_dispatch_builder.cpp b/opencl/source/built_ins/builtins_dispatch_builder.cpp index 2703445728..f90d37216b 100644 --- a/opencl/source/built_ins/builtins_dispatch_builder.cpp +++ b/opencl/source/built_ins/builtins_dispatch_builder.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2020 Intel Corporation + * Copyright (C) 2017-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -11,13 +11,13 @@ #include "shared/source/built_ins/sip.h" #include "shared/source/compiler_interface/compiler_interface.h" #include "shared/source/helpers/basic_math.h" +#include "shared/source/helpers/built_ins_helper.h" #include "shared/source/helpers/debug_helpers.h" #include "opencl/source/built_ins/aux_translation_builtin.h" #include "opencl/source/built_ins/built_ins.inl" #include "opencl/source/built_ins/vme_dispatch_builder.h" #include "opencl/source/cl_device/cl_device.h" -#include "opencl/source/helpers/built_ins_helper.h" #include "opencl/source/helpers/convert_color.h" #include "opencl/source/helpers/dispatch_info_builder.h" #include "opencl/source/kernel/kernel.h" diff --git a/opencl/source/dll/CMakeLists.txt b/opencl/source/dll/CMakeLists.txt index b2015f48d6..697a462d55 100644 --- a/opencl/source/dll/CMakeLists.txt +++ b/opencl/source/dll/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2018-2020 Intel Corporation +# Copyright (C) 2018-2021 Intel Corporation # # SPDX-License-Identifier: MIT # @@ -22,15 +22,15 @@ set(RUNTIME_SRCS_DLL_BASE ${NEO_SHARED_DIRECTORY}/gmm_helper/resource_info.cpp ${NEO_SHARED_DIRECTORY}/gmm_helper/page_table_mngr.cpp ${NEO_SHARED_DIRECTORY}/helpers/abort.cpp - ${NEO_SHARED_DIRECTORY}/helpers/debug_helpers.cpp ${NEO_SHARED_DIRECTORY}/helpers/allow_deferred_deleter.cpp + ${NEO_SHARED_DIRECTORY}/helpers/built_ins_helper.cpp + ${NEO_SHARED_DIRECTORY}/helpers/debug_helpers.cpp ${NEO_SHARED_DIRECTORY}/utilities/cpuintrinsics.cpp ${NEO_SHARED_DIRECTORY}/utilities/debug_settings_reader_creator.cpp ${NEO_SHARED_DIRECTORY}/utilities/io_functions.cpp ${NEO_SOURCE_DIR}/opencl/source/api/api.cpp ${NEO_SOURCE_DIR}/opencl/source/compiler_interface/default_cache_config.cpp ${NEO_SOURCE_DIR}/opencl/source/helpers/api_specific_config_ocl.cpp - ${NEO_SOURCE_DIR}/opencl/source/helpers/built_ins_helper.cpp ${GTPIN_INIT_FILE} ${HW_SRC_LINK} diff --git a/opencl/source/helpers/CMakeLists.txt b/opencl/source/helpers/CMakeLists.txt index 450cb3d4ff..06087cb4ec 100644 --- a/opencl/source/helpers/CMakeLists.txt +++ b/opencl/source/helpers/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2018-2020 Intel Corporation +# Copyright (C) 2018-2021 Intel Corporation # # SPDX-License-Identifier: MIT # @@ -8,7 +8,6 @@ set(RUNTIME_SRCS_HELPERS_BASE ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/base_object.cpp ${CMAKE_CURRENT_SOURCE_DIR}/base_object.h - ${CMAKE_CURRENT_SOURCE_DIR}/built_ins_helper.h ${CMAKE_CURRENT_SOURCE_DIR}/cl_blit_properties.h ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/cl_device_helpers.cpp ${CMAKE_CURRENT_SOURCE_DIR}/cl_device_helpers.h diff --git a/opencl/source/platform/platform.cpp b/opencl/source/platform/platform.cpp index 3960fdaf33..f2252d5e25 100644 --- a/opencl/source/platform/platform.cpp +++ b/opencl/source/platform/platform.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2020 Intel Corporation + * Copyright (C) 2018-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -14,6 +14,7 @@ #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/gmm_helper/gmm_helper.h" +#include "shared/source/helpers/built_ins_helper.h" #include "shared/source/helpers/debug_helpers.h" #include "shared/source/helpers/get_info.h" #include "shared/source/helpers/hw_helper.h" @@ -25,7 +26,6 @@ #include "opencl/source/api/api.h" #include "opencl/source/cl_device/cl_device.h" #include "opencl/source/gtpin/gtpin_notify.h" -#include "opencl/source/helpers/built_ins_helper.h" #include "opencl/source/helpers/get_info_status_mapper.h" #include "opencl/source/platform/extensions.h" #include "opencl/source/sharings/sharing_factory.h" diff --git a/opencl/test/unit_test/libult/CMakeLists.txt b/opencl/test/unit_test/libult/CMakeLists.txt index 6fe0959b4e..b6422dd604 100644 --- a/opencl/test/unit_test/libult/CMakeLists.txt +++ b/opencl/test/unit_test/libult/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2018-2020 Intel Corporation +# Copyright (C) 2018-2021 Intel Corporation # # SPDX-License-Identifier: MIT # @@ -48,7 +48,6 @@ set(IGDRCL_SRCS_LIB_ULT ${NEO_SHARED_TEST_DIRECTORY}/unit_test/utilities/cpuintrinsics.cpp ${NEO_SOURCE_DIR}/opencl/source/compiler_interface/default_cache_config.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/abort.cpp - ${NEO_SOURCE_DIR}/opencl/test/unit_test/helpers/built_ins_helper.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/helpers/debug_helpers.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/helpers/execution_environment_helper.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/helpers/execution_environment_helper.h @@ -62,6 +61,8 @@ set(IGDRCL_SRCS_LIB_ULT ${NEO_SOURCE_DIR}/opencl/test/unit_test/libult/ult_command_stream_receiver.h ${NEO_SOURCE_DIR}/opencl/test/unit_test/utilities/debug_settings_reader_creator.cpp ${NEO_SHARED_TEST_DIRECTORY}/unit_test/base_ult_config_listener.cpp + ${NEO_SHARED_TEST_DIRECTORY}/unit_test/base_ult_config_listener.cpp + ${NEO_SHARED_TEST_DIRECTORY}/unit_test/helpers/built_ins_helper.cpp ${NEO_SHARED_TEST_DIRECTORY}/unit_test/helpers/memory_leak_listener.cpp ${NEO_SHARED_TEST_DIRECTORY}/unit_test/helpers/memory_leak_listener.h ${NEO_SHARED_TEST_DIRECTORY}/unit_test/helpers/memory_management.cpp diff --git a/opencl/test/unit_test/main.cpp b/opencl/test/unit_test/main.cpp index 6285b3223d..06b9b03b62 100644 --- a/opencl/test/unit_test/main.cpp +++ b/opencl/test/unit_test/main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2020 Intel Corporation + * Copyright (C) 2017-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -15,6 +15,7 @@ #include "shared/test/unit_test/helpers/memory_leak_listener.h" #include "shared/test/unit_test/helpers/test_files.h" #include "shared/test/unit_test/helpers/ult_hw_config.inl" +#include "shared/test/unit_test/mocks/mock_sip.h" #include "shared/test/unit_test/test_macros/test_checks_shared.h" #include "shared/test/unit_test/tests_configuration.h" @@ -24,7 +25,6 @@ #include "opencl/test/unit_test/helpers/kernel_binary_helper.h" #include "opencl/test/unit_test/mocks/mock_gmm.h" #include "opencl/test/unit_test/mocks/mock_program.h" -#include "opencl/test/unit_test/mocks/mock_sip.h" #include "opencl/test/unit_test/ult_config_listener.h" #include "gmock/gmock.h" diff --git a/opencl/test/unit_test/mocks/CMakeLists.txt b/opencl/test/unit_test/mocks/CMakeLists.txt index 6e36cdfb10..79036c86bb 100644 --- a/opencl/test/unit_test/mocks/CMakeLists.txt +++ b/opencl/test/unit_test/mocks/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2018-2020 Intel Corporation +# Copyright (C) 2018-2021 Intel Corporation # # SPDX-License-Identifier: MIT # @@ -73,8 +73,6 @@ set(IGDRCL_SRCS_tests_mocks ${CMAKE_CURRENT_SOURCE_DIR}/mock_program.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mock_sampler.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_sharing_factory.h - ${CMAKE_CURRENT_SOURCE_DIR}/mock_sip.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/mock_sip.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_source_level_debugger.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_submissions_aggregator.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_svm_manager.h diff --git a/opencl/test/unit_test/mocks/mock_builtins.h b/opencl/test/unit_test/mocks/mock_builtins.h index 2cffa85c7e..f79b3e5b9b 100644 --- a/opencl/test/unit_test/mocks/mock_builtins.h +++ b/opencl/test/unit_test/mocks/mock_builtins.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2020 Intel Corporation + * Copyright (C) 2018-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -9,9 +9,9 @@ #include "shared/source/built_ins/built_ins.h" #include "shared/source/built_ins/sip.h" +#include "shared/test/unit_test/mocks/mock_sip.h" #include "opencl/source/built_ins/builtins_dispatch_builder.h" -#include "opencl/test/unit_test/mocks/mock_sip.h" #include diff --git a/opencl/test/unit_test/mocks/mock_compilers.cpp b/opencl/test/unit_test/mocks/mock_compilers.cpp index 8651897410..cb197bc765 100644 --- a/opencl/test/unit_test/mocks/mock_compilers.cpp +++ b/opencl/test/unit_test/mocks/mock_compilers.cpp @@ -11,10 +11,10 @@ #include "shared/source/helpers/hw_info.h" #include "shared/test/unit_test/helpers/test_files.h" #include "shared/test/unit_test/mocks/mock_compiler_interface.h" +#include "shared/test/unit_test/mocks/mock_sip.h" #include "opencl/source/os_interface/os_inc_base.h" #include "opencl/test/unit_test/mocks/mock_compilers.h" -#include "opencl/test/unit_test/mocks/mock_sip.h" #include "cif/macros/enable.h" #include "compiler_options.h" diff --git a/opencl/test/unit_test/offline_compiler/mock/mock_sip_ocloc_tests.cpp b/opencl/test/unit_test/offline_compiler/mock/mock_sip_ocloc_tests.cpp index d21fffcbe3..3547510509 100644 --- a/opencl/test/unit_test/offline_compiler/mock/mock_sip_ocloc_tests.cpp +++ b/opencl/test/unit_test/offline_compiler/mock/mock_sip_ocloc_tests.cpp @@ -5,7 +5,7 @@ * */ -#include "opencl/test/unit_test/mocks/mock_sip.h" +#include "shared/test/unit_test/mocks/mock_sip.h" #include diff --git a/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp b/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp index 17e429d6a3..494bed6644 100644 --- a/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2020 Intel Corporation + * Copyright (C) 2017-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -29,7 +29,6 @@ #include "opencl/source/command_stream/aub_command_stream_receiver.h" #include "opencl/source/command_stream/command_stream_receiver_with_aub_dump.h" -#include "opencl/source/helpers/built_ins_helper.h" #include "opencl/source/mem_obj/buffer.h" #include "opencl/source/os_interface/windows/wddm_device_command_stream.h" #include "opencl/source/platform/platform.h" diff --git a/shared/source/built_ins/built_ins.cpp b/shared/source/built_ins/built_ins.cpp index 126bf3af5c..21ed8e5950 100644 --- a/shared/source/built_ins/built_ins.cpp +++ b/shared/source/built_ins/built_ins.cpp @@ -11,10 +11,10 @@ #include "shared/source/compiler_interface/compiler_interface.h" #include "shared/source/device_binary_format/device_binary_formats.h" #include "shared/source/helpers/basic_math.h" +#include "shared/source/helpers/built_ins_helper.h" #include "shared/source/helpers/debug_helpers.h" #include "shared/source/memory_manager/memory_manager.h" -#include "opencl/source/helpers/built_ins_helper.h" #include "opencl/source/helpers/convert_color.h" #include "opencl/source/helpers/dispatch_info_builder.h" diff --git a/shared/source/helpers/CMakeLists.txt b/shared/source/helpers/CMakeLists.txt index e935dc9aaf..acf8023a54 100644 --- a/shared/source/helpers/CMakeLists.txt +++ b/shared/source/helpers/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2020 Intel Corporation +# Copyright (C) 2019-2021 Intel Corporation # # SPDX-License-Identifier: MIT # @@ -21,6 +21,7 @@ set(NEO_CORE_HELPERS ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/blit_commands_helper_extra.cpp ${CMAKE_CURRENT_SOURCE_DIR}/blit_commands_helper.cpp ${CMAKE_CURRENT_SOURCE_DIR}/blit_commands_helper.h + ${CMAKE_CURRENT_SOURCE_DIR}/built_ins_helper.h ${CMAKE_CURRENT_SOURCE_DIR}/cache_policy.cpp ${CMAKE_CURRENT_SOURCE_DIR}/cache_policy.h ${CMAKE_CURRENT_SOURCE_DIR}/common_types.h diff --git a/opencl/source/helpers/built_ins_helper.cpp b/shared/source/helpers/built_ins_helper.cpp similarity index 75% rename from opencl/source/helpers/built_ins_helper.cpp rename to shared/source/helpers/built_ins_helper.cpp index dfdc4c7338..0a4b05e8f4 100644 --- a/opencl/source/helpers/built_ins_helper.cpp +++ b/shared/source/helpers/built_ins_helper.cpp @@ -1,11 +1,11 @@ /* - * Copyright (C) 2018-2020 Intel Corporation + * Copyright (C) 2018-2021 Intel Corporation * * SPDX-License-Identifier: MIT * */ -#include "opencl/source/helpers/built_ins_helper.h" +#include "shared/source/helpers/built_ins_helper.h" #include "shared/source/device/device.h" #include "shared/source/device_binary_format/device_binary_formats.h" diff --git a/opencl/source/helpers/built_ins_helper.h b/shared/source/helpers/built_ins_helper.h similarity index 69% rename from opencl/source/helpers/built_ins_helper.h rename to shared/source/helpers/built_ins_helper.h index 246570dc46..a8e4d2ebff 100644 --- a/opencl/source/helpers/built_ins_helper.h +++ b/shared/source/helpers/built_ins_helper.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2020 Intel Corporation + * Copyright (C) 2018-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -7,7 +7,6 @@ #pragma once #include "shared/source/built_ins/built_ins.h" -#include "shared/source/program/program_info.h" namespace NEO { class Device; diff --git a/shared/test/unit_test/helpers/CMakeLists.txt b/shared/test/unit_test/helpers/CMakeLists.txt index d648bb0422..3bbee2d275 100644 --- a/shared/test/unit_test/helpers/CMakeLists.txt +++ b/shared/test/unit_test/helpers/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2020 Intel Corporation +# Copyright (C) 2019-2021 Intel Corporation # # SPDX-License-Identifier: MIT # @@ -10,6 +10,7 @@ set(NEO_CORE_HELPERS_TESTS ${CMAKE_CURRENT_SOURCE_DIR}/blit_commands_helper_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/blit_commands_helper_tests.inl ${CMAKE_CURRENT_SOURCE_DIR}/blit_commands_helper_tests_gen12lp.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/built_ins_helper.cpp ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/debug_manager_state_restore.h ${CMAKE_CURRENT_SOURCE_DIR}/default_hw_info.h diff --git a/opencl/test/unit_test/helpers/built_ins_helper.cpp b/shared/test/unit_test/helpers/built_ins_helper.cpp similarity index 52% rename from opencl/test/unit_test/helpers/built_ins_helper.cpp rename to shared/test/unit_test/helpers/built_ins_helper.cpp index b081899a8e..c6ecc092a7 100644 --- a/opencl/test/unit_test/helpers/built_ins_helper.cpp +++ b/shared/test/unit_test/helpers/built_ins_helper.cpp @@ -1,19 +1,14 @@ /* - * Copyright (C) 2018-2020 Intel Corporation + * Copyright (C) 2018-2021 Intel Corporation * * SPDX-License-Identifier: MIT * */ -#include "opencl/source/helpers/built_ins_helper.h" +#include "shared/source/helpers/built_ins_helper.h" #include "shared/source/device/device.h" - -#include "opencl/source/compiler_interface/default_cl_cache_config.h" -#include "opencl/test/unit_test/mocks/mock_builtins.h" -#include "opencl/test/unit_test/mocks/mock_compilers.h" -#include "opencl/test/unit_test/mocks/mock_program.h" -#include "opencl/test/unit_test/mocks/mock_sip.h" +#include "shared/test/unit_test/mocks/mock_sip.h" namespace NEO { diff --git a/shared/test/unit_test/main.cpp b/shared/test/unit_test/main.cpp index a9f28b5b6a..14f2937add 100644 --- a/shared/test/unit_test/main.cpp +++ b/shared/test/unit_test/main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation + * Copyright (C) 2020-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -15,6 +15,7 @@ #include "shared/test/unit_test/helpers/memory_leak_listener.h" #include "shared/test/unit_test/helpers/test_files.h" #include "shared/test/unit_test/helpers/ult_hw_config.inl" +#include "shared/test/unit_test/mocks/mock_sip.h" #include "shared/test/unit_test/test_macros/test_checks_shared.h" #include "shared/test/unit_test/tests_configuration.h" @@ -25,7 +26,6 @@ #include "opencl/test/unit_test/mocks/mock_gmm.h" #include "opencl/test/unit_test/mocks/mock_gmm_client_context.h" #include "opencl/test/unit_test/mocks/mock_program.h" -#include "opencl/test/unit_test/mocks/mock_sip.h" #include "opencl/test/unit_test/ult_config_listener.h" #include "gmock/gmock.h" diff --git a/shared/test/unit_test/mocks/CMakeLists.txt b/shared/test/unit_test/mocks/CMakeLists.txt index 73ef55c2d9..d234f22548 100644 --- a/shared/test/unit_test/mocks/CMakeLists.txt +++ b/shared/test/unit_test/mocks/CMakeLists.txt @@ -20,6 +20,8 @@ set(NEO_CORE_tests_mocks ${CMAKE_CURRENT_SOURCE_DIR}/mock_device.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_graphics_allocation.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_os_library.h + ${CMAKE_CURRENT_SOURCE_DIR}/mock_sip.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/mock_sip.h ${CMAKE_CURRENT_SOURCE_DIR}/ult_device_factory.cpp ${CMAKE_CURRENT_SOURCE_DIR}/ult_device_factory.h ) diff --git a/opencl/test/unit_test/mocks/mock_sip.cpp b/shared/test/unit_test/mocks/mock_sip.cpp similarity index 90% rename from opencl/test/unit_test/mocks/mock_sip.cpp rename to shared/test/unit_test/mocks/mock_sip.cpp index e81d73261f..f84ecdba26 100644 --- a/opencl/test/unit_test/mocks/mock_sip.cpp +++ b/shared/test/unit_test/mocks/mock_sip.cpp @@ -5,17 +5,13 @@ * */ -#include "opencl/test/unit_test/mocks/mock_sip.h" +#include "shared/test/unit_test/mocks/mock_sip.h" #include "shared/source/helpers/file_io.h" #include "shared/source/helpers/hw_info.h" #include "shared/source/memory_manager/os_agnostic_memory_manager.h" #include "shared/test/unit_test/helpers/test_files.h" -#include "opencl/source/os_interface/os_inc_base.h" -#include "opencl/test/unit_test/mocks/mock_compilers.h" -#include "opencl/test/unit_test/mocks/mock_program.h" - #include "cif/macros/enable.h" #include "ocl_igc_interface/igc_ocl_device_ctx.h" diff --git a/opencl/test/unit_test/mocks/mock_sip.h b/shared/test/unit_test/mocks/mock_sip.h similarity index 100% rename from opencl/test/unit_test/mocks/mock_sip.h rename to shared/test/unit_test/mocks/mock_sip.h