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

Int128 support #974

Open
maleadt opened this issue Jun 14, 2021 · 2 comments
Open

Int128 support #974

maleadt opened this issue Jun 14, 2021 · 2 comments
Labels
cuda kernels Stuff about writing CUDA kernels. enhancement New feature or request

Comments

@maleadt
Copy link
Member

maleadt commented Jun 14, 2021

CUDA GPUs do not natively support Int128 operations. LLVM supports lowering code that works with Int128, https://reviews.llvm.org/rGb9fc48da832654a2b486adaa790ceaa6dba94455, but requires compiler intrinsics for many operations:

julia> using CUDA

julia> x = widen.(CuArray(rand(Int64, 10)))
10-element CuArray{Int128, 1}:
  ...

julia> (x, x)
ERROR: LLVM error: Undefined external symbol "__divti3"

With https://reviews.llvm.org/D34708, it should be possible to resolve those intrinsics in the current module, so we can just add them to our runtime library.

@maleadt maleadt added enhancement New feature or request cuda kernels Stuff about writing CUDA kernels. labels Jun 14, 2021
@maleadt
Copy link
Member Author

maleadt commented Jun 14, 2021

Alternatively, we could build compiler-rt for NVPTX and ship that in CUDA.jl like we do with libdevice.

@maleadt
Copy link
Member Author

maleadt commented Apr 27, 2024

Another MWE from #793:

julia> using CUDA

julia> A = zeros(3) |> CuArray
3-element CuArray{Float64, 1}:
 0.0
 0.0
 0.0

julia> A .= UInt128(5)

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. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant