Skip to content

Commit dca33e1

Browse files
Move hw_info_config files to shared
Related-To: NEO-5161 Signed-off-by: Filip Hazubski <[email protected]>
1 parent 4abe4a9 commit dca33e1

24 files changed

+59
-33
lines changed

opencl/source/enable_gens.cmake

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (C) 2018-2020 Intel Corporation
2+
# Copyright (C) 2018-2021 Intel Corporation
33
#
44
# SPDX-License-Identifier: MIT
55
#
@@ -94,12 +94,6 @@ macro(macro_for_each_gen)
9494
foreach(BRANCH ${BRANCH_DIR_LIST})
9595
string(REGEX REPLACE "/$" "" _BRANCH_FILENAME_SUFFIX "${BRANCH}")
9696
string(REGEX REPLACE "^/" "_" _BRANCH_FILENAME_SUFFIX "${_BRANCH_FILENAME_SUFFIX}")
97-
if(EXISTS ${GENX_PREFIX}${BRANCH}windows/hw_info_config_${GEN_TYPE_LOWER}${_BRANCH_FILENAME_SUFFIX}.cpp)
98-
list(APPEND RUNTIME_SRCS_${GEN_TYPE}_CPP_WINDOWS ${GENX_PREFIX}${BRANCH}windows/hw_info_config_${GEN_TYPE_LOWER}${_BRANCH_FILENAME_SUFFIX}.cpp)
99-
endif()
100-
if(EXISTS ${GENX_PREFIX}${BRANCH}linux/hw_info_config_${GEN_TYPE_LOWER}${_BRANCH_FILENAME_SUFFIX}.cpp)
101-
list(APPEND RUNTIME_SRCS_${GEN_TYPE}_CPP_LINUX ${GENX_PREFIX}${BRANCH}linux/hw_info_config_${GEN_TYPE_LOWER}${_BRANCH_FILENAME_SUFFIX}.cpp)
102-
endif()
10397
set(SRC_FILE ${NEO_SHARED_DIRECTORY}${BRANCH}${GEN_TYPE_LOWER}/image_core_${GEN_TYPE_LOWER}.cpp)
10498
if(EXISTS ${SRC_FILE})
10599
list(APPEND RUNTIME_SRCS_${GEN_TYPE}_CPP_BASE ${SRC_FILE})
@@ -125,6 +119,10 @@ macro(macro_for_each_gen)
125119
endforeach()
126120
endmacro()
127121

122+
get_property(RUNTIME_SRCS_GENX_ALL_BASE GLOBAL PROPERTY RUNTIME_SRCS_GENX_ALL_BASE)
123+
get_property(RUNTIME_SRCS_GENX_ALL_LINUX GLOBAL PROPERTY RUNTIME_SRCS_GENX_ALL_LINUX)
124+
get_property(RUNTIME_SRCS_GENX_ALL_WINDOWS GLOBAL PROPERTY RUNTIME_SRCS_GENX_ALL_WINDOWS)
125+
128126
apply_macro_for_each_gen("SUPPORTED")
129127

130128
target_sources(${NEO_STATIC_LIB_NAME} PRIVATE ${RUNTIME_SRCS_GENX_ALL_BASE})
@@ -133,6 +131,3 @@ if(WIN32)
133131
else()
134132
target_sources(${NEO_STATIC_LIB_NAME} PRIVATE ${RUNTIME_SRCS_GENX_ALL_LINUX})
135133
endif()
136-
set_property(GLOBAL PROPERTY RUNTIME_SRCS_GENX_ALL_BASE ${RUNTIME_SRCS_GENX_ALL_BASE})
137-
set_property(GLOBAL PROPERTY RUNTIME_SRCS_GENX_ALL_LINUX ${RUNTIME_SRCS_GENX_ALL_LINUX})
138-
set_property(GLOBAL PROPERTY RUNTIME_SRCS_GENX_ALL_WINDOWS ${RUNTIME_SRCS_GENX_ALL_WINDOWS})

shared/source/enable_gens.cmake

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (C) 2020 Intel Corporation
2+
# Copyright (C) 2020-2021 Intel Corporation
33
#
44
# SPDX-License-Identifier: MIT
55
#
@@ -37,6 +37,24 @@ macro(macro_for_each_platform)
3737
endif()
3838
endforeach()
3939

40+
foreach(BRANCH_DIR ${BRANCH_DIR_LIST})
41+
foreach(PLATFORM_FILE "hw_info_${PLATFORM_IT_LOWER}.inl")
42+
foreach(BRANCH ${BRANCH_DIR_LIST})
43+
set(SRC_FILE ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR}${GEN_TYPE_LOWER}${BRANCH}${PLATFORM_FILE})
44+
if(EXISTS ${SRC_FILE})
45+
list(APPEND RUNTIME_SRCS_${GEN_TYPE}_CPP_BASE ${SRC_FILE})
46+
endif()
47+
48+
string(REGEX REPLACE "/$" "" _BRANCH_FILENAME_SUFFIX "${BRANCH_DIR}")
49+
string(REGEX REPLACE "^/" "_" _BRANCH_FILENAME_SUFFIX "${_BRANCH_FILENAME_SUFFIX}")
50+
set(SRC_FILE ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR}${GEN_TYPE_LOWER}${BRANCH}linux/hw_info_config_${PLATFORM_IT_LOWER}${_BRANCH_FILENAME_SUFFIX}.inl)
51+
if(EXISTS ${SRC_FILE})
52+
list(APPEND RUNTIME_SRCS_${GEN_TYPE}_CPP_LINUX ${SRC_FILE})
53+
endif()
54+
endforeach()
55+
endforeach()
56+
endforeach()
57+
4058
endmacro()
4159

