Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hw04 #18

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

hw04 #18

wants to merge 4 commits into from

Conversation

xu-kq
Copy link

@xu-kq xu-kq commented Jan 11, 2022

-O3 -ffast-math -march=native似乎没有在CMakeLists.txt中写对。于是这次实验在cmd里编译的。

  1. 什么都不开: g++ main.cpp -o main
    Initial energy: -8.571527
    Final energy: -8.511589
    Time elapsed: 21081 ms

  2. 开启优化编译选项:g++ -O3 -ffast-math -march=native main.cpp -o main
    Initial energy: -8.571528
    Final energy: -8.511649
    Time elapsed: 1670 ms

  3. 做了一些人工的优化:
    Initial energy: -8.571528
    Final energy: -8.562015
    Time elapsed: 917 ms
    包括:struct填充至32字节;Gdt, epseps提到循环外;先累加到局部变量,再赋给AOS。

有点遗憾没在win下调好CMakeLists,然后omp simd没有感受到。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant