diff --git a/opencl/source/enable_gens.cmake b/opencl/source/enable_gens.cmake index d0cc03e8c4..b2967d7784 100644 --- a/opencl/source/enable_gens.cmake +++ b/opencl/source/enable_gens.cmake @@ -26,7 +26,6 @@ set(RUNTIME_SRCS_GENX_CPP_BASE experimental_command_buffer gpgpu_walker hardware_commands_helper - hw_helper hw_info image sampler diff --git a/opencl/source/gen11/aub_mem_dump_gen11.cpp b/opencl/source/gen11/aub_mem_dump_gen11.cpp index 2a8560f8bd..1320b3a983 100644 --- a/opencl/source/gen11/aub_mem_dump_gen11.cpp +++ b/opencl/source/gen11/aub_mem_dump_gen11.cpp @@ -8,6 +8,7 @@ #include "shared/source/helpers/completion_stamp.h" #include "shared/source/helpers/hw_helper.h" +#include "opencl/source/aub/aub_helper_bdw_plus.inl" #include "opencl/source/aub_mem_dump/aub_alloc_dump.inl" #include "opencl/source/aub_mem_dump/aub_mem_dump.inl" @@ -80,6 +81,8 @@ const MMIOList *AUBFamilyMapper::perEngineMMIO[aub_stream::NUM_ENGINES] &mmioListBCS, &mmioListVCS, &mmioListVECS}; + +template class AubHelperHw; } // namespace NEO namespace AubAllocDump { diff --git a/opencl/source/gen12lp/additional_files_gen12lp.cmake b/opencl/source/gen12lp/additional_files_gen12lp.cmake index d2fb4ca3c5..06d3b52287 100644 --- a/opencl/source/gen12lp/additional_files_gen12lp.cmake +++ b/opencl/source/gen12lp/additional_files_gen12lp.cmake @@ -5,10 +5,8 @@ # set(RUNTIME_SRCS_ADDITIONAL_FILES_GEN12LP - ${CMAKE_CURRENT_SOURCE_DIR}/gen12lp/helpers_gen12lp.h ${CMAKE_CURRENT_SOURCE_DIR}/gen12lp/definitions${BRANCH_DIR_SUFFIX}/command_queue_helpers_gen12lp.inl ${CMAKE_CURRENT_SOURCE_DIR}/gen12lp/definitions${BRANCH_DIR_SUFFIX}/hardware_commands_helper_gen12lp.inl - ${CMAKE_CURRENT_SOURCE_DIR}/gen12lp${BRANCH_DIR_SUFFIX}/helpers_gen12lp.cpp ) include_directories(${NEO_SOURCE_DIR}/opencl/source/gen12lp/definitions${BRANCH_DIR_SUFFIX}/) diff --git a/opencl/source/gen12lp/aub_mem_dump_gen12lp.cpp b/opencl/source/gen12lp/aub_mem_dump_gen12lp.cpp index d5d5ee5d44..0dfb51b974 100644 --- a/opencl/source/gen12lp/aub_mem_dump_gen12lp.cpp +++ b/opencl/source/gen12lp/aub_mem_dump_gen12lp.cpp @@ -8,6 +8,7 @@ #include "shared/source/helpers/completion_stamp.h" #include "shared/source/helpers/hw_helper.h" +#include "opencl/source/aub/aub_helper_bdw_plus.inl" #include "opencl/source/aub_mem_dump/aub_alloc_dump.inl" #include "opencl/source/aub_mem_dump/aub_mem_dump.inl" @@ -235,6 +236,8 @@ const MMIOList *AUBFamilyMapper::perEngineMMIO[aub_stream::NUM_ENGINES] &mmioListVCS, &mmioListVECS, &mmioListCCS}; + +template class AubHelperHw; } // namespace NEO namespace AubAllocDump { diff --git a/opencl/source/gen12lp/command_stream_receiver_simulated_common_hw_gen12lp.cpp b/opencl/source/gen12lp/command_stream_receiver_simulated_common_hw_gen12lp.cpp index e9f545a6e0..d69e93724f 100644 --- a/opencl/source/gen12lp/command_stream_receiver_simulated_common_hw_gen12lp.cpp +++ b/opencl/source/gen12lp/command_stream_receiver_simulated_common_hw_gen12lp.cpp @@ -5,8 +5,9 @@ * */ +#include "shared/source/gen12lp/helpers_gen12lp.h" + #include "opencl/source/command_stream/command_stream_receiver_simulated_common_hw_bdw_plus.inl" -#include "opencl/source/gen12lp/helpers_gen12lp.h" namespace NEO { typedef TGLLPFamily Family; diff --git a/opencl/source/gen12lp/hardware_commands_helper_gen12lp.cpp b/opencl/source/gen12lp/hardware_commands_helper_gen12lp.cpp index 9a567b94f5..b7a313b7ff 100644 --- a/opencl/source/gen12lp/hardware_commands_helper_gen12lp.cpp +++ b/opencl/source/gen12lp/hardware_commands_helper_gen12lp.cpp @@ -7,10 +7,10 @@ #include "hardware_commands_helper_gen12lp.inl" +#include "shared/source/gen12lp/helpers_gen12lp.h" #include "shared/source/gen12lp/hw_cmds.h" #include "opencl/source/command_queue/command_queue.h" -#include "opencl/source/gen12lp/helpers_gen12lp.h" #include "opencl/source/helpers/hardware_commands_helper.h" #include "opencl/source/helpers/hardware_commands_helper_base.inl" #include "opencl/source/helpers/hardware_commands_helper_bdw_plus.inl" diff --git a/opencl/source/gen12lp/image_gen12lp.cpp b/opencl/source/gen12lp/image_gen12lp.cpp index c964584a2b..12190c6a59 100644 --- a/opencl/source/gen12lp/image_gen12lp.cpp +++ b/opencl/source/gen12lp/image_gen12lp.cpp @@ -5,9 +5,9 @@ * */ +#include "shared/source/gen12lp/helpers_gen12lp.h" #include "shared/source/gen12lp/hw_cmds.h" -#include "opencl/source/gen12lp/helpers_gen12lp.h" #include "opencl/source/mem_obj/image.h" #include "opencl/source/mem_obj/image.inl" diff --git a/opencl/source/gen8/aub_mem_dump_gen8.cpp b/opencl/source/gen8/aub_mem_dump_gen8.cpp index 83910decd0..bceae303cc 100644 --- a/opencl/source/gen8/aub_mem_dump_gen8.cpp +++ b/opencl/source/gen8/aub_mem_dump_gen8.cpp @@ -7,6 +7,7 @@ #include "shared/source/helpers/hw_helper.h" +#include "opencl/source/aub/aub_helper_bdw_plus.inl" #include "opencl/source/aub_mem_dump/aub_alloc_dump.inl" #include "opencl/source/aub_mem_dump/aub_mem_dump.inl" @@ -64,6 +65,8 @@ const MMIOList *AUBFamilyMapper::perEngineMMIO[aub_stream::NUM_ENGINES] &mmioListBCS, &mmioListVCS, &mmioListVECS}; + +template class AubHelperHw; } // namespace NEO namespace AubAllocDump { diff --git a/opencl/source/gen9/aub_mem_dump_gen9.cpp b/opencl/source/gen9/aub_mem_dump_gen9.cpp index a8ba4258c3..d807bd1560 100644 --- a/opencl/source/gen9/aub_mem_dump_gen9.cpp +++ b/opencl/source/gen9/aub_mem_dump_gen9.cpp @@ -7,6 +7,7 @@ #include "shared/source/helpers/hw_helper.h" +#include "opencl/source/aub/aub_helper_bdw_plus.inl" #include "opencl/source/aub_mem_dump/aub_alloc_dump.inl" #include "opencl/source/aub_mem_dump/aub_mem_dump.inl" @@ -77,6 +78,7 @@ const MMIOList *AUBFamilyMapper::perEngineMMIO[aub_stream::NUM_ENGINES] &mmioListVCS, &mmioListVECS}; +template class AubHelperHw; } // namespace NEO namespace AubAllocDump { diff --git a/opencl/test/unit_test/gen12lp/coherency_tests_gen12lp.inl b/opencl/test/unit_test/gen12lp/coherency_tests_gen12lp.inl index 1894a7e0c5..3623a7d2a4 100644 --- a/opencl/test/unit_test/gen12lp/coherency_tests_gen12lp.inl +++ b/opencl/test/unit_test/gen12lp/coherency_tests_gen12lp.inl @@ -6,12 +6,12 @@ */ #include "shared/source/command_stream/command_stream_receiver_hw.h" +#include "shared/source/gen12lp/helpers_gen12lp.h" #include "shared/source/helpers/hw_helper.h" #include "shared/source/helpers/ptr_math.h" #include "shared/test/unit_test/cmd_parse/hw_parse.h" #include "shared/test/unit_test/mocks/mock_device.h" -#include "opencl/source/gen12lp/helpers_gen12lp.h" #include "opencl/source/helpers/hardware_commands_helper.h" #include "test.h" diff --git a/shared/source/CMakeLists.txt b/shared/source/CMakeLists.txt index a1bba1b188..7b8272f3f6 100644 --- a/shared/source/CMakeLists.txt +++ b/shared/source/CMakeLists.txt @@ -65,6 +65,14 @@ else() list(APPEND CORE_SOURCES ${CORE_SRCS_GENX_ALL_LINUX}) endif() +macro(macro_for_each_gen) + append_sources_from_properties(CORE_SOURCES + SHARED_SRCS_ADDITIONAL_FILES_${GEN_TYPE} + ) +endmacro() + +apply_macro_for_each_gen("SUPPORTED") + append_sources_from_properties(CORE_SOURCES NEO_CORE_BUILT_INS NEO_CORE_COMMAND_STREAM diff --git a/shared/source/enable_gens.cmake b/shared/source/enable_gens.cmake index 848869b38a..7414d39c35 100644 --- a/shared/source/enable_gens.cmake +++ b/shared/source/enable_gens.cmake @@ -13,6 +13,7 @@ set(CORE_SRCS_GENX_H_BASE set(CORE_RUNTIME_SRCS_GENX_CPP_BASE command_encoder command_stream_receiver_hw + hw_helper preamble preemption ) diff --git a/opencl/source/gen11/hw_helper_gen11.cpp b/shared/source/gen11/hw_helper_gen11.cpp similarity index 89% rename from opencl/source/gen11/hw_helper_gen11.cpp rename to shared/source/gen11/hw_helper_gen11.cpp index 8c46fb13ff..76844eded5 100644 --- a/opencl/source/gen11/hw_helper_gen11.cpp +++ b/shared/source/gen11/hw_helper_gen11.cpp @@ -8,8 +8,6 @@ #include "shared/source/helpers/flat_batch_buffer_helper_hw.inl" #include "shared/source/helpers/hw_helper_bdw_plus.inl" -#include "opencl/source/aub/aub_helper_bdw_plus.inl" - namespace NEO { typedef ICLFamily Family; @@ -23,7 +21,6 @@ std::string HwHelperHw::getExtensions() const { return "cl_intel_subgroup_local_block_io "; } -template class AubHelperHw; template class HwHelperHw; template class FlatBatchBufferHelperHw; template struct MemorySynchronizationCommands; diff --git a/shared/source/gen12lp/CMakeLists.txt b/shared/source/gen12lp/CMakeLists.txt new file mode 100644 index 0000000000..8a2352bc80 --- /dev/null +++ b/shared/source/gen12lp/CMakeLists.txt @@ -0,0 +1,12 @@ +# +# Copyright (C) 2020 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +set(SHARED_SRCS_ADDITIONAL_FILES_GEN12LP + ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/helpers_gen12lp.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/helpers_gen12lp.h +) + +set_property(GLOBAL PROPERTY SHARED_SRCS_ADDITIONAL_FILES_GEN12LP ${SHARED_SRCS_ADDITIONAL_FILES_GEN12LP}) \ No newline at end of file diff --git a/opencl/source/gen12lp/helpers_gen12lp.cpp b/shared/source/gen12lp/helpers_gen12lp.cpp similarity index 92% rename from opencl/source/gen12lp/helpers_gen12lp.cpp rename to shared/source/gen12lp/helpers_gen12lp.cpp index f9a336b937..5e898f7a2c 100644 --- a/opencl/source/gen12lp/helpers_gen12lp.cpp +++ b/shared/source/gen12lp/helpers_gen12lp.cpp @@ -5,12 +5,10 @@ * */ -#include "opencl/source/gen12lp/helpers_gen12lp.h" +#include "shared/source/gen12lp/helpers_gen12lp.h" #include "shared/source/command_stream/command_stream_receiver.h" -#include "opencl/source/command_stream/command_stream_receiver_simulated_common_hw.h" - namespace NEO { namespace Gen12LPHelpers { diff --git a/opencl/source/gen12lp/helpers_gen12lp.h b/shared/source/gen12lp/helpers_gen12lp.h similarity index 100% rename from opencl/source/gen12lp/helpers_gen12lp.h rename to shared/source/gen12lp/helpers_gen12lp.h diff --git a/opencl/source/gen12lp/hw_helper_gen12lp.cpp b/shared/source/gen12lp/hw_helper_gen12lp.cpp similarity index 97% rename from opencl/source/gen12lp/hw_helper_gen12lp.cpp rename to shared/source/gen12lp/hw_helper_gen12lp.cpp index 632a73b57f..0a9243544a 100644 --- a/opencl/source/gen12lp/hw_helper_gen12lp.cpp +++ b/shared/source/gen12lp/hw_helper_gen12lp.cpp @@ -9,13 +9,11 @@ using Family = NEO::TGLLPFamily; +#include "shared/source/gen12lp/helpers_gen12lp.h" #include "shared/source/helpers/flat_batch_buffer_helper_hw.inl" #include "shared/source/helpers/hw_helper_bdw_plus.inl" #include "shared/source/helpers/hw_helper_tgllp_plus.inl" -#include "opencl/source/aub/aub_helper_bdw_plus.inl" -#include "opencl/source/gen12lp/helpers_gen12lp.h" - #include "engine_node.h" namespace NEO { @@ -172,7 +170,6 @@ void MemorySynchronizationCommands::setCacheFlushExtraProperties(Family: pipeControl.setConstantCacheInvalidationEnable(false); } -template class AubHelperHw; template class HwHelperHw; template class FlatBatchBufferHelperHw; template struct MemorySynchronizationCommands; diff --git a/shared/source/gen12lp/preamble_gen12lp.cpp b/shared/source/gen12lp/preamble_gen12lp.cpp index 19df21129b..4325890828 100644 --- a/shared/source/gen12lp/preamble_gen12lp.cpp +++ b/shared/source/gen12lp/preamble_gen12lp.cpp @@ -6,10 +6,10 @@ */ #include "shared/source/command_stream/csr_definitions.h" +#include "shared/source/gen12lp/helpers_gen12lp.h" #include "shared/source/helpers/engine_node_helper.h" #include "shared/source/helpers/preamble_bdw_plus.inl" -#include "opencl/source/gen12lp/helpers_gen12lp.h" #include "opencl/source/helpers/hardware_commands_helper.h" #include "pipe_control_args.h" diff --git a/opencl/source/gen8/hw_helper_gen8.cpp b/shared/source/gen8/hw_helper_gen8.cpp similarity index 93% rename from opencl/source/gen8/hw_helper_gen8.cpp rename to shared/source/gen8/hw_helper_gen8.cpp index 193f54fb83..1c9518c55d 100644 --- a/opencl/source/gen8/hw_helper_gen8.cpp +++ b/shared/source/gen8/hw_helper_gen8.cpp @@ -9,8 +9,6 @@ #include "shared/source/helpers/flat_batch_buffer_helper_hw.inl" #include "shared/source/helpers/hw_helper_bdw_plus.inl" -#include "opencl/source/aub/aub_helper_bdw_plus.inl" - namespace NEO { typedef BDWFamily Family; @@ -36,7 +34,6 @@ void MemorySynchronizationCommands::addPipeControl(LinearStream &command *cmdBuffer = cmd; } -template class AubHelperHw; template class HwHelperHw; template class FlatBatchBufferHelperHw; template struct MemorySynchronizationCommands; diff --git a/opencl/source/gen9/hw_helper_gen9.cpp b/shared/source/gen9/hw_helper_gen9.cpp similarity index 93% rename from opencl/source/gen9/hw_helper_gen9.cpp rename to shared/source/gen9/hw_helper_gen9.cpp index e4d1d76460..52a8b5f6af 100644 --- a/opencl/source/gen9/hw_helper_gen9.cpp +++ b/shared/source/gen9/hw_helper_gen9.cpp @@ -8,8 +8,6 @@ #include "shared/source/helpers/flat_batch_buffer_helper_hw.inl" #include "shared/source/helpers/hw_helper_bdw_plus.inl" -#include "opencl/source/aub/aub_helper_bdw_plus.inl" - namespace NEO { typedef SKLFamily Family; @@ -36,7 +34,6 @@ uint32_t HwHelperHw::getMetricsLibraryGenId() const { return static_cast(MetricsLibraryApi::ClientGen::Gen9); } -template class AubHelperHw; template class HwHelperHw; template class FlatBatchBufferHelperHw; template struct MemorySynchronizationCommands;