Skip to content

Commit 4365f75

Browse files
authored
[AMD] Support libdevice.round (#7139)
Fixes triton-lang/triton#7135
1 parent ba63c59 commit 4365f75

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

third_party/amd/language/hip/libdevice.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,3 +473,12 @@ def ilogb(arg0, _semantic=None):
473473
(core.dtype("fp32"), ): ("__ocml_ilogb_f32", core.dtype("int32")),
474474
(core.dtype("fp64"), ): ("__ocml_ilogb_f64", core.dtype("int32")),
475475
}, is_pure=True, _semantic=_semantic)
476+
477+
478+
@core.extern
479+
def round(arg0, _semantic=None):
480+
return core.extern_elementwise(
481+
"", "", [arg0], {
482+
(core.dtype("fp32"), ): ("__ocml_round_f32", core.dtype("fp32")),
483+
(core.dtype("fp64"), ): ("__ocml_round_f64", core.dtype("fp64")),
484+
}, is_pure=True, _semantic=_semantic)

0 commit comments

Comments
 (0)