nki.isa.nc_find_index8#

nki.isa.nc_find_index8(dst, data, vals, name=None)[source]#

Find indices of the 8 given vals in each partition of the data tensor.

This instruction first loads the 8 values, then loads the data tensor and outputs the indices (starting at 0) of the first occurrence of each value in the data tensor, for each partition.

The data tensor can be up to 5-dimensional, while the vals tensor must be up to 3-dimensional. The data tensor must have between 8 and 16,384 elements per partition. The vals tensor must have exactly 8 elements per partition. The output will contain exactly 8 elements per partition and will be uint16 or uint32 type. Default output type is uint32.

Behavior is undefined if vals tensor contains values that are not in the data tensor.

If provided, a mask is applied only to the data tensor.

Parameters:
  • dst – a 2D tile containing indices (uint16 or uint32) of the 8 values in each partition with shape [par_dim, 8]

  • data – the data tensor to find indices from

  • vals – tensor containing the 8 values per partition whose indices will be found