diff --git a/opencl/test/unit_test/os_interface/CMakeLists.txt b/opencl/test/unit_test/os_interface/CMakeLists.txt index f395950981..781920a720 100644 --- a/opencl/test/unit_test/os_interface/CMakeLists.txt +++ b/opencl/test/unit_test/os_interface/CMakeLists.txt @@ -9,7 +9,6 @@ set(IGDRCL_SRCS_tests_os_interface_base ${CMAKE_CURRENT_SOURCE_DIR}/device_factory_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mock_performance_counters.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mock_performance_counters.h - ${CMAKE_CURRENT_SOURCE_DIR}/os_interface_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/performance_counters_tests.cpp ) diff --git a/opencl/test/unit_test/os_interface/os_interface_tests.cpp b/opencl/test/unit_test/os_interface/os_interface_tests.cpp deleted file mode 100644 index 36df839016..0000000000 --- a/opencl/test/unit_test/os_interface/os_interface_tests.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2018-2021 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/source/os_interface/os_interface.h" - -#include "gtest/gtest.h" - -#include - -TEST(OSInterface, WhenInterfaceIsCreatedThenItIsNonCopyable) { - EXPECT_FALSE(std::is_move_constructible::value); - EXPECT_FALSE(std::is_copy_constructible::value); -} - -TEST(OSInterface, WhenInterfaceIsCreatedThenItIsNonAssignable) { - EXPECT_FALSE(std::is_move_assignable::value); - EXPECT_FALSE(std::is_copy_assignable::value); -} diff --git a/opencl/test/unit_test/os_interface/windows/CMakeLists.txt b/opencl/test/unit_test/os_interface/windows/CMakeLists.txt index f8999e49d3..c9018dec14 100644 --- a/opencl/test/unit_test/os_interface/windows/CMakeLists.txt +++ b/opencl/test/unit_test/os_interface/windows/CMakeLists.txt @@ -6,7 +6,6 @@ set(IGDRCL_SRCS_tests_os_interface_windows ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt - ${CMAKE_CURRENT_SOURCE_DIR}/device_command_stream_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/device_os_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/driver_info_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/file_logger_win_tests.cpp @@ -14,8 +13,6 @@ set(IGDRCL_SRCS_tests_os_interface_windows ${CMAKE_CURRENT_SOURCE_DIR}/mock_os_time_win.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_performance_counters_win.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mock_performance_counters_win.h - ${CMAKE_CURRENT_SOURCE_DIR}/os_interface_win_tests.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/os_interface_win_tests.h ${CMAKE_CURRENT_SOURCE_DIR}/os_time_win_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/performance_counters_win_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/registry_reader_tests.cpp diff --git a/shared/source/os_interface/os_interface.h b/shared/source/os_interface/os_interface.h index 92f4c6580d..cd24a49ec3 100644 --- a/shared/source/os_interface/os_interface.h +++ b/shared/source/os_interface/os_interface.h @@ -14,6 +14,7 @@ #include #include #include +#include #include namespace NEO { @@ -124,4 +125,10 @@ class OSInterface : public NonCopyableClass { protected: std::unique_ptr driverModel = nullptr; }; + +static_assert(!std::is_move_constructible_v); +static_assert(!std::is_copy_constructible_v); +static_assert(!std::is_move_assignable_v); +static_assert(!std::is_copy_assignable_v); + } // namespace NEO diff --git a/shared/test/unit_test/os_interface/windows/CMakeLists.txt b/shared/test/unit_test/os_interface/windows/CMakeLists.txt index 53632bd2ad..f05a0afad9 100644 --- a/shared/test/unit_test/os_interface/windows/CMakeLists.txt +++ b/shared/test/unit_test/os_interface/windows/CMakeLists.txt @@ -9,11 +9,14 @@ set(NEO_CORE_OS_INTERFACE_TESTS_WINDOWS ${CMAKE_CURRENT_SOURCE_DIR}/adapter_info_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/adapter_info_tests.h ${CMAKE_CURRENT_SOURCE_DIR}/deferrable_deletion_win_tests.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/device_command_stream_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/gdi_interface_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/gmm_helper_tests_win.cpp ${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_win_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_win_tests.h ${CMAKE_CURRENT_SOURCE_DIR}/os_context_win_tests.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/os_interface_win_tests.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/os_interface_win_tests.h ${CMAKE_CURRENT_SOURCE_DIR}/os_library_win_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/self_lib_win.cpp ${CMAKE_CURRENT_SOURCE_DIR}/um_km_data_translator_tests.cpp diff --git a/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp b/shared/test/unit_test/os_interface/windows/device_command_stream_tests.cpp similarity index 99% rename from opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp rename to shared/test/unit_test/os_interface/windows/device_command_stream_tests.cpp index 5a594c7f40..842ac47bbb 100644 --- a/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/device_command_stream_tests.cpp @@ -44,8 +44,6 @@ #include "shared/test/common/test_macros/test.h" #include "shared/test/unit_test/fixtures/mock_aub_center_fixture.h" -#include "opencl/test/unit_test/mocks/mock_buffer.h" - #include "hw_cmds.h" using namespace NEO; @@ -680,17 +678,17 @@ TEST_F(WddmCommandStreamTest, WhenProcesssingEvictionThenEvictionAllocationsList TEST_F(WddmCommandStreamTest, WhenMakingResidentAndNonResidentThenAllocationIsMovedCorrectly) { GraphicsAllocation *gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{csr->getRootDeviceIndex(), MemoryConstants::pageSize}); - Buffer *buffer = new AlignedBuffer(gfxAllocation); - csr->makeResident(*buffer->getGraphicsAllocation(csr->getRootDeviceIndex())); + ASSERT_NE(gfxAllocation, nullptr); + + csr->makeResident(*gfxAllocation); EXPECT_EQ(0u, wddm->makeResidentResult.called); EXPECT_EQ(1u, csr->getResidencyAllocations().size()); EXPECT_EQ(gfxAllocation, csr->getResidencyAllocations()[0]); - csr->makeNonResident(*buffer->getGraphicsAllocation(csr->getRootDeviceIndex())); + csr->makeNonResident(*gfxAllocation); EXPECT_EQ(gfxAllocation, csr->getEvictionAllocations()[0]); - delete buffer; memoryManager->freeGraphicsMemory(gfxAllocation); } diff --git a/opencl/test/unit_test/os_interface/windows/os_interface_win_tests.cpp b/shared/test/unit_test/os_interface/windows/os_interface_win_tests.cpp similarity index 95% rename from opencl/test/unit_test/os_interface/windows/os_interface_win_tests.cpp rename to shared/test/unit_test/os_interface/windows/os_interface_win_tests.cpp index a969ff8014..9049f85499 100644 --- a/opencl/test/unit_test/os_interface/windows/os_interface_win_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/os_interface_win_tests.cpp @@ -1,11 +1,11 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * */ -#include "opencl/test/unit_test/os_interface/windows/os_interface_win_tests.h" +#include "shared/test/unit_test/os_interface/windows/os_interface_win_tests.h" #include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/os_interface/windows/os_context_win.h" diff --git a/opencl/test/unit_test/os_interface/windows/os_interface_win_tests.h b/shared/test/unit_test/os_interface/windows/os_interface_win_tests.h similarity index 92% rename from opencl/test/unit_test/os_interface/windows/os_interface_win_tests.h rename to shared/test/unit_test/os_interface/windows/os_interface_win_tests.h index 892597b951..9c2233cc61 100644 --- a/opencl/test/unit_test/os_interface/windows/os_interface_win_tests.h +++ b/shared/test/unit_test/os_interface/windows/os_interface_win_tests.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT *