Skip to content

Commit b65eccf

Browse files
committed
Clarity
1 parent 62aee7e commit b65eccf

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/device/intrinsics/math.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ using Base.Math: throw_complex_domainerror
99
# - consider emitting LLVM intrinsics and lowering those in the back-end
1010

1111
### Constants
12-
@device_override Core.Float32(::typeof(π), ::RoundingMode) = reinterpret(Float32, 0x40490fdb) # reinterpret(UInt32,Float32(reinterpret(Float64,0x400921FB60000000)))
13-
@device_override Core.Float16(::typeof(π), ::RoundingMode) = reinterpret(Float16, 0x4248)
14-
@device_override Core.Float32(::typeof(ℯ), ::RoundingMode) = reinterpret(Float32, 0x402df854) # reinterpret(UInt32,Float32(reinterpret(Float64,0x4005BF0A80000000)))
15-
@device_override Core.Float16(::typeof(ℯ), ::RoundingMode) = reinterpret(Float16, 0x4170)
12+
@device_override Core.Float32(::typeof(π), ::RoundingMode) = reinterpret(Float32, 0x40490fdb) # 3.1415927f0 reinterpret(UInt32,Float32(reinterpret(Float64,0x400921FB60000000)))
13+
@device_override Core.Float16(::typeof(π), ::RoundingMode) = reinterpret(Float16, 0x4248) # Float16(3.14)
14+
@device_override Core.Float32(::typeof(ℯ), ::RoundingMode) = reinterpret(Float32, 0x402df854) # 2.7182817f0 reinterpret(UInt32,Float32(reinterpret(Float64,0x4005BF0A80000000)))
15+
@device_override Core.Float16(::typeof(ℯ), ::RoundingMode) = reinterpret(Float16, 0x4170) # Float16(2.719)
1616

1717
### Common Intrinsics
1818
@device_function clamp_fast(x::Float32, minval::Float32, maxval::Float32) = ccall("extern air.fast_clamp.f32", llvmcall, Cfloat, (Cfloat, Cfloat, Cfloat), x, minval, maxval)

test/device/intrinsics.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,8 @@ end
413413
end
414414

415415
let # "issue551"
416-
@test only(Array(map(y -> y < pi, Metal.zeros(T, 1))))
417-
@test only(Array(map(y -> y < ℯ, Metal.zeros(T, 1))))
416+
@test T.(MtlArray([π]), RoundNearest) = T)
417+
@test T.(MtlArray([ℯ]), RoundNearest) = T(ℯ)
418418
end
419419
end
420420
end

0 commit comments

Comments
 (0)