Merged
Conversation
vchuravy
approved these changes
May 13, 2022
Collaborator
vchuravy
left a comment
There was a problem hiding this comment.
This is complex enough that having it in one place seems sensible.
Collaborator
|
1.7 failed on the atomics test |
maleadt
requested changes
May 16, 2022
Member
maleadt
left a comment
There was a problem hiding this comment.
I'm not really familiar with atomics and their APIs, but superficially this looks OK (minor some small changes).
CI sees to fail with assertions enabled though.
5 tasks
maleadt
approved these changes
May 18, 2022
Contributor
Author
|
@maleadt I'm fixing bugs locally with LLVM assertion enabled. I'll ping you once I fix all bugs locally. |
Contributor
Author
|
@maleadt OK, I think it's ready. Can you run the CI? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch introduces
LLVM.Interop.atomic_pointer*onLLVMPtrmimickingCore.Intrinsics.atomic_pointer*API onPtr. This is a superset of JuliaGPU/CUDA.jl#1393. It extracts the "CUDA-unaware" part of the atomics previously partially implemented in CUDA.jl. My motivation for this is to implement GPU-interop of https://github.com/JuliaConcurrent/UnsafeAtomics.jl and https://github.com/JuliaConcurrent/Atomix.jl without explicitly dispatching on CUDA.jl and AMDGPU.jl types.As discussed in JuliaGPU/CUDA.jl#1393 the native code from this is not particularly good on CUDA. But that's probably fixable in LLVM (a long-term solution). As a short-term solution, I think CUDA.jl and AMDGPU.jl can use
@device_overrideto override these intrinsics in their device context (e.g., use@llvm.nvvm.*intrinsics in CUDA).cc @vchuravy @jpsamaroo