diff options
author | 2016-08-19 15:29:44 -0800 | |
---|---|---|
committer | 2016-08-19 16:32:58 -0700 | |
commit | 67df783697027d8af0e848a1bc71aeafd82f78a2 (patch) | |
tree | c5e6bb2a87a09f7eb6e587f976b706ed674353a9 /tensorflow/core/util/presized_cuckoo_map.h | |
parent | 8c08b34a0b9fd51c5cd3166f2d99e1246e2e6645 (diff) |
Automated rollback of change 130775324
Change: 130804905
Diffstat (limited to 'tensorflow/core/util/presized_cuckoo_map.h')
-rw-r--r-- | tensorflow/core/util/presized_cuckoo_map.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/tensorflow/core/util/presized_cuckoo_map.h b/tensorflow/core/util/presized_cuckoo_map.h index 5244ab693a..b488d32e03 100644 --- a/tensorflow/core/util/presized_cuckoo_map.h +++ b/tensorflow/core/util/presized_cuckoo_map.h @@ -50,10 +50,7 @@ class PresizedCuckooMap { // The key type is fixed as a pre-hashed key for this specialized use. typedef uint64 key_type; - explicit PresizedCuckooMap(uint64 num_entries) { Clear(num_entries); } - - void Clear(uint64 num_entries) { - cpq_.reset(new CuckooPathQueue()); + explicit PresizedCuckooMap(uint64 num_entries) : cpq_(new CuckooPathQueue) { double n(num_entries); n /= kLoadFactor; num_buckets_ = (static_cast<uint64>(n) / kSlotsPerBucket); @@ -65,7 +62,6 @@ class PresizedCuckooMap { for (int i = 0; i < kSlotsPerBucket; i++) { empty_bucket.keys[i] = kUnusedSlot; } - buckets_.clear(); buckets_.resize(num_buckets_, empty_bucket); #if !defined(__GCUDACC__) && !defined(__GCUDACC_HOST__) buckets_divisor_ = Eigen::internal::TensorIntDivisor<uint64>(num_buckets_); @@ -321,7 +317,7 @@ class PresizedCuckooMap { std::vector<Bucket> buckets_; Eigen::internal::TensorIntDivisor<uint64> buckets_divisor_; // for fast mod - std::unique_ptr<CuckooPathQueue> cpq_; + const std::unique_ptr<CuckooPathQueue> cpq_; CuckooPathEntry visited_[kVisitedListSize]; TF_DISALLOW_COPY_AND_ASSIGN(PresizedCuckooMap); |