- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi guys!
I'm new to Intel's TBB and I would like to optimize my raytracing engine.
The problem is, that I don't get any performance boost by using TBB,
which is somehow weird, because it should run faster in a multi-threaded
environment.
What I did so far:
[cpp]tbb::task_scheduler_init init; init.initialize(4); ... tbb::blocked_range2dI initialized the task scheduler to use 4 threads and SCREENH, SCREENW and GRAN are the screen resolution and the granularity (I tried values between 1 and 10000 - no effect).range(0u, SCREENH, GRAN, 0u, SCREENW, GRAN); tbb::parallel_for(range, tRenderParallel(renderer));[/cpp]
The tRenderParallel calls my renderer with the appropriate clip region.
I understand it in that the way, that the above code is enough to parallelize the system. Can anyone tell me, what's wrong with my approach?
Thanks in advance,
pkei
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You ought to be able to see information on this subject already posted in the TBB section of the forum.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are no obvious issues with the code you've shared, but as always, the devil is in the details. Need to see tRenderParallel.operator() and perhaps further details to understand what may be preventing your desired scaling, but one sanity question: you are running four threads on a machine that has at least four HW threads, right?
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page