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

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
主站蜘蛛池模板: 茶陵县| 城步| 兴山县| 行唐县| 宁都县| 泗洪县| 温泉县| 从江县| 龙江县| 中卫市| 荣成市| 华池县| 衡阳县| 凭祥市| 宕昌县| 长海县| 辰溪县| 扎兰屯市| 乐陵市| 尼木县| 教育| 孙吴县| 阳朔县| 铜川市| 章丘市| 日喀则市| 陈巴尔虎旗| 庆阳市| 聊城市| 衡阳县| 韶山市| 济宁市| 安丘市| 昌乐县| 土默特左旗| 静安区| 凌源市| 皮山县| 贵定县| 永泰县| 本溪市|