Skip to content

UOp

UOp ¤

UOp(
    op: Ops,
    dtype: DType = void,
    src: Tuple[UOp, ...] = tuple(),
    arg: Any = None,
)

Bases: MathTrait

Source code in tinygrad/ops.py
230
231
232
def __init__(self, op:Ops, dtype:DType=dtypes.void, src: Tuple[UOp,...]=tuple(), arg:Any=None):
  # TODO: instant check rules here make debugging easier
  self.op, self.dtype, self.src, self.arg = op, dtype, src, arg

Ops ¤

Bases: FastEnum

Attributes:

SINK ¤

SINK = auto()

CONTIGUOUS ¤

CONTIGUOUS = auto()

PRELOAD ¤

PRELOAD = auto()

COPY ¤

COPY = auto()

EMPTY ¤

EMPTY = auto()

BUFFER_VIEW ¤

BUFFER_VIEW = auto()

EXPAND ¤

EXPAND = auto()

CONTRACT ¤

CONTRACT = auto()

VIEW ¤

VIEW = auto()

DEFINE_GLOBAL ¤

DEFINE_GLOBAL = auto()

BUFFER ¤

BUFFER = auto()

DEFINE_VAR ¤

DEFINE_VAR = auto()

DEFINE_LOCAL ¤

DEFINE_LOCAL = auto()

DEFINE_ACC ¤

DEFINE_ACC = auto()

VALID ¤

VALID = auto()

SPECIAL ¤

SPECIAL = auto()

NOOP ¤

NOOP = auto()

REDUCE_AXIS ¤

REDUCE_AXIS = auto()

GEP ¤

GEP = auto()

VECTORIZE ¤

VECTORIZE = auto()

CAST ¤

CAST = auto()

BITCAST ¤

BITCAST = auto()

EXP2 ¤

EXP2 = auto()

LOG2 ¤

LOG2 = auto()

SIN ¤

SIN = auto()

SQRT ¤

SQRT = auto()

RECIP ¤

RECIP = auto()

NEG ¤

NEG = auto()

LOAD ¤

LOAD = auto()

WMMA ¤

WMMA = auto()

ADD ¤

ADD = auto()

MUL ¤

MUL = auto()

IDIV ¤

IDIV = auto()

MAX ¤

MAX = auto()

MOD ¤

MOD = auto()

CMPLT ¤

CMPLT = auto()

CMPNE ¤

CMPNE = auto()

XOR ¤

XOR = auto()

SHL ¤

SHL = auto()

SHR ¤

SHR = auto()

OR ¤

OR = auto()

AND ¤

AND = auto()

THREEFRY ¤

THREEFRY = auto()

SUB ¤

SUB = auto()

FDIV ¤

FDIV = auto()

WHERE ¤

WHERE = auto()

MULACC ¤

MULACC = auto()

STORE ¤

STORE = auto()

ASSIGN ¤

ASSIGN = auto()

BIND ¤

BIND = auto()

INDEX ¤

INDEX = auto()

BARRIER ¤

BARRIER = auto()

IF ¤

IF = auto()

RANGE ¤

RANGE = auto()

ENDRANGE ¤

ENDRANGE = auto()

ENDIF ¤

ENDIF = auto()

VCONST ¤

VCONST = auto()

CONST ¤

CONST = auto()