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 CuRef(Value) behave more like Ref #1803

Closed
maleadt opened this issue Mar 15, 2023 · 2 comments
Closed

Make CuRef(Value) behave more like Ref #1803

maleadt opened this issue Mar 15, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@maleadt
Copy link
Member

maleadt commented Mar 15, 2023

There's some disparities between how Base.Ref(Value) behaves, and what CUDA.CuRef(Value) does:

  • CuRef is separate from CuRefValue, while in Base they are linked (RefValue <: Ref)
  • Ref(...) creates a constructor you can index, while calling CuRef isn't currently meant to be used outside of ccall signatures
  • a CuRef isn't actually mutable, and is currently only used as a GPU-compatible counterpart of Ref for broadcasting purposes

All this currently isn't too much of a problem as we don't actually export CuRef, but it'd be nice to make it behave like Base.Ref. One possible solution would be to use unified memory, although that would disallow any conversions during CuRefValue construction (we currently call adapt).

@kshyatt
Copy link
Contributor

kshyatt commented Feb 12, 2025

Did #2645 partially address this?

@maleadt
Copy link
Member Author

maleadt commented Feb 13, 2025

Yes, thanks for noticing.

@maleadt maleadt closed this as completed Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants