Laurawly commented on a change in pull request #4353: [Perf] Enhance cudnn and 
cublas backend and enable TensorCore
URL: https://github.com/apache/incubator-tvm/pull/4353#discussion_r347069637
 
 

 ##########
 File path: src/runtime/contrib/cublas/cublas.cc
 ##########
 @@ -36,6 +36,36 @@ inline cublasOperation_t BooleanToTranspose(bool item) {
   return item ? CUBLAS_OP_T : CUBLAS_OP_N;
 }
 
+inline void TryEnableTensorCore(cublasHandle_t hdl) {
+  // TensorCores are only supported in cublas 9.0 or higher
+  int version;
+  CHECK_CUBLAS_ERROR(cublasGetVersion(hdl, &version));
+  if (version >= 9000)
+    CHECK_CUBLAS_ERROR(cublasSetMathMode(hdl, CUBLAS_TENSOR_OP_MATH));
+}
+
+struct CublasHgemmOp {
+  typedef half TDatatype;
+  cublasHandle_t handle;
+  explicit CublasHgemmOp(cublasHandle_t hdl)
+      : handle(hdl)
+  {}
 
 Review comment:
   fix indent

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


With regards,
Apache Git Services

Reply via email to