Skip to content

Commit

Permalink
Fix cache retrieval (#718)
Browse files Browse the repository at this point in the history
  • Loading branch information
pxl-th authored Jan 9, 2025
1 parent b6f3376 commit 8c937e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "AMDGPU"
uuid = "21141c5a-9bdb-4563-92ae-f87d6854732e"
authors = ["Julian P Samaroo <[email protected]>", "Valentin Churavy <[email protected]>", "Anton Smirnov <[email protected]>"]
version = "1.2.0"
version = "1.2.1"

[deps]
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
Expand Down
7 changes: 6 additions & 1 deletion src/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ mutable struct ROCArray{T, N, B} <: AbstractGPUArray{T, N}
function ROCArray{T, N, B}(::UndefInitializer, dims::Dims{N}) where {T, N, B <: Mem.AbstractAMDBuffer}
@assert isbitstype(T) "ROCArray only supports bits types"
sz::Int64 = prod(dims) * sizeof(T)
return GPUArrays.cached_alloc((ROCArray, AMDGPU.device(), T, B, sz)) do
x = GPUArrays.cached_alloc((ROCArray, AMDGPU.device(), T, B, sz)) do
@debug "Allocate `T=$T`, `dims=$dims`: $(Base.format_bytes(sz))"
data = DataRef(pool_free, pool_alloc(B, sz))
return finalizer(unsafe_free!, new{T, N, B}(data, dims, 0))
end
return if size(x) != dims
reshape(x, dims)
else
x
end::ROCArray{T, N, B}
end

Expand Down

2 comments on commit 8c937e3

@pxl-th
Copy link
Member Author

@pxl-th pxl-th commented on 8c937e3 Jan 9, 2025

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/122714

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 v1.2.1 -m "<description of version>" 8c937e36a11c019a336b095f8183fcbb80ddb21a
git push origin v1.2.1

Please sign in to comment.