TCOLEXPANDDIV
Tile Operation Diagram
Introduction
Column-wise broadcast divide: divide each element of src0 by a per-column scalar vector src1.
Math Interpretation
Let R = dst.GetValidRow() and C = dst.GetValidCol(). Let s_j be the per-column scalar taken from src1 (one value per column).
For 0 <= i < R and 0 <= j < C:
dsti,j=src0i,j/sj\mathrm{dst}_{i,j} = \mathrm{src0}_{i,j} / s_j
Assembly Syntax
PTO-AS form: see PTO-AS Specification.
Synchronous form:
%dst = tcolexpanddiv %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>
AS Level 1 (SSA)
%dst = pto.tcolexpanddiv %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>
AS Level 2 (DPS)
pto.tcolexpanddiv ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
C++ Intrinsic
Declared in include/pto/common/pto_instr.hpp:
template <typename TileDataDst, typename TileDataSrc0, typename TileDataSrc1, typename... WaitEvents>
PTO_INST RecordEvent TCOLEXPANDDIV(TileDataDst &dst, TileDataSrc0 &src0, TileDataSrc1 &src1, WaitEvents &... events);
Constraints
TileDataDst::DType,TileDataSrc1::DTypemust be one of:half,float.- Tile shape/layout constraint (compile-time):
TileDataDst::isRowMajor. src1is expected to provide one scalar per column (i.e., its valid shape must coverCvalues).- Exact layout/fractal constraints are target-specific; see backend headers under
include/pto/npu/*/TColExpand*.hpp.
Examples
See related examples in docs/isa/ and docs/coding/tutorials/.
ASM Form Examples
Auto Mode
# Auto mode: compiler/runtime-managed placement and scheduling.
%dst = pto.tcolexpanddiv %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>
Manual Mode
# Manual mode: resources must be bound explicitly before issuing the instruction.
# Optional for tile operands:
# pto.tassign %arg0, @tile(0x1000)
# pto.tassign %arg1, @tile(0x2000)
%dst = pto.tcolexpanddiv %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>
PTO Assembly Form
%dst = tcolexpanddiv %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>
# AS Level 2 (DPS)
pto.tcolexpanddiv ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)