gpt4 book ai didi

c - instrA 在 CPU 上比 instrB 快,但在 GPU 上反之亦然?

转载 作者:行者123 更新时间:2023-11-30 21:21:02 29 4
gpt4 key购买 nike

有没有一个例子:

on CPU, Instruction A is faster than Instruction B
However,
on GPU, Instruction B is faster than Instruction A
(Instructions are assumed to be math operations)

这可能是由于 GPU 的一些因素造成的,例如:

  • GPU 并行执行数据相关指令,这可能比顺序执行更糟糕
  • 高速缓存未命中率高、存储体冲突

最佳答案

当然,很长一段时间以来,GPU 不原生支持 32b 整数算术(尤其是乘法)是很常见的。在许多 CPU/GPU 组合中,CPU 上的 32b 整数乘法比 CPU 上的 32b 浮点乘法更快,GPU 上反之亦然。

关于c - instrA 在 CPU 上比 instrB 快,但在 GPU 上反之亦然?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30311755/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com