4260
macro(macro_for_each_gen)
@@ -79,6 +97,13 @@ macro(macro_for_each_gen)
7997
list(APPEND ${GEN_TYPE}_SRC_LINK_BASE ${SRC_FILE})
8098
endif()
8199
endforeach()
100+
101+
if(EXISTS ${CORE_GENX_PREFIX}${BRANCH_DIR}windows/hw_info_config_${GEN_TYPE_LOWER}${_BRANCH_FILENAME_SUFFIX}.cpp)
102+
list(APPEND RUNTIME_SRCS_${GEN_TYPE}_CPP_WINDOWS ${CORE_GENX_PREFIX}${BRANCH_DIR}windows/hw_info_config_${GEN_TYPE_LOWER}${_BRANCH_FILENAME_SUFFIX}.cpp)
103+
endif()
104+
if(EXISTS ${CORE_GENX_PREFIX}${BRANCH_DIR}linux/hw_info_config_${GEN_TYPE_LOWER}${_BRANCH_FILENAME_SUFFIX}.cpp)
105+
list(APPEND RUNTIME_SRCS_${GEN_TYPE}_CPP_LINUX ${CORE_GENX_PREFIX}${BRANCH_DIR}linux/hw_info_config_${GEN_TYPE_LOWER}${_BRANCH_FILENAME_SUFFIX}.cpp)
106+
endif()
82107
endforeach()
83108
if(EXISTS ${GENERATED_GENX_PREFIX}/hw_cmds_generated_${GEN_TYPE_LOWER}.inl)
84109
list(APPEND CORE_SRCS_${GEN_TYPE}_H_BASE "${GENERATED_GENX_PREFIX}/hw_cmds_generated_${GEN_TYPE_LOWER}.inl")
@@ -93,10 +118,16 @@ macro(macro_for_each_gen)
93118
list(APPEND CORE_SRCS_GENX_ALL_LINUX ${CORE_SRCS_${GEN_TYPE}_CPP_LINUX})
94119

95120
list(APPEND CORE_SRCS_LINK ${${GEN_TYPE}_SRC_LINK_BASE})
121+
list(APPEND RUNTIME_SRCS_GENX_ALL_BASE ${RUNTIME_SRCS_${GEN_TYPE}_CPP_BASE})
122+
list(APPEND RUNTIME_SRCS_GENX_ALL_LINUX ${RUNTIME_SRCS_${GEN_TYPE}_CPP_LINUX})
123+
list(APPEND RUNTIME_SRCS_GENX_ALL_WINDOWS ${RUNTIME_SRCS_${GEN_TYPE}_CPP_WINDOWS})
96124
endmacro()
97125

98126
apply_macro_for_each_gen("SUPPORTED")
99127

100128
set_property(GLOBAL PROPERTY CORE_SRCS_GENX_ALL_BASE ${CORE_SRCS_GENX_ALL_BASE})
101129
set_property(GLOBAL PROPERTY CORE_SRCS_GENX_ALL_LINUX ${CORE_SRCS_GENX_ALL_LINUX})
102130
set_property(GLOBAL PROPERTY CORE_SRCS_GENX_ALL_WINDOWS ${CORE_SRCS_GENX_ALL_WINDOWS})
131+
set_property(GLOBAL PROPERTY RUNTIME_SRCS_GENX_ALL_BASE ${RUNTIME_SRCS_GENX_ALL_BASE})
132+
set_property(GLOBAL PROPERTY RUNTIME_SRCS_GENX_ALL_LINUX ${RUNTIME_SRCS_GENX_ALL_LINUX})
133+
set_property(GLOBAL PROPERTY RUNTIME_SRCS_GENX_ALL_WINDOWS ${RUNTIME_SRCS_GENX_ALL_WINDOWS})

opencl/source/gen11/linux/hw_info_config_ehl.inl renamed to shared/source/gen11/linux/hw_info_config_ehl.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018-2020 Intel Corporation
2+
* Copyright (C) 2018-2021 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*

opencl/source/gen11/linux/hw_info_config_gen11.cpp renamed to shared/source/gen11/linux/hw_info_config_gen11.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018-2020 Intel Corporation
2+
* Copyright (C) 2018-2021 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*

opencl/source/gen11/linux/hw_info_config_icllp.inl renamed to shared/source/gen11/linux/hw_info_config_icllp.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018-2020 Intel Corporation
2+
* Copyright (C) 2018-2021 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*

opencl/source/gen11/linux/hw_info_config_lkf.inl renamed to shared/source/gen11/linux/hw_info_config_lkf.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018-2020 Intel Corporation
2+
* Copyright (C) 2018-2021 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*

opencl/source/gen11/windows/hw_info_config_gen11.cpp renamed to shared/source/gen11/windows/hw_info_config_gen11.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018-2020 Intel Corporation
2+
* Copyright (C) 2018-2021 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*

opencl/source/gen12lp/hw_info_config_adls.inl renamed to shared/source/gen12lp/hw_info_config_adls.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2020 Intel Corporation
2+
* Copyright (C) 2020-2021 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*

opencl/source/gen12lp/linux/hw_info_config_adls.inl renamed to shared/source/gen12lp/linux/hw_info_config_adls.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2020 Intel Corporation
2+
* Copyright (C) 2020-2021 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*

opencl/source/gen12lp/linux/hw_info_config_dg1.inl renamed to shared/source/gen12lp/linux/hw_info_config_dg1.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2020 Intel Corporation
2+
* Copyright (C) 2020-2021 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*

0 commit comments

Comments
 (0)