Re: gnu_parallel STL not vectorized?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 4/23/2015 10:52 AM, Marc Glisse wrote:
> On Thu, 23 Apr 2015, Tim Prince wrote:
>
>> On 4/23/2015 10:25 AM, Marc Glisse wrote:
>>> On Thu, 23 Apr 2015, Tim Prince wrote:
>>>
>>>> From the looks of gcc 6.0, it appears that gnu_parallel STL is
>>>> slated to
>>>> become part of the release.
>>>
>>> Could you be more specific about what you are talking about and where
>>> you got your information?
>> I set -D_GLIBCXX_PARALLEL in previous versions but nothing happened.
>
> According to
> https://gcc.gnu.org/onlinedocs/libstdc++/manual/parallel_mode_using.html
> something like "-fopenmp -O2 -D_GLIBCXX_PARALLEL" should work. And
> indeed the generated code is quite different than without
> -D_GLIBCXX_PARALLEL. I did not test performance.
>
>> Now in 6.0 it goes parallel, but with poor performance.
>
> What other version are you comparing to? I would be very surprised if
> anything had changed between 5.1.0 and current trunk (6.0).
If I remove -D_GLIBCXX_PARALLEL or build with 5.0.0 or 4.9.2, it
performs normally, with the easy cases exhibiting simd vectorization. 
The cases aren't big enough to need parallelization, but it shouldn't
ruin performance.  As I said, I don't believe I ever had it go parallel
before.
>
>>> Parallel mode has been a part of libstdc++ for several years:
>>> https://gcc.gnu.org/onlinedocs/libstdc++/manual/parallel_mode.html
>>>
>>>> Am I right in believing that gnu_parallel STL code is not simd
>>>> vectorized?
>>>
>>> It is not manually vectorized, but the compiler is free to do it if it
>>> can.
>> Does this require setting  -march and/or -ftree-vectorize options for
>> libstdc++ build?  What would be the recommended incantation?
>
> No, the compiled part of the library should not matter, it is only
> when compiling your application that you should use -O3 -march=native
> to maximize vectorization opportunities.
>

-- 
Tim Prince





[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux