[BugFix][OpenCL] Guard QCOM perf hint behind USE_OPENCL_EXTN_QCOM to avoid undefined symbol on non-QCOM runtimes#18589
Conversation
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Summary of ChangesHello @ping-ee, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical linking issue within the OpenCL runtime where QCOM-specific performance hint functions were inadvertently included in builds on platforms lacking QCOM OpenCL extensions. By introducing an additional conditional compilation flag, Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly fixes a linkage error that occurs on non-Qualcomm OpenCL runtimes. The issue arises because QCOM-specific macros are now defined in standard OpenCL headers, but the corresponding functions are not available to link against on unsupported platforms. By adding the USE_OPENCL_EXTN_QCOM build flag to the preprocessor guard, the code for setting performance hints is now only compiled when targeting Qualcomm devices, which is the correct behavior. The change is minimal, well-justified, and consistent with how other QCOM-specific extensions are handled in the codebase. The fix is sound and I have no further suggestions.
|
This PR reopens #18581 with the same commits. |
This PR is a re-open of #18581
The previous PR was created while Jenkins CI was experiencing a disk space issue and the CI job did not trigger.
PR Description
Recent OpenCL-Headers update (KhronosGroup/OpenCL-Headers#277
) added QCOM perf-hint definitions (
CL_CONTEXT_PERF_HINT_QCOM,clSetPerfHintQCOM) tocl_ext.h.These macros are now defined even on platforms whose OpenCL runtimes (e.g., PoCL, ICD loaders) do not implement the QCOM extension.
TVM previously enabled the perf-hint code path solely based on the presence of
CL_CONTEXT_PERF_HINT_QCOM, causing link errors such as:This PR guards the QCOM perf-hint logic behind
USE_OPENCL_EXTN_QCOM, matching the behavior of other QCOM-specific OpenCL paths (e.g.,SetNativePtr).Effects
Prevents accidental linking against unsupported QCOM symbols on non-QCOM runtimes.
Keeps QCOM builds fully functional when
USE_OPENCL_EXTN_QCOMis explicitly enabled.Aligns TVM’s extension handling across OpenCL code paths.