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: 1 addition & 1 deletion lib/DaggerWebDash/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
TimespanLogging = "a526e669-04d3-4846-9525-c66122c55f63"

[compat]
Dagger = "0.16, 0.17, 0.18"
Dagger = "0.16, 0.17, 0.18, 0.19"
HTTP = "1.7"
JSON3 = "1"
MemPool = "0.3, 0.4"
Expand Down
8 changes: 4 additions & 4 deletions src/array/indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ Base.getindex(c::ArrayOp, idx...) =
const GETINDEX_CACHE = TaskLocalValue{Dict{Tuple,Any}}(()->Dict{Tuple,Any}())
const GETINDEX_CACHE_SIZE = ScopedValue{Int}(0)
with_index_caching(f, size::Integer=1) = with(f, GETINDEX_CACHE_SIZE=>size)
function Base.getindex(A::DArray{T,N}, idx::NTuple{N,Int}) where {T,N}
@inline function Base.getindex(A::DArray{T,N}, idx::NTuple{N,Int}) where {T,N}
# Scalar indexing check
assert_allowscalar()

# Boundscheck
checkbounds(A, idx...)
Base.@boundscheck checkbounds(A, idx...)

# Find the associated partition and offset within it
part_idx, offset_idx = partition_for(A, idx)
Expand Down Expand Up @@ -108,12 +108,12 @@ end

### setindex!

function Base.setindex!(A::DArray{T,N}, value, idx::NTuple{N,Int}) where {T,N}
@inline function Base.setindex!(A::DArray{T,N}, value, idx::NTuple{N,Int}) where {T,N}
# Scalar indexing check
assert_allowscalar()

# Boundscheck
checkbounds(A, idx...)
Base.@boundscheck checkbounds(A, idx...)

# Find the associated partition and offset within it
part_idx, offset_idx = partition_for(A, idx)
Expand Down
8 changes: 4 additions & 4 deletions src/utils/haloarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ function Base.copy(tile::HaloArray{T,N,H}) where {T,N,H}
end

# Define getindex for HaloArray
function Base.getindex(tile::HaloArray{T,N}, I::Vararg{Int,N}) where {T,N}
checkbounds(tile, I...)
@inline function Base.getindex(tile::HaloArray{T,N}, I::Vararg{Int,N}) where {T,N}
Base.@boundscheck checkbounds(tile, I...)
if all(1 .<= I .<= size(tile.center))
return tile.center[I...]
elseif !any(1 .<= I .<= size(tile.center))
Expand All @@ -69,8 +69,8 @@ function Base.getindex(tile::HaloArray{T,N}, I::Vararg{Int,N}) where {T,N}
end

# Define setindex! for HaloArray
function Base.setindex!(tile::HaloArray{T,N}, value, I::Vararg{Int,N}) where {T,N}
checkbounds(tile, I...)
@inline function Base.setindex!(tile::HaloArray{T,N}, value, I::Vararg{Int,N}) where {T,N}
Base.@boundscheck checkbounds(tile, I...)
if all(1 .<= I .<= size(tile.center))
# Center
return tile.center[I...] = value
Expand Down
12 changes: 6 additions & 6 deletions src/utils/reuse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ mutable struct ReusableLinkedList{T} <: AbstractVector{T}
end
end
Base.eltype(list::ReusableLinkedList{T}) where T = T
function Base.getindex(list::ReusableLinkedList{T}, idx::Integer) where T
checkbounds(list, idx)
@inline function Base.getindex(list::ReusableLinkedList{T}, idx::Integer) where T
Base.@boundscheck checkbounds(list, idx)
node = list.head
for _ in 1:(idx-1)
node === nothing && throw(BoundsError(list, idx))
Expand All @@ -218,8 +218,8 @@ function Base.getindex(list::ReusableLinkedList{T}, idx::Integer) where T
node === nothing && throw(BoundsError(list, idx))
return node.value
end
function Base.setindex!(list::ReusableLinkedList{T}, value::T, idx::Integer) where T
checkbounds(list, idx)
@inline function Base.setindex!(list::ReusableLinkedList{T}, value::T, idx::Integer) where T
Base.@boundscheck checkbounds(list, idx)
node = list.head
for _ in 1:(idx-1)
node === nothing && throw(BoundsError(list, idx))
Expand Down Expand Up @@ -377,8 +377,8 @@ function Base.resize!(list::ReusableLinkedList, N::Integer)
end
return list
end
function Base.deleteat!(list::ReusableLinkedList, idx::Integer)
checkbounds(list, idx)
@inline function Base.deleteat!(list::ReusableLinkedList, idx::Integer)
Base.@boundscheck checkbounds(list, idx)
if idx == 1
deleted = list.head
list.head = list.head.next
Expand Down