Skip to content

complete hw06 - #29

Open
Deyi-Chen wants to merge 1 commit into
parallel101:mainfrom
Deyi-Chen:main
Open

complete hw06#29
Deyi-Chen wants to merge 1 commit into
parallel101:mainfrom
Deyi-Chen:main

Conversation

@Deyi-Chen

Copy link
Copy Markdown

Intel Core Ultra 9 275HX, WSL2: 24 logical CPUs (nproc=24, 1 thread/core)
fill 使用parallel for, independent; saxpy同理
sqrtdot和minvalue使用reduce,避免race condition, 利用结合律
magicfilter使用parallel for+mutex lock, 先每个线程local push, 最后merge
scanner使用scan, 数据之间有依赖,identity 用 T(0) 而非直接0,类型正确

函数 串行 (s) 并行 (s) 加速比
fill 0.293 0.039 ~7.5×
saxpy 0.041 0.013 ~3.2×
sqrtdot 0.069 0.007 ~9.9×
minvalue 0.059 0.004 ~14.7×
magicfilter 0.346 0.274 ~1.3×
scanner 0.044 0.021 ~2.1×

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

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