Skip to content

Commit

Permalink
Merge pull request #1122 from JuliaGPU/backports-release-3.4
Browse files Browse the repository at this point in the history
Backports for 3.4.2
  • Loading branch information
maleadt committed Aug 27, 2021
2 parents c3ce593 + f20b5f6 commit be43480
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "CUDA"
uuid = "052768ef-5323-5732-b1bb-66c8b64840ba"
version = "3.4.1"
version = "3.4.2"

[deps]
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
Expand Down
4 changes: 2 additions & 2 deletions lib/utils/cache.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ end
function Base.pop!(f::Function, cache::HandleCache{K,V}, key) where {K,V}
function check_cache(f::Function=()->nothing)
try
GC.disable_finalizers()
GC.enable_finalizers(false)
lock(cache.lock) do
handle = if !haskey(cache.idle_handles, key) || isempty(cache.idle_handles[key])
f()
Expand All @@ -33,7 +33,7 @@ function Base.pop!(f::Function, cache::HandleCache{K,V}, key) where {K,V}
return handle
end
finally
GC.enable_finalizers()
GC.enable_finalizers(true)
end
end

Expand Down
2 changes: 1 addition & 1 deletion src/device/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const overrides = Expr[]

macro device_override(ex)
code = quote
$GPUCompiler.@override($method_table, $ex)
$GPUCompiler.@override(CUDA.method_table, $ex)
end
if isdefined(Base.Experimental, Symbol("@overlay"))
return esc(code)
Expand Down
3 changes: 2 additions & 1 deletion src/pool.jl
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,8 @@ Returns the cached amount of memory (in bytes) being held on by the CUDA allocat
"""
function cached_memory()
state = active_state()
if stream_ordered(state.device)
if version() >= v"11.3" && stream_ordered(state.device)
# we can only query the memory pool's reserved memory on CUDA 11.3 and later
pool = memory_pool(state.device)
Int(attribute(UInt64, pool, MEMPOOL_ATTR_RESERVED_MEM_CURRENT))
else
Expand Down

2 comments on commit be43480

@maleadt
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/43682

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 v3.4.2 -m "<description of version>" be4348054a5c7af00e872f1864545ab8b2bea022
git push origin v3.4.2

Please sign in to comment.