Skip to content

Commit 609dccf

Browse files
authored
Merge pull request #11395 from tensor-tang/fix
remove mkldnn flag from gtest strdup for cpu
2 parents 417fcf4 + 98b14a3 commit 609dccf

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

paddle/fluid/framework/executor.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,9 @@ void Executor::EnableMKLDNN(const ProgramDesc& program) {
406406
}
407407
}
408408
}
409+
#else
410+
LOG(WARNING)
411+
<< "'MKLDNN' is not supported, Please re-compile with WITH_MKLDNN option";
409412
#endif
410413
}
411414

paddle/fluid/inference/tests/book/test_inference_nlp.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ DEFINE_string(data_file, "", "File of input index data.");
2929
DEFINE_int32(repeat, 100, "Running the inference program repeat times");
3030
DEFINE_bool(prepare_vars, true, "Prepare variables before executor");
3131
DEFINE_int32(num_threads, 1, "Number of threads should be used");
32+
DECLARE_bool(use_mkldnn);
3233

3334
inline double GetCurrentMs() {
3435
struct timeval time;

paddle/testing/paddle_gtest_main.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ int main(int argc, char** argv) {
3131
strdup("--tryfromenv=fraction_of_gpu_memory_to_use,use_pinned_memory"));
3232
#else
3333
new_argv.push_back(strdup("--tryfromenv=use_pinned_memory,use_mkldnn"));
34+
new_argv.push_back(strdup("--undefok=use_mkldnn"));
3435
#endif
3536
int new_argc = static_cast<int>(new_argv.size());
3637
char** new_argv_address = new_argv.data();

0 commit comments

Comments
 (0)