Skip to content

Commit c4360af

Browse files
Add unsafe trunc (#1255)
* Add unsafe trunc * Update ext/ReactantCUDAExt.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * add mod --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 6b6a5f9 commit c4360af

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ext/ReactantCUDAExt.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ end
5959

6060
for jlop in (
6161
:(Base.min),
62+
:(Base.mod),
6263
:(Base.max),
6364
:(Base.:+),
6465
:(Base.:-),
@@ -81,6 +82,9 @@ Base.@constprop :aggressive @inline Base.:^(
8182
a::CuTracedRNumber{T,A}, b::Integer
8283
) where {T,A} = ^(a[], b)
8384

85+
@inline Base.unsafe_trunc(::Type{T}, a::CuTracedRNumber) where {T} =
86+
Base.unsafe_trunc(T, a[])
87+
8488
for jlop in (:(Base.:+), :(Base.:-), :(Base.isnan), :(Base.isfinite), :(Base.isinf))
8589
@eval begin
8690
@inline $jlop(a::CuTracedRNumber) = $jlop(a[])

0 commit comments

Comments
 (0)