On 4 June 2010 23:00, Pablo d'Angelo <[email protected]> wrote:
> Am 04.06.2010 15:42, schrieb Lukáš Jirkovský:
>>
>> Hello,
>> today I decided to improve the performance of deghosting in hugin.
>> First try using SSE didn't work really well [1].
>
> Did you check that your data was properly aligned for use with SSE?

Yep, I did. I used #pragma pack(16) for it.

My guess is that the slowdown may be caused by some caching or maybe
the data array is stored using general registers first and then moved
to the XMM, I remember that I read the move from general registers to
the XMM registers is quite expensive. Other possibility is that the
slowdown is caused by the fact the data are aligned and takes more
space than usually and caching becomes less effective.

>
>> Second one using
>>
>> OpenMP show noticeable increase of performance, because the code can
>> be parallelized quite easily (the only thing needed is to add two
>> pragma's) and efficiently (it runs four times faster on my Core i7).
>>
>> I can see that the most of the threaded code in Hugin uses
>> boost::thread but I remember that the thread class from wxWidgets was
>> also mentioned. What should I use? Personally I'd like to avoid
>> wxWidgets threads because both deghosting_mask and hugin_hdrmerge are
>> console applications.
>
> If OpenMP works fine for you, go ahead and use it. When I parallized the
> remapping with boost::thread, OpenMP was not properly supported by gcc, but
> this has changed since then. If you need generic thread support use
> boost::thread, except if it tied to the wxWidgets UI, where wxThreads might
> be more suitable for some tasks.
>
> ciao
>  Pablo
>

Thank you. I'm still considering the boost::thread. If it is not too
complicated to use boost thread I'll use it because OpenMP adds
another dependency. But certainly it's good to know that it's OK to
stick with OpenMP.

Lukas

-- 
You received this message because you are subscribed to the Google Groups 
"hugin and other free panoramic software" group.
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/hugin-ptx

Reply via email to