aws-taylor commented on a change in pull request #17230: Additional fix for
vector access.
URL: https://github.com/apache/incubator-mxnet/pull/17230#discussion_r363880914
##########
File path: 3rdparty/mshadow/mshadow/dot_engine-inl.h
##########
@@ -421,12 +421,9 @@ struct BLASEngine<cpu, double> {
CBLAS_TRANSPOSE p_transa[GROUP_SIZE] = {cblas_a_trans};
CBLAS_TRANSPOSE p_transb[GROUP_SIZE] = {cblas_b_trans};
- std::vector<const double*> pp_A;
- std::vector<const double*> pp_B;
- std::vector<double*> pp_C;
- pp_A.reserve(batch_count);
- pp_B.reserve(batch_count);
- pp_C.reserve(batch_count);
+ std::vector<const double*> pp_A(batch_count, nullptr);
Review comment:
I did this because it's precisely the same logic used by the earlier commit.
That being said, I believe the STL guarantees that non-class types will be
zero initialized when using the constructor form you propose, so I would expect
the performance of the two forms to be identical.
----------------------------------------------------------------
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