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

ray6899 tbb #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

ray6899 tbb #7

wants to merge 1 commit into from

Conversation

jinjiwu
Copy link

@jinjiwu jinjiwu commented Jan 22, 2022

提示:请在 PR 描述中说明使用的 CPU 有多少核、多少线程哦 :)
如果不希望写 PR 描述,也可以直接在代码注释里写,没问题的~

内核数:4
逻辑核心:8
线程数:默认创建,应该是8?

实验结果

除了saxpy和scanner之外,其余函数都有明显的速度提升,原因未找到

fill: 0.59706s
fill: 0.607065s
fill_parallel: 0.134176s
fill_parallel: 0.13482s
saxpy: 0.0321525s
saxpy_parallel: 0.031659s
sqrtdot: 0.0801601s
5165.4
sqrtdot_parallel: 0.0160526s
5792.62
minvalue: 0.0724999s
-1.11803
minvalue_parallel: 0.0109034s
-1.11803
magicfilter: 0.272147s
55924034
magicfilter_parallel: 0.164996s
55924034
scanner: 0.0879465s
6.18926e+07
scanner_patallel: 0.132198s
6.18926e+07

完成情况

  • fill :使用tbb parallel for
  • saxpy:依旧使用tbb parallel for
  • sqrtdot:使用tbb parallel reduce
  • minvalue:使用tbb parallel reuce
  • magicfilter: 使用tbb parallel for 和 锁实现
  • scanner:使用tbb parallel scan实现

@jinjiwu jinjiwu marked this pull request as ready for review January 22, 2022 06:29
@jinjiwu jinjiwu changed the title tbb ray6899 tbb Jan 22, 2022
Copy link
Contributor

@archibate archibate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

做的好!saxpy和magicfilter没有提升的主要原因是memory-bound了,第七课也提到了。

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.

None yet

2 participants