access2rohit commented on a change in pull request #16104: Faster Transpose 2D
URL: https://github.com/apache/incubator-mxnet/pull/16104#discussion_r321500521
##########
File path: src/operator/tensor/matrix_op-inl.h
##########
@@ -257,6 +257,29 @@ struct TransposeParam : public
dmlc::Parameter<TransposeParam> {
}
};
+
+template<typename xpu, typename DType>
+MSHADOW_XINLINE void Transpose2D(DType *in, DType *out, index_t shape_0,
index_t shape_1) {
+// ensure cache line hits and prevent cache miss for any configuration
+index_t blocksize = 32;
+index_t n = shape_0;
+index_t p = shape_1;
+
+for (index_t i = 0; i < n; i += blocksize) {
+ #pragma omp parallel for
Review comment:
nit: align #pragma with underlying for loop
----------------------------------------------------------------
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]
With regards,
Apache Git Services