lebeg commented on a change in pull request #13343: Mitigate exponential
complexity when running gpu_topology tests
URL: https://github.com/apache/incubator-mxnet/pull/13343#discussion_r235396762
##########
File path: tests/cpp/kvstore/gpu_topology_test.cc
##########
@@ -67,15 +63,18 @@ bool IsSatisfactory(const std::vector<float>& W, int
num_gpus, int depth) {
// Generates random link topology matrix using random number generator
void TestComputeTreesRandomized(int num_gpus, float alpha, int backtrack,
std::mt19937* gen) {
+ using namespace std;
std::uniform_real_distribution<> dis(0.f, 1.f);
bool satisfied = false;
std::vector<float> W(num_gpus*num_gpus, 0.f);
int depth = mxnet::kvstore::ComputeDepth(num_gpus);
- while (!satisfied) {
- float k = dis(*gen);
- std::fill(W.begin(), W.end(), 0.f);
- GenerateMatrix(&W, num_gpus, k, gen);
- satisfied = IsSatisfactory(W, num_gpus, depth);
+ std::fill(W.begin(), W.end(), 0.f);
Review comment:
According to `std::vector`'s
[constructor](https://en.cppreference.com/w/cpp/container/vector/vector), the
initialization is already done at [line
69](https://github.com/apache/incubator-mxnet/pull/13343/files#diff-aa4b0df5f0d88b507982b6c56307dc09R69).
----------------------------------------------------------------
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