Skip to content

Conversation

@ContradNamiseb
Copy link
Contributor

This pr adds openvino for intel igpu's, may be useful for igpu's that don't support sycl(e,g intel 10th gen and below).
This supports:

  • OnnxRuntime 1.22.0 Release and
  • OpenVINO™ 2025.1.0 Release

Comment on lines +41 to +47
#if __has_include("CL/opencl.hpp")
#include "CL/opencl.hpp"
#elif __has_include("OpenCL/opencl.hpp")
#include "OpenCL/opencl.hpp"
#else
#include "opencl.hpp"
#endif
Copy link
Member

@borg323 borg323 Aug 25, 2025

Choose a reason for hiding this comment

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

This should be guarded by a #if __has_include("CL/opencl.h") and should define a USE_OPENVINO or USE_OPECL symbol to exclude the code that will fail to build otherwise.

Also OpenCL/opencl.hpp is only for apple systems AFAIK, does openvino support them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it should be supported by apple but that was not my intent here.

}
case OnnxProvider::OPENVINO: {
auto ocl_instance = std::make_shared<OpenCL>();
cl_context opencl_context = ocl_instance->context_.get();
Copy link
Member

Choose a reason for hiding this comment

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

Is this necessary or optional?

Copy link
Contributor Author

@ContradNamiseb ContradNamiseb Aug 25, 2025

Choose a reason for hiding this comment

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

No. its optional. When you don't want to use cl_context that is.

Copy link
Member

Choose a reason for hiding this comment

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

Then make it conditional on USE_OPENCL defined earlier in the file if __has_include("CL/opencl.h") is true.

@ContradNamiseb ContradNamiseb marked this pull request as draft August 29, 2025 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants