From 2e95ef42ae4b561d22305216391c508d8c7fba17 Mon Sep 17 00:00:00 2001 From: Mateusz Hoppe Date: Fri, 17 Jan 2020 15:14:52 +0100 Subject: [PATCH] Move thread_arbitration_policy.h to core - extract QueueThrottle to core Change-Id: I954732a44ae4fdd5f227ec6be4e27b879ca6eece Signed-off-by: Mateusz Hoppe --- core/command_stream/CMakeLists.txt | 3 ++- core/command_stream/queue_throttle.h | 17 +++++++++++++++++ .../command_stream/thread_arbitration_policy.h | 0 core/unit_tests/gen8/test_preamble_gen8.cpp | 4 ++-- core/unit_tests/gen9/skl/test_preamble_skl.cpp | 4 ++-- runtime/command_stream/CMakeLists.txt | 1 - .../command_stream/command_stream_receiver.h | 2 +- runtime/command_stream/csr_definitions.h | 6 +++--- runtime/gen9/reg_configs.h | 4 ++-- runtime/helpers/properties_helper.h | 9 ++------- runtime/kernel/kernel.h | 2 +- .../thread_arbitration_policy_helper.cpp | 2 +- 12 files changed, 33 insertions(+), 21 deletions(-) create mode 100644 core/command_stream/queue_throttle.h rename {runtime => core}/command_stream/thread_arbitration_policy.h (100%) diff --git a/core/command_stream/CMakeLists.txt b/core/command_stream/CMakeLists.txt index 6ef411348e..e341228f9e 100644 --- a/core/command_stream/CMakeLists.txt +++ b/core/command_stream/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2019 Intel Corporation +# Copyright (C) 2019-2020 Intel Corporation # # SPDX-License-Identifier: MIT # @@ -12,6 +12,7 @@ set(NEO_CORE_COMMAND_STREAM ${CMAKE_CURRENT_SOURCE_DIR}/preemption.cpp ${CMAKE_CURRENT_SOURCE_DIR}/preemption.h ${CMAKE_CURRENT_SOURCE_DIR}/preemption.inl + ${CMAKE_CURRENT_SOURCE_DIR}/thread_arbitration_policy.h ) set_property(GLOBAL PROPERTY NEO_CORE_COMMAND_STREAM ${NEO_CORE_COMMAND_STREAM}) diff --git a/core/command_stream/queue_throttle.h b/core/command_stream/queue_throttle.h new file mode 100644 index 0000000000..1808d04c3a --- /dev/null +++ b/core/command_stream/queue_throttle.h @@ -0,0 +1,17 @@ +/* + * Copyright (C) 2020 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#pragma once +#include + +namespace NEO { +enum QueueThrottle : uint32_t { + LOW, + MEDIUM, + HIGH +}; +} // namespace NEO diff --git a/runtime/command_stream/thread_arbitration_policy.h b/core/command_stream/thread_arbitration_policy.h similarity index 100% rename from runtime/command_stream/thread_arbitration_policy.h rename to core/command_stream/thread_arbitration_policy.h diff --git a/core/unit_tests/gen8/test_preamble_gen8.cpp b/core/unit_tests/gen8/test_preamble_gen8.cpp index 8eb2e2b25d..6d9a241e7d 100644 --- a/core/unit_tests/gen8/test_preamble_gen8.cpp +++ b/core/unit_tests/gen8/test_preamble_gen8.cpp @@ -1,14 +1,14 @@ /* - * Copyright (C) 2018-2019 Intel Corporation + * Copyright (C) 2018-2020 Intel Corporation * * SPDX-License-Identifier: MIT * */ +#include "core/command_stream/thread_arbitration_policy.h" #include "core/helpers/options.h" #include "core/helpers/preamble.h" #include "core/unit_tests/preamble/preamble_fixture.h" -#include "runtime/command_stream/thread_arbitration_policy.h" #include "runtime/gen8/reg_configs.h" #include "unit_tests/fixtures/platform_fixture.h" diff --git a/core/unit_tests/gen9/skl/test_preamble_skl.cpp b/core/unit_tests/gen9/skl/test_preamble_skl.cpp index 2bbdb444ad..d849f127be 100644 --- a/core/unit_tests/gen9/skl/test_preamble_skl.cpp +++ b/core/unit_tests/gen9/skl/test_preamble_skl.cpp @@ -1,15 +1,15 @@ /* - * Copyright (C) 2018-2019 Intel Corporation + * Copyright (C) 2018-2020 Intel Corporation * * SPDX-License-Identifier: MIT * */ #include "core/command_stream/preemption.h" +#include "core/command_stream/thread_arbitration_policy.h" #include "core/helpers/preamble.h" #include "core/unit_tests/helpers/debug_manager_state_restore.h" #include "core/unit_tests/preamble/preamble_fixture.h" -#include "runtime/command_stream/thread_arbitration_policy.h" #include "runtime/gen9/reg_configs.h" #include "unit_tests/gen_common/gen_cmd_parse.h" diff --git a/runtime/command_stream/CMakeLists.txt b/runtime/command_stream/CMakeLists.txt index c92fec5f8a..e71a7846c7 100644 --- a/runtime/command_stream/CMakeLists.txt +++ b/runtime/command_stream/CMakeLists.txt @@ -45,7 +45,6 @@ set(RUNTIME_SRCS_COMMAND_STREAM ${CMAKE_CURRENT_SOURCE_DIR}/tbx_command_stream_receiver_hw.h ${CMAKE_CURRENT_SOURCE_DIR}/tbx_command_stream_receiver_hw.inl ${CMAKE_CURRENT_SOURCE_DIR}/tbx_stream.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/thread_arbitration_policy.h ${CMAKE_CURRENT_SOURCE_DIR}/definitions${BRANCH_DIR_SUFFIX}/command_stream_receiver_hw_ext.inl ) diff --git a/runtime/command_stream/command_stream_receiver.h b/runtime/command_stream/command_stream_receiver.h index c65f3166c0..685f2dd87c 100644 --- a/runtime/command_stream/command_stream_receiver.h +++ b/runtime/command_stream/command_stream_receiver.h @@ -7,6 +7,7 @@ #pragma once #include "core/command_stream/linear_stream.h" +#include "core/command_stream/thread_arbitration_policy.h" #include "core/helpers/aligned_memory.h" #include "core/helpers/completion_stamp.h" #include "core/helpers/options.h" @@ -15,7 +16,6 @@ #include "runtime/command_stream/aub_subcapture.h" #include "runtime/command_stream/csr_definitions.h" #include "runtime/command_stream/submissions_aggregator.h" -#include "runtime/command_stream/thread_arbitration_policy.h" #include "runtime/helpers/blit_commands_helper.h" #include "runtime/helpers/flat_batch_buffer_helper.h" diff --git a/runtime/command_stream/csr_definitions.h b/runtime/command_stream/csr_definitions.h index bb3689dde7..0134e6005e 100644 --- a/runtime/command_stream/csr_definitions.h +++ b/runtime/command_stream/csr_definitions.h @@ -1,18 +1,18 @@ /* - * Copyright (C) 2017-2019 Intel Corporation + * Copyright (C) 2017-2020 Intel Corporation * * SPDX-License-Identifier: MIT * */ #pragma once +#include "core/command_stream/queue_throttle.h" +#include "core/command_stream/thread_arbitration_policy.h" #include "core/helpers/hw_info.h" #include "core/helpers/pipeline_select_args.h" #include "core/kernel/grf_config.h" #include "core/memory_manager/memory_constants.h" -#include "runtime/command_stream/thread_arbitration_policy.h" #include "runtime/helpers/csr_deps.h" -#include "runtime/helpers/properties_helper.h" #include diff --git a/runtime/gen9/reg_configs.h b/runtime/gen9/reg_configs.h index f2b2497c6d..9f9135cc45 100644 --- a/runtime/gen9/reg_configs.h +++ b/runtime/gen9/reg_configs.h @@ -1,13 +1,13 @@ /* - * Copyright (C) 2018-2019 Intel Corporation + * Copyright (C) 2018-2020 Intel Corporation * * SPDX-License-Identifier: MIT * */ #pragma once +#include "core/command_stream/thread_arbitration_policy.h" #include "core/helpers/preamble.h" -#include "runtime/command_stream/thread_arbitration_policy.h" namespace NEO { struct SKLFamily; diff --git a/runtime/helpers/properties_helper.h b/runtime/helpers/properties_helper.h index d445b8cdd1..343a68f1af 100644 --- a/runtime/helpers/properties_helper.h +++ b/runtime/helpers/properties_helper.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2019 Intel Corporation + * Copyright (C) 2018-2020 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -7,6 +7,7 @@ #pragma once +#include "core/command_stream/queue_throttle.h" #include "runtime/api/cl_types.h" #include @@ -16,12 +17,6 @@ namespace NEO { class MemObj; class Buffer; -enum QueueThrottle : uint32_t { - LOW, - MEDIUM, - HIGH -}; - struct EventsRequest { EventsRequest() = delete; diff --git a/runtime/kernel/kernel.h b/runtime/kernel/kernel.h index fdc236c97e..298790f6f1 100644 --- a/runtime/kernel/kernel.h +++ b/runtime/kernel/kernel.h @@ -6,6 +6,7 @@ */ #pragma once +#include "core/command_stream/thread_arbitration_policy.h" #include "core/debug_settings/debug_settings_manager.h" #include "core/helpers/address_patch.h" #include "core/helpers/preamble.h" @@ -14,7 +15,6 @@ #include "public/cl_ext_private.h" #include "runtime/api/cl_types.h" #include "runtime/command_stream/command_stream_receiver_hw.h" -#include "runtime/command_stream/thread_arbitration_policy.h" #include "runtime/device_queue/device_queue.h" #include "runtime/helpers/base_object.h" #include "runtime/helpers/properties_helper.h" diff --git a/unit_tests/command_stream/thread_arbitration_policy_helper.cpp b/unit_tests/command_stream/thread_arbitration_policy_helper.cpp index 7465c8661f..9f833985b6 100644 --- a/unit_tests/command_stream/thread_arbitration_policy_helper.cpp +++ b/unit_tests/command_stream/thread_arbitration_policy_helper.cpp @@ -5,8 +5,8 @@ * */ +#include "core/command_stream/thread_arbitration_policy.h" #include "public/cl_ext_private.h" -#include "runtime/command_stream/thread_arbitration_policy.h" #include namespace NEO {