diff --git a/src/helpers.jl b/src/helpers.jl index f1e8c57..cb5d4ef 100644 --- a/src/helpers.jl +++ b/src/helpers.jl @@ -101,14 +101,18 @@ mutable struct CudssData handle::cudssHandle_t data::cudssData_t - function CudssData() + function CudssData(cudss_handle::cudssHandle_t) data_ref = Ref{cudssData_t}() - cudss_handle = handle() cudssDataCreate(cudss_handle, data_ref) obj = new(cudss_handle, data_ref[]) finalizer(cudssDataDestroy, obj) obj end + + function CudssData() + cudss_handle = handle() + CudssData(cudss_handle) + end end Base.unsafe_convert(::Type{cudssData_t}, data::CudssData) = data.data