Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate oneTBB in my project #1568

Closed
v0jiuqi opened this issue Nov 25, 2024 · 4 comments
Closed

Integrate oneTBB in my project #1568

v0jiuqi opened this issue Nov 25, 2024 · 4 comments
Labels

Comments

@v0jiuqi
Copy link

v0jiuqi commented Nov 25, 2024

I have added these in my CMakeList.txt:
find_package(TBB REQUIRED)
list(APPEND MNN_DEPENDS TBB::tbb)

and i write these in my code:
auto range_ = oneapi::tbb::blocked_range<std::size_t>(0, mTotalSize, 100); oneapi::tbb::parallel_for(range_, [&](const tbb::blocked_range<std::size_t>& range) { for (auto it = range.begin(); it != range.end(); ++it) { int j = 9; } });
then compile error like:
Undefined symbol: tbb::detail::r1::deallocate(tbb::detail::d1::small_object_pool&, void*, unsigned long, tbb::detail::d1::execution_data const&)
But if i just write :
auto range_ = oneapi::tbb::blocked_range<std::size_t>(0, mTotalSize, 100);
Then compilation succeed.
Like that error occured when i write "parallel_for"

@v0jiuqi v0jiuqi added the bug label Nov 25, 2024
@isaevil
Copy link
Contributor

isaevil commented Nov 25, 2024

@v0jiuqi what does list(APPEND MNN_DEPENDS TBB::tbb) do exactly? It seems like you do not link your application against oneTBB using target_link_libraries(<your_target> ... TBB::tbb)

@v0jiuqi
Copy link
Author

v0jiuqi commented Nov 25, 2024

i write this : target_link_libraries(xxx.out ${MNN_DEPS} ${EXTRA_LIBS})

@isaevil
Copy link
Contributor

isaevil commented Nov 25, 2024

Could you please show how the log looks like with VERBOSE=1 make command?

@v0jiuqi
Copy link
Author

v0jiuqi commented Nov 26, 2024

Thank you. I placed these two lines of code in the wrong position. Now i have fixed the bug. 👍

@isaevil isaevil closed this as completed Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants