Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Initial Runic formatting
4f29bf67e8be8e82da2deabd8236aaa9d95b781e
2 changes: 2 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ jobs:
- uses: julia-actions/julia-runtest@v1

- uses: julia-actions/julia-processcoverage@v1
if: matrix.version == '1.x' && matrix.os == 'ubuntu-latest'
with:
directories: src

- uses: codecov/codecov-action@v4
if: matrix.version == '1.x' && matrix.os == 'ubuntu-latest'
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/Runic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Runic
on:
push:
branches: [master]
pull_request:
jobs:
runic:
name: Runic
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: "1"
- uses: fredrikekre/runic-action@v1
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function write_if_changed(path::String, content::String)
if isfile(path) && read(path, String) == content
return # Content unchanged, skip write
end
write(path, content)
return write(path, content)
end

# ============================================
Expand Down
6 changes: 3 additions & 3 deletions ext/AdaptiveArrayPoolsCUDAExt/acquire.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
# ==============================================================================

using AdaptiveArrayPools: get_view!, get_nd_view!, get_nd_array!, allocate_vector, safe_prod,
_record_type_touch!, _fixed_slot_bit, _checkpoint_typed_pool!,
_MODE_BITS_MASK
_record_type_touch!, _fixed_slot_bit, _checkpoint_typed_pool!,
_MODE_BITS_MASK

"""
get_view!(tp::CuTypedPool{T}, n::Int) -> CuVector{T}
Expand Down Expand Up @@ -205,5 +205,5 @@ end
end
@inbounds pool._touched_type_masks[depth] = current_mask | b
end
nothing
return nothing
end
56 changes: 28 additions & 28 deletions ext/AdaptiveArrayPoolsCUDAExt/convenience.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,61 +37,61 @@ Default element type for disabled CUDA pools (matches CUDA.zeros() default).
AdaptiveArrayPools.default_eltype(::DisabledPool{:cuda}) = Float32

# --- zeros! for DisabledPool{:cuda} ---
@inline AdaptiveArrayPools.zeros!(::DisabledPool{:cuda}, ::Type{T}, dims::Vararg{Int,N}) where {T,N} = CUDA.zeros(T, dims...)
@inline AdaptiveArrayPools.zeros!(p::DisabledPool{:cuda}, dims::Vararg{Int,N}) where {N} = CUDA.zeros(AdaptiveArrayPools.default_eltype(p), dims...)
@inline AdaptiveArrayPools.zeros!(::DisabledPool{:cuda}, ::Type{T}, dims::NTuple{N,Int}) where {T,N} = CUDA.zeros(T, dims...)
@inline AdaptiveArrayPools.zeros!(p::DisabledPool{:cuda}, dims::NTuple{N,Int}) where {N} = CUDA.zeros(AdaptiveArrayPools.default_eltype(p), dims...)
@inline AdaptiveArrayPools.zeros!(::DisabledPool{:cuda}, ::Type{T}, dims::Vararg{Int, N}) where {T, N} = CUDA.zeros(T, dims...)
@inline AdaptiveArrayPools.zeros!(p::DisabledPool{:cuda}, dims::Vararg{Int, N}) where {N} = CUDA.zeros(AdaptiveArrayPools.default_eltype(p), dims...)
@inline AdaptiveArrayPools.zeros!(::DisabledPool{:cuda}, ::Type{T}, dims::NTuple{N, Int}) where {T, N} = CUDA.zeros(T, dims...)
@inline AdaptiveArrayPools.zeros!(p::DisabledPool{:cuda}, dims::NTuple{N, Int}) where {N} = CUDA.zeros(AdaptiveArrayPools.default_eltype(p), dims...)

# --- ones! for DisabledPool{:cuda} ---
@inline AdaptiveArrayPools.ones!(::DisabledPool{:cuda}, ::Type{T}, dims::Vararg{Int,N}) where {T,N} = CUDA.ones(T, dims...)
@inline AdaptiveArrayPools.ones!(p::DisabledPool{:cuda}, dims::Vararg{Int,N}) where {N} = CUDA.ones(AdaptiveArrayPools.default_eltype(p), dims...)
@inline AdaptiveArrayPools.ones!(::DisabledPool{:cuda}, ::Type{T}, dims::NTuple{N,Int}) where {T,N} = CUDA.ones(T, dims...)
@inline AdaptiveArrayPools.ones!(p::DisabledPool{:cuda}, dims::NTuple{N,Int}) where {N} = CUDA.ones(AdaptiveArrayPools.default_eltype(p), dims...)
@inline AdaptiveArrayPools.ones!(::DisabledPool{:cuda}, ::Type{T}, dims::Vararg{Int, N}) where {T, N} = CUDA.ones(T, dims...)
@inline AdaptiveArrayPools.ones!(p::DisabledPool{:cuda}, dims::Vararg{Int, N}) where {N} = CUDA.ones(AdaptiveArrayPools.default_eltype(p), dims...)
@inline AdaptiveArrayPools.ones!(::DisabledPool{:cuda}, ::Type{T}, dims::NTuple{N, Int}) where {T, N} = CUDA.ones(T, dims...)
@inline AdaptiveArrayPools.ones!(p::DisabledPool{:cuda}, dims::NTuple{N, Int}) where {N} = CUDA.ones(AdaptiveArrayPools.default_eltype(p), dims...)

# --- similar! for DisabledPool{:cuda} ---
@inline AdaptiveArrayPools.similar!(::DisabledPool{:cuda}, x::CuArray) = CUDA.similar(x)
@inline AdaptiveArrayPools.similar!(::DisabledPool{:cuda}, x::CuArray, ::Type{T}) where {T} = CUDA.similar(x, T)
@inline AdaptiveArrayPools.similar!(::DisabledPool{:cuda}, x::CuArray, dims::Vararg{Int,N}) where {N} = CUDA.similar(x, dims...)
@inline AdaptiveArrayPools.similar!(::DisabledPool{:cuda}, x::CuArray, ::Type{T}, dims::Vararg{Int,N}) where {T,N} = CUDA.similar(x, T, dims...)
@inline AdaptiveArrayPools.similar!(::DisabledPool{:cuda}, x::CuArray, dims::Vararg{Int, N}) where {N} = CUDA.similar(x, dims...)
@inline AdaptiveArrayPools.similar!(::DisabledPool{:cuda}, x::CuArray, ::Type{T}, dims::Vararg{Int, N}) where {T, N} = CUDA.similar(x, T, dims...)
# Fallback for non-CuArray inputs (creates CuArray from AbstractArray)
@inline AdaptiveArrayPools.similar!(::DisabledPool{:cuda}, x::AbstractArray) = CuArray{eltype(x)}(undef, size(x))
@inline AdaptiveArrayPools.similar!(::DisabledPool{:cuda}, x::AbstractArray, ::Type{T}) where {T} = CuArray{T}(undef, size(x))
@inline AdaptiveArrayPools.similar!(::DisabledPool{:cuda}, x::AbstractArray, dims::Vararg{Int,N}) where {N} = CuArray{eltype(x)}(undef, dims)
@inline AdaptiveArrayPools.similar!(::DisabledPool{:cuda}, x::AbstractArray, ::Type{T}, dims::Vararg{Int,N}) where {T,N} = CuArray{T}(undef, dims)
@inline AdaptiveArrayPools.similar!(::DisabledPool{:cuda}, x::AbstractArray, dims::Vararg{Int, N}) where {N} = CuArray{eltype(x)}(undef, dims)
@inline AdaptiveArrayPools.similar!(::DisabledPool{:cuda}, x::AbstractArray, ::Type{T}, dims::Vararg{Int, N}) where {T, N} = CuArray{T}(undef, dims)

# --- unsafe_zeros! for DisabledPool{:cuda} ---
@inline AdaptiveArrayPools.unsafe_zeros!(::DisabledPool{:cuda}, ::Type{T}, dims::Vararg{Int,N}) where {T,N} = CUDA.zeros(T, dims...)
@inline AdaptiveArrayPools.unsafe_zeros!(p::DisabledPool{:cuda}, dims::Vararg{Int,N}) where {N} = CUDA.zeros(AdaptiveArrayPools.default_eltype(p), dims...)
@inline AdaptiveArrayPools.unsafe_zeros!(::DisabledPool{:cuda}, ::Type{T}, dims::NTuple{N,Int}) where {T,N} = CUDA.zeros(T, dims...)
@inline AdaptiveArrayPools.unsafe_zeros!(p::DisabledPool{:cuda}, dims::NTuple{N,Int}) where {N} = CUDA.zeros(AdaptiveArrayPools.default_eltype(p), dims...)
@inline AdaptiveArrayPools.unsafe_zeros!(::DisabledPool{:cuda}, ::Type{T}, dims::Vararg{Int, N}) where {T, N} = CUDA.zeros(T, dims...)
@inline AdaptiveArrayPools.unsafe_zeros!(p::DisabledPool{:cuda}, dims::Vararg{Int, N}) where {N} = CUDA.zeros(AdaptiveArrayPools.default_eltype(p), dims...)
@inline AdaptiveArrayPools.unsafe_zeros!(::DisabledPool{:cuda}, ::Type{T}, dims::NTuple{N, Int}) where {T, N} = CUDA.zeros(T, dims...)
@inline AdaptiveArrayPools.unsafe_zeros!(p::DisabledPool{:cuda}, dims::NTuple{N, Int}) where {N} = CUDA.zeros(AdaptiveArrayPools.default_eltype(p), dims...)

# --- unsafe_ones! for DisabledPool{:cuda} ---
@inline AdaptiveArrayPools.unsafe_ones!(::DisabledPool{:cuda}, ::Type{T}, dims::Vararg{Int,N}) where {T,N} = CUDA.ones(T, dims...)
@inline AdaptiveArrayPools.unsafe_ones!(p::DisabledPool{:cuda}, dims::Vararg{Int,N}) where {N} = CUDA.ones(AdaptiveArrayPools.default_eltype(p), dims...)
@inline AdaptiveArrayPools.unsafe_ones!(::DisabledPool{:cuda}, ::Type{T}, dims::NTuple{N,Int}) where {T,N} = CUDA.ones(T, dims...)
@inline AdaptiveArrayPools.unsafe_ones!(p::DisabledPool{:cuda}, dims::NTuple{N,Int}) where {N} = CUDA.ones(AdaptiveArrayPools.default_eltype(p), dims...)
@inline AdaptiveArrayPools.unsafe_ones!(::DisabledPool{:cuda}, ::Type{T}, dims::Vararg{Int, N}) where {T, N} = CUDA.ones(T, dims...)
@inline AdaptiveArrayPools.unsafe_ones!(p::DisabledPool{:cuda}, dims::Vararg{Int, N}) where {N} = CUDA.ones(AdaptiveArrayPools.default_eltype(p), dims...)
@inline AdaptiveArrayPools.unsafe_ones!(::DisabledPool{:cuda}, ::Type{T}, dims::NTuple{N, Int}) where {T, N} = CUDA.ones(T, dims...)
@inline AdaptiveArrayPools.unsafe_ones!(p::DisabledPool{:cuda}, dims::NTuple{N, Int}) where {N} = CUDA.ones(AdaptiveArrayPools.default_eltype(p), dims...)

# --- unsafe_similar! for DisabledPool{:cuda} ---
@inline AdaptiveArrayPools.unsafe_similar!(::DisabledPool{:cuda}, x::CuArray) = CUDA.similar(x)
@inline AdaptiveArrayPools.unsafe_similar!(::DisabledPool{:cuda}, x::CuArray, ::Type{T}) where {T} = CUDA.similar(x, T)
@inline AdaptiveArrayPools.unsafe_similar!(::DisabledPool{:cuda}, x::CuArray, dims::Vararg{Int,N}) where {N} = CUDA.similar(x, dims...)
@inline AdaptiveArrayPools.unsafe_similar!(::DisabledPool{:cuda}, x::CuArray, ::Type{T}, dims::Vararg{Int,N}) where {T,N} = CUDA.similar(x, T, dims...)
@inline AdaptiveArrayPools.unsafe_similar!(::DisabledPool{:cuda}, x::CuArray, dims::Vararg{Int, N}) where {N} = CUDA.similar(x, dims...)
@inline AdaptiveArrayPools.unsafe_similar!(::DisabledPool{:cuda}, x::CuArray, ::Type{T}, dims::Vararg{Int, N}) where {T, N} = CUDA.similar(x, T, dims...)
# Fallback for non-CuArray inputs
@inline AdaptiveArrayPools.unsafe_similar!(::DisabledPool{:cuda}, x::AbstractArray) = CuArray{eltype(x)}(undef, size(x))
@inline AdaptiveArrayPools.unsafe_similar!(::DisabledPool{:cuda}, x::AbstractArray, ::Type{T}) where {T} = CuArray{T}(undef, size(x))
@inline AdaptiveArrayPools.unsafe_similar!(::DisabledPool{:cuda}, x::AbstractArray, dims::Vararg{Int,N}) where {N} = CuArray{eltype(x)}(undef, dims)
@inline AdaptiveArrayPools.unsafe_similar!(::DisabledPool{:cuda}, x::AbstractArray, ::Type{T}, dims::Vararg{Int,N}) where {T,N} = CuArray{T}(undef, dims)
@inline AdaptiveArrayPools.unsafe_similar!(::DisabledPool{:cuda}, x::AbstractArray, dims::Vararg{Int, N}) where {N} = CuArray{eltype(x)}(undef, dims)
@inline AdaptiveArrayPools.unsafe_similar!(::DisabledPool{:cuda}, x::AbstractArray, ::Type{T}, dims::Vararg{Int, N}) where {T, N} = CuArray{T}(undef, dims)

# --- acquire! for DisabledPool{:cuda} ---
@inline AdaptiveArrayPools.acquire!(::DisabledPool{:cuda}, ::Type{T}, n::Int) where {T} = CuVector{T}(undef, n)
@inline AdaptiveArrayPools.acquire!(::DisabledPool{:cuda}, ::Type{T}, dims::Vararg{Int,N}) where {T,N} = CuArray{T,N}(undef, dims)
@inline AdaptiveArrayPools.acquire!(::DisabledPool{:cuda}, ::Type{T}, dims::NTuple{N,Int}) where {T,N} = CuArray{T,N}(undef, dims)
@inline AdaptiveArrayPools.acquire!(::DisabledPool{:cuda}, ::Type{T}, dims::Vararg{Int, N}) where {T, N} = CuArray{T, N}(undef, dims)
@inline AdaptiveArrayPools.acquire!(::DisabledPool{:cuda}, ::Type{T}, dims::NTuple{N, Int}) where {T, N} = CuArray{T, N}(undef, dims)
@inline AdaptiveArrayPools.acquire!(::DisabledPool{:cuda}, x::CuArray) = CUDA.similar(x)
@inline AdaptiveArrayPools.acquire!(::DisabledPool{:cuda}, x::AbstractArray) = CuArray{eltype(x)}(undef, size(x))

# --- unsafe_acquire! for DisabledPool{:cuda} ---
@inline AdaptiveArrayPools.unsafe_acquire!(::DisabledPool{:cuda}, ::Type{T}, n::Int) where {T} = CuVector{T}(undef, n)
@inline AdaptiveArrayPools.unsafe_acquire!(::DisabledPool{:cuda}, ::Type{T}, dims::Vararg{Int,N}) where {T,N} = CuArray{T,N}(undef, dims)
@inline AdaptiveArrayPools.unsafe_acquire!(::DisabledPool{:cuda}, ::Type{T}, dims::NTuple{N,Int}) where {T,N} = CuArray{T,N}(undef, dims)
@inline AdaptiveArrayPools.unsafe_acquire!(::DisabledPool{:cuda}, ::Type{T}, dims::Vararg{Int, N}) where {T, N} = CuArray{T, N}(undef, dims)
@inline AdaptiveArrayPools.unsafe_acquire!(::DisabledPool{:cuda}, ::Type{T}, dims::NTuple{N, Int}) where {T, N} = CuArray{T, N}(undef, dims)
@inline AdaptiveArrayPools.unsafe_acquire!(::DisabledPool{:cuda}, x::CuArray) = CUDA.similar(x)
@inline AdaptiveArrayPools.unsafe_acquire!(::DisabledPool{:cuda}, x::AbstractArray) = CuArray{eltype(x)}(undef, size(x))
8 changes: 4 additions & 4 deletions ext/AdaptiveArrayPoolsCUDAExt/dispatch.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ using AdaptiveArrayPools: allocate_vector, wrap_array, get_typed_pool!
# ==============================================================================

@inline AdaptiveArrayPools.allocate_vector(
::AbstractTypedPool{T,CuVector{T}}, n::Int
::AbstractTypedPool{T, CuVector{T}}, n::Int
) where {T} = CuVector{T}(undef, n)

# ==============================================================================
Expand All @@ -20,8 +20,8 @@ using AdaptiveArrayPools: allocate_vector, wrap_array, get_typed_pool!
# GPU uses reshape which returns CuArray{T,N} via GPUArrays derive()
# (NOT ReshapedArray like CPU - this is simpler for GPU kernels)
@inline AdaptiveArrayPools.wrap_array(
::AbstractTypedPool{T,CuVector{T}}, flat_view, dims::NTuple{N,Int}
) where {T,N} = reshape(flat_view, dims)
::AbstractTypedPool{T, CuVector{T}}, flat_view, dims::NTuple{N, Int}
) where {T, N} = reshape(flat_view, dims)

# ==============================================================================
# get_typed_pool! Dispatches for CuAdaptiveArrayPool
Expand All @@ -39,7 +39,7 @@ using AdaptiveArrayPools: allocate_vector, wrap_array, get_typed_pool!

# Slow path: rare types via IdDict (with checkpoint correction!)
@inline function AdaptiveArrayPools.get_typed_pool!(p::CuAdaptiveArrayPool, ::Type{T}) where {T}
get!(p.others, T) do
return get!(p.others, T) do
tp = CuTypedPool{T}()
# CRITICAL: Match CPU behavior - auto-checkpoint new pool if inside @with_pool scope
# Without this, rewind! would corrupt state for dynamically-created pools
Expand Down
44 changes: 22 additions & 22 deletions ext/AdaptiveArrayPoolsCUDAExt/state.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# AbstractTypedPool, so they work for CuTypedPool automatically.

using AdaptiveArrayPools: checkpoint!, rewind!, reset!,
_checkpoint_typed_pool!, _rewind_typed_pool!, _has_bit,
_LAZY_MODE_BIT, _TYPED_LAZY_BIT, _TYPE_BITS_MASK
_checkpoint_typed_pool!, _rewind_typed_pool!, _has_bit,
_LAZY_MODE_BIT, _TYPED_LAZY_BIT, _TYPE_BITS_MASK

# ==============================================================================
# GPU Fixed Slot Iteration
Expand All @@ -20,7 +20,7 @@ Apply `f` to each fixed slot CuTypedPool. Zero allocation via compile-time unrol
"""
@generated function AdaptiveArrayPools.foreach_fixed_slot(f::F, pool::CuAdaptiveArrayPool) where {F}
exprs = [:(f(getfield(pool, $(QuoteNode(field))))) for field in GPU_FIXED_SLOT_FIELDS]
quote
return quote
Base.@_inline_meta
$(exprs...)
nothing
Expand Down Expand Up @@ -57,7 +57,7 @@ end
push!(pool._touched_type_masks, UInt16(0))
push!(pool._touched_has_others, AdaptiveArrayPools._fixed_slot_bit(T) == UInt16(0))
_checkpoint_typed_pool!(AdaptiveArrayPools.get_typed_pool!(pool, T), pool._current_depth)
nothing
return nothing
end

