- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I try to use MKL and DPL, when I include both header file in the same cpp file like this:
#include <oneapi/mkl.hpp>
#include <oneapi/dpl/execution>
#include <oneapi/dpl/algorithm>
There will be an error:
In file included from /opt/intel/oneapi/dpl/2021.5.0/linux/include/oneapi/dpl/execution:23:
In file included from /usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/execution:32:
In file included from /usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/pstl/glue_execution_defs.h:50:
In file included from /usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/pstl/algorithm_impl.h:22:
In file included from /usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/pstl/parallel_backend.h:16:
/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/pstl/parallel_backend_tbb.h:70:10: error: no member named 'task' in namespace 'tbb'
tbb::task::self().group()->cancel_group_execution();
However, if i change the order:
#include <oneapi/dpl/execution>
#include <oneapi/dpl/algorithm>
#include <oneapi/mkl.hpp>
it can be built successfully.
Is it a bug? please confirm.
The attachment is my sample. You can run it by:
mkdir build && cd build
cmake ..
make
For my computer, the oneapi version is: 2021.4.0.3422
and system is: Linux tigerlake-i5-1135G7-qwerty 5.11.0-38-generic #42~20.04.1-Ubuntu
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for reaching out to us.
>> if i change the order...it can be built successfully.Is it a bug? please confirm.
Yes it is a known issue and it is already mentioned in oneTBB release notes
An application using Parallel STL algorithms in libstdc++ versions 9 and 10 may fail to compile due to incompatible interface changes between earlier versions of Threading Building Blocks (TBB) and oneAPI Threading Building Blocks (oneTBB).
Reordering of the header files is one way to avoid errors as you have mentioned
and another way is to set the following macros PSTL_USE_PARALLEL_POLICIES (in libstdc++ 9) or _GLIBCXX_USE_TBB_PAR_BACKEND (in libstdc++ 10) to zero.
You can set these macros even during compilation as shown below
eg: dpcpp <filename> -DPSTL_USE_PARALLEL_POLICIES=0 # for libstdc++ 9
dpcpp <filename> -D_GLIBCXX_USE_TBB_PAR_BACKEND=0 # for libstdc++ 10
Please refer to the below link for more details
Hope the provided information helps.
Regards,
Vidya.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for reaching out to us.
>> if i change the order...it can be built successfully.Is it a bug? please confirm.
Yes it is a known issue and it is already mentioned in oneTBB release notes
An application using Parallel STL algorithms in libstdc++ versions 9 and 10 may fail to compile due to incompatible interface changes between earlier versions of Threading Building Blocks (TBB) and oneAPI Threading Building Blocks (oneTBB).
Reordering of the header files is one way to avoid errors as you have mentioned
and another way is to set the following macros PSTL_USE_PARALLEL_POLICIES (in libstdc++ 9) or _GLIBCXX_USE_TBB_PAR_BACKEND (in libstdc++ 10) to zero.
You can set these macros even during compilation as shown below
eg: dpcpp <filename> -DPSTL_USE_PARALLEL_POLICIES=0 # for libstdc++ 9
dpcpp <filename> -D_GLIBCXX_USE_TBB_PAR_BACKEND=0 # for libstdc++ 10
Please refer to the below link for more details
Hope the provided information helps.
Regards,
Vidya.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It can work now with -D_GLIBCXX_USE_TBB_PAR_BACKEND=0
Thanks for your support!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for accepting our solution.
As the issue is resolved we are closing this thread. If you need any additional assistance from Intel, please post a new question as this thread will no longer be monitored.
Have a Nice Day!
Regards,
Vidya.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page