avx_mathfun | AVX-optimized sin , cos , exp and log functions
kandi X-RAY | avx_mathfun Summary
kandi X-RAY | avx_mathfun Summary
Origin from here. But fix several problem for it.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of avx_mathfun
avx_mathfun Key Features
avx_mathfun Examples and Code Snippets
Community Discussions
Trending Discussions on avx_mathfun
QUESTION
I'm testing a c code for linux with large arrays to measure thread performance, the application scales very well when threads are increased until max cores (8 for Intel 4770), but this is only for the pure math part of my code.
If I add the printf part for resulted arrays then the times becomes too large, from few seconds to several minutes even if redirected to a file, when printf those arrays should add just a few seconds.
The code:
(gcc 7.5.0-Ubuntu 18.04)
without printf loop:
gcc -O3 -m64 exp_multi.c -pthread -lm
with printf loop:
gcc -DPRINT_ARRAY -O3 -m64 exp_multi.c -pthread -lm
...ANSWER
Answered 2020-Oct-15 at 21:27I don't think this has much to with pthread
because your code only appears to call printf
after the threads are joined. Instead, the poor performance is likely due to cache misses by needing to read from the xv
and yv
arrays in every iteration of the print loop.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install avx_mathfun
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page