Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! fixup! fixup! Add task-local device and queue
Browse files Browse the repository at this point in the history
jpsamaroo committed Feb 20, 2023
1 parent 9e64e70 commit 5563c12
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/runtime/queue.jl
Original file line number Diff line number Diff line change
@@ -91,7 +91,13 @@ function ROCQueue(device::ROCDevice; priority::Symbol=:normal, pooled::Bool=fals
if length(pool) >= ALLOC_QUEUE_POOL_MAX[prio_idx]
idx = ((ALLOC_QUEUE_INDEX[] - 1) % length(pool)) + 1
ALLOC_QUEUE_INDEX[] += 1
return pool[idx]
q = pool[idx]
if q.active
return q
else
@debug "Removing dead queue from pool"
deleteat!(pool, idx)
end
end

# Otherwise, we want to allocate a new queue for the pool

0 comments on commit 5563c12

Please sign in to comment.