Skip to content

Commit

Permalink
Release 0.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison committed May 29, 2024
1 parent a265eb5 commit fb77fa8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "CUDSS"
uuid = "45b445bb-4962-46a0-9369-b4df9d0f772e"
authors = ["Alexis Montoison <alexis.montoison@polymtl.ca>"]
version = "0.1.5"
version = "0.1.6"

[deps]
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
Expand All @@ -12,7 +12,7 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[compat]
CEnum = "0.4, 0.5"
CUDA = "5"
CUDA = "5.4.0"
CUDSS_jll = "0.1.0"
julia = "1.6"
LinearAlgebra = "1.6"
Expand Down
2 changes: 1 addition & 1 deletion src/CUDSS.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module CUDSS

using CUDA, CUDA.CUSPARSE
using CUDA, CUDA.APIUtils, CUDA.CUSPARSE
using CUDSS_jll
using LinearAlgebra
using SparseArrays
Expand Down
26 changes: 16 additions & 10 deletions src/management.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,20 @@ version() = VersionNumber(cudssGetProperty(CUDA.MAJOR_VERSION),
cudssGetProperty(CUDA.MINOR_VERSION),
cudssGetProperty(CUDA.PATCH_LEVEL))

# cache for created, but unused handles
const idle_handles = CUDA.HandleCache{CuContext,cudssHandle_t}()
## handles

function handle_ctor(ctx)
context!(ctx) do
cudssCreate()
end
end
function handle_dtor(ctx, handle)
context!(ctx; skip_destroyed=true) do
cudssDestroy(handle)
end
end

const idle_handles = HandleCache{CuContext,cudssHandle_t}(handle_ctor, handle_dtor)

function handle()
cuda = CUDA.active_state()
Expand All @@ -30,16 +42,10 @@ function handle()

# get library state
@noinline function new_state(cuda)
new_handle = pop!(idle_handles, cuda.context) do
cudssCreate()
end
new_handle = pop!(idle_handles, cuda.context)

finalizer(current_task()) do task
push!(idle_handles, cuda.context, new_handle) do
context!(cuda.context; skip_destroyed=true) do
cudssDestroy(new_handle)
end
end
push!(idle_handles, cuda.context, new_handle)
end

cudssSetStream(new_handle, cuda.stream)
Expand Down

2 comments on commit fb77fa8

@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/107920

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.1.6 -m "<description of version>" fb77fa84e3146bce3eb78bd3e869e0c1d0ab130f
git push origin v0.1.6

Please sign in to comment.