Skip to content

Conversation

@MasterJH5574
Copy link
Contributor

This PR fixes a bug of deciding whether a function is host or device function in TIR build.

Previously the decision is made based on checking whether "cpu" is a substring of the target string. This check fails to work for ROCm target, which usually comes with an "mcpu" attribute that also contains "cpu".

This PR fixes by checking target kind. Targets with kind "llvm" or "c" will be treated as host functions.

This PR fixes a bug of deciding whether a function is host
or device function in TIR build.

Previously the decision is made based on checking whether `"cpu"`
is a substring of the target string. This check fails to work
for ROCm target, which usually comes with an `"mcpu"` attribute
that also contains `"cpu"`.

This PR fixes by checking target kind. Targets with kind `"llvm"`
or `"c"` will be treated as host functions.
@tqchen tqchen merged commit 532db33 into apache:main Aug 8, 2025
13 checks passed
ShiboXing pushed a commit to ShiboXing/tvm that referenced this pull request Aug 10, 2025
This PR fixes a bug of deciding whether a function is host
or device function in TIR build.

Previously the decision is made based on checking whether `"cpu"`
is a substring of the target string. This check fails to work
for ROCm target, which usually comes with an `"mcpu"` attribute
that also contains `"cpu"`.

This PR fixes by checking target kind. Targets with kind `"llvm"`
or `"c"` will be treated as host functions.
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.

3 participants