Support benchmark on windows machines

Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/10564

Reviewed By: llyfacebook

Differential Revision: D9356389

Pulled By: sf-wind

fbshipit-source-id: f6c58e68d3eaf3a39c9f89b8f04e6039c75b4cd9
This commit is contained in:
Fei Sun 2018-08-16 10:48:42 -07:00 committed by Facebook Github Bot
parent 00f2731112
commit 319fefe9e6
2 changed files with 8 additions and 1 deletions

View File

@ -15,6 +15,8 @@
*/
#include <string>
#include <chrono>
#include <thread>
#include "binaries/benchmark_helper.h"
#include "caffe2/core/blob_serialization.h"
@ -241,7 +243,7 @@ void runNetwork(
caffe2::wipe_cache();
}
if (sleep_before_run > 0) {
sleep(sleep_before_run);
std::this_thread::sleep_for(std::chrono::seconds(sleep_before_run));
}
LOG(INFO) << "Main runs.";
CAFFE_ENFORCE(

View File

@ -18,6 +18,10 @@ if NOT DEFINED USE_CUDA (
set USE_CUDA=OFF
)
if NOT DEFINED USE_OBSERVERS (
set USE_OBSERVERS=OFF
)
if NOT DEFINED CMAKE_GENERATOR (
if DEFINED APPVEYOR_BUILD_WORKER_IMAGE (
if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2017" (
@ -61,6 +65,7 @@ cmake .. ^
-DUSE_GFLAGS=OFF ^
-DUSE_LMDB=OFF ^
-DUSE_LEVELDB=OFF ^
-DUSE_OBSERVERS=%USE_OBSERVERS%^
-DUSE_ROCKSDB=OFF ^
-DUSE_OPENCV=OFF ^
-DBUILD_SHARED_LIBS=OFF ^