junrushao1994 commented on a change in pull request #5863:
URL: https://github.com/apache/incubator-tvm/pull/5863#discussion_r443830077



##########
File path: src/target/source/intrin_rule_cuda.cc
##########
@@ -93,32 +96,36 @@ struct CUDAPopcount {
 };
 
 struct CUDAWarpIntrinsic {
-  const char* operator()(DataType t, const std::string& name) const {
-    if (name == intrinsic::tvm_warp_shuffle) {
-      return "__shfl_sync";
-    }
-    if (name == intrinsic::tvm_warp_shuffle_up) {
-      return "__shfl_up_sync";
+  const Op operator()(DataType t, const Op& orig_op) const {
+    if (orig_op.same_as(builtin::tvm_warp_shuffle())) {
+      return Op::Get("tir.cuda.__shfl_sync");
     }
-    if (name == intrinsic::tvm_warp_shuffle_down) {
-      return "__shfl_down_sync";
+    if (orig_op.same_as(builtin::tvm_warp_shuffle_up())) {
+      return Op::Get("tir.cuda.__shfl_up_sync");
     }
-    if (name == intrinsic::tvm_warp_activemask) {
-      return "__activemask";
+
+    if (orig_op.same_as(builtin::tvm_warp_shuffle_down())) {
+      return Op::Get("tir.cuda.__shfl_down_sync");
     }
-    return "";
+    return Op(nullptr);

Review comment:
       shall we just LOG(FATAL) here and throw?




----------------------------------------------------------------
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]


Reply via email to