tvm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-tvm] junrushao1994 commented on a change in pull request #5863: [TIR][REFACTOR][API-CHANGE] Change Call.name to Call.op(RelayExpr)
Date Mon, 22 Jun 2020 21:14:28 GMT

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:
users@infra.apache.org



Mime
View raw message