Skip to content

Commit

Permalink
Add a constructor for CudssData
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison committed Apr 19, 2024
1 parent 81121f2 commit 33e4dc7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/helpers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

2 comments on commit 33e4dc7

@amontoison
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/105264

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.0 -m "<description of version>" 33e4dc7a462da3f6f655262ee77059269ed362e0
git push origin v0.2.0

Please sign in to comment.