vcpkg/ports/openvino/006-onednn-gpu-build.patch

86 lines
3.4 KiB
Diff

diff --git a/cmake/OpenCL.cmake b/cmake/OpenCL.cmake
index df86d3434..cf4274b47 100644
--- a/cmake/OpenCL.cmake
+++ b/cmake/OpenCL.cmake
@@ -42,5 +42,5 @@ endif()
add_definitions(-DCL_TARGET_OPENCL_VERSION=120)
set(DNNL_GPU_RUNTIME_CURRENT ${DNNL_GPU_RUNTIME})
-include_directories(${OpenCL_INCLUDE_DIRS})
+# include_directories(${OpenCL_INCLUDE_DIRS})
list(APPEND EXTRA_SHARED_LIBS OpenCL::OpenCL)
diff --git a/cmake/TBB.cmake b/cmake/TBB.cmake
index d6bbe3e80..a62a25117 100644
--- a/cmake/TBB.cmake
+++ b/cmake/TBB.cmake
@@ -26,7 +26,7 @@ include("cmake/Threading.cmake")
macro(handle_tbb_target)
if(TBB_FOUND)
set_property(TARGET TBB::tbb PROPERTY "MAP_IMPORTED_CONFIG_RELWITHMDD" "DEBUG")
- include_directories_with_host_compiler(${_tbb_include_dirs})
+ # include_directories_with_host_compiler(${_tbb_include_dirs})
list(APPEND EXTRA_SHARED_LIBS ${TBB_IMPORTED_TARGETS})
# Print TBB location
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index e38723312..f19c63f3d 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -50,5 +50,7 @@ endif()
set(OBJ_LIB ${DNNL_LIBRARY_NAME}_common)
add_library(${OBJ_LIB} OBJECT ${SOURCES})
+target_include_directories(${OBJ_LIB} PRIVATE
+ $<TARGET_PROPERTY:OpenCL::OpenCL,INTERFACE_INCLUDE_DIRECTORIES>)
set_property(GLOBAL APPEND PROPERTY DNNL_LIB_DEPS
$<TARGET_OBJECTS:${OBJ_LIB}>)
diff --git a/src/gpu/CMakeLists.txt b/src/gpu/CMakeLists.txt
index e31655ec4..867dcac6f 100644
--- a/src/gpu/CMakeLists.txt
+++ b/src/gpu/CMakeLists.txt
@@ -27,6 +27,8 @@ add_definitions_with_host_compiler(-DNGEN_WINDOWS_COMPAT)
set(OBJ_LIB ${DNNL_LIBRARY_NAME}_gpu)
add_library(${OBJ_LIB} OBJECT ${SOURCES})
+target_include_directories(${OBJ_LIB} PRIVATE
+ $<TARGET_PROPERTY:OpenCL::OpenCL,INTERFACE_INCLUDE_DIRECTORIES>)
set_property(GLOBAL APPEND PROPERTY DNNL_LIB_DEPS
$<TARGET_OBJECTS:${OBJ_LIB}>)
diff --git a/src/gpu/compute/CMakeLists.txt b/src/gpu/compute/CMakeLists.txt
index 3f08abbe1..51c59f026 100644
--- a/src/gpu/compute/CMakeLists.txt
+++ b/src/gpu/compute/CMakeLists.txt
@@ -23,5 +23,7 @@ file(GLOB_RECURSE SOURCES
set(OBJ_LIB ${DNNL_LIBRARY_NAME}_gpu_compute)
add_library(${OBJ_LIB} OBJECT ${SOURCES})
+target_include_directories(${OBJ_LIB} PRIVATE
+ $<TARGET_PROPERTY:OpenCL::OpenCL,INTERFACE_INCLUDE_DIRECTORIES>)
set_property(GLOBAL APPEND PROPERTY DNNL_LIB_DEPS
$<TARGET_OBJECTS:${OBJ_LIB}>)
diff --git a/src/gpu/jit/CMakeLists.txt b/src/gpu/jit/CMakeLists.txt
index 178d325ed..a84b54b02 100644
--- a/src/gpu/jit/CMakeLists.txt
+++ b/src/gpu/jit/CMakeLists.txt
@@ -32,5 +32,7 @@ endif()
set(OBJ_LIB ${DNNL_LIBRARY_NAME}_gpu_jit)
add_library(${OBJ_LIB} OBJECT ${SOURCES})
+target_include_directories(${OBJ_LIB} PRIVATE
+ $<TARGET_PROPERTY:OpenCL::OpenCL,INTERFACE_INCLUDE_DIRECTORIES>)
set_property(GLOBAL APPEND PROPERTY DNNL_LIB_DEPS
$<TARGET_OBJECTS:${OBJ_LIB}>)
diff --git a/src/gpu/ocl/CMakeLists.txt b/src/gpu/ocl/CMakeLists.txt
index 2ccb8d1f5..ab6310e39 100644
--- a/src/gpu/ocl/CMakeLists.txt
+++ b/src/gpu/ocl/CMakeLists.txt
@@ -39,5 +39,7 @@ list(APPEND SOURCES ${kernel_list_src})
set(OBJ_LIB ${DNNL_LIBRARY_NAME}_gpu_ocl)
add_library(${OBJ_LIB} OBJECT ${SOURCES})
+target_include_directories(${OBJ_LIB} PRIVATE
+ $<TARGET_PROPERTY:OpenCL::OpenCL,INTERFACE_INCLUDE_DIRECTORIES>)
set_property(GLOBAL APPEND PROPERTY DNNL_LIB_DEPS
$<TARGET_OBJECTS:${OBJ_LIB}>)