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

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
主站蜘蛛池模板: 南丹县| 常州市| 井陉县| 新竹市| 孝义市| 农安县| 曲周县| 永昌县| 阳新县| 阜南县| 周宁县| 凭祥市| 浦江县| 蒲江县| 金山区| 三亚市| 洪洞县| 徐闻县| 武威市| 肃南| 汨罗市| 通江县| 四子王旗| 日照市| 普安县| 昆山市| 大埔区| 招远市| 武清区| 宁化县| 宜黄县| 寻乌县| 黔西县| 鹤峰县| 兴山县| 浮山县| 湟中县| 乌兰浩特市| 咸阳市| 喀什市| 鹤山市|