From d0c672f33bcc1b7445e035dbfed403722c3c21f7 Mon Sep 17 00:00:00 2001 From: Rajy Rawther Date: Mon, 20 Jul 2020 12:36:18 -0700 Subject: [PATCH] RALI - fix build error with tot (#339) --- rali/rali/include/tf_record_reader.h | 3 +++ rali/rali/source/tf_record_reader.cpp | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/rali/rali/include/tf_record_reader.h b/rali/rali/include/tf_record_reader.h index a2f19e8c2c..27692b7ac4 100644 --- a/rali/rali/include/tf_record_reader.h +++ b/rali/rali/include/tf_record_reader.h @@ -29,6 +29,7 @@ THE SOFTWARE. #include #include #include "reader.h" +#include "timing_debug.h" #include #include "example.pb.h" #include "feature.pb.h" @@ -60,6 +61,7 @@ class TFRecordReader : public Reader std::string id() override { return _last_id;}; unsigned count() override; + unsigned long long get_shuffle_time() {return _shuffle_time.get_timing();}; ~TFRecordReader() override; @@ -106,5 +108,6 @@ class TFRecordReader : public Reader Reader::Status read_image(unsigned char* buff, std::string record_file_name, uint file_size); Reader::Status read_image_names(std::ifstream &file_contents, uint file_size); std::map _image_record_starting; + TimingDBG _shuffle_time; }; diff --git a/rali/rali/source/tf_record_reader.cpp b/rali/rali/source/tf_record_reader.cpp index 40997748b1..485c05f53a 100644 --- a/rali/rali/source/tf_record_reader.cpp +++ b/rali/rali/source/tf_record_reader.cpp @@ -34,7 +34,8 @@ THE SOFTWARE. namespace filesys = boost::filesystem; -TFRecordReader::TFRecordReader() +TFRecordReader::TFRecordReader(): + _shuffle_time("shuffle_time", DBG_TIMING) { _src_dir = nullptr; _sub_dir = nullptr; @@ -69,8 +70,10 @@ Reader::Status TFRecordReader::initialize(ReaderConfig desc) _shuffle = desc.shuffle(); ret = folder_reading(); //shuffle dataset if set + _shuffle_time.start(); if (ret == Reader::Status::OK && _shuffle) std::random_shuffle(_file_names.begin(), _file_names.end()); + _shuffle_time.end(); return ret; }