diff --git a/src/io/io.cpp b/src/io/io.cpp index 5eb1582a70b9f63925e02c41a486d30cae0c7f44..ad1650a266bb26bdc689f1cce766d7238bc852e0 100644 --- a/src/io/io.cpp +++ b/src/io/io.cpp @@ -172,22 +172,17 @@ const framework::Program Loader::Load( // DLOG << "n_ops: " << (*c_program->blocks)->n_ops; // - std::shared_ptr originProgramDesc = - std::make_shared(c_program); + auto originProgramDesc = std::make_shared(c_program); framework::Program program; program.model_path = dirname; program.originProgram = originProgramDesc; - std::shared_ptr scope = - std::make_shared(); + auto scope = std::make_shared(); program.scope = scope; - originProgramDesc->Block(0); for (const auto &block : originProgramDesc->Blocks()) { - for (int i = 0; i < block->Vars().size(); ++i) { - std::shared_ptr var_desc = block->Vars()[i]; - // DLOG << "var name-- " << var_desc->Name(); + for (auto var_desc : block->Vars()) { auto var = scope->Var(var_desc->Name()); if (var_desc->Type() == framework::VARTYPE_TYPE_LOD_TENSOR) { diff --git a/test/common/test_openmp.cpp b/test/common/test_openmp.cpp index c92fc919936b067ad70f40e3f5b3acd725e845e2..790c434101e20478853b7079533403d65dc829ba 100644 --- a/test/common/test_openmp.cpp +++ b/test/common/test_openmp.cpp @@ -16,6 +16,7 @@ limitations under the License. */ #include int main(void) { +#ifdef PADDLE_MOBILE_USE_OPENMP #pragma omp parallel num_threads(2) { // int thread_id = omp_get_thread_num(); @@ -23,5 +24,6 @@ int main(void) { // std::cout << "Hello, OMP " << thread_id << "/" << nthreads << // "\n"; } +#endif return 0; }