[BugFix][OpenCL] Guard QCOM perf hint behind USE_OPENCL_EXTN_QCOM to avoid undefined symbol on non-QCOM runtimes #18589
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.