From 32a6020875db4347792357ef2aca8bcd8c617b61 Mon Sep 17 00:00:00 2001 From: Alexis Montoison Date: Fri, 19 Apr 2024 16:43:49 -0400 Subject: [PATCH] Add a constructor for CudssData --- src/helpers.jl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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