comaniac commented on a change in pull request #7468:
URL: https://github.com/apache/tvm/pull/7468#discussion_r578641105
##########
File path: python/tvm/topi/cuda/nms.py
##########
@@ -610,8 +610,10 @@ def _get_sorted_indices(data, data_buf, score_index,
score_shape):
)
target = tvm.target.Target.current()
- # TODO(masahi): Check -libs=thrust option
- if target and target.kind.name in ["cuda", "rocm"] and
is_thrust_available():
+ if target and (
+ can_use_thrust(target, "tvm.contrib.thrust.sort")
+ or can_use_rocthrust(target, "tvm.contrib.thrust.sort")
+ ):
sort_tensor = argsort_thrust(score_tensor, axis=1, is_ascend=False,
dtype="int32")
else:
sort_tensor = argsort(score_tensor, axis=1, is_ascend=False,
dtype="int32")
Review comment:
Just a thought and feel free to ignore: Since THRUST won't be used
without `-libs=thrust` after this PR, would that be better to add a warning
message here if `tvm.contrib.thrust.sort` is available (i.e., users built TVM
with THRUST enabled) and target doesn't have `-libs=thrust`? We can then remove
the warning in the next release or so.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]