reduction资料.ppt

Parallel Reduction Parallel Reduction Parallel Reduction可以理解为将一个数组中的所有数相加求和的过程并行化 Tree-based approach used within each thread block Need to be able to use multiple thread blocks CUDA本身并不支持全局同步(Global Synchronization),CUDA的kernel运行时有一个特性,同一时间只能有一个kernel运行,这样我们便可以将每一层规约作为一个kernel来重复递归调用 Kernel Decomposition 通过调用多个kernel分解计算来解决Global Synchronization问题 Global Synchronization代价大,效率低,Kernel忽略HW代价,SW代价也很低 Reduction #1: Interleaved Addressing(交错寻址) Reduction #1: Interleaved Addressing(交错寻址) Reduction #1: Interleaved Addressing(交错寻址) 1个warp中有32个线程,在相同的时间要执行相同的指令 Reducti

文档评论(0)

1亿VIP精品文档

相关文档