Skip to content

Conversation

@ping-ee
Copy link
Contributor

@ping-ee ping-ee commented Dec 17, 2025

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) to cl_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:

undefined symbol: clSetPerfHintQCOM

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_QCOM is explicitly enabled.
Aligns TVM’s extension handling across OpenCL code paths.

ping-ee and others added 2 commits December 11, 2025 18:20
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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, USE_OPENCL_EXTN_QCOM, the change ensures that these QCOM-specific calls are only compiled when explicitly enabled, thereby preventing undefined symbol errors and maintaining proper functionality for both QCOM and non-QCOM OpenCL environments.

Highlights

  • Bug Fix: Resolves a linking error where clSetPerfHintQCOM caused undefined symbol errors on non-QCOM OpenCL runtimes.
  • Conditional Compilation: The QCOM performance hint logic is now guarded by USE_OPENCL_EXTN_QCOM in addition to CL_CONTEXT_PERF_HINT_QCOM.
  • Consistency: Aligns the handling of QCOM-specific OpenCL extensions with other existing QCOM-specific code paths in TVM.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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.

@ping-ee
Copy link
Contributor Author

ping-ee commented Dec 17, 2025

This PR reopens #18581 with the same commits.
The previous PR did not trigger Jenkins CI due to a disk space issue.

@mshr-h mshr-h merged commit 5989ef5 into apache:main Dec 17, 2025
20 checks passed
@ping-ee ping-ee deleted the guard-clSetPerfHintQCOM branch December 17, 2025 14:10
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