You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/04/02 06:33:34 UTC

[GitHub] [incubator-tvm] wpan11nv commented on a change in pull request #5209: [CodeGen][CUDA] Fix bugs

wpan11nv commented on a change in pull request #5209: [CodeGen][CUDA] Fix bugs
URL: https://github.com/apache/incubator-tvm/pull/5209#discussion_r402080514
 
 

 ##########
 File path: src/target/source/codegen_cuda.cc
 ##########
 @@ -352,6 +354,37 @@ void CodeGenCUDA::PrintStorageScope(
   }
 }
 
+void CodeGenCUDA::VisitExpr_(const CastNode* op, std::ostream& os) {
+  DataType from_ty = op->value.dtype();
+  DataType target_ty = op->dtype;
+  CHECK_EQ(target_ty.lanes(), from_ty.lanes());
+
+  // Emit simple C-style type conversion.
+  if (from_ty.is_scalar())
+    return CodeGenC::VisitExpr_(op, os);
+
+  // We could emit make_float4 like calls, but the emitted code looks
+  // too compact to read. Emit this as vectorized unary ops.
 
 Review comment:
   No, typical optimizations like mem2reg will promote temporary into registers and make them equivalent. 

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


With regards,
Apache Git Services