nki.isa.tensor_copy_dynamic_src#

nki.isa.tensor_copy_dynamic_src(dst, src, engine=engine.unknown, name=None)[source]#

Create a copy of src tile within NeuronCore on-chip SRAMs using Vector or Scalar or GpSimd Engine, with src located at a dynamic offset within each partition.

Both source and destination tiles can be in either SBUF or PSUM. By default, this API returns a tile in SBUF, unless the returned value is assigned to a pre-declared PSUM tile.

The source and destination tiles must also have the same number of partitions and the same number of elements per partition.

The dynamic offset must be a scalar value resided in SBUF. If you have a list of dynamic offsets for gathering tiles in SBUF/PSUM, you may loop over each offset and call tensor_copy_dynamic_src once per offset.

Parameters:
  • src – the source of copy, must be a tile in SBUF or PSUM that is dynamically indexed within each partition.

  • engine – (optional) the engine to use for the operation: nki.isa.vector_engine, nki.isa.gpsimd_engine, nki.isa.scalar_engine or nki.isa.unknown_engine (default, let compiler select best engine).

  • return – the modified destination of copy.