oneDPL
oneDPL copied to clipboard
No member named `task` in namespace `tbb`
I'm encountering this compile error when trying to compile oneDPL with the asynchronous algorithm API---not sure if I need to add a compiler flag, different include order, or what. I believe this is different from #547, since I'm using oneDPL, not parallel STL, but correct me if I'm wrong.
Compiler version: 2022.2.0.20220730 (Same error with a few other versions)
Intel(R) oneAPI DPC++/C++ Compiler 2022.2.0 (2022.2.0.20220730)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/intel/oneapi/compiler/2022.2.0/linux/bin-llvm
Configuration file: /opt/intel/oneapi/compiler/2022.2.0/linux/bin/icpx.cfg
Compile line: icpx test.cpp -o test -fsycl
#include <CL/sycl.hpp>
#include <oneapi/dpl/execution>
#include <oneapi/dpl/async>
int main(int argc, char** argv) {
return 0;
}
Error:
bbrock@sdp4450:~/src/personal.rscohn1.distributed-ranges/examples/sycl$ icpx test.cpp -o test -fsycl
In file included from test.cpp:2:
In file included from /opt/intel/oneapi/dpl/2021.7.1/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();
~~~~~^
/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/pstl/parallel_backend_tbb.h:413:34: error: expected class name
class __merge_task : public tbb::task
^
/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/pstl/parallel_backend_tbb.h:415:23: error: no type named 'task' in namespace 'tbb'
/*override*/ tbb::task*
~~~~~^
/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/pstl/parallel_backend_tbb.h:438:6: error: no type named 'task' in namespace 'tbb'
tbb::task*
~~~~~^
/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/pstl/parallel_backend_tbb.h:471:14: error: no type named 'task' in namespace 'tbb'
tbb::task* __right = new (tbb::task::allocate_additional_child_of(*parent()))
. . .
Okay, silly me, -D_GLIBCXX_USE_TBB_PAR_BACKEND=0
seems to fix my compilation. Does this mean recent versions of libstdc++
will automatically bring in legacy TBB by default, breaking oneTBB, even if I don't use any pSTL features?
My understanding is that in the current public release of DPC++, the -D_GLIBCXX_USE_TBB_PAR_BACKEND=0
is always necessary when using DPC++ asynchronous algorithms. This does seem to have been fixed in the most recent DPC++ trunk, however.