Hello I'm executing a std::foreach like:
std::for_each(
std::execution::par_unseq,
vector_of_int.begin(),
vvector_of_int.end(),
[&captured_variables](auto &v) { Execute(v, captured_variables); }
);
when i build with DEBUG version (cmake -DCMAKE_BUILD_TYPE=Debug ..), it runs with multi thread (i can check it with htop) but when i build with RELEASE version (cmake -DCMAKE_BUILD_TYPE=Release ..), it runs with single thread
its there something i must check?
i'm using c++17 / g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 with
cmake_minimum_required(VERSION 3.1)
set(CMAKE_CXX_STANDARD 17)
target_link_libraries(MyCode pthread tbb)
I tried to run the below sample program on my machine having g++ (Ubuntu 11.1.0-1ubuntu1~18.04.1) 11.1.0.
My CMakeLists.txt is as below:
I didn't face any such behavior that you mentioned above. It is running in a multi-threaded fashion using both "Release & Debug" modes. Please refer to the screenshots below:
Thanks, Santosh