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

Riga finished hw08! #12

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

Riga finished hw08! #12

wants to merge 2 commits into from

Conversation

Riga27527
Copy link

实验结果

All correct!

时间统计

实验平台:windows11 cuda11.5 RTX3090

fill_sin : 0.000362s

filter_positive : 0.000732s

  1. fill_sin 改成“网格跨步循环”以后,这里三重尖括号里的参数如何调整?10 分

    • 答 : 可以让线程数开少一点,保证gridDim * blockDim < n, 让每个线程多处理几个任务
  2. 这里的“边角料法”对于不是 1024 整数倍的 n 会出错,为什么?请修复:10 分

    • 答 : 会导致向下取整,以至于一部分数据没有被处理,应该使其向上取整
  3. 这里 CPU 访问数据前漏了一步什么操作?请补上:10 分

    • 答 :漏了CPU和GPU的同步操作,即checkCudaErrors(cudaDeviceSynchronize());
  4. 这里有什么问题?请改正:10 分

    • 答 : 因为是并行处理的,如果不保证数据同步的话会导致结果错误,可以使用原子操作解决;当然也可以使用BLS等方案。

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