iblis17 commented on a change in pull request #7741: New operators linalg_syrk,
linalg_gelqf
URL: https://github.com/apache/incubator-mxnet/pull/7741#discussion_r137701127
##########
File path: src/operator/linalg_impl.h
##########
@@ -719,4 +719,137 @@ LINALG_GPU_BATCH_POTRI(double)
#endif
+//////////////////////////////// SYRK
////////////////////////////////////////////
+
+// CPU/GPU-versions of BLAS3 function "syrk". Please refer to the
BLAS3-documentation
+// for further information about the function and its parameters.
+// Note that this is B = syrk(A, B), so B is input and output parameter.
+
+#if MSHADOW_USE_CBLAS == 1
+
+template<typename xpu, typename DType> inline
+void check_syrk(const Tensor<xpu, 2, DType>& A, const Tensor<xpu, 2, DType>& B,
+ DType alpha, DType beta, bool tA) {
+ // Any checking that helps user debug potential problems.
+ CHECK_EQ(B.size(0), B.size(1))
+ << "B must be square symmetric matrix for syrk";
+ CHECK_EQ((tA ? A.size(1) : A.size(0)), B.size(0))
+ << "Non compatible matrix dimensions between inputs A and B for syrk";
+}
+
+#define LINALG_CPU_SYRK(fname, DType) \
+template<> inline \
+void linalg_syrk<cpu, DType>(const Tensor<cpu, 2, DType>& A, \
+ const Tensor<cpu, 2, DType>& B, DType alpha, \
+ DType beta, bool tA, Stream<cpu> *s) { \
+ check_syrk(A, B, alpha, beta, tA); \
+ cblas_##fname(CblasRowMajor, CblasLower, (tA ? CblasTrans : CblasNoTrans), \
Review comment:
I finally figure out that MXNet.jl need a modified `cblas.h`:
https://github.com/dmlc/MXNet.jl/blob/master/deps/cblas.h
I will manage to send a patch for that. @mseeger thanks for your time and
explanation!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services