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 AddrSpacePtr type #34760

Merged
merged 1 commit into from
Feb 22, 2020
Merged

Add AddrSpacePtr type #34760

merged 1 commit into from
Feb 22, 2020

Conversation

thomasfaingnaert
Copy link
Contributor

Some intrinsics of the LLVM NVPTX backend have argument types i8 addrspace(x)*.
At the moment, there is no way to ccall these intrinsics, since Ref{T} is converted to the plain i8*.

As discussed in JuliaGPU/CUDAnative.jl#548, this PR adds an ASPtr{T, AS} type whose sole purpose is to ensure that codegen emits an LLVM i8 addrspace(x)* when using ccall(..., llvmcall, ...).

// cc: @vchuravy, @maleadt

@maleadt maleadt added compiler:codegen Generation of LLVM IR and native code domain:gpu Affects running Julia on a GPU labels Feb 14, 2020
@maleadt maleadt requested a review from vtjnash February 14, 2020 15:02
@StefanKarpinski
Copy link
Sponsor Member

AddrSpacePtr seems like it would be a better name for this.

src/julia.h Outdated Show resolved Hide resolved
base/refpointer.jl Outdated Show resolved Hide resolved
src/julia.h Outdated Show resolved Hide resolved
@thomasfaingnaert thomasfaingnaert changed the title Add ASPtr type [WIPAdd ASPtr type Feb 14, 2020
@thomasfaingnaert thomasfaingnaert changed the title [WIPAdd ASPtr type [WIP] Add ASPtr type Feb 14, 2020
@thomasfaingnaert thomasfaingnaert changed the title [WIP] Add ASPtr type Add AddrSpacePtr type Feb 14, 2020
Copy link
Sponsor Member

@vchuravy vchuravy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Edit: Can you squash the PR?

@thomasfaingnaert
Copy link
Contributor Author

@vchuravy Done

@vchuravy vchuravy closed this Feb 21, 2020
@vchuravy vchuravy reopened this Feb 21, 2020
@thomasfaingnaert
Copy link
Contributor Author

Did another rebase so CI passes now.

@vchuravy vchuravy merged commit ba96e8b into JuliaLang:master Feb 22, 2020
@thomasfaingnaert thomasfaingnaert deleted the tf/as-ptr branch February 22, 2020 11:53
bors bot added a commit to JuliaGPU/CUDAnative.jl that referenced this pull request Feb 23, 2020
557: Use AddrSpacePtr to call WMMA intrinsics r=vchuravy a=thomasfaingnaert

Closes #548 
Depends on JuliaLang/julia#34760

Co-authored-by: Thomas Faingnaert <[email protected]>
bors bot added a commit to JuliaGPU/CUDAnative.jl that referenced this pull request Feb 24, 2020
557: Use AddrSpacePtr to call WMMA intrinsics r=thomasfaingnaert a=thomasfaingnaert

Closes #548 
Depends on JuliaLang/julia#34760

Co-authored-by: Thomas Faingnaert <[email protected]>
@maleadt maleadt mentioned this pull request Mar 23, 2020
27 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:codegen Generation of LLVM IR and native code domain:gpu Affects running Julia on a GPU
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants