Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ocl_ext.hpp: Fix to evade redefinition errors in Homebrew #27698

Open
wants to merge 1 commit into
base: releases/2024/5
Choose a base branch
from

Conversation

artanokhov
Copy link
Contributor

@artanokhov artanokhov commented Nov 22, 2024

Details:

In file included from /tmp/openvino-20241121-7530-to0hc8/openvino-2024.5.0/src/plugins/intel_gpu/src/runtime/ocl/ocl_ext.hpp:14,
                 from /tmp/openvino-20241121-7530-to0hc8/openvino-2024.5.0/src/plugins/intel_gpu/src/runtime/ocl/ocl_wrapper.hpp:73,
                 from /tmp/openvino-20241121-7530-to0hc8/openvino-2024.5.0/src/plugins/intel_gpu/src/runtime/ocl/ocl_common.hpp:6,
                 from /tmp/openvino-20241121-7530-to0hc8/openvino-2024.5.0/src/plugins/intel_gpu/src/runtime/ocl/ocl_memory.hpp:7,
                 from /tmp/openvino-20241121-7530-to0hc8/openvino-2024.5.0/src/plugins/intel_gpu/src/runtime/memory.cpp:10:
/tmp/openvino-20241121-7530-to0hc8/openvino-2024.5.0/src/plugins/intel_gpu/src/runtime/ocl/ocl_ext.hpp:50:1: error: redefinition of ‘struct cl::detail::param_traits<cl::detail::cl_device_info, 16648>’
   50 | CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_SUB_GROUP_SIZES_INTEL, vector<size_type>)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/linuxbrew/.linuxbrew/include/CL/opencl.hpp:1909:1: note: previous definition of ‘struct cl::detail::param_traits<cl::detail::cl_device_info, 16648>’
 1909 | CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_SUB_GROUP_SIZES_INTEL, cl::vector<size_type>)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/openvino-20241121-7530-to0hc8/openvino-2024.5.0/src/plugins/intel_gpu/src/runtime/ocl/ocl_ext.hpp:271:1: error: redefinition of ‘struct cl::detail::param_traits<cl::detail::cl_device_info, 16976>’
  271 | CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_IP_VERSION_INTEL, cl_uint)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/linuxbrew/.linuxbrew/include/CL/opencl.hpp:1899:1: note: previous definition of ‘struct cl::detail::param_traits<cl::detail::cl_device_info, 16976>’
 1899 | CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_IP_VERSION_INTEL, cl_uint)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/openvino-20241121-7530-to0hc8/openvino-2024.5.0/src/plugins/intel_gpu/src/runtime/ocl/ocl_ext.hpp:272:1: error: redefinition of ‘struct cl::detail::param_traits<cl::detail::cl_device_info, 16977>’
  272 | CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_ID_INTEL, cl_uint)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/linuxbrew/.linuxbrew/include/CL/opencl.hpp:1900:1: note: previous definition of ‘struct cl::detail::param_traits<cl::detail::cl_device_info, 16977>’
 1900 | CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_ID_INTEL, cl_uint)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/openvino-20241121-7530-to0hc8/openvino-2024.5.0/src/plugins/intel_gpu/src/runtime/ocl/ocl_ext.hpp:273:1: error: redefinition of ‘struct cl::detail::param_traits<cl::detail::cl_device_info, 16978>’
  273 | CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_NUM_SLICES_INTEL, cl_uint)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/linuxbrew/.linuxbrew/include/CL/opencl.hpp:1901:1: note: previous definition of ‘struct cl::detail::param_traits<cl::detail::cl_device_info, 16978>’
 1901 | CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_NUM_SLICES_INTEL, cl_uint)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/openvino-20241121-7530-to0hc8/openvino-2024.5.0/src/plugins/intel_gpu/src/runtime/ocl/ocl_ext.hpp:274:1: error: redefinition of ‘struct cl::detail::param_traits<cl::detail::cl_device_info, 16979>’
  274 | CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_NUM_SUB_SLICES_PER_SLICE_INTEL, cl_uint)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/linuxbrew/.linuxbrew/include/CL/opencl.hpp:1902:1: note: previous definition of ‘struct cl::detail::param_traits<cl::detail::cl_device_info, 16979>’
 1902 | CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_NUM_SUB_SLICES_PER_SLICE_INTEL, cl_uint)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/openvino-20241121-7530-to0hc8/openvino-2024.5.0/src/plugins/intel_gpu/src/runtime/ocl/ocl_ext.hpp:275:1: error: redefinition of ‘struct cl::detail::param_traits<cl::detail::cl_device_info, 16980>’
  275 | CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_NUM_EUS_PER_SUB_SLICE_INTEL, cl_uint)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/li

The guess is that system OCL used in Homebrew Linux CI already have such definitions and we must evade redefinitions in our ocl_ext.hpp.

PR in homebrew itself
Homebrew/homebrew-core#198227

@artanokhov artanokhov requested review from a team as code owners November 22, 2024 10:43
@github-actions github-actions bot added the category: GPU OpenVINO GPU plugin label Nov 22, 2024
@artanokhov artanokhov force-pushed the fix-ocl-ext-redefine-homebrew branch 3 times, most recently from 7ffc5ff to 766e8cf Compare November 22, 2024 12:17
@ilya-lavrenov ilya-lavrenov added this to the 2024.6 milestone Nov 22, 2024
@ilya-lavrenov
Copy link
Contributor

build_jenkins


#endif // cl_intel_required_subgroup_size

#ifndef OV_CL_HPP_NO_REDECLARE_TRAITS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to use CL_DEVICE_SUB_GROUP_SIZES_INTEL here instead of custom macro OV_CL_HPP_NO_REDECLARE_TRAITS ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: GPU OpenVINO GPU plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants