diff options
author | Manjunath Kudlur <keveman@gmail.com> | 2015-11-25 08:48:47 -0800 |
---|---|---|
committer | Manjunath Kudlur <keveman@gmail.com> | 2015-11-25 08:48:47 -0800 |
commit | 854f49bd43588c062b046384f239f64a3d819702 (patch) | |
tree | c2373bf71ef65ae4c116ea703947141281c1eace /tensorflow/core/util | |
parent | 9c3043ff3bf31a6a81810b4ce9e87ef936f1f529 (diff) |
TensorFlow: Upstream changes to git
Changes:
- Updates to docs
- Several changes for Python 3 compatibility
- Added license headers
Base CL: 108710566
Diffstat (limited to 'tensorflow/core/util')
-rw-r--r-- | tensorflow/core/util/cuda_kernel_helper.h | 9 | ||||
-rw-r--r-- | tensorflow/core/util/events_writer.cc | 2 | ||||
-rw-r--r-- | tensorflow/core/util/events_writer.h | 4 |
3 files changed, 12 insertions, 3 deletions
diff --git a/tensorflow/core/util/cuda_kernel_helper.h b/tensorflow/core/util/cuda_kernel_helper.h index 22a6e5dcef..86f974ee26 100644 --- a/tensorflow/core/util/cuda_kernel_helper.h +++ b/tensorflow/core/util/cuda_kernel_helper.h @@ -60,6 +60,15 @@ inline CudaLaunchConfig GetCudaLaunchConfig(int work_element_count, return config; } +template <typename T> +__device__ __host__ inline T ldg(const T* address) { +#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ >= 350 + return __ldg(address); +#else + return *address; +#endif +} + } // namespace tensorflow #endif // GOOGLE_CUDA diff --git a/tensorflow/core/util/events_writer.cc b/tensorflow/core/util/events_writer.cc index b210f42879..7ea03be5fd 100644 --- a/tensorflow/core/util/events_writer.cc +++ b/tensorflow/core/util/events_writer.cc @@ -90,7 +90,7 @@ string EventsWriter::FileName() { return filename_; } -void EventsWriter::WriteSerializedEvent(const string& event_str) { +void EventsWriter::WriteSerializedEvent(StringPiece event_str) { if (recordio_writer_.get() == NULL) { if (!Init()) { LOG(ERROR) << "Write failed because file could not be opened."; diff --git a/tensorflow/core/util/events_writer.h b/tensorflow/core/util/events_writer.h index 59488ef407..14f2594a28 100644 --- a/tensorflow/core/util/events_writer.h +++ b/tensorflow/core/util/events_writer.h @@ -61,8 +61,8 @@ class EventsWriter { // Append "event_str", a serialized Event, to the file. // Note that this function does NOT check that de-serializing event_str - // results in a valid Event proto. - void WriteSerializedEvent(const string& event_str); + // results in a valid Event proto. The tensorflow:: bit makes SWIG happy. + void WriteSerializedEvent(tensorflow::StringPiece event_str); // EventWriter automatically flushes and closes on destruction, but // these two methods are provided for users who want to write to disk sooner |