From ced0eebd13afe671022e3fb10eb7b082b88159f1 Mon Sep 17 00:00:00 2001 From: Vladimir Paramuzov Date: Thu, 3 Nov 2022 18:02:23 +0400 Subject: [PATCH] [GPU] Silence ocl include pragma message (#13789) --- docs/snippets/gpu/context_sharing.cpp | 1 + docs/snippets/gpu/preprocessing.cpp | 1 + docs/snippets/gpu/queue_sharing.cpp | 1 + docs/snippets/gpu/remote_objects_creation.cpp | 1 + samples/cpp/benchmark_app/remote_tensors_filling.cpp | 1 + samples/cpp/benchmark_app/remote_tensors_filling.hpp | 3 +++ src/inference/include/ie/gpu/gpu_ocl_wrapper.hpp | 6 +++++- .../include/openvino/runtime/intel_gpu/ocl/ocl_wrapper.hpp | 6 +++++- .../intel_gpu/include/intel_gpu/plugin/remote_context.hpp | 4 ++++ src/tests/functional/inference_engine/CMakeLists.txt | 5 +++++ .../plugin/gpu/remote_blob_tests/dx11_remote_ctx_test.cpp | 4 ++++ .../gpu/remote_blob_tests/gpu_remote_tensor_tests.cpp | 2 ++ .../plugin/gpu/remote_blob_tests/remote_blob_helpers.hpp | 4 ++++ .../behavior/executable_network/get_metric.cpp | 2 ++ .../behavior/ov_plugin/core_integration.cpp | 2 ++ .../behavior/plugin/core_integration.cpp | 2 ++ .../include/multi/multi_remote_blob_multidevice_test.hpp | 3 +++ 17 files changed, 46 insertions(+), 2 deletions(-) diff --git a/docs/snippets/gpu/context_sharing.cpp b/docs/snippets/gpu/context_sharing.cpp index 5b0c206692a..bafce972408 100644 --- a/docs/snippets/gpu/context_sharing.cpp +++ b/docs/snippets/gpu/context_sharing.cpp @@ -1,4 +1,5 @@ #include +#define OV_GPU_USE_OPENCL_HPP #include cl::Context get_ocl_context(); // a function which returns cl context created on the app side diff --git a/docs/snippets/gpu/preprocessing.cpp b/docs/snippets/gpu/preprocessing.cpp index ebfc3489c46..1ec82bb50d7 100644 --- a/docs/snippets/gpu/preprocessing.cpp +++ b/docs/snippets/gpu/preprocessing.cpp @@ -1,4 +1,5 @@ #include +#define OV_GPU_USE_OPENCL_HPP #include #include #include diff --git a/docs/snippets/gpu/queue_sharing.cpp b/docs/snippets/gpu/queue_sharing.cpp index 95517af1466..5b89b297060 100644 --- a/docs/snippets/gpu/queue_sharing.cpp +++ b/docs/snippets/gpu/queue_sharing.cpp @@ -1,4 +1,5 @@ #include +#define OV_GPU_USE_OPENCL_HPP #include diff --git a/docs/snippets/gpu/remote_objects_creation.cpp b/docs/snippets/gpu/remote_objects_creation.cpp index 70df2a654a5..fab320326f3 100644 --- a/docs/snippets/gpu/remote_objects_creation.cpp +++ b/docs/snippets/gpu/remote_objects_creation.cpp @@ -1,6 +1,7 @@ #include #include +#define OV_GPU_USE_OPENCL_HPP #include #ifdef WIN32 diff --git a/samples/cpp/benchmark_app/remote_tensors_filling.cpp b/samples/cpp/benchmark_app/remote_tensors_filling.cpp index 09c44ece906..fbc342b9403 100644 --- a/samples/cpp/benchmark_app/remote_tensors_filling.cpp +++ b/samples/cpp/benchmark_app/remote_tensors_filling.cpp @@ -12,6 +12,7 @@ #include #ifdef HAVE_DEVICE_MEM_SUPPORT +# define OV_GPU_USE_OPENCL_HPP # include # include #endif diff --git a/samples/cpp/benchmark_app/remote_tensors_filling.hpp b/samples/cpp/benchmark_app/remote_tensors_filling.hpp index 4e8555b844e..67f56a0e564 100644 --- a/samples/cpp/benchmark_app/remote_tensors_filling.hpp +++ b/samples/cpp/benchmark_app/remote_tensors_filling.hpp @@ -5,6 +5,9 @@ #pragma once #if defined(HAVE_GPU_DEVICE_MEM_SUPPORT) +# ifndef OV_GPU_USE_OPENCL_HPP +# define OV_GPU_USE_OPENCL_HPP +# endif # define HAVE_DEVICE_MEM_SUPPORT # include #endif diff --git a/src/inference/include/ie/gpu/gpu_ocl_wrapper.hpp b/src/inference/include/ie/gpu/gpu_ocl_wrapper.hpp index 43cebbbb112..17336a47443 100644 --- a/src/inference/include/ie/gpu/gpu_ocl_wrapper.hpp +++ b/src/inference/include/ie/gpu/gpu_ocl_wrapper.hpp @@ -39,7 +39,11 @@ # pragma GCC system_header #endif -#include +#ifdef OV_GPU_USE_OPENCL_HPP +# include +#else +# include +#endif #ifdef __GNUC__ # pragma GCC diagnostic pop diff --git a/src/inference/include/openvino/runtime/intel_gpu/ocl/ocl_wrapper.hpp b/src/inference/include/openvino/runtime/intel_gpu/ocl/ocl_wrapper.hpp index a1263cf35b2..1aff96eb672 100644 --- a/src/inference/include/openvino/runtime/intel_gpu/ocl/ocl_wrapper.hpp +++ b/src/inference/include/openvino/runtime/intel_gpu/ocl/ocl_wrapper.hpp @@ -41,7 +41,11 @@ # pragma GCC system_header #endif -#include +#ifdef OV_GPU_USE_OPENCL_HPP +# include +#else +# include +#endif #ifdef __GNUC__ # pragma GCC diagnostic pop diff --git a/src/plugins/intel_gpu/include/intel_gpu/plugin/remote_context.hpp b/src/plugins/intel_gpu/include/intel_gpu/plugin/remote_context.hpp index 23b06e41ccf..caf9e60a986 100644 --- a/src/plugins/intel_gpu/include/intel_gpu/plugin/remote_context.hpp +++ b/src/plugins/intel_gpu/include/intel_gpu/plugin/remote_context.hpp @@ -18,6 +18,10 @@ # define NOMINMAX #endif +#ifndef OV_GPU_USE_OPENCL_HPP +#define OV_GPU_USE_OPENCL_HPP +#endif + #ifdef _WIN32 # include #else diff --git a/src/tests/functional/inference_engine/CMakeLists.txt b/src/tests/functional/inference_engine/CMakeLists.txt index 60a5f2acc5d..2df1f3f3e98 100644 --- a/src/tests/functional/inference_engine/CMakeLists.txt +++ b/src/tests/functional/inference_engine/CMakeLists.txt @@ -190,6 +190,11 @@ function(ie_headers_compilation_with_custom_flags) endif() set(content "#include <${header_file}>\n${content}") endforeach() + + if (OPENCL_HEADERS_DIR) + set(content "#define OV_GPU_USE_OPENCL_HPP\n${content}") + endif() + set(source_file "${CMAKE_CURRENT_BINARY_DIR}/modern_flags_${IE_TEST_TEST_SUFFIX}.cpp") file(REMOVE ${source_file}) file(GENERATE OUTPUT ${source_file} CONTENT ${content}) diff --git a/src/tests/functional/plugin/gpu/remote_blob_tests/dx11_remote_ctx_test.cpp b/src/tests/functional/plugin/gpu/remote_blob_tests/dx11_remote_ctx_test.cpp index c995ffe115e..03255464534 100644 --- a/src/tests/functional/plugin/gpu/remote_blob_tests/dx11_remote_ctx_test.cpp +++ b/src/tests/functional/plugin/gpu/remote_blob_tests/dx11_remote_ctx_test.cpp @@ -28,6 +28,10 @@ #define NOMINMAX_DEFINED_CTX_UT #endif +#ifndef OV_GPU_USE_OPENCL_HPP +# define OV_GPU_USE_OPENCL_HPP +#endif + #include #include #include diff --git a/src/tests/functional/plugin/gpu/remote_blob_tests/gpu_remote_tensor_tests.cpp b/src/tests/functional/plugin/gpu/remote_blob_tests/gpu_remote_tensor_tests.cpp index e6a012e0fd2..3e4cbc8148a 100644 --- a/src/tests/functional/plugin/gpu/remote_blob_tests/gpu_remote_tensor_tests.cpp +++ b/src/tests/functional/plugin/gpu/remote_blob_tests/gpu_remote_tensor_tests.cpp @@ -7,6 +7,8 @@ #include #include +#define OV_GPU_USE_OPENCL_HPP + #include "openvino/runtime/intel_gpu/ocl/ocl.hpp" #include "openvino/runtime/core.hpp" diff --git a/src/tests/functional/plugin/gpu/remote_blob_tests/remote_blob_helpers.hpp b/src/tests/functional/plugin/gpu/remote_blob_tests/remote_blob_helpers.hpp index c1769b3f0dd..d1670fc3764 100644 --- a/src/tests/functional/plugin/gpu/remote_blob_tests/remote_blob_helpers.hpp +++ b/src/tests/functional/plugin/gpu/remote_blob_tests/remote_blob_helpers.hpp @@ -11,6 +11,10 @@ # define NOMINMAX #endif +#ifndef OV_GPU_USE_OPENCL_HPP +# define OV_GPU_USE_OPENCL_HPP +#endif + #ifdef _WIN32 # include #elif defined ENABLE_LIBVA diff --git a/src/tests/functional/plugin/gpu/shared_tests_instances/behavior/executable_network/get_metric.cpp b/src/tests/functional/plugin/gpu/shared_tests_instances/behavior/executable_network/get_metric.cpp index e032752ade5..a8b22c2183a 100644 --- a/src/tests/functional/plugin/gpu/shared_tests_instances/behavior/executable_network/get_metric.cpp +++ b/src/tests/functional/plugin/gpu/shared_tests_instances/behavior/executable_network/get_metric.cpp @@ -4,6 +4,8 @@ #include "behavior/executable_network/get_metric.hpp" +#define OV_GPU_USE_OPENCL_HPP + #ifdef _WIN32 # include "gpu/gpu_context_api_dx.hpp" #elif defined ENABLE_LIBVA diff --git a/src/tests/functional/plugin/gpu/shared_tests_instances/behavior/ov_plugin/core_integration.cpp b/src/tests/functional/plugin/gpu/shared_tests_instances/behavior/ov_plugin/core_integration.cpp index 3ed6f031fff..5e1e6fa3425 100644 --- a/src/tests/functional/plugin/gpu/shared_tests_instances/behavior/ov_plugin/core_integration.cpp +++ b/src/tests/functional/plugin/gpu/shared_tests_instances/behavior/ov_plugin/core_integration.cpp @@ -7,6 +7,8 @@ #include "behavior/ov_plugin/core_integration.hpp" #include "openvino/runtime/intel_gpu/properties.hpp" +#define OV_GPU_USE_OPENCL_HPP + #ifdef _WIN32 # include "gpu/gpu_context_api_dx.hpp" #elif defined ENABLE_LIBVA diff --git a/src/tests/functional/plugin/gpu/shared_tests_instances/behavior/plugin/core_integration.cpp b/src/tests/functional/plugin/gpu/shared_tests_instances/behavior/plugin/core_integration.cpp index 4c58eb6ab82..2bbe8683385 100644 --- a/src/tests/functional/plugin/gpu/shared_tests_instances/behavior/plugin/core_integration.cpp +++ b/src/tests/functional/plugin/gpu/shared_tests_instances/behavior/plugin/core_integration.cpp @@ -4,6 +4,8 @@ #include "behavior/plugin/core_integration.hpp" +#define OV_GPU_USE_OPENCL_HPP + #ifdef _WIN32 # include "gpu/gpu_context_api_dx.hpp" #elif defined ENABLE_LIBVA diff --git a/src/tests/functional/plugin/shared/include/multi/multi_remote_blob_multidevice_test.hpp b/src/tests/functional/plugin/shared/include/multi/multi_remote_blob_multidevice_test.hpp index 251a1b658c7..e2fedb403bc 100644 --- a/src/tests/functional/plugin/shared/include/multi/multi_remote_blob_multidevice_test.hpp +++ b/src/tests/functional/plugin/shared/include/multi/multi_remote_blob_multidevice_test.hpp @@ -4,6 +4,9 @@ #include #include +#ifndef OV_GPU_USE_OPENCL_HPP +# define OV_GPU_USE_OPENCL_HPP +#endif #include "openvino/runtime/intel_gpu/ocl/ocl.hpp" #include "openvino/runtime/core.hpp" #include "openvino/runtime/properties.hpp"