diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-03-14 13:47:22 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-03-14 13:55:47 -0700 |
commit | 16632df29d09b3bbe5cc75df39f5ec720225e6d1 (patch) | |
tree | 3dfe1ffb7d5c8a4fc0cb6f9f8f6ae1fc4145464a /tensorflow/contrib/makefile | |
parent | 4ff81a7d891c2affadb9c9068cf37fdb109c0e77 (diff) |
Remove nsync header files from tensorflow/core/platform/default/mutex.h
The implementation of tensorflow/core/platform/default/mutex.h uses the nsync
library, so mutex.h has included nsync header files.
This has been awkward, because each TensorFlow build (bazel, cmake, make, plus
the instructions for compiling individual custom ops, on all the various
platforms) has needed to handle the include paths correctly, reaching into a
package that is downloaded separately from TensorFlow itself.
This change avoids that awkwardness, instead taking on two different
irritations:
- mutex.h now defines two structs that are large enough and aligned enough to
contain an nsync_mu and an nsync_cv. This is an abstraction violation,
because TensorFlow's source should not need to know how big these data
structures are. However, this is unlikely to cause problems because:
1) this is checked by a static assertion in mutex.cc, so we will notice
immediately should a change be needed, and
2) this will likely never fail because we have no intent of allowing nsync's
data strcutures to get bigger.
- The methods of mutex and condition_variable can no longer be inlined, because
that too would require mutex.h to include the nsync header files. (Or we'd
need to declare the nsync functions directly in mutex.h, which would be
another abstraction violation.) However, this is a small imposition
because the overhead of a procedure call is typically small.
The assumption behind this CL is that these irritations are less important than
the ongoing frustration of maintaining the complex include path in multiple build
systems.
PiperOrigin-RevId: 189079523
Diffstat (limited to 'tensorflow/contrib/makefile')
-rw-r--r-- | tensorflow/contrib/makefile/proto_text_cc_files.txt | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tensorflow/contrib/makefile/proto_text_cc_files.txt b/tensorflow/contrib/makefile/proto_text_cc_files.txt index d56e388477..77c936d8c5 100644 --- a/tensorflow/contrib/makefile/proto_text_cc_files.txt +++ b/tensorflow/contrib/makefile/proto_text_cc_files.txt @@ -17,6 +17,7 @@ tensorflow/core/platform/env_time.cc tensorflow/core/platform/setround.cc tensorflow/core/platform/denormal.cc tensorflow/core/platform/default/tracing.cc +tensorflow/core/platform/default/mutex.cc tensorflow/core/platform/default/logging.cc tensorflow/core/platform/cpu_info.cc tensorflow/core/lib/wav/wav_io.cc |