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

unsafe_wrap: unconditionally use the memory type provided by the user. #2372

Merged
merged 1 commit into from
May 13, 2024

Conversation

maleadt
Copy link
Member

@maleadt maleadt commented May 13, 2024

This makes it possible to create 'fake' CuArrays:

julia> a = unsafe_wrap(CuArray{Int,2,CUDA.DeviceMemory}, convert(CuPtr{Int}, CU_NULL), (1,2));

julia> typeof(a)
CuArray{Int64, 2, CUDA.DeviceMemory}

This can be useful to compile without having to allocate memory.

Copy link

codecov bot commented May 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.11%. Comparing base (e9928ca) to head (f45efdb).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2372   +/-   ##
=======================================
  Coverage   73.11%   73.11%           
=======================================
  Files         157      157           
  Lines       15148    15148           
=======================================
  Hits        11076    11076           
  Misses       4072     4072           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@maleadt maleadt merged commit 543171c into master May 13, 2024
1 check passed
@maleadt maleadt deleted the tb/unsafe_wrap branch May 13, 2024 16:25
@maleadt maleadt added enhancement New feature or request cuda array Stuff about CuArray. labels May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuda array Stuff about CuArray. enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant