正在加载图片...
Control Divergence Examples Divergence can arise when branch or loop condition is a function of thread indices Example kernel statement with divergence: - if (threadldx.x>2){} This creates two different control paths for threads in a block Decision granularity warp size;threads 0,1 and 2 follow different path than the rest of the threads in the first warp Example without divergence: -If (blockldx.x>2){} Decision granularity is a multiple of blocks size;all threads in any given warp follow the same path 电子科妓女学 O11 Control Divergence Examples – Divergence can arise when branch or loop condition is a function of thread indices – Example kernel statement with divergence: – if (threadIdx.x > 2) { } – This creates two different control paths for threads in a block – Decision granularity < warp size; threads 0, 1 and 2 follow different path than the rest of the threads in the first warp – Example without divergence: – If (blockIdx.x > 2) { } – Decision granularity is a multiple of blocks size; all threads in any given warp follow the same path
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有