From 1eb3bd5c0aca8b6c9d9038fd4514adab151b63ad Mon Sep 17 00:00:00 2001 From: Andrzej Swierczynski Date: Tue, 17 Mar 2020 14:25:44 +0100 Subject: [PATCH] Move platform() and constructPlatform() to MockPlatform Related-To: NEO-4207 Change-Id: I7ed1c16f2eb357c3143d2a3f0b688f3cc747e9ff Signed-off-by: Andrzej Swierczynski --- opencl/source/platform/platform.cpp | 16 ---------------- opencl/source/platform/platform.h | 2 -- .../test/unit_test/api/cl_create_pipe_tests.inl | 1 + .../unit_test/api/cl_get_device_ids_tests.inl | 1 + .../api/cl_get_supported_image_formats_tests.inl | 1 + opencl/test/unit_test/api/cl_svm_alloc_tests.inl | 1 + .../unit_test/aub_tests/fixtures/aub_fixture.h | 1 + .../aub_tests/fixtures/unified_memory_fixture.h | 1 + .../command_queue/enqueue_handler_tests.cpp | 1 + .../command_queue/sync_buffer_handler_tests.cpp | 1 + .../aub_command_stream_receiver_2_tests.cpp | 1 + ...ommand_stream_receiver_flush_task_3_tests.cpp | 1 + .../command_stream_receiver_tests.cpp | 1 + ...mmand_stream_receiver_with_aub_dump_tests.cpp | 1 + .../command_stream/get_devices_tests.cpp | 1 + .../command_stream/tbx_command_stream_tests.cpp | 1 + .../unit_test/context/context_negative_tests.cpp | 1 + .../unit_test/context/gl/context_gl_tests.cpp | 1 + .../test/unit_test/context/gl/context_gl_tests.h | 1 + opencl/test/unit_test/d3d_sharing/d3d9_tests.cpp | 1 + opencl/test/unit_test/device/device_tests.cpp | 1 + .../device/get_device_info_size_tests.cpp | 1 + .../event/async_events_handler_tests.cpp | 1 + .../unit_test/event/event_callbacks_tests.cpp | 1 + opencl/test/unit_test/event/event_tests.cpp | 1 + .../execution_environment_tests.cpp | 1 + .../fixtures/device_instrumentation_fixture.cpp | 1 + opencl/test/unit_test/fixtures/image_fixture.h | 1 + .../unit_test/fixtures/media_kernel_fixture.h | 1 + .../unit_test/fixtures/mock_aub_center_fixture.h | 1 + .../gen12lp/hw_helper_tests_gen12lp.inl | 1 + .../windows/gmm_callbacks_tests_gen12lp.cpp | 1 + .../test/unit_test/gen8/coherency_tests_gen8.cpp | 1 + .../test/unit_test/gen9/coherency_tests_gen9.cpp | 1 + .../unit_test/gmm_helper/gmm_helper_tests.cpp | 1 + .../helpers/execution_environment_helper.cpp | 1 + .../unit_test/helpers/timestamp_packet_tests.cpp | 1 + opencl/test/unit_test/mem_obj/image_tests.cpp | 1 + .../mem_obj/mem_obj_destruction_tests.cpp | 1 + opencl/test/unit_test/mem_obj/mem_obj_tests.cpp | 1 + .../deferrable_allocation_deletion_tests.cpp | 1 + .../memory_manager/memory_manager_tests.cpp | 1 + .../unit_test/memory_manager/surface_tests.cpp | 1 + .../unified_memory_manager_tests.cpp | 1 + opencl/test/unit_test/mocks/mock_cl_device.cpp | 1 + opencl/test/unit_test/mocks/mock_gmm.h | 1 + opencl/test/unit_test/mocks/mock_platform.cpp | 16 ++++++++++++++++ opencl/test/unit_test/mocks/mock_platform.h | 4 ++++ .../os_interface/device_factory_tests.cpp | 1 + .../linux/device_command_stream_fixture.h | 1 + .../test/unit_test/os_interface/linux/drm_mock.h | 1 + .../windows/device_command_stream_tests.cpp | 1 + .../os_interface/windows/device_os_tests.cpp | 1 + .../windows/file_logger_win_tests.cpp | 1 + .../windows/gl/gl_os_sharing_tests.cpp | 1 + .../os_interface/windows/wddm20_tests.cpp | 1 + .../os_interface/windows/wddm23_tests.cpp | 1 + .../os_interface/windows/wddm_fixture.h | 1 + .../windows/wddm_kmdaf_listener_tests.cpp | 1 + .../windows/wddm_memory_manager_tests.cpp | 1 + .../windows/wddm_memory_manager_tests.h | 1 + .../windows/wddm_residency_controller_tests.cpp | 1 + ...cked_enqueue_with_callback_scenario_tests.cpp | 1 + .../gl/windows/gl_arb_sync_event_tests.cpp | 1 + .../sharings/gl/windows/gl_sharing_tests.cpp | 1 + .../sharings/gl/windows/gl_texture_tests.cpp | 1 + .../unit_test/sharings/sharing_factory_tests.cpp | 1 + .../unit_test/sharings/va/context_va_tests.cpp | 1 + .../unit_test/sharings/va/va_sharing_tests.cpp | 1 + .../source_level_debugger_device_tests.cpp | 1 + opencl/test/unit_test/ult_config_listener.cpp | 1 + .../unit_test/preemption/preemption_tests.cpp | 1 + 72 files changed, 88 insertions(+), 18 deletions(-) diff --git a/opencl/source/platform/platform.cpp b/opencl/source/platform/platform.cpp index 00f7127b64..937723116b 100644 --- a/opencl/source/platform/platform.cpp +++ b/opencl/source/platform/platform.cpp @@ -40,22 +40,6 @@ namespace NEO { std::vector> platformsImpl; -Platform *platform() { - if (platformsImpl.empty()) { - return nullptr; - } - return platformsImpl[0].get(); -} - -Platform *constructPlatform() { - static std::mutex mutex; - std::unique_lock lock(mutex); - if (platformsImpl.empty()) { - platformsImpl.push_back(std::make_unique(*(new ExecutionEnvironment()))); - } - return platformsImpl[0].get(); -} - Platform::Platform(ExecutionEnvironment &executionEnvironmentIn) : executionEnvironment(executionEnvironmentIn) { clDevices.reserve(4); setAsyncEventsHandler(std::unique_ptr(new AsyncEventsHandler())); diff --git a/opencl/source/platform/platform.h b/opencl/source/platform/platform.h index 0e9d0e450f..3e31bf3daa 100644 --- a/opencl/source/platform/platform.h +++ b/opencl/source/platform/platform.h @@ -80,6 +80,4 @@ class Platform : public BaseObject<_cl_platform_id> { }; extern std::vector> platformsImpl; -Platform *platform(); -Platform *constructPlatform(); } // namespace NEO diff --git a/opencl/test/unit_test/api/cl_create_pipe_tests.inl b/opencl/test/unit_test/api/cl_create_pipe_tests.inl index acc859e1b6..c1436fc729 100644 --- a/opencl/test/unit_test/api/cl_create_pipe_tests.inl +++ b/opencl/test/unit_test/api/cl_create_pipe_tests.inl @@ -10,6 +10,7 @@ #include "opencl/source/context/context.h" #include "opencl/source/helpers/base_object.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "cl_api_tests.h" 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 782beaaa7c..b889699db0 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 @@ -11,6 +11,7 @@ #include "opencl/source/platform/platform.h" #include "opencl/test/unit_test/helpers/variable_backup.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "cl_api_tests.h" diff --git a/opencl/test/unit_test/api/cl_get_supported_image_formats_tests.inl b/opencl/test/unit_test/api/cl_get_supported_image_formats_tests.inl index 0902467890..a55fc762bd 100644 --- a/opencl/test/unit_test/api/cl_get_supported_image_formats_tests.inl +++ b/opencl/test/unit_test/api/cl_get_supported_image_formats_tests.inl @@ -11,6 +11,7 @@ #include "opencl/source/context/context.h" #include "opencl/test/unit_test/mocks/mock_cl_device.h" #include "opencl/test/unit_test/mocks/mock_device.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "cl_api_tests.h" diff --git a/opencl/test/unit_test/api/cl_svm_alloc_tests.inl b/opencl/test/unit_test/api/cl_svm_alloc_tests.inl index b2488ac82f..f1883cf50e 100644 --- a/opencl/test/unit_test/api/cl_svm_alloc_tests.inl +++ b/opencl/test/unit_test/api/cl_svm_alloc_tests.inl @@ -9,6 +9,7 @@ #include "shared/test/unit_test/utilities/base_object_utils.h" #include "opencl/source/context/context.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "cl_api_tests.h" diff --git a/opencl/test/unit_test/aub_tests/fixtures/aub_fixture.h b/opencl/test/unit_test/aub_tests/fixtures/aub_fixture.h index b431e2e737..36b427336e 100644 --- a/opencl/test/unit_test/aub_tests/fixtures/aub_fixture.h +++ b/opencl/test/unit_test/aub_tests/fixtures/aub_fixture.h @@ -18,6 +18,7 @@ #include "opencl/test/unit_test/command_queue/command_queue_fixture.h" #include "opencl/test/unit_test/mocks/mock_cl_device.h" #include "opencl/test/unit_test/mocks/mock_device.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "opencl/test/unit_test/tests_configuration.h" #include diff --git a/opencl/test/unit_test/aub_tests/fixtures/unified_memory_fixture.h b/opencl/test/unit_test/aub_tests/fixtures/unified_memory_fixture.h index dc6a28b9f7..fccdb2fa24 100644 --- a/opencl/test/unit_test/aub_tests/fixtures/unified_memory_fixture.h +++ b/opencl/test/unit_test/aub_tests/fixtures/unified_memory_fixture.h @@ -11,6 +11,7 @@ #include "opencl/source/api/api.h" #include "opencl/test/unit_test/aub_tests/fixtures/aub_fixture.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" namespace NEO { namespace PagaFaultManagerTestConfig { diff --git a/opencl/test/unit_test/command_queue/enqueue_handler_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_handler_tests.cpp index d3c8ec463f..b6f6dc57f0 100644 --- a/opencl/test/unit_test/command_queue/enqueue_handler_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_handler_tests.cpp @@ -21,6 +21,7 @@ #include "opencl/test/unit_test/mocks/mock_internal_allocation_storage.h" #include "opencl/test/unit_test/mocks/mock_kernel.h" #include "opencl/test/unit_test/mocks/mock_mdi.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "test.h" using namespace NEO; diff --git a/opencl/test/unit_test/command_queue/sync_buffer_handler_tests.cpp b/opencl/test/unit_test/command_queue/sync_buffer_handler_tests.cpp index 677afe3ad1..4a5d994c7f 100644 --- a/opencl/test/unit_test/command_queue/sync_buffer_handler_tests.cpp +++ b/opencl/test/unit_test/command_queue/sync_buffer_handler_tests.cpp @@ -12,6 +12,7 @@ #include "opencl/test/unit_test/mocks/mock_command_queue.h" #include "opencl/test/unit_test/mocks/mock_kernel.h" #include "opencl/test/unit_test/mocks/mock_mdi.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "test.h" using namespace NEO; diff --git a/opencl/test/unit_test/command_stream/aub_command_stream_receiver_2_tests.cpp b/opencl/test/unit_test/command_stream/aub_command_stream_receiver_2_tests.cpp index bd9915e8c3..ea418b0f29 100644 --- a/opencl/test/unit_test/command_stream/aub_command_stream_receiver_2_tests.cpp +++ b/opencl/test/unit_test/command_stream/aub_command_stream_receiver_2_tests.cpp @@ -28,6 +28,7 @@ #include "opencl/test/unit_test/mocks/mock_kernel.h" #include "opencl/test/unit_test/mocks/mock_mdi.h" #include "opencl/test/unit_test/mocks/mock_os_context.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "test.h" #include "third_party/aub_stream/headers/aubstream.h" diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_3_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_3_tests.cpp index 23f8abb110..224957cb63 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_3_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_3_tests.cpp @@ -23,6 +23,7 @@ #include "opencl/test/unit_test/mocks/mock_gmm_page_table_mngr.h" #include "opencl/test/unit_test/mocks/mock_kernel.h" #include "opencl/test/unit_test/mocks/mock_os_context.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "opencl/test/unit_test/mocks/mock_program.h" #include "opencl/test/unit_test/mocks/mock_submissions_aggregator.h" #include "test.h" diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_tests.cpp index 7be8aa1860..8be9792caa 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_tests.cpp @@ -36,6 +36,7 @@ #include "opencl/test/unit_test/mocks/mock_graphics_allocation.h" #include "opencl/test/unit_test/mocks/mock_hw_helper.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "opencl/test/unit_test/mocks/mock_program.h" #include "test.h" diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_with_aub_dump_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_with_aub_dump_tests.cpp index 9fb6f2b2bf..0084078ef6 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_with_aub_dump_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_with_aub_dump_tests.cpp @@ -27,6 +27,7 @@ #include "opencl/test/unit_test/mocks/mock_aub_manager.h" #include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_os_context.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "test.h" using namespace NEO; diff --git a/opencl/test/unit_test/command_stream/get_devices_tests.cpp b/opencl/test/unit_test/command_stream/get_devices_tests.cpp index a963304adc..5422a57771 100644 --- a/opencl/test/unit_test/command_stream/get_devices_tests.cpp +++ b/opencl/test/unit_test/command_stream/get_devices_tests.cpp @@ -16,6 +16,7 @@ #include "opencl/source/platform/platform.h" #include "opencl/test/unit_test/helpers/variable_backup.h" #include "opencl/test/unit_test/libult/create_command_stream.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "test.h" namespace NEO { diff --git a/opencl/test/unit_test/command_stream/tbx_command_stream_tests.cpp b/opencl/test/unit_test/command_stream/tbx_command_stream_tests.cpp index 003cbd8cc5..3f35ac6e54 100644 --- a/opencl/test/unit_test/command_stream/tbx_command_stream_tests.cpp +++ b/opencl/test/unit_test/command_stream/tbx_command_stream_tests.cpp @@ -34,6 +34,7 @@ #include "opencl/test/unit_test/mocks/mock_kernel.h" #include "opencl/test/unit_test/mocks/mock_mdi.h" #include "opencl/test/unit_test/mocks/mock_os_context.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "opencl/test/unit_test/mocks/mock_tbx_csr.h" #include "test.h" diff --git a/opencl/test/unit_test/context/context_negative_tests.cpp b/opencl/test/unit_test/context/context_negative_tests.cpp index 82f98b12d2..77ff2518d3 100644 --- a/opencl/test/unit_test/context/context_negative_tests.cpp +++ b/opencl/test/unit_test/context/context_negative_tests.cpp @@ -9,6 +9,7 @@ #include "opencl/source/platform/platform.h" #include "opencl/test/unit_test/fixtures/device_fixture.h" #include "opencl/test/unit_test/fixtures/memory_management_fixture.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "test.h" #include "CL/cl_gl.h" diff --git a/opencl/test/unit_test/context/gl/context_gl_tests.cpp b/opencl/test/unit_test/context/gl/context_gl_tests.cpp index ff27a83fca..be644a11b0 100644 --- a/opencl/test/unit_test/context/gl/context_gl_tests.cpp +++ b/opencl/test/unit_test/context/gl/context_gl_tests.cpp @@ -8,6 +8,7 @@ #include "opencl/test/unit_test/context/gl/context_gl_tests.h" #include "opencl/source/sharings/gl/gl_sharing.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" namespace NEO { diff --git a/opencl/test/unit_test/context/gl/context_gl_tests.h b/opencl/test/unit_test/context/gl/context_gl_tests.h index c883b6fef5..1a4a6e9892 100644 --- a/opencl/test/unit_test/context/gl/context_gl_tests.h +++ b/opencl/test/unit_test/context/gl/context_gl_tests.h @@ -9,6 +9,7 @@ #include "opencl/test/unit_test/fixtures/platform_fixture.h" #include "opencl/test/unit_test/mocks/mock_context.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "gtest/gtest.h" #include diff --git a/opencl/test/unit_test/d3d_sharing/d3d9_tests.cpp b/opencl/test/unit_test/d3d_sharing/d3d9_tests.cpp index 16133239a0..4d59743bc9 100644 --- a/opencl/test/unit_test/d3d_sharing/d3d9_tests.cpp +++ b/opencl/test/unit_test/d3d_sharing/d3d9_tests.cpp @@ -19,6 +19,7 @@ #include "opencl/test/unit_test/mocks/mock_context.h" #include "opencl/test/unit_test/mocks/mock_d3d_objects.h" #include "opencl/test/unit_test/mocks/mock_gmm.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "test.h" namespace NEO { diff --git a/opencl/test/unit_test/device/device_tests.cpp b/opencl/test/unit_test/device/device_tests.cpp index e05a77310c..7d1aa15d0d 100644 --- a/opencl/test/unit_test/device/device_tests.cpp +++ b/opencl/test/unit_test/device/device_tests.cpp @@ -20,6 +20,7 @@ #include "opencl/test/unit_test/mocks/mock_context.h" #include "opencl/test/unit_test/mocks/mock_csr.h" #include "opencl/test/unit_test/mocks/mock_execution_environment.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "test.h" #include diff --git a/opencl/test/unit_test/device/get_device_info_size_tests.cpp b/opencl/test/unit_test/device/get_device_info_size_tests.cpp index f0ab67939a..106e2fef92 100644 --- a/opencl/test/unit_test/device/get_device_info_size_tests.cpp +++ b/opencl/test/unit_test/device/get_device_info_size_tests.cpp @@ -7,6 +7,7 @@ #include "opencl/source/device/cl_device_info_map.h" #include "opencl/test/unit_test/fixtures/device_fixture.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/event/async_events_handler_tests.cpp b/opencl/test/unit_test/event/async_events_handler_tests.cpp index 69e8126057..357ffb6126 100644 --- a/opencl/test/unit_test/event/async_events_handler_tests.cpp +++ b/opencl/test/unit_test/event/async_events_handler_tests.cpp @@ -13,6 +13,7 @@ #include "opencl/source/event/user_event.h" #include "opencl/source/platform/platform.h" #include "opencl/test/unit_test/mocks/mock_async_event_handler.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "test.h" #include "gmock/gmock.h" diff --git a/opencl/test/unit_test/event/event_callbacks_tests.cpp b/opencl/test/unit_test/event/event_callbacks_tests.cpp index 2c3a51adda..be9dd3a3e9 100644 --- a/opencl/test/unit_test/event/event_callbacks_tests.cpp +++ b/opencl/test/unit_test/event/event_callbacks_tests.cpp @@ -12,6 +12,7 @@ #include "opencl/test/unit_test/mocks/mock_command_queue.h" #include "opencl/test/unit_test/mocks/mock_context.h" #include "opencl/test/unit_test/mocks/mock_event.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "test.h" #include diff --git a/opencl/test/unit_test/event/event_tests.cpp b/opencl/test/unit_test/event/event_tests.cpp index 6c387b9ef5..008bcec226 100644 --- a/opencl/test/unit_test/event/event_tests.cpp +++ b/opencl/test/unit_test/event/event_tests.cpp @@ -26,6 +26,7 @@ #include "opencl/test/unit_test/mocks/mock_kernel.h" #include "opencl/test/unit_test/mocks/mock_mdi.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "opencl/test/unit_test/mocks/mock_program.h" #include "opencl/test/unit_test/os_interface/mock_performance_counters.h" #include "test.h" 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 5cd18fd2db..cabcd11a69 100644 --- a/opencl/test/unit_test/execution_environment/execution_environment_tests.cpp +++ b/opencl/test/unit_test/execution_environment/execution_environment_tests.cpp @@ -26,6 +26,7 @@ #include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" #include "opencl/test/unit_test/mocks/mock_memory_operations_handler.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "test.h" using namespace NEO; diff --git a/opencl/test/unit_test/fixtures/device_instrumentation_fixture.cpp b/opencl/test/unit_test/fixtures/device_instrumentation_fixture.cpp index a427e79e98..e002891e32 100644 --- a/opencl/test/unit_test/fixtures/device_instrumentation_fixture.cpp +++ b/opencl/test/unit_test/fixtures/device_instrumentation_fixture.cpp @@ -10,6 +10,7 @@ #include "opencl/source/device/cl_device.h" #include "opencl/test/unit_test/helpers/execution_environment_helper.h" #include "opencl/test/unit_test/mocks/mock_device.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" namespace NEO { void DeviceInstrumentationFixture::SetUp(bool instrumentation) { diff --git a/opencl/test/unit_test/fixtures/image_fixture.h b/opencl/test/unit_test/fixtures/image_fixture.h index 20e32067a3..688f33d2fb 100644 --- a/opencl/test/unit_test/fixtures/image_fixture.h +++ b/opencl/test/unit_test/fixtures/image_fixture.h @@ -15,6 +15,7 @@ #include "opencl/source/platform/platform.h" #include "opencl/test/unit_test/fixtures/device_fixture.h" #include "opencl/test/unit_test/mocks/mock_context.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "test.h" #include "CL/cl.h" diff --git a/opencl/test/unit_test/fixtures/media_kernel_fixture.h b/opencl/test/unit_test/fixtures/media_kernel_fixture.h index 737f6b97e1..d4873e4f21 100644 --- a/opencl/test/unit_test/fixtures/media_kernel_fixture.h +++ b/opencl/test/unit_test/fixtures/media_kernel_fixture.h @@ -9,6 +9,7 @@ #include "opencl/test/unit_test/command_queue/enqueue_fixture.h" #include "opencl/test/unit_test/fixtures/hello_world_fixture.h" #include "opencl/test/unit_test/helpers/hw_parse.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" namespace NEO { diff --git a/opencl/test/unit_test/fixtures/mock_aub_center_fixture.h b/opencl/test/unit_test/fixtures/mock_aub_center_fixture.h index 04e552f3c0..09966d3613 100644 --- a/opencl/test/unit_test/fixtures/mock_aub_center_fixture.h +++ b/opencl/test/unit_test/fixtures/mock_aub_center_fixture.h @@ -13,6 +13,7 @@ #include "opencl/source/platform/platform.h" #include "opencl/test/unit_test/mocks/mock_aub_center.h" #include "opencl/test/unit_test/mocks/mock_aub_manager.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "opencl/test/unit_test/tests_configuration.h" namespace NEO { diff --git a/opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl b/opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl index 2e988e7358..465dc2f580 100644 --- a/opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl +++ b/opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl @@ -10,6 +10,7 @@ #include "opencl/test/unit_test/gen12lp/special_ult_helper_gen12lp.h" #include "opencl/test/unit_test/helpers/hw_helper_tests.h" #include "opencl/test/unit_test/mocks/mock_context.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "engine_node.h" diff --git a/opencl/test/unit_test/gen12lp/windows/gmm_callbacks_tests_gen12lp.cpp b/opencl/test/unit_test/gen12lp/windows/gmm_callbacks_tests_gen12lp.cpp index 4ee85e56e7..5504373256 100644 --- a/opencl/test/unit_test/gen12lp/windows/gmm_callbacks_tests_gen12lp.cpp +++ b/opencl/test/unit_test/gen12lp/windows/gmm_callbacks_tests_gen12lp.cpp @@ -19,6 +19,7 @@ #include "opencl/test/unit_test/helpers/execution_environment_helper.h" #include "opencl/test/unit_test/helpers/hw_parse.h" #include "opencl/test/unit_test/libult/ult_command_stream_receiver.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "test.h" using namespace NEO; diff --git a/opencl/test/unit_test/gen8/coherency_tests_gen8.cpp b/opencl/test/unit_test/gen8/coherency_tests_gen8.cpp index a146668154..7de06be5c5 100644 --- a/opencl/test/unit_test/gen8/coherency_tests_gen8.cpp +++ b/opencl/test/unit_test/gen8/coherency_tests_gen8.cpp @@ -10,6 +10,7 @@ #include "opencl/source/platform/platform.h" #include "opencl/test/unit_test/helpers/dispatch_flags_helper.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "test.h" using namespace NEO; diff --git a/opencl/test/unit_test/gen9/coherency_tests_gen9.cpp b/opencl/test/unit_test/gen9/coherency_tests_gen9.cpp index c4b513afec..c56fabcd09 100644 --- a/opencl/test/unit_test/gen9/coherency_tests_gen9.cpp +++ b/opencl/test/unit_test/gen9/coherency_tests_gen9.cpp @@ -10,6 +10,7 @@ #include "opencl/source/platform/platform.h" #include "opencl/test/unit_test/helpers/dispatch_flags_helper.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "test.h" using namespace NEO; 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 18c8c219b8..7a860da7c5 100644 --- a/opencl/test/unit_test/gmm_helper/gmm_helper_tests.cpp +++ b/opencl/test/unit_test/gmm_helper/gmm_helper_tests.cpp @@ -22,6 +22,7 @@ #include "opencl/test/unit_test/mocks/mock_gmm.h" #include "opencl/test/unit_test/mocks/mock_graphics_allocation.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "GL/gl.h" #include "GL/glext.h" diff --git a/opencl/test/unit_test/helpers/execution_environment_helper.cpp b/opencl/test/unit_test/helpers/execution_environment_helper.cpp index 4c5598da57..3830c62b65 100644 --- a/opencl/test/unit_test/helpers/execution_environment_helper.cpp +++ b/opencl/test/unit_test/helpers/execution_environment_helper.cpp @@ -12,6 +12,7 @@ #include "shared/test/unit_test/helpers/debug_manager_state_restore.h" #include "opencl/source/platform/platform.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" namespace NEO { diff --git a/opencl/test/unit_test/helpers/timestamp_packet_tests.cpp b/opencl/test/unit_test/helpers/timestamp_packet_tests.cpp index 7900ad481e..913f822721 100644 --- a/opencl/test/unit_test/helpers/timestamp_packet_tests.cpp +++ b/opencl/test/unit_test/helpers/timestamp_packet_tests.cpp @@ -26,6 +26,7 @@ #include "opencl/test/unit_test/mocks/mock_kernel.h" #include "opencl/test/unit_test/mocks/mock_mdi.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "opencl/test/unit_test/mocks/mock_timestamp_container.h" #include "test.h" diff --git a/opencl/test/unit_test/mem_obj/image_tests.cpp b/opencl/test/unit_test/mem_obj/image_tests.cpp index dce93665b7..8aa1a7234e 100644 --- a/opencl/test/unit_test/mem_obj/image_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image_tests.cpp @@ -27,6 +27,7 @@ #include "opencl/test/unit_test/mocks/mock_context.h" #include "opencl/test/unit_test/mocks/mock_gmm.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "test.h" using namespace NEO; diff --git a/opencl/test/unit_test/mem_obj/mem_obj_destruction_tests.cpp b/opencl/test/unit_test/mem_obj/mem_obj_destruction_tests.cpp index 71e8b84911..6ded351ce6 100644 --- a/opencl/test/unit_test/mem_obj/mem_obj_destruction_tests.cpp +++ b/opencl/test/unit_test/mem_obj/mem_obj_destruction_tests.cpp @@ -19,6 +19,7 @@ #include "opencl/test/unit_test/mocks/mock_context.h" #include "opencl/test/unit_test/mocks/mock_device.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "test.h" using namespace NEO; diff --git a/opencl/test/unit_test/mem_obj/mem_obj_tests.cpp b/opencl/test/unit_test/mem_obj/mem_obj_tests.cpp index 0efb7aaf95..d2e804ddfc 100644 --- a/opencl/test/unit_test/mem_obj/mem_obj_tests.cpp +++ b/opencl/test/unit_test/mem_obj/mem_obj_tests.cpp @@ -22,6 +22,7 @@ #include "opencl/test/unit_test/mocks/mock_device.h" #include "opencl/test/unit_test/mocks/mock_graphics_allocation.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/memory_manager/deferrable_allocation_deletion_tests.cpp b/opencl/test/unit_test/memory_manager/deferrable_allocation_deletion_tests.cpp index d2d4390a8c..ad370ff240 100644 --- a/opencl/test/unit_test/memory_manager/deferrable_allocation_deletion_tests.cpp +++ b/opencl/test/unit_test/memory_manager/deferrable_allocation_deletion_tests.cpp @@ -16,6 +16,7 @@ #include "opencl/test/unit_test/mocks/mock_allocation_properties.h" #include "opencl/test/unit_test/mocks/mock_device.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "test.h" using namespace NEO; diff --git a/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp b/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp index 26b5167d41..400c48a563 100644 --- a/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp +++ b/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp @@ -45,6 +45,7 @@ #include "opencl/test/unit_test/mocks/mock_mdi.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" #include "opencl/test/unit_test/mocks/mock_os_context.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "test.h" #include diff --git a/opencl/test/unit_test/memory_manager/surface_tests.cpp b/opencl/test/unit_test/memory_manager/surface_tests.cpp index a15f94d7d3..cd088638b7 100644 --- a/opencl/test/unit_test/memory_manager/surface_tests.cpp +++ b/opencl/test/unit_test/memory_manager/surface_tests.cpp @@ -13,6 +13,7 @@ #include "opencl/source/platform/platform.h" #include "opencl/test/unit_test/mocks/mock_buffer.h" #include "opencl/test/unit_test/mocks/mock_csr.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "test.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/memory_manager/unified_memory_manager_tests.cpp b/opencl/test/unit_test/memory_manager/unified_memory_manager_tests.cpp index f0f5bd6d29..4ca406819e 100644 --- a/opencl/test/unit_test/memory_manager/unified_memory_manager_tests.cpp +++ b/opencl/test/unit_test/memory_manager/unified_memory_manager_tests.cpp @@ -16,6 +16,7 @@ #include "opencl/test/unit_test/mocks/mock_context.h" #include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "opencl/test/unit_test/mocks/mock_svm_manager.h" #include "test.h" diff --git a/opencl/test/unit_test/mocks/mock_cl_device.cpp b/opencl/test/unit_test/mocks/mock_cl_device.cpp index 972464f869..fb9f2f7fc0 100644 --- a/opencl/test/unit_test/mocks/mock_cl_device.cpp +++ b/opencl/test/unit_test/mocks/mock_cl_device.cpp @@ -8,6 +8,7 @@ #include "opencl/test/unit_test/mocks/mock_cl_device.h" #include "opencl/test/unit_test/mocks/mock_device.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" using namespace NEO; diff --git a/opencl/test/unit_test/mocks/mock_gmm.h b/opencl/test/unit_test/mocks/mock_gmm.h index 2f9f2271f5..bdd6223028 100644 --- a/opencl/test/unit_test/mocks/mock_gmm.h +++ b/opencl/test/unit_test/mocks/mock_gmm.h @@ -13,6 +13,7 @@ #include "opencl/source/mem_obj/image.h" #include "opencl/test/unit_test/mocks/mock_device.h" #include "opencl/test/unit_test/mocks/mock_gmm_resource_info.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" namespace NEO { namespace MockGmmParams { diff --git a/opencl/test/unit_test/mocks/mock_platform.cpp b/opencl/test/unit_test/mocks/mock_platform.cpp index 1106c7ac7e..0e5ccd7219 100644 --- a/opencl/test/unit_test/mocks/mock_platform.cpp +++ b/opencl/test/unit_test/mocks/mock_platform.cpp @@ -20,4 +20,20 @@ bool MockPlatform::initializeWithNewDevices() { executionEnvironment.prepareRootDeviceEnvironments(1u); return Platform::initialize(DeviceFactory::createDevices(executionEnvironment)); } + +Platform *platform() { + if (platformsImpl.empty()) { + return nullptr; + } + return platformsImpl[0].get(); +} + +Platform *constructPlatform() { + static std::mutex mutex; + std::unique_lock lock(mutex); + if (platformsImpl.empty()) { + platformsImpl.push_back(std::make_unique(*(new ExecutionEnvironment()))); + } + return platformsImpl[0].get(); +} } // namespace NEO diff --git a/opencl/test/unit_test/mocks/mock_platform.h b/opencl/test/unit_test/mocks/mock_platform.h index 9a9b93fbc2..7ccc6ec6ee 100644 --- a/opencl/test/unit_test/mocks/mock_platform.h +++ b/opencl/test/unit_test/mocks/mock_platform.h @@ -21,5 +21,9 @@ class MockPlatform : public Platform { bool initializeWithNewDevices(); }; +Platform *platform(); + +Platform *constructPlatform(); + bool initPlatform(); } // namespace NEO diff --git a/opencl/test/unit_test/os_interface/device_factory_tests.cpp b/opencl/test/unit_test/os_interface/device_factory_tests.cpp index 4ec938d879..52c61119ad 100644 --- a/opencl/test/unit_test/os_interface/device_factory_tests.cpp +++ b/opencl/test/unit_test/os_interface/device_factory_tests.cpp @@ -15,6 +15,7 @@ #include "opencl/source/platform/platform.h" #include "opencl/test/unit_test/mocks/mock_execution_environment.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "gtest/gtest.h" #include "hw_device_id.h" diff --git a/opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.h b/opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.h index cc0d4015e3..4dd5522737 100644 --- a/opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.h +++ b/opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.h @@ -14,6 +14,7 @@ #include "opencl/source/platform/platform.h" #include "opencl/test/unit_test/helpers/gtest_helpers.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "drm/i915_drm.h" #include "engine_node.h" diff --git a/opencl/test/unit_test/os_interface/linux/drm_mock.h b/opencl/test/unit_test/os_interface/linux/drm_mock.h index fc8ef9dc93..ca4917f7f3 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_mock.h +++ b/opencl/test/unit_test/os_interface/linux/drm_mock.h @@ -12,6 +12,7 @@ #include "shared/source/os_interface/linux/drm_neo.h" #include "opencl/source/platform/platform.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "drm/i915_drm.h" 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 166c75fc0d..1d2dda46f0 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 @@ -38,6 +38,7 @@ #include "opencl/test/unit_test/mocks/mock_device.h" #include "opencl/test/unit_test/mocks/mock_gmm_page_table_mngr.h" #include "opencl/test/unit_test/mocks/mock_graphics_allocation.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "opencl/test/unit_test/mocks/mock_program.h" #include "opencl/test/unit_test/mocks/mock_submissions_aggregator.h" #include "opencl/test/unit_test/mocks/mock_wddm_interface23.h" diff --git a/opencl/test/unit_test/os_interface/windows/device_os_tests.cpp b/opencl/test/unit_test/os_interface/windows/device_os_tests.cpp index 2e1b4d0fbd..68e7dd9876 100644 --- a/opencl/test/unit_test/os_interface/windows/device_os_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/device_os_tests.cpp @@ -11,6 +11,7 @@ #include "opencl/test/unit_test/mocks/mock_cl_device.h" #include "opencl/test/unit_test/mocks/mock_device.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "gmock/gmock.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/os_interface/windows/file_logger_win_tests.cpp b/opencl/test/unit_test/os_interface/windows/file_logger_win_tests.cpp index 48732f8003..9e3bc91926 100644 --- a/opencl/test/unit_test/os_interface/windows/file_logger_win_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/file_logger_win_tests.cpp @@ -9,6 +9,7 @@ #include "shared/source/gmm_helper/gmm.h" #include "opencl/source/platform/platform.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "opencl/test/unit_test/os_interface/windows/mock_wddm_allocation.h" #include "opencl/test/unit_test/utilities/file_logger_tests.h" #include "test.h" diff --git a/opencl/test/unit_test/os_interface/windows/gl/gl_os_sharing_tests.cpp b/opencl/test/unit_test/os_interface/windows/gl/gl_os_sharing_tests.cpp index c05fbe2086..10748e3914 100644 --- a/opencl/test/unit_test/os_interface/windows/gl/gl_os_sharing_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/gl/gl_os_sharing_tests.cpp @@ -18,6 +18,7 @@ #include "opencl/source/sharings/gl/windows/gl_sharing_windows.h" #include "opencl/test/unit_test/mocks/gl/windows/mock_gl_sharing_windows.h" #include "opencl/test/unit_test/mocks/mock_execution_environment.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "opencl/test/unit_test/os_interface/windows/wddm_fixture.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp index 72a8571dcf..080e378f40 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp @@ -29,6 +29,7 @@ #include "opencl/test/unit_test/mocks/mock_gfx_partition.h" #include "opencl/test/unit_test/mocks/mock_gmm_resource_info.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "opencl/test/unit_test/mocks/mock_wddm_residency_logger.h" #include "opencl/test/unit_test/mocks/mock_wddm_residency_logger_functions.h" #include "opencl/test/unit_test/os_interface/windows/mock_wddm_allocation.h" diff --git a/opencl/test/unit_test/os_interface/windows/wddm23_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm23_tests.cpp index 2222e7e9cd..58854b21a0 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm23_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm23_tests.cpp @@ -15,6 +15,7 @@ #include "shared/test/unit_test/helpers/debug_manager_state_restore.h" #include "opencl/source/platform/platform.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "opencl/test/unit_test/mocks/mock_wddm.h" #include "opencl/test/unit_test/mocks/mock_wddm_interface23.h" #include "opencl/test/unit_test/os_interface/windows/gdi_dll_fixture.h" diff --git a/opencl/test/unit_test/os_interface/windows/wddm_fixture.h b/opencl/test/unit_test/os_interface/windows/wddm_fixture.h index 301388136f..b9df7b3547 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_fixture.h +++ b/opencl/test/unit_test/os_interface/windows/wddm_fixture.h @@ -20,6 +20,7 @@ #include "shared/test/unit_test/os_interface/windows/mock_gdi_interface.h" #include "opencl/source/platform/platform.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "opencl/test/unit_test/mocks/mock_wddm.h" #include "opencl/test/unit_test/mocks/mock_wddm_interface20.h" #include "opencl/test/unit_test/mocks/mock_wddm_residency_allocations_container.h" diff --git a/opencl/test/unit_test/os_interface/windows/wddm_kmdaf_listener_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm_kmdaf_listener_tests.cpp index ac84f99184..4f31c635c1 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_kmdaf_listener_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm_kmdaf_listener_tests.cpp @@ -17,6 +17,7 @@ #include "opencl/source/platform/platform.h" #include "opencl/test/unit_test/mock_gdi/mock_gdi.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "opencl/test/unit_test/os_interface/windows/mock_kmdaf_listener.h" #include "opencl/test/unit_test/os_interface/windows/mock_wddm_allocation.h" #include "test.h" 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 4d41b3a128..a3bfb0a3fa 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 @@ -32,6 +32,7 @@ #include "opencl/test/unit_test/mocks/mock_device.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" #include "opencl/test/unit_test/mocks/mock_os_context.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "opencl/test/unit_test/os_interface/windows/mock_wddm_allocation.h" using namespace NEO; diff --git a/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.h b/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.h index 2d640fa3de..14d6e15585 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.h +++ b/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.h @@ -16,6 +16,7 @@ #include "opencl/test/unit_test/mocks/mock_context.h" #include "opencl/test/unit_test/mocks/mock_gmm.h" #include "opencl/test/unit_test/mocks/mock_gmm_page_table_mngr.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "opencl/test/unit_test/mocks/mock_wddm_residency_allocations_container.h" #include "opencl/test/unit_test/os_interface/windows/mock_wddm_memory_manager.h" #include "opencl/test/unit_test/os_interface/windows/wddm_fixture.h" diff --git a/opencl/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp index f257673d90..081a67a9c3 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp @@ -24,6 +24,7 @@ #include "opencl/test/unit_test/libult/create_command_stream.h" #include "opencl/test/unit_test/mocks/mock_allocation_properties.h" #include "opencl/test/unit_test/mocks/mock_execution_environment.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "opencl/test/unit_test/mocks/mock_wddm.h" #include "opencl/test/unit_test/os_interface/windows/mock_wddm_allocation.h" #include "opencl/test/unit_test/os_interface/windows/mock_wddm_memory_manager.h" diff --git a/opencl/test/unit_test/scenarios/blocked_enqueue_with_callback_scenario_tests.cpp b/opencl/test/unit_test/scenarios/blocked_enqueue_with_callback_scenario_tests.cpp index d6825fbce8..81840cd243 100644 --- a/opencl/test/unit_test/scenarios/blocked_enqueue_with_callback_scenario_tests.cpp +++ b/opencl/test/unit_test/scenarios/blocked_enqueue_with_callback_scenario_tests.cpp @@ -11,6 +11,7 @@ #include "opencl/test/unit_test/fixtures/scenario_test_fixture.h" #include "opencl/test/unit_test/mocks/mock_command_queue.h" #include "opencl/test/unit_test/mocks/mock_kernel.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "test.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/sharings/gl/windows/gl_arb_sync_event_tests.cpp b/opencl/test/unit_test/sharings/gl/windows/gl_arb_sync_event_tests.cpp index 10f1b3a585..2c5f145cf3 100644 --- a/opencl/test/unit_test/sharings/gl/windows/gl_arb_sync_event_tests.cpp +++ b/opencl/test/unit_test/sharings/gl/windows/gl_arb_sync_event_tests.cpp @@ -21,6 +21,7 @@ #include "opencl/test/unit_test/mocks/mock_csr.h" #include "opencl/test/unit_test/mocks/mock_device.h" #include "opencl/test/unit_test/mocks/mock_event.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "test.h" using namespace NEO; diff --git a/opencl/test/unit_test/sharings/gl/windows/gl_sharing_tests.cpp b/opencl/test/unit_test/sharings/gl/windows/gl_sharing_tests.cpp index e7e117f386..e69632372c 100644 --- a/opencl/test/unit_test/sharings/gl/windows/gl_sharing_tests.cpp +++ b/opencl/test/unit_test/sharings/gl/windows/gl_sharing_tests.cpp @@ -35,6 +35,7 @@ #include "opencl/test/unit_test/mocks/mock_event.h" #include "opencl/test/unit_test/mocks/mock_gmm_resource_info.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "test.h" #include "gl/gl_sharing_os.h" diff --git a/opencl/test/unit_test/sharings/gl/windows/gl_texture_tests.cpp b/opencl/test/unit_test/sharings/gl/windows/gl_texture_tests.cpp index 96723b8697..a586705179 100644 --- a/opencl/test/unit_test/sharings/gl/windows/gl_texture_tests.cpp +++ b/opencl/test/unit_test/sharings/gl/windows/gl_texture_tests.cpp @@ -15,6 +15,7 @@ #include "opencl/test/unit_test/mocks/mock_context.h" #include "opencl/test/unit_test/mocks/mock_gmm.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/sharings/sharing_factory_tests.cpp b/opencl/test/unit_test/sharings/sharing_factory_tests.cpp index 1f168e9787..91b327a1ea 100644 --- a/opencl/test/unit_test/sharings/sharing_factory_tests.cpp +++ b/opencl/test/unit_test/sharings/sharing_factory_tests.cpp @@ -19,6 +19,7 @@ #include "opencl/test/unit_test/mocks/mock_cl_device.h" #include "opencl/test/unit_test/mocks/mock_context.h" #include "opencl/test/unit_test/mocks/mock_device.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "opencl/test/unit_test/mocks/mock_sharing_factory.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/sharings/va/context_va_tests.cpp b/opencl/test/unit_test/sharings/va/context_va_tests.cpp index 652c767f3b..6d783403dd 100644 --- a/opencl/test/unit_test/sharings/va/context_va_tests.cpp +++ b/opencl/test/unit_test/sharings/va/context_va_tests.cpp @@ -10,6 +10,7 @@ #include "opencl/source/sharings/va/va_sharing.h" #include "opencl/test/unit_test/fixtures/platform_fixture.h" #include "opencl/test/unit_test/mocks/mock_context.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/sharings/va/va_sharing_tests.cpp b/opencl/test/unit_test/sharings/va/va_sharing_tests.cpp index c37c7b04a0..bb01e843a2 100644 --- a/opencl/test/unit_test/sharings/va/va_sharing_tests.cpp +++ b/opencl/test/unit_test/sharings/va/va_sharing_tests.cpp @@ -20,6 +20,7 @@ #include "opencl/test/unit_test/libult/create_command_stream.h" #include "opencl/test/unit_test/libult/ult_command_stream_receiver.h" #include "opencl/test/unit_test/mocks/mock_context.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "opencl/test/unit_test/sharings/va/mock_va_sharing.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/source_level_debugger/source_level_debugger_device_tests.cpp b/opencl/test/unit_test/source_level_debugger/source_level_debugger_device_tests.cpp index ce8bd9d18f..abdbaf1ccf 100644 --- a/opencl/test/unit_test/source_level_debugger/source_level_debugger_device_tests.cpp +++ b/opencl/test/unit_test/source_level_debugger/source_level_debugger_device_tests.cpp @@ -13,6 +13,7 @@ #include "opencl/test/unit_test/fixtures/device_fixture.h" #include "opencl/test/unit_test/mocks/mock_builtins.h" #include "opencl/test/unit_test/mocks/mock_device.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "opencl/test/unit_test/mocks/mock_source_level_debugger.h" #include "test.h" diff --git a/opencl/test/unit_test/ult_config_listener.cpp b/opencl/test/unit_test/ult_config_listener.cpp index 486bb4b67e..9e3d157329 100644 --- a/opencl/test/unit_test/ult_config_listener.cpp +++ b/opencl/test/unit_test/ult_config_listener.cpp @@ -13,6 +13,7 @@ #include "shared/test/unit_test/helpers/ult_hw_config.h" #include "opencl/source/platform/platform.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" void NEO::UltConfigListener::OnTestStart(const ::testing::TestInfo &testInfo) { referencedHwInfo = *platformDevices[0]; diff --git a/shared/test/unit_test/preemption/preemption_tests.cpp b/shared/test/unit_test/preemption/preemption_tests.cpp index 9d4f628d5a..8c2823365b 100644 --- a/shared/test/unit_test/preemption/preemption_tests.cpp +++ b/shared/test/unit_test/preemption/preemption_tests.cpp @@ -19,6 +19,7 @@ #include "opencl/test/unit_test/mocks/mock_device.h" #include "opencl/test/unit_test/mocks/mock_graphics_allocation.h" #include "opencl/test/unit_test/mocks/mock_kernel.h" +#include "opencl/test/unit_test/mocks/mock_platform.h" #include "gmock/gmock.h"