From 278efbdfe6d3b7cac20f159133a9c4abc65914f1 Mon Sep 17 00:00:00 2001 From: Daria Hinz Date: Wed, 15 Jan 2020 10:03:21 +0100 Subject: [PATCH] Split structures into core and OCL-specific ones Change-Id: I349ed52bcc7ed26eb0ff892acadc456ae285b92e Signed-off-by: Daria Hinz --- core/gen11/enable_family_full_core_gen11.cpp | 25 +++++++++++++++++ .../enable_family_full_core_gen12lp.cpp | 25 +++++++++++++++++ core/gen8/enable_family_full_core_gen8.cpp | 27 +++++++++++++++++++ core/gen9/enable_family_full_core_gen9.cpp | 27 +++++++++++++++++++ runtime/enable_gens.cmake | 3 ++- ...1.cpp => enable_family_full_ocl_gen11.cpp} | 14 +++------- ...cpp => enable_family_full_ocl_gen12lp.cpp} | 14 +++------- ...n8.cpp => enable_family_full_ocl_gen8.cpp} | 14 +++------- ...n9.cpp => enable_family_full_ocl_gen9.cpp} | 14 +++------- unit_tests/libult/CMakeLists.txt | 3 ++- 10 files changed, 124 insertions(+), 42 deletions(-) create mode 100644 core/gen11/enable_family_full_core_gen11.cpp create mode 100644 core/gen12lp/enable_family_full_core_gen12lp.cpp create mode 100644 core/gen8/enable_family_full_core_gen8.cpp create mode 100644 core/gen9/enable_family_full_core_gen9.cpp rename runtime/gen11/{enable_family_full_gen11.cpp => enable_family_full_ocl_gen11.cpp} (75%) rename runtime/gen12lp/{enable_family_full_gen12lp.cpp => enable_family_full_ocl_gen12lp.cpp} (74%) rename runtime/gen8/{enable_family_full_gen8.cpp => enable_family_full_ocl_gen8.cpp} (75%) rename runtime/gen9/{enable_family_full_gen9.cpp => enable_family_full_ocl_gen9.cpp} (75%) diff --git a/core/gen11/enable_family_full_core_gen11.cpp b/core/gen11/enable_family_full_core_gen11.cpp new file mode 100644 index 0000000000..a85f477620 --- /dev/null +++ b/core/gen11/enable_family_full_core_gen11.cpp @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2018-2020 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "core/gen11/hw_cmds.h" +#include "core/helpers/hw_helper.h" + +namespace NEO { + +extern HwHelper *hwHelperFactory[IGFX_MAX_CORE]; + +typedef ICLFamily Family; +static auto gfxFamily = IGFX_GEN11_CORE; + +struct EnableCoreGen11 { + EnableCoreGen11() { + hwHelperFactory[gfxFamily] = &HwHelperHw::get(); + } +}; + +static EnableCoreGen11 enable; +} // namespace NEO diff --git a/core/gen12lp/enable_family_full_core_gen12lp.cpp b/core/gen12lp/enable_family_full_core_gen12lp.cpp new file mode 100644 index 0000000000..fcded4d4bc --- /dev/null +++ b/core/gen12lp/enable_family_full_core_gen12lp.cpp @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2019-2020 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "core/gen12lp/hw_cmds.h" +#include "core/helpers/hw_helper.h" + +namespace NEO { + +extern HwHelper *hwHelperFactory[IGFX_MAX_CORE]; + +typedef TGLLPFamily Family; +static auto gfxFamily = IGFX_GEN12LP_CORE; + +struct EnableCoreGen12LP { + EnableCoreGen12LP() { + hwHelperFactory[gfxFamily] = &HwHelperHw::get(); + } +}; + +static EnableCoreGen12LP enable; +} // namespace NEO diff --git a/core/gen8/enable_family_full_core_gen8.cpp b/core/gen8/enable_family_full_core_gen8.cpp new file mode 100644 index 0000000000..682bfcb405 --- /dev/null +++ b/core/gen8/enable_family_full_core_gen8.cpp @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2017-2020 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "core/gen8/hw_cmds.h" +#include "core/helpers/hw_helper.h" + +#include + +namespace NEO { + +extern HwHelper *hwHelperFactory[IGFX_MAX_CORE]; + +typedef BDWFamily Family; +static const auto gfxFamily = IGFX_GEN8_CORE; + +struct EnableCoreGen8 { + EnableCoreGen8() { + hwHelperFactory[gfxFamily] = &HwHelperHw::get(); + } +}; + +static EnableCoreGen8 enable; +} // namespace NEO diff --git a/core/gen9/enable_family_full_core_gen9.cpp b/core/gen9/enable_family_full_core_gen9.cpp new file mode 100644 index 0000000000..a72e4e8c7b --- /dev/null +++ b/core/gen9/enable_family_full_core_gen9.cpp @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2017-2020 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "core/gen8/hw_cmds.h" +#include "core/helpers/hw_helper.h" + +#include + +namespace NEO { + +extern HwHelper *hwHelperFactory[IGFX_MAX_CORE]; + +typedef SKLFamily Family; +static const auto gfxFamily = IGFX_GEN9_CORE; + +struct EnableCoreGen9 { + EnableCoreGen9() { + hwHelperFactory[gfxFamily] = &HwHelperHw::get(); + } +}; + +static EnableCoreGen9 enable; +} // namespace NEO diff --git a/runtime/enable_gens.cmake b/runtime/enable_gens.cmake index 8bfe592718..25519d8cf0 100644 --- a/runtime/enable_gens.cmake +++ b/runtime/enable_gens.cmake @@ -117,7 +117,8 @@ macro(macro_for_each_gen) list(APPEND RUNTIME_SRCS_${GEN_TYPE}_CPP_WINDOWS ${GENX_PREFIX}/windows/hw_info_config_${GEN_TYPE_LOWER}.cpp) list(APPEND RUNTIME_SRCS_${GEN_TYPE}_CPP_LINUX ${GENX_PREFIX}/linux/hw_info_config_${GEN_TYPE_LOWER}.cpp) - list(APPEND ${GEN_TYPE}_SRC_LINK_BASE ${GENX_PREFIX}/enable_family_full_${GEN_TYPE_LOWER}.cpp) + list(APPEND ${GEN_TYPE}_SRC_LINK_BASE ${GENX_PREFIX}/enable_family_full_ocl_${GEN_TYPE_LOWER}.cpp) + list(APPEND ${GEN_TYPE}_SRC_LINK_BASE ${CORE_GENX_PREFIX}/enable_family_full_core_${GEN_TYPE_LOWER}.cpp) list(APPEND ${GEN_TYPE}_SRC_LINK_BASE ${CORE_GENX_PREFIX}/enable_hw_info_config_${GEN_TYPE_LOWER}.cpp) list(APPEND ${GEN_TYPE}_SRC_LINK_BASE ${CORE_GENX_PREFIX}/enable_${GEN_TYPE_LOWER}.cpp) diff --git a/runtime/gen11/enable_family_full_gen11.cpp b/runtime/gen11/enable_family_full_ocl_gen11.cpp similarity index 75% rename from runtime/gen11/enable_family_full_gen11.cpp rename to runtime/gen11/enable_family_full_ocl_gen11.cpp index 95dd7116ee..c997e1f5bb 100644 --- a/runtime/gen11/enable_family_full_gen11.cpp +++ b/runtime/gen11/enable_family_full_ocl_gen11.cpp @@ -1,11 +1,10 @@ /* - * Copyright (C) 2018-2019 Intel Corporation + * Copyright (C) 2018-2020 Intel Corporation * * SPDX-License-Identifier: MIT * */ -#include "core/gen11/hw_cmds.h" #include "runtime/command_queue/command_queue_hw.h" #include "runtime/command_stream/aub_command_stream_receiver_hw.h" #include "runtime/command_stream/command_stream_receiver_hw.h" @@ -15,20 +14,16 @@ #ifdef HAVE_INSTRUMENTATION #include "runtime/event/perf_counter.h" #endif -#include "core/helpers/hw_helper.h" #include "runtime/mem_obj/buffer.h" #include "runtime/mem_obj/image.h" #include "runtime/sampler/sampler.h" namespace NEO { -extern HwHelper *hwHelperFactory[IGFX_MAX_CORE]; - typedef ICLFamily Family; -static auto gfxFamily = IGFX_GEN11_CORE; -struct EnableGen11 { - EnableGen11() { +struct EnableOCLGen11 { + EnableOCLGen11() { populateFactoryTable>(); populateFactoryTable>(); populateFactoryTable>(); @@ -37,9 +32,8 @@ struct EnableGen11 { populateFactoryTable>(); populateFactoryTable>(); populateFactoryTable>(); - hwHelperFactory[gfxFamily] = &HwHelperHw::get(); } }; -static EnableGen11 enable; +static EnableOCLGen11 enable; } // namespace NEO diff --git a/runtime/gen12lp/enable_family_full_gen12lp.cpp b/runtime/gen12lp/enable_family_full_ocl_gen12lp.cpp similarity index 74% rename from runtime/gen12lp/enable_family_full_gen12lp.cpp rename to runtime/gen12lp/enable_family_full_ocl_gen12lp.cpp index 2b7956d738..a3f992b0f8 100644 --- a/runtime/gen12lp/enable_family_full_gen12lp.cpp +++ b/runtime/gen12lp/enable_family_full_ocl_gen12lp.cpp @@ -1,12 +1,10 @@ /* - * Copyright (C) 2019 Intel Corporation + * Copyright (C) 2019-2020 Intel Corporation * * SPDX-License-Identifier: MIT * */ -#include "core/gen12lp/hw_cmds.h" -#include "core/helpers/hw_helper.h" #include "runtime/command_queue/command_queue_hw.h" #include "runtime/command_stream/aub_command_stream_receiver_hw.h" #include "runtime/command_stream/command_stream_receiver_hw.h" @@ -18,13 +16,10 @@ namespace NEO { -extern HwHelper *hwHelperFactory[IGFX_MAX_CORE]; - typedef TGLLPFamily Family; -static auto gfxFamily = IGFX_GEN12LP_CORE; -struct EnableGen12LP { - EnableGen12LP() { +struct EnableOCLGen12LP { + EnableOCLGen12LP() { populateFactoryTable>(); populateFactoryTable>(); populateFactoryTable>(); @@ -33,9 +28,8 @@ struct EnableGen12LP { populateFactoryTable>(); populateFactoryTable>(); populateFactoryTable>(); - hwHelperFactory[gfxFamily] = &HwHelperHw::get(); } }; -static EnableGen12LP enable; +static EnableOCLGen12LP enable; } // namespace NEO diff --git a/runtime/gen8/enable_family_full_gen8.cpp b/runtime/gen8/enable_family_full_ocl_gen8.cpp similarity index 75% rename from runtime/gen8/enable_family_full_gen8.cpp rename to runtime/gen8/enable_family_full_ocl_gen8.cpp index a850be93d0..2dd7597bde 100644 --- a/runtime/gen8/enable_family_full_gen8.cpp +++ b/runtime/gen8/enable_family_full_ocl_gen8.cpp @@ -1,12 +1,10 @@ /* - * Copyright (C) 2017-2019 Intel Corporation + * Copyright (C) 2017-2020 Intel Corporation * * SPDX-License-Identifier: MIT * */ -#include "core/gen8/hw_cmds.h" -#include "core/helpers/hw_helper.h" #include "runtime/command_queue/command_queue_hw.h" #include "runtime/command_stream/aub_command_stream_receiver_hw.h" #include "runtime/command_stream/command_stream_receiver_hw.h" @@ -21,13 +19,10 @@ namespace NEO { -extern HwHelper *hwHelperFactory[IGFX_MAX_CORE]; - typedef BDWFamily Family; -static const auto gfxFamily = IGFX_GEN8_CORE; -struct EnableGen8 { - EnableGen8() { +struct EnableOCLGen8 { + EnableOCLGen8() { populateFactoryTable>(); populateFactoryTable>(); populateFactoryTable>(); @@ -36,9 +31,8 @@ struct EnableGen8 { populateFactoryTable>(); populateFactoryTable>(); populateFactoryTable>(); - hwHelperFactory[gfxFamily] = &HwHelperHw::get(); } }; -static EnableGen8 enable; +static EnableOCLGen8 enable; } // namespace NEO diff --git a/runtime/gen9/enable_family_full_gen9.cpp b/runtime/gen9/enable_family_full_ocl_gen9.cpp similarity index 75% rename from runtime/gen9/enable_family_full_gen9.cpp rename to runtime/gen9/enable_family_full_ocl_gen9.cpp index 8054c7f213..855e3ed99a 100644 --- a/runtime/gen9/enable_family_full_gen9.cpp +++ b/runtime/gen9/enable_family_full_ocl_gen9.cpp @@ -1,12 +1,10 @@ /* - * Copyright (C) 2017-2019 Intel Corporation + * Copyright (C) 2017-2020 Intel Corporation * * SPDX-License-Identifier: MIT * */ -#include "core/gen8/hw_cmds.h" -#include "core/helpers/hw_helper.h" #include "runtime/command_queue/command_queue_hw.h" #include "runtime/command_stream/aub_command_stream_receiver_hw.h" #include "runtime/command_stream/command_stream_receiver_hw.h" @@ -21,13 +19,10 @@ namespace NEO { -extern HwHelper *hwHelperFactory[IGFX_MAX_CORE]; - typedef SKLFamily Family; -static const auto gfxFamily = IGFX_GEN9_CORE; -struct EnableGen9 { - EnableGen9() { +struct EnableOCLGen9 { + EnableOCLGen9() { populateFactoryTable>(); populateFactoryTable>(); populateFactoryTable>(); @@ -36,9 +31,8 @@ struct EnableGen9 { populateFactoryTable>(); populateFactoryTable>(); populateFactoryTable>(); - hwHelperFactory[gfxFamily] = &HwHelperHw::get(); } }; -static EnableGen9 enable; +static EnableOCLGen9 enable; } // namespace NEO diff --git a/unit_tests/libult/CMakeLists.txt b/unit_tests/libult/CMakeLists.txt index 16bcb84d34..c204dcd4d9 100644 --- a/unit_tests/libult/CMakeLists.txt +++ b/unit_tests/libult/CMakeLists.txt @@ -10,7 +10,8 @@ macro(macro_for_each_gen) ${NEO_SOURCE_DIR}/core/unit_tests/libult/${GEN_TYPE_LOWER}.cpp ${NEO_SOURCE_DIR}/core/${GEN_TYPE_LOWER}/enable_hw_info_config_${GEN_TYPE_LOWER}.cpp ${NEO_SOURCE_DIR}/core/${GEN_TYPE_LOWER}/enable_${GEN_TYPE_LOWER}.cpp - ${NEO_SOURCE_DIR}/runtime/${GEN_TYPE_LOWER}/enable_family_full_${GEN_TYPE_LOWER}.cpp + ${NEO_SOURCE_DIR}/core/${GEN_TYPE_LOWER}/enable_family_full_core_${GEN_TYPE_LOWER}.cpp + ${NEO_SOURCE_DIR}/runtime/${GEN_TYPE_LOWER}/enable_family_full_ocl_${GEN_TYPE_LOWER}.cpp ) if(EXISTS "${NEO_SOURCE_DIR}/core/unit_tests/${GEN_TYPE_LOWER}/cmd_parse${BRANCH_DIR_SUFFIX}/cmd_parse_${GEN_TYPE_LOWER}.inl")