# Type-specific checkpoint (multiple types)
Expand All @@ -72,7 +72,7 @@ end
end
has_any_fallback = any(i -> AdaptiveArrayPools._fixed_slot_bit(types[i].parameters[1]) == UInt16(0), unique_indices)
checkpoint_exprs = [:(_checkpoint_typed_pool!(AdaptiveArrayPools.get_typed_pool!(pool, types[$i]), pool._current_depth)) for i in unique_indices]
quote
return quote
pool._current_depth += 1
push!(pool._touched_type_masks, UInt16(0))
push!(pool._touched_has_others, $has_any_fallback)
Expand Down Expand Up @@ -121,7 +121,7 @@ end
pop!(pool._touched_type_masks)
pop!(pool._touched_has_others)
pool._current_depth -= 1
nothing
return nothing
end

# Type-specific rewind (multiple types)
Expand All @@ -136,7 +136,7 @@ end
end
rewind_exprs = [:(_rewind_typed_pool!(AdaptiveArrayPools.get_typed_pool!(pool, types[$i]), pool._current_depth)) for i in reverse(unique_indices)]
reset_exprs = [:(reset!(AdaptiveArrayPools.get_typed_pool!(pool, types[$i]))) for i in unique_indices]
quote
return quote
if pool._current_depth == 1
$(reset_exprs...)
return nothing
Expand Down Expand Up @@ -175,19 +175,19 @@ end
@inbounds pool._touched_has_others[depth] = true
end
# Float16 uses lazy first-touch via bit 7 in _record_type_touch! — no eager checkpoint needed.
nothing
return nothing
end

