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

Add some more fastmath functions #2047

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

Zentrik
Copy link
Contributor

@Zentrik Zentrik commented Aug 20, 2023

This prevents falling back to slow functions and integrates with the new fastmath kwarg.

  • exp2_fast doesn't fall back to a julia implementation anymore.
  • inv_fast no longer falls back to inv.
  • When the new fastmath kwarg is not set, sqrt_fast loses the fast flag in llvm ir (call float @llvm.sqrt.f32 vs call fast float @llvm.sqrt.f32) but the ptx doesn't seem to be affected by the flag. Is there a way to set the fast math flag in a ccall?

@maleadt
Copy link
Member

maleadt commented Aug 22, 2023

Is there a way to set the fast math flag in a ccall?

That would be #1991, so not right now. Well, unless you want to use inline LLVM IR with llvmcall, see e.g. https://github.com/vchuravy/FastmathOverlay.jl/blob/main/src/FastmathOverlay.jl.

@maleadt maleadt added cuda kernels Stuff about writing CUDA kernels. performance How fast can we go? labels Aug 22, 2023
@maleadt maleadt merged commit f89e1ab into JuliaGPU:master Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuda kernels Stuff about writing CUDA kernels. performance How fast can we go?
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants