hawk.scatter#
- hawk.scatter(sink, policy='auto')[source]#
hawk.scatter(sink)[key] += vaddsvintosinkatkey,= vstores it there. Many lanes may share a key; the adds are combined (atomics or a segmented sum), never a race; the order is not fixed unlesspolicy="ordered": then each key’s adds are made in lane order within fixed lane chunks and the chunks are added in order (no atomics: the same bits on every launch for one lane count and one target size, ULP ofnp.add.atotherwise). A scalar or vector payload; any number of such statements, and in aforof static trip; a lane that skips it (a masked or index-set lane) adds nothing, and a negative key adds nothing (underpolicy="ordered"only -1 is the skip key: any other key outside the target is reported by name)."auto"and"compensated"add with a correction kept in a companion plane<sink>_cthat the runtime owns (the caller never passes it);"plain"is the atomic add alone.keyis an index, one coordinate per axis of a sink declared with named axes, anIndexplane or aSorted[Index]one.hawk.scatter(mask, policy="or")[word] |= bitssets bits of anInt32orUInt32plane (a bit mask: the word index is the key): the commit is the target’s atomic OR, so any number of lanes may hit one word and the result is the exactnp.bitwise_or.at; the C target ORs serially. A bit mask is discrete:vjpandjvpof a kernel that writes one refuse by name. Written only as the target of a store in a kernel body.- Return type:
Any- Parameters:
sink (Any)
policy (str)