@inline function AdaptiveArrayPools._lazy_rewind!(pool::CuAdaptiveArrayPool)
d = pool._current_depth
mask = @inbounds(pool._touched_type_masks[d]) & _TYPE_BITS_MASK
_has_bit(mask, Float64) && _rewind_typed_pool!(pool.float64, d)
_has_bit(mask, Float32) && _rewind_typed_pool!(pool.float32, d)
_has_bit(mask, Int64) && _rewind_typed_pool!(pool.int64, d)
_has_bit(mask, Int32) && _rewind_typed_pool!(pool.int32, d)
_has_bit(mask, Float64) && _rewind_typed_pool!(pool.float64, d)
_has_bit(mask, Float32) && _rewind_typed_pool!(pool.float32, d)
_has_bit(mask, Int64) && _rewind_typed_pool!(pool.int64, d)
_has_bit(mask, Int32) && _rewind_typed_pool!(pool.int32, d)
_has_bit(mask, ComplexF64) && _rewind_typed_pool!(pool.complexf64, d)
_has_bit(mask, ComplexF32) && _rewind_typed_pool!(pool.complexf32, d)
_has_bit(mask, Bool) && _rewind_typed_pool!(pool.bool, d)
_has_bit(mask, Bool) && _rewind_typed_pool!(pool.bool, d)
# Bit 7: Float16 (CUDA reassignment — _fixed_slot_bit(Float16)==0, must use explicit bit check)
mask & _cuda_float16_bit() != 0 && _rewind_typed_pool!(pool.float16, d)
if @inbounds(pool._touched_has_others[d])
Expand All @@ -198,7 +198,7 @@ end
pop!(pool._touched_type_masks)
pop!(pool._touched_has_others)
pool._current_depth -= 1
nothing
return nothing
end

