aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Benjamin Kramer <kramerb@google.com>2018-10-02 10:15:11 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-10-02 10:19:31 -0700
commitdd66b78b38b457c7d37527472c4e92a7a07f4b09 (patch)
tree7bc3fbbd547ae88c9ef06a71b7c15e20be41e756
parentce41d2f95e1e5883f1808030c94fd9aaa57d9f10 (diff)
[XLA] Fix some outdated comments referring to FlatMap
Also convert unordered_map to flat/node_hash_map where the comments allow. PiperOrigin-RevId: 215410566
-rw-r--r--tensorflow/compiler/xla/service/BUILD2
-rw-r--r--tensorflow/compiler/xla/service/allocation_tracker.h5
-rw-r--r--tensorflow/compiler/xla/service/gpu/BUILD1
-rw-r--r--tensorflow/compiler/xla/service/gpu/nvptx_compiler.h9
-rw-r--r--tensorflow/compiler/xla/service/hlo_evaluator.h5
5 files changed, 11 insertions, 11 deletions
diff --git a/tensorflow/compiler/xla/service/BUILD b/tensorflow/compiler/xla/service/BUILD
index 13803f5ebe..3f8b734afb 100644
--- a/tensorflow/compiler/xla/service/BUILD
+++ b/tensorflow/compiler/xla/service/BUILD
@@ -253,8 +253,8 @@ cc_library(
"//tensorflow/compiler/xla:xla_data_proto",
"//tensorflow/core:lib",
"@com_google_absl//absl/algorithm:container",
- "@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:inlined_vector",
+ "@com_google_absl//absl/container:node_hash_map",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:optional",
diff --git a/tensorflow/compiler/xla/service/allocation_tracker.h b/tensorflow/compiler/xla/service/allocation_tracker.h
index af227fe4da..43feccee3c 100644
--- a/tensorflow/compiler/xla/service/allocation_tracker.h
+++ b/tensorflow/compiler/xla/service/allocation_tracker.h
@@ -124,10 +124,7 @@ class AllocationTracker {
int64 next_handle_ GUARDED_BY(mutex_);
// A map from device ordinal to AllocationMap.
- //
- // This is not a TF FlatMap because (currently) FlatMap (and therefore
- // AllocationMap) is not movable.
- std::unordered_map<int, AllocationMap> opaque_to_allocation_map_
+ absl::flat_hash_map<int, AllocationMap> opaque_to_allocation_map_
GUARDED_BY(mutex_);
// A map from data handle to a vector of shaped buffers that represent the
diff --git a/tensorflow/compiler/xla/service/gpu/BUILD b/tensorflow/compiler/xla/service/gpu/BUILD
index a838464cae..522e9f5948 100644
--- a/tensorflow/compiler/xla/service/gpu/BUILD
+++ b/tensorflow/compiler/xla/service/gpu/BUILD
@@ -718,6 +718,7 @@ cc_library(
"//tensorflow/core:lib_internal",
"//tensorflow/core:regexp_internal",
"//tensorflow/core:stream_executor_no_cuda",
+ "@com_google_absl//absl/container:node_hash_map",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:optional",
diff --git a/tensorflow/compiler/xla/service/gpu/nvptx_compiler.h b/tensorflow/compiler/xla/service/gpu/nvptx_compiler.h
index 8e97774750..c4a0b727cd 100644
--- a/tensorflow/compiler/xla/service/gpu/nvptx_compiler.h
+++ b/tensorflow/compiler/xla/service/gpu/nvptx_compiler.h
@@ -20,6 +20,7 @@ limitations under the License.
#include <string>
#include <vector>
+#include "absl/container/node_hash_map.h"
#include "absl/types/optional.h"
#include "absl/types/span.h"
#include "tensorflow/compiler/xla/service/executable.h"
@@ -140,10 +141,10 @@ class NVPTXCompiler : public LLVMCompiler {
tensorflow::condition_variable compilation_done_cv_;
};
- // Don't even think about switching this to FlatMap; iterator stability is
- // critical here.
- std::unordered_map<CompilationCacheKey, CompilationCacheValue,
- CompilationCacheHash, CompilationCacheEq>
+ // Don't even think about switching this to flat_hash_map; iterator stability
+ // is critical here.
+ absl::node_hash_map<CompilationCacheKey, CompilationCacheValue,
+ CompilationCacheHash, CompilationCacheEq>
compilation_cache_ GUARDED_BY(mutex_);
TF_DISALLOW_COPY_AND_ASSIGN(NVPTXCompiler);
diff --git a/tensorflow/compiler/xla/service/hlo_evaluator.h b/tensorflow/compiler/xla/service/hlo_evaluator.h
index 6c2662ebae..2b0792616e 100644
--- a/tensorflow/compiler/xla/service/hlo_evaluator.h
+++ b/tensorflow/compiler/xla/service/hlo_evaluator.h
@@ -18,6 +18,7 @@ limitations under the License.
#include <memory>
+#include "absl/container/node_hash_map.h"
#include "absl/memory/memory.h"
#include "absl/types/span.h"
#include "tensorflow/compiler/xla/service/dfs_hlo_visitor_with_default.h"
@@ -210,8 +211,8 @@ class HloEvaluator : public DfsHloVisitorWithDefault {
// post-orderring.
// Must be cleared for each evaluation.
// Storing Literal in place require the container to have pointer stability so
- // we cannot use FlatMap any more.
- std::unordered_map<const HloInstruction*, Literal> evaluated_;
+ // we cannot use flat_hash_map any more.
+ absl::node_hash_map<const HloInstruction*, Literal> evaluated_;
private:
template <typename ReturnT, typename NativeT>