CUDA:散射通信模式 [英] CUDA: Scatter communication pattern

查看:1135
本文介绍了CUDA:散射通信模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从Udacity的课程。在测验中,他们给出了排序预排名变量(玩家的身高)的问题。因为,它是输入和输出数组之间的一一对应,应该不是 Map 通信模式而不是 Scatter

解决方案

CUDA对这些术语没有规范的定义,我知道。因此,我的答案只是一个建议,它是如何或已被解释。



因为,它是输入和输出数组之间的一一对应 p>

该语句似乎不支持该语句,该语句显示了输出数组中没有相应输入点的空格。



如果一个较小的值集合被分布到一个较大的数组中(因此,在输出数组中产生了间隙,其中没有输入值对应于间隙位置) em> scatter 可能用于描述该操作。散点图和地图都具有描述输入值所在位置的地图,但是可能教师已经以这样的方式定义了散点图和地图,以区分这两种情况,例如以下合理的定义:



散射:从输入到输出的一对一关系(即单向关系)。每个输入位置都有相应的输出位置,但不是每个输出位置都有相应的输入位置。



地图:之间的一对一关系>输入和输出(即双向关系)。每个输入位置都有相应的输出位置。 每个输出位置都有一个相应的输入位置。



Gather:one-to-one relationship 从输出到输入(即单向关系)。每个输出位置都有相应的输入位置,但不是每个输入位置都有相应的输出位置。


I am learning CUDA from the Udacity's course on parallel programming. In a quiz, they have a given a problem of sorting a pre-ranked variable(player's height). Since, it is a one-one correspondence between input and output array, should it not be a Map communication pattern instead of a Scatter?

解决方案

CUDA makes no canonical definition of these terms, that I know of. Therefore my answer is merely a suggestion of how it might be or have been interpreted.

"Since, it is a one-one correspondence between input and output array"

This statement doesn't appear to be supported by the diagram, which shows gaps in the output array, which have no corresponding input point associated with them.

If a smaller set of values are distributed into a larger array (with resultant gaps in the output array, therefore, in which no input value corresponds to the gap location(s)), then a scatter might be used to describe that operation. Both scatters and maps have maps which describe where the input values go, but it might be that the instructor has defined scatter and map in such a way as to differentiate between these two cases, such as the following plausible definitions:

Scatter: one-to-one relationship from input to output (ie. unidirectional relationship). Every input location has a corresponding output location, but not every output location has a corresponding input location.

Map: one-to-one relationship between input and output (ie. bidirectional relationship). Every input location has a corresponding output location, and every output location has a corresponding input location.

Gather: one-to-one relationship from output to input (ie. unidirection relationship). Every output location has a corresponding input location, but not every input location has a corresponding output location.

这篇关于CUDA:散射通信模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