[GPU] Prepare cldnn lib for further merge with plugin (#8932)
This commit is contained in:
parent
a77f92e785
commit
f0e570b30a
6
inference-engine/thirdparty/CMakeLists.txt
vendored
6
inference-engine/thirdparty/CMakeLists.txt
vendored
@ -18,13 +18,7 @@ if(ENABLE_LTO)
|
||||
endif()
|
||||
|
||||
if (ENABLE_INTEL_GPU)
|
||||
if (ENABLE_TESTS)
|
||||
set(CLDNN__INCLUDE_TESTS ON CACHE BOOL "" FORCE)
|
||||
else()
|
||||
set(CLDNN__INCLUDE_TESTS OFF CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
add_subdirectory(clDNN)
|
||||
ov_install_static_lib(clDNN_lib gpu)
|
||||
endif()
|
||||
|
||||
function(ie_add_mkldnn)
|
||||
|
79
inference-engine/thirdparty/clDNN/CMakeLists.txt
vendored
79
inference-engine/thirdparty/clDNN/CMakeLists.txt
vendored
@ -2,56 +2,13 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
# Name of project (helper constant variable).
|
||||
set(CLDNN__PROJ_NAME "clDNN")
|
||||
|
||||
# Default languages: C, C++.
|
||||
project("${CLDNN__PROJ_NAME}")
|
||||
|
||||
# ======================================================================================================
|
||||
# ====================================== HELPER CONSTANT VARIABLES =====================================
|
||||
# ======================================================================================================
|
||||
# ======================================================================================================
|
||||
|
||||
if(ENABLE_GPU_DEBUG_CAPS)
|
||||
add_definitions(-DGPU_DEBUG_CONFIG=1)
|
||||
endif()
|
||||
|
||||
# Path which points to main directory of project.
|
||||
set(CLDNN__MAIN_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
set(MAIN_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
set(INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/api")
|
||||
|
||||
# Path which points to directory with interface for framework.
|
||||
set(CLDNN__API_DIR "${CMAKE_CURRENT_SOURCE_DIR}/api")
|
||||
|
||||
# Path which points to directory with interface for framework.
|
||||
set(CLDNN__KERNEL_SELECTOR_DIR "${CMAKE_CURRENT_SOURCE_DIR}/kernel_selector")
|
||||
|
||||
# Path which points to directory with runtime
|
||||
set(CLDNN__RUNTIME_DIR "${CMAKE_CURRENT_SOURCE_DIR}/runtime")
|
||||
|
||||
# Code generation settings.
|
||||
|
||||
# Path which points to root directory where code generated elements are created.
|
||||
set(CLDNN__CODEGEN_BASEDIR "${CMAKE_CURRENT_BINARY_DIR}/codegen")
|
||||
# Path which points to root directory where code generated elements are created
|
||||
# (specific to build configuration).
|
||||
set(CLDNN__CODEGEN_DIR "${CLDNN__CODEGEN_BASEDIR}")
|
||||
|
||||
# Path which points to automatically included directory with code generated elements
|
||||
# (to support "copy-if-different" optimization).
|
||||
set(CLDNN__CODEGEN_INCDIR "${CLDNN__CODEGEN_DIR}/include")
|
||||
|
||||
# ======================================================================================================
|
||||
# ============================================ CMAKE OPTIONS ===========================================
|
||||
# ======================================================================================================
|
||||
|
||||
# Include and build: Tests (unit tests and small acceptance tests) for clDNN framework.
|
||||
set(CLDNN__INCLUDE_TESTS ON CACHE BOOL "Include and build: clDNN framework's tests.")
|
||||
mark_as_advanced(CLDNN__INCLUDE_TESTS)
|
||||
|
||||
# ======================================================================================================
|
||||
|
||||
# Check for python 3 interpreter (required tool).
|
||||
find_package(PythonInterp 3 QUIET)
|
||||
if(NOT PYTHONINTERP_FOUND)
|
||||
message(WARNING "[clDNN] Project requires Python 3.x interpreter to build (with python loader). CMake could not detect it correctly.
|
||||
@ -59,35 +16,11 @@ if(NOT PYTHONINTERP_FOUND)
|
||||
)
|
||||
endif()
|
||||
|
||||
# ======================================================================================================
|
||||
set(CLDNN_UTILS__RAPIDJSON_INCDIRS "utils/rapidjson" CACHE INTERNAL "Paths to interface headers for rapidjson.")
|
||||
|
||||
# ======================================================================================================
|
||||
# ==================================== COMMON BUILD CONFIGURATION ======================================
|
||||
# ======================================================================================================
|
||||
|
||||
# =================================== Main targets names and labels ====================================
|
||||
|
||||
set(CLDNN_BUILD__PROJ__clDNN "clDNN_lib")
|
||||
set(CLDNN_BUILD__PROJ_LABEL__clDNN "clDNN")
|
||||
|
||||
# ===================================== Include/Link directories =======================================
|
||||
|
||||
include_directories(
|
||||
${CLDNN_UTILS__RAPIDJSON_INCDIRS}
|
||||
"${CLDNN__CODEGEN_INCDIR}"
|
||||
"${CLDNN__API_DIR}"
|
||||
$<TARGET_PROPERTY:inference_engine_plugin_api,INTERFACE_INCLUDE_DIRECTORIES>
|
||||
)
|
||||
|
||||
# =================================== Link targets and dependencies ====================================
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(runtime)
|
||||
add_subdirectory(kernel_selector)
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(utils)
|
||||
|
||||
if(CLDNN__INCLUDE_TESTS)
|
||||
if(ENABLE_TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
add_subdirectory(kernel_selector)
|
||||
|
||||
target_link_libraries(${CLDNN_BUILD__PROJ__clDNN} PRIVATE inference_engine)
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cldnn/runtime/engine.hpp"
|
||||
#include "cldnn/primitives/implementation_desc.hpp"
|
||||
#include "intel_gpu/runtime/engine.hpp"
|
||||
#include "intel_gpu/primitives/implementation_desc.hpp"
|
||||
|
||||
#include "topology.hpp"
|
||||
|
@ -4,13 +4,13 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cldnn/graph/topology.hpp"
|
||||
#include "cldnn/graph/program.hpp"
|
||||
#include "cldnn/runtime/compounds.hpp"
|
||||
#include "cldnn/runtime/memory.hpp"
|
||||
#include "cldnn/runtime/engine.hpp"
|
||||
#include "cldnn/runtime/event.hpp"
|
||||
#include "cldnn/runtime/stream.hpp"
|
||||
#include "intel_gpu/graph/topology.hpp"
|
||||
#include "intel_gpu/graph/program.hpp"
|
||||
#include "intel_gpu/runtime/compounds.hpp"
|
||||
#include "intel_gpu/runtime/memory.hpp"
|
||||
#include "intel_gpu/runtime/engine.hpp"
|
||||
#include "intel_gpu/runtime/event.hpp"
|
||||
#include "intel_gpu/runtime/stream.hpp"
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cldnn/runtime/engine.hpp"
|
||||
#include "cldnn/runtime/stream.hpp"
|
||||
#include "intel_gpu/runtime/engine.hpp"
|
||||
#include "intel_gpu/runtime/stream.hpp"
|
||||
#include "build_options.hpp"
|
||||
|
||||
#include <list>
|
@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cldnn/primitives/primitive.hpp"
|
||||
#include "cldnn/primitives/input_layout.hpp"
|
||||
#include "intel_gpu/primitives/primitive.hpp"
|
||||
#include "intel_gpu/primitives/input_layout.hpp"
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
@ -5,7 +5,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma once
|
||||
#include "primitive.hpp"
|
||||
#include "cldnn/graph/topology.hpp"
|
||||
#include "intel_gpu/graph/topology.hpp"
|
||||
#include <vector>
|
||||
|
||||
namespace cldnn {
|
@ -5,7 +5,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma once
|
||||
#include "primitive.hpp"
|
||||
#include "cldnn/runtime/memory.hpp"
|
||||
#include "intel_gpu/runtime/memory.hpp"
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
@ -5,7 +5,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma once
|
||||
#include "primitive.hpp"
|
||||
#include "cldnn/runtime/memory.hpp"
|
||||
#include "intel_gpu/runtime/memory.hpp"
|
||||
|
||||
namespace cldnn {
|
||||
/// @addtogroup cpp_api C++ API
|
@ -4,7 +4,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cldnn/runtime/tensor.hpp"
|
||||
#include "intel_gpu/runtime/tensor.hpp"
|
||||
|
||||
#include <map>
|
||||
#include <ostream>
|
@ -5,7 +5,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma once
|
||||
#include "primitive.hpp"
|
||||
#include "cldnn/runtime/memory.hpp"
|
||||
#include "intel_gpu/runtime/memory.hpp"
|
||||
|
||||
namespace cldnn {
|
||||
/// @addtogroup cpp_api C++ API
|
@ -7,7 +7,7 @@
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
#include "primitive.hpp"
|
||||
#include "cldnn/graph/topology.hpp"
|
||||
#include "intel_gpu/graph/topology.hpp"
|
||||
|
||||
#define DEFAULT_MAX_NUM_ITERATION 256
|
||||
namespace cldnn {
|
@ -4,7 +4,7 @@
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma once
|
||||
#include "cldnn/primitives/primitive.hpp"
|
||||
#include "intel_gpu/primitives/primitive.hpp"
|
||||
#include <vector>
|
||||
|
||||
namespace cldnn {
|
@ -4,7 +4,7 @@
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma once
|
||||
#include "cldnn/primitives/primitive.hpp"
|
||||
#include "intel_gpu/primitives/primitive.hpp"
|
||||
#include <vector>
|
||||
|
||||
namespace cldnn {
|
@ -5,7 +5,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma once
|
||||
#include "primitive.hpp"
|
||||
#include "cldnn/runtime/memory.hpp"
|
||||
#include "intel_gpu/runtime/memory.hpp"
|
||||
#include <vector>
|
||||
|
||||
namespace cldnn {
|
@ -6,8 +6,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cldnn/runtime/compounds.hpp"
|
||||
#include "cldnn/runtime/layout.hpp"
|
||||
#include "intel_gpu/runtime/compounds.hpp"
|
||||
#include "intel_gpu/runtime/layout.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <string>
|
@ -5,7 +5,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma once
|
||||
#include "primitive.hpp"
|
||||
#include "cldnn/runtime/memory.hpp"
|
||||
#include "intel_gpu/runtime/memory.hpp"
|
||||
#include <vector>
|
||||
|
||||
namespace cldnn {
|
@ -2,171 +2,92 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
# =================================== Name / Output settings from parent ===============================
|
||||
set(TARGET_NAME "ov_intel_gpu_kernels")
|
||||
|
||||
set(CLDNN_BUILD__PROJ "cldnn_kernel_selector")
|
||||
set(CLDNN_BUILD__PROJ_LABEL "${CLDNN_BUILD__PROJ}")
|
||||
|
||||
# ========================================= Source/Header files ========================================
|
||||
|
||||
set(__CLDNN_Directory__main "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
set(__CLDNN_Label__main "")
|
||||
file(GLOB __CLDNN_Sources__main
|
||||
"${__CLDNN_Directory__main}/*.h"
|
||||
"${__CLDNN_Directory__main}/*.hpp"
|
||||
"${__CLDNN_Directory__main}/*.cpp"
|
||||
file(GLOB_RECURSE LIBRARY_SRC
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/*.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/*.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
|
||||
)
|
||||
|
||||
set(__CLDNN_Directory__core "${__CLDNN_Directory__main}/core")
|
||||
set(__CLDNN_Label__core "core")
|
||||
file(GLOB __CLDNN_Sources__core
|
||||
"${__CLDNN_Directory__core}/*.h"
|
||||
"${__CLDNN_Directory__core}/*.hpp"
|
||||
"${__CLDNN_Directory__core}/*.cpp"
|
||||
file(GLOB_RECURSE KERNELS
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/core/cl_kernels/*.cl"
|
||||
)
|
||||
|
||||
set(__CLDNN_Directory__common "${__CLDNN_Directory__main}/common")
|
||||
set(__CLDNN_Label__common "common")
|
||||
file(GLOB __CLDNN_Sources__common
|
||||
"${__CLDNN_Directory__common}/*.h"
|
||||
"${__CLDNN_Directory__common}/*.hpp"
|
||||
"${__CLDNN_Directory__common}/*.cpp"
|
||||
)
|
||||
# Path which points to root directory where code generated elements are created
|
||||
# (specific to build configuration).
|
||||
set(CODEGEN_DIR "${CMAKE_CURRENT_BINARY_DIR}/codegen")
|
||||
set(CODEGEN_CACHE_DIR "${CODEGEN_DIR}/cache")
|
||||
|
||||
set(__CLDNN_Directory__core_common "${__CLDNN_Directory__core}/common")
|
||||
set(__CLDNN_Label__core_common "${__CLDNN_Label__core}\\common")
|
||||
file(GLOB __CLDNN_Sources__core_common
|
||||
"${__CLDNN_Directory__core_common}/*.h"
|
||||
"${__CLDNN_Directory__core_common}/*.hpp"
|
||||
"${__CLDNN_Directory__core_common}/*.cpp"
|
||||
)
|
||||
# Path which points to automatically included directory with code generated elements
|
||||
# (to support "copy-if-different" optimization).
|
||||
set(CODEGEN_INCDIR "${CODEGEN_DIR}/include")
|
||||
|
||||
set(__CLDNN_Directory__core_cache "${__CLDNN_Directory__core}/cache")
|
||||
set(__CLDNN_Label__core_cache "${__CLDNN_Label__core}\\cache")
|
||||
file(GLOB __CLDNN_Sources__core_cache
|
||||
"${__CLDNN_Directory__core_cache}/*.h"
|
||||
"${__CLDNN_Directory__core_cache}/*.hpp"
|
||||
"${__CLDNN_Directory__core_cache}/*.cpp"
|
||||
)
|
||||
|
||||
set(__CLDNN_Directory__actual_kernels "${__CLDNN_Directory__core}/actual_kernels")
|
||||
set(__CLDNN_Label__actual_kernels "${__CLDNN_Label__core}\\actual_kernels")
|
||||
file(GLOB_RECURSE __CLDNN_Sources__actual_kernels
|
||||
"${__CLDNN_Directory__actual_kernels}/*.h"
|
||||
"${__CLDNN_Directory__actual_kernels}/*.hpp"
|
||||
"${__CLDNN_Directory__actual_kernels}/*.cpp"
|
||||
)
|
||||
foreach(__CLDNN_FilePath ${__CLDNN_Sources__actual_kernels})
|
||||
string(REPLACE ";" "\;" __CLDNN_FilePath "${__CLDNN_FilePath}") # [WA#1] Must escape ; again if occurred in item.
|
||||
get_filename_component(__CLDNN_FileDir "${__CLDNN_FilePath}" DIRECTORY)
|
||||
get_filename_component(__CLDNN_DirName "${__CLDNN_FileDir}" NAME)
|
||||
set(PRIM_DB "ks_primitive_db.inc")
|
||||
set(PRIM_DB_BATCH_HEADERS "ks_primitive_db_batch_headers.inc")
|
||||
set(CODEGEN_CACHE_SOURCES "${CODEGEN_INCDIR}/${PRIM_DB}"
|
||||
"${CODEGEN_INCDIR}/${PRIM_DB_BATCH_HEADERS}")
|
||||
|
||||
set(__CLDNN_FileLabel "${__CLDNN_Label__actual_kernels}\\${__CLDNN_DirName}")
|
||||
source_group("${__CLDNN_FileLabel}" FILES ${__CLDNN_FilePath})
|
||||
endforeach()
|
||||
|
||||
set(__CLDNN_Directory__cl_kernels "${__CLDNN_Directory__core}/cl_kernels")
|
||||
set(__CLDNN_Label__cl_kernels "${__CLDNN_Label__core}\\cl_kernels")
|
||||
file(GLOB_RECURSE __CLDNN_Sources__cl_kernels
|
||||
"${__CLDNN_Directory__cl_kernels}/*.cl"
|
||||
)
|
||||
|
||||
set(__CLDNN_Directory__cg_cache "${CLDNN__CODEGEN_INCDIR}")
|
||||
set(__CLDNN_CGDirectory__cg_cache "${CLDNN__CODEGEN_DIR}/cache")
|
||||
set(__CLDNN_Label__cg_cache "${__CLDNN_Label__core}\\codegen")
|
||||
set(__CLDNN_Label__cg_cache_batch_headers "${__CLDNN_Label__core}\\codegen")
|
||||
set(__CLDNN_File__cg_cache__prim_db "ks_primitive_db.inc")
|
||||
set(__CLDNN_File__cg_cache__prim_db_batch_headers "ks_primitive_db_batch_headers.inc")
|
||||
set(__CLDNN_Sources__cg_cache
|
||||
"${__CLDNN_Directory__cg_cache}/${__CLDNN_File__cg_cache__prim_db}"
|
||||
"${__CLDNN_Directory__cg_cache}/${__CLDNN_File__cg_cache__prim_db_batch_headers}"
|
||||
)
|
||||
|
||||
set(__CLDNN_AllSources
|
||||
${__CLDNN_Sources__main}
|
||||
${__CLDNN_Sources__core}
|
||||
${__CLDNN_Sources__common}
|
||||
${__CLDNN_Sources__core_common}
|
||||
${__CLDNN_Sources__core_cache}
|
||||
${__CLDNN_Sources__actual_kernels}
|
||||
${__CLDNN_Sources__cl_kernels}
|
||||
${__CLDNN_Sources__cg_cache}
|
||||
)
|
||||
set(CODEGEN_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/core/common/primitive_db_gen.py")
|
||||
# Helping with some generators.
|
||||
set_property(SOURCE ${__CLDNN_Sources__cg_cache} PROPERTY GENERATED TRUE)
|
||||
set_property(SOURCE ${CODEGEN_CACHE_SOURCES} PROPERTY GENERATED TRUE)
|
||||
|
||||
# =============================================== Filters ==============================================
|
||||
add_custom_command(OUTPUT "${CODEGEN_CACHE_DIR}/${PRIM_DB}"
|
||||
COMMAND "${CMAKE_COMMAND}" -E make_directory "${CODEGEN_CACHE_DIR}"
|
||||
COMMAND "${PYTHON_EXECUTABLE}" "${CODEGEN_SCRIPT}" -out_path "${CODEGEN_CACHE_DIR}"
|
||||
-out_file_name_prim_db "${PRIM_DB}"
|
||||
-out_file_name_batch_headers "${PRIM_DB_BATCH_HEADERS}"
|
||||
-kernels "${CMAKE_CURRENT_SOURCE_DIR}/core/cl_kernels/"
|
||||
DEPENDS ${KERNELS} "${CODEGEN_SCRIPT}"
|
||||
COMMENT "Generating ${CODEGEN_CACHE_DIR}/${PRIM_DB} ..."
|
||||
)
|
||||
|
||||
source_group("${__CLDNN_Label__main}" FILES ${__CLDNN_Sources__main})
|
||||
source_group("${__CLDNN_Label__core}" FILES ${__CLDNN_Sources__core})
|
||||
source_group("${__CLDNN_Label__common}" FILES ${__CLDNN_Sources__common})
|
||||
source_group("${__CLDNN_Label__core_common}" FILES ${__CLDNN_Sources__core_common})
|
||||
source_group("${__CLDNN_Label__core_cache}" FILES ${__CLDNN_Sources__core_cache})
|
||||
#source_group("${__CLDNN_Label__actual_kernels}" FILES ${__CLDNN_Sources__actual_kernels})
|
||||
source_group("${__CLDNN_Label__cl_kernels}" FILES ${__CLDNN_Sources__cl_kernels})
|
||||
source_group("${__CLDNN_Label__cg_cache}" FILES ${__CLDNN_Sources__cg_cache})
|
||||
add_custom_command(OUTPUT "${CODEGEN_INCDIR}/${PRIM_DB}"
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CODEGEN_CACHE_DIR}/${PRIM_DB}" "${CODEGEN_INCDIR}/${PRIM_DB}"
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CODEGEN_CACHE_DIR}/${PRIM_DB_BATCH_HEADERS}" "${CODEGEN_INCDIR}/${PRIM_DB_BATCH_HEADERS}"
|
||||
DEPENDS "${CODEGEN_CACHE_DIR}/${PRIM_DB}" "${KERNELS}" "${CODEGEN_SCRIPT}"
|
||||
COMMENT "Updating file if the file changed (${PRIM_DB}) ..."
|
||||
)
|
||||
|
||||
# ===================================== Include/Link directories =======================================
|
||||
add_library(${TARGET_NAME} STATIC ${LIBRARY_SRC} ${CODEGEN_CACHE_SOURCES})
|
||||
|
||||
include_directories(
|
||||
"${CLDNN__MAIN_DIR}"
|
||||
"${__CLDNN_Directory__main}"
|
||||
"${__CLDNN_Directory__core}"
|
||||
"${__CLDNN_Directory__core}/common"
|
||||
"${__CLDNN_Directory__core}/cache"
|
||||
"${__CLDNN_Directory__actual_kernels}"
|
||||
"${__CLDNN_Directory__common}"
|
||||
)
|
||||
target_include_directories(${TARGET_NAME} PUBLIC $<BUILD_INTERFACE:${INCLUDE_DIR}>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/core/>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/core/common/>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/core/actual_kernels/>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/core/cache/>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/common/>
|
||||
$<BUILD_INTERFACE:${CODEGEN_INCDIR}>)
|
||||
|
||||
# =================================== Link targets and dependencies ====================================
|
||||
|
||||
# Main shared library.
|
||||
add_library("${CLDNN_BUILD__PROJ}" STATIC
|
||||
${__CLDNN_AllSources}
|
||||
)
|
||||
|
||||
target_compile_options("${CLDNN_BUILD__PROJ}" PRIVATE
|
||||
target_compile_options(${TARGET_NAME} PRIVATE
|
||||
$<$<CONFIG:Release>:$<IF:$<CXX_COMPILER_ID:MSVC>,/Os,-Os>>)
|
||||
|
||||
set_property(TARGET "${CLDNN_BUILD__PROJ}" PROPERTY PROJECT_LABEL "${CLDNN_BUILD__PROJ_LABEL}")
|
||||
|
||||
if(COMMAND add_cpplint_target)
|
||||
add_cpplint_target("${CLDNN_BUILD__PROJ}_cpplint" FOR_TARGETS "${CLDNN_BUILD__PROJ}")
|
||||
add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME})
|
||||
endif()
|
||||
|
||||
target_link_libraries("${CLDNN_BUILD__PROJ}"
|
||||
OpenCL
|
||||
)
|
||||
target_link_libraries(${TARGET_NAME} PUBLIC OpenCL rapidjson inference_engine_plugin_api)
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries("${CLDNN_BUILD__PROJ}" setupapi)
|
||||
target_link_libraries(${TARGET_NAME} PRIVATE setupapi)
|
||||
elseif((NOT ANDROID) AND (UNIX))
|
||||
target_link_libraries("${CLDNN_BUILD__PROJ}" pthread)
|
||||
target_link_libraries(${TARGET_NAME} PRIVATE pthread)
|
||||
endif()
|
||||
|
||||
# =================================== Custom pre- and post-steps =======================================
|
||||
add_custom_command(OUTPUT "${__CLDNN_CGDirectory__cg_cache}/${__CLDNN_File__cg_cache__prim_db}"
|
||||
COMMAND "${CMAKE_COMMAND}" -E make_directory "${__CLDNN_CGDirectory__cg_cache}"
|
||||
COMMAND "${PYTHON_EXECUTABLE}" "${__CLDNN_Directory__core_common}/primitive_db_gen.py" -out_path "${__CLDNN_CGDirectory__cg_cache}" -out_file_name_prim_db "${__CLDNN_File__cg_cache__prim_db}" -out_file_name_batch_headers "${__CLDNN_File__cg_cache__prim_db_batch_headers}" -kernels "${__CLDNN_Directory__cl_kernels}"
|
||||
DEPENDS ${__CLDNN_Sources__cl_kernels} "${__CLDNN_Directory__core_common}/primitive_db_gen.py"
|
||||
COMMENT "Generating ${__CLDNN_File__cg_cache__prim_db} ..."
|
||||
)
|
||||
add_custom_command(OUTPUT "${__CLDNN_Directory__cg_cache}/${__CLDNN_File__cg_cache__prim_db}"
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${__CLDNN_CGDirectory__cg_cache}/${__CLDNN_File__cg_cache__prim_db}" "${__CLDNN_Directory__cg_cache}/${__CLDNN_File__cg_cache__prim_db}"
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${__CLDNN_CGDirectory__cg_cache}/${__CLDNN_File__cg_cache__prim_db_batch_headers}" "${__CLDNN_Directory__cg_cache}/${__CLDNN_File__cg_cache__prim_db_batch_headers}"
|
||||
DEPENDS "${__CLDNN_CGDirectory__cg_cache}/${__CLDNN_File__cg_cache__prim_db}" ${__CLDNN_Sources__cl_kernels} "${__CLDNN_Directory__core_common}/primitive_db_gen.py"
|
||||
COMMENT "Updating file if the file changed (${__CLDNN_File__cg_cache__prim_db}) ..."
|
||||
)
|
||||
if(WIN32)
|
||||
set(CLDNN_CACHE_PATH "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIGURATION>")
|
||||
set(TUNING_CACHE_PATH "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIGURATION>")
|
||||
else((NOT ANDROID) AND (UNIX))
|
||||
set(CLDNN_CACHE_PATH "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/")
|
||||
set(TUNING_CACHE_PATH "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/")
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
TARGET "${CLDNN_BUILD__PROJ}" POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different ${__CLDNN_Directory__core}/cache/cache.json ${CLDNN_CACHE_PATH}/cache.json)
|
||||
TARGET ${TARGET_NAME} POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/core/cache/cache.json ${TUNING_CACHE_PATH}/cache.json)
|
||||
|
||||
ov_install_static_lib("${CLDNN_BUILD__PROJ}" gpu)
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/core/cache/cache.json
|
||||
DESTINATION ${IE_CPACK_RUNTIME_PATH}
|
||||
COMPONENT gpu)
|
||||
|
||||
# ======================================================================================================
|
||||
ov_install_static_lib(${TARGET_NAME} gpu)
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "api/cldnn/runtime/device_info.hpp"
|
||||
#include "intel_gpu/runtime/device_info.hpp"
|
||||
#include "convolution_kernel_base.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
@ -5,7 +5,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "kernel_selector_params.h"
|
||||
#include "cldnn/runtime/kernel_args.hpp"
|
||||
#include "intel_gpu/runtime/kernel_args.hpp"
|
||||
|
||||
#include <cfloat>
|
||||
#include <cstdint>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user