# ==============================================================================
Expand All @@ -221,7 +221,7 @@ end
@inbounds pool._touched_has_others[d] = true
end
# Float16 uses lazy first-touch via bit 7 in _record_type_touch! — no eager checkpoint needed.
nothing
return nothing
end

# _typed_lazy_rewind!: selective rewind of (tracked | touched) mask.
Expand All @@ -232,13 +232,13 @@ end
d = pool._current_depth
touched = @inbounds(pool._touched_type_masks[d]) & _TYPE_BITS_MASK
combined = tracked_mask | touched
_has_bit(combined, Float64) && _rewind_typed_pool!(pool.float64, d)
_has_bit(combined, Float32) && _rewind_typed_pool!(pool.float32, d)
_has_bit(combined, Int64) && _rewind_typed_pool!(pool.int64, d)
_has_bit(combined, Int32) && _rewind_typed_pool!(pool.int32, d)
_has_bit(combined, Float64) && _rewind_typed_pool!(pool.float64, d)
_has_bit(combined, Float32) && _rewind_typed_pool!(pool.float32, d)
_has_bit(combined, Int64) && _rewind_typed_pool!(pool.int64, d)
_has_bit(combined, Int32) && _rewind_typed_pool!(pool.int32, d)
_has_bit(combined, ComplexF64) && _rewind_typed_pool!(pool.complexf64, d)
_has_bit(combined, ComplexF32) && _rewind_typed_pool!(pool.complexf32, d)
_has_bit(combined, Bool) && _rewind_typed_pool!(pool.bool, d)
_has_bit(combined, Bool) && _rewind_typed_pool!(pool.bool, d)
# Float16: bit 7 is set by _record_type_touch! on first touch (lazy first-touch).
# Also rewind when Float16 was a *tracked* type in the macro: _typed_lazy_checkpoint!
# calls checkpoint!(pool, Float16) which pushes a checkpoint at depth d, but _acquire_impl!
Expand All @@ -257,7 +257,7 @@ end
pop!(pool._touched_type_masks)
pop!(pool._touched_has_others)
pool._current_depth -= 1
nothing
return nothing
end

# ==============================================================================
Expand Down Expand Up @@ -288,7 +288,7 @@ end
# Type-specific reset
@inline function AdaptiveArrayPools.reset!(pool::CuAdaptiveArrayPool, ::Type{T}) where {T}
reset!(AdaptiveArrayPools.get_typed_pool!(pool, T))
pool
return pool
end

# ==============================================================================
Expand Down
Loading