Skip to content

Make qos_fill and qos_stop local for each thread in sparsebytemap #744

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
May 17, 2025
Merged
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ julia = "1.10"
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
NPZ = "15e1cf62-19b3-5cfa-8e77-841668bca605"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
TensorMarket = "8b7d4fe7-0b45-4d0d-9dd8-5cc9b23b4b77"
TensorMarket = "8b7d4fe7-0b45-4d0d-9dd8-5cc9b23b4b77"
6 changes: 3 additions & 3 deletions src/architecture.jl
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@

struct CPUThread{Parent} <: AbstractTask
tid::Int
dev::CPU
device::CPU
parent::Parent
end
get_device(task::CPUThread) = task.device
Expand All @@ -220,8 +220,8 @@
Base.ndims(::Type{CPULocalArray{A}}) where {A} = ndims(A)

transfer(device::Union{CPUThread,CPUSharedMemory}, arr::AbstractArray) = arr
function transfer(device::CPULocalMemory, arr::AbstractArray)
CPULocalArray{A}(mem.device, [copy(arr) for _ in 1:(mem.device.n)])
function transfer(mem::CPULocalMemory, arr::AbstractArray)
CPULocalArray(mem.device, [copy(arr) for _ in 1:(mem.device.n)])

Check warning on line 224 in src/architecture.jl

View check run for this annotation

Codecov / codecov/patch

src/architecture.jl#L223-L224

Added lines #L223 - L224 were not covered by tests
end
function transfer(task::CPUThread, arr::CPULocalArray)
if get_device(task) === arr.device
Expand Down
1 change: 1 addition & 0 deletions src/postprocess.jl
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ end

iseffectful(ex) = false
function iseffectful(ex::Expr)
ex.head == :break && return true
@capture(ex, :call(~f::(!ispure), ~args...)) && return true
@capture(ex, :(=)(~lhs::issymbol, ~rhs)) && lhs != :_ && return true
@capture(ex, :for(~lhs, ~rhs)) && return iseffectful(rhs) #TODO this could be handled better if we desugared :for
Expand Down
4 changes: 2 additions & 2 deletions src/tensors/levels/sparse_bytemap_levels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ function distribute_level(
distribute_buffer(ctx, lvl.tbl, arch, style),
distribute_buffer(ctx, lvl.srt, arch, style),
lvl.shape,
lvl.qos_fill,
lvl.qos_stop,
distribute_buffer(ctx, lvl.qos_fill, arch, style),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realize this was such a simple fix. Thank you so much!

distribute_buffer(ctx, lvl.qos_stop, arch, style),
)
end

Expand Down
Loading