Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions python/triton/language/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,12 @@ def broadcast_to(input, shape, _builder=None):

@builtin
def trans(input, _builder=None):
"""
Returns a transposed tensor.

:param input: The input tensor.
:type input:
"""
return semantic.trans(input, _builder)


Expand Down Expand Up @@ -926,6 +932,15 @@ def view(input, shape, _builder=None):

@builtin
def reshape(input, shape, _builder=None):
"""
Returns a tensor with the same number of elements as input but with the
provided shape.

:param input: The input tensor.
:type input:
:param shape: The new shape.
:type shape: Tuple[int]
"""
shape = _shape_check_impl(shape)
return semantic.reshape(input, shape, _builder)

Expand Down Expand Up @@ -1224,13 +1239,30 @@ def where(condition, x, y, _builder=None):

@builtin
def umulhi(x, y, _builder=None):
"""
Returns the most significant 32 bits of the product of x and y.

:param x: the input tensor
:type x: int32
:param y: the input tensor
:type y: int32
"""
x = _to_tensor(x, _builder)
y = _to_tensor(y, _builder)
return semantic.umulhi(x, y, _builder)


@builtin
def fdiv(x, y, ieee_rounding=False, _builder=None):
"""
Returns a floating-point resultant tensor of dividing x by y.

:param x: the input numerator value.
:param y: the input denominator value.
:param ieee_rounding: To follow IEEE-754 floating point number
rounding mechanism
:type ieee_rounding: bool
"""
ieee_rounding = _constexpr_to_value(ieee_rounding)
return semantic.fdiv(x, y, ieee_rounding, _builder)

Expand Down