diff --git a/src/controllers/aer_controller.hpp b/src/controllers/aer_controller.hpp index 3fdbddf7c1..63c662a739 100644 --- a/src/controllers/aer_controller.hpp +++ b/src/controllers/aer_controller.hpp @@ -963,10 +963,10 @@ Result Controller::execute(std::vector &circuits, parallel_nested_ = true; // nested should be set to zero if num_threads clause will be used -#if defined(_WIN64) || defined(_WIN32) - omp_set_nested(0); -#else +#ifdef _OPENMP >= 200805 omp_set_max_active_levels(0); +#else + omp_set_nested(0); #endif result.metadata.add(parallel_nested_, "omp_nested");