tvm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-tvm] wpan11nv commented on a change in pull request #5209: [CodeGen][CUDA] Fix bugs
Date Thu, 02 Apr 2020 06:33:34 GMT
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

Mime
View raw message