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

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
主站蜘蛛池模板: 岑溪市| 湖州市| 若尔盖县| 福贡县| 金华市| 吴堡县| 合作市| 常州市| 广水市| 延津县| 石棉县| 靖州| 中方县| 陕西省| 比如县| 海淀区| 佛坪县| 柯坪县| 西华县| 澄江县| 泗洪县| 贵港市| 将乐县| 赫章县| 资中县| 平凉市| 尼木县| 卓尼县| 聂荣县| 栾城县| 新昌县| 阳谷县| 宁乡县| 新闻| 融水| 玉林市| 吉木乃县| 日土县| 云林县| 新平| 清徐县|