roastduck commented on a change in pull request #5498:
URL: https://github.com/apache/incubator-tvm/pull/5498#discussion_r419033202



##########
File path: src/target/source/intrin_rule_cuda.cc
##########
@@ -91,6 +106,19 @@ static void DispatchCUDAShuffle(const TVMArgs& args, 
TVMRetValue* rv) {
       call->dtype, "__shfl", cuda_args, CallNode::PureExtern);
 }
 
+static void DispatchCUDAShuffleSync(const TVMArgs& args, TVMRetValue* rv) {
+  PrimExpr e = args[0];
+  const CallNode* call = e.as<CallNode>();
+  CHECK(call != nullptr);
+  CHECK_EQ(call->args.size(), 4);  // value, warp_id/offset, width, warp_size
+
+  // mask is ignored.
+  const std::string& name = CUDAShuffleSync()(call->name);
+  auto mask = IntImm(DataType::UInt(32), 0xFFFFFFFF);

Review comment:
       Can we reserve `mask` as an argument? Since it is critical when there 
are branch divergence. `0xFFFFFFFF` is only a special case.




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