From c5980c35660d758cdf3c0e7fcf2a38004defdc84 Mon Sep 17 00:00:00 2001 From: dongdaxiang Date: Wed, 27 Mar 2019 21:06:11 +0800 Subject: [PATCH] add _LINUX macro test=develop --- paddle/fluid/framework/data_feed.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/paddle/fluid/framework/data_feed.cc b/paddle/fluid/framework/data_feed.cc index 8f19f68ed2..00ef061045 100644 --- a/paddle/fluid/framework/data_feed.cc +++ b/paddle/fluid/framework/data_feed.cc @@ -12,8 +12,15 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ +#if defined _WIN32 || defined __APPLE__ +#else +#define _LINUX +#endif + #include "paddle/fluid/framework/data_feed.h" +#ifdef _LINUX #include +#endif #include #include "gflags/gflags.h" #include "google/protobuf/io/zero_copy_stream_impl.h" @@ -101,6 +108,7 @@ bool PrivateQueueDataFeed::Start() { template void PrivateQueueDataFeed::ReadThread() { +#ifdef _LINUX std::string filename; while (PickOneFile(&filename)) { int err_no = 0; @@ -112,6 +120,7 @@ void PrivateQueueDataFeed::ReadThread() { } } queue_->Close(); +#endif } template @@ -248,6 +257,7 @@ void InMemoryDataFeed::FillMemoryDataToChannel() { template void InMemoryDataFeed::FillChannelToMemoryData() { +#ifdef _LINUX VLOG(3) << "FillChannelToMemoryData, thread_id=" << thread_id_; std::vector local_vec; std::shared_ptr> channel = nullptr; @@ -278,10 +288,12 @@ void InMemoryDataFeed::FillChannelToMemoryData() { << ", thread_id=" << thread_id_; } std::vector().swap(local_vec); +#endif } template void InMemoryDataFeed::LoadIntoMemory() { +#ifdef _LINUX VLOG(3) << "LoadIntoMemory() begin, thread_id=" << thread_id_; std::vector local_vec; std::string filename; @@ -317,6 +329,7 @@ void InMemoryDataFeed::LoadIntoMemory() { } std::vector().swap(local_vec); VLOG(3) << "LoadIntoMemory() end, thread_id=" << thread_id_; +#endif } template -- GitLab