# Opencv compiled with openmp not work in cv::parallel\_for

**URL:** <https://forum.opencv.org/t/opencv-compiled-with-openmp-not-work-in-cv-parallel-for/17682>\
**Category:** C++\
**Tags:** resize, build, openmp\
**Created:** [May 18, 2024, 3:10am UTC](https://forum.opencv.org/t/opencv-compiled-with-openmp-not-work-in-cv-parallel-for/17682 "2024-05-18T03:10:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tenglike](https://avatars.discourse-cdn.com/v4/letter/t/e9c0ed/32.png) [@tenglike](https://forum.opencv.org/u/tenglike)\
**Post date:** [May 18, 2024, 3:10am UTC](https://forum.opencv.org/t/opencv-compiled-with-openmp-not-work-in-cv-parallel-for/17682/1 "2024-05-18T03:10:40Z")

</div>

I use cmake-gui to build opencv on NVIDIA Jetsion Xavier NX, and tick WITH OPENMP option.After, I loop simple cv::resize (source image size:1280x1024, destination image size:10000x10000, INTER\_LINRAR). However, I find that only one core of CPU is 100%. It seems that cv::parallel\_for not use openmp in cv::resize(). The code seems to say that macro HAVE\_OPENMP must exist. So how can I use parallel\_for with openmp?
