Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
-O3 -ffast-math -march=native似乎没有在CMakeLists.txt中写对。于是这次实验在cmd里编译的。
什么都不开: g++ main.cpp -o main
Initial energy: -8.571527
Final energy: -8.511589
Time elapsed: 21081 ms
开启优化编译选项:g++ -O3 -ffast-math -march=native main.cpp -o main
Initial energy: -8.571528
Final energy: -8.511649
Time elapsed: 1670 ms
做了一些人工的优化:
Initial energy: -8.571528
Final energy: -8.562015
Time elapsed: 917 ms
包括:struct填充至32字节;Gdt, epseps提到循环外;先累加到局部变量,再赋给AOS。
有点遗憾没在win下调好CMakeLists,然后omp simd没有感受到。