Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make exp(::Float32) and friends vectorize #44865

Merged

Conversation

oscardssmith
Copy link
Member

with

x32 = randn(Float32, 1024); y32 = similar(x32);

old

julia> @btime @. $y32.=exp($x32);
  5.492 μs (0 allocations: 0 bytes)

new

@btime @. $y32.=exp($x32);
  629.982 ns (0 allocations: 0 bytes)

Results are identical, and performance for scalars are also identical.

@oscardssmith oscardssmith added performance Must go faster maths Mathematical functions labels Apr 5, 2022
base/special/exp.jl Outdated Show resolved Hide resolved
base/special/exp.jl Outdated Show resolved Hide resolved
base/special/exp.jl Outdated Show resolved Hide resolved
base/special/exp.jl Outdated Show resolved Hide resolved
@oscardssmith
Copy link
Member Author

Ready to merge?

@oscardssmith oscardssmith merged commit a4a0b04 into JuliaLang:master Apr 13, 2022
@oscardssmith oscardssmith deleted the make-float32-exp-vectorize branch April 13, 2022 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maths Mathematical functions performance Must go faster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants