JuliaGPU / CUDA.jl

CUDA programming in Julia.
https://juliagpu.org/cuda/
Other
1.2k stars 218 forks source link

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

Closed maleadt closed 4 months ago

maleadt commented 4 months ago

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.

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.