官术网_书友最值得收藏!

Gather

In this pattern, each thread or task has multiple inputs, and it produces a single output to be written at a single location in memory. Suppose you want to write a program that finds a moving average of three numbers; this is an example of a gather operation. It takes three inputs from memory and writes single output to memory. So, there is data reuse on the input side. It is basically a many-to-one operation. The code for gather pattern will look as follows:

out[i] = (in [i-1] + in[i] + in[i+1])/3
主站蜘蛛池模板: 宣城市| 日喀则市| 山阳县| 斗六市| 兴山县| 金秀| 光泽县| 武陟县| 仁寿县| 和田市| 鄂托克旗| 岑巩县| 体育| 宿松县| 抚州市| 若尔盖县| 金昌市| 永平县| 合肥市| 杭州市| 黄骅市| 三原县| 毕节市| 平阳县| 铜川市| 吕梁市| 津南区| 克山县| 柳州市| 新乡市| 自治县| 信阳市| 普兰店市| 米脂县| 洪湖市| 无锡市| 米泉市| 德清县| 德格县| 临猗县| 沾化县|