Skip to content

Commit

Permalink
More signal/queue conveniences
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsamaroo committed Feb 12, 2021
1 parent 1cf84ad commit 0a4d708
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/queue.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function HSAQueue(agent::HSAAgent)
end
return queue
end
HSAQueue() = HSAQueue(get_default_agent())

get_default_queue() = get_default_queue(get_default_agent())

Expand Down
1 change: 1 addition & 0 deletions src/runtime.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ struct HSAStatusSignal
exe::HSAExecutable
end
create_event(::typeof(HSA_rt), exe) = HSAStatusSignal(HSASignal(), exe.exe)
Base.wait(event::HSAStatusSignal; kwargs...) = wait(RuntimeEvent(event); kwargs...)
function Base.wait(event::RuntimeEvent{HSAStatusSignal}; check_exceptions=true, cleanup=true, kwargs...)
wait(event.event.signal; kwargs...) # wait for completion signal
unpreserve!(event) # allow kernel-associated objects to be freed
Expand Down
1 change: 1 addition & 0 deletions src/signal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function HSASignal(init::Integer=1)
end
return signal
end
HSASignal(signal::HSA.Signal) = HSASignal(Ref(signal))

Adapt.adapt_structure(::Adaptor, sig::HSASignal) = sig.signal[]

Expand Down

0 comments on commit 0a4d708

Please sign in to comment.