Exception support for Queue.

Remove "zombie" queue state and report queue creation failure via
exceptions.  Make Shared object a final container and support array
objects with Shared.  Add message printing to hsa_exception in
debug builds.

Change-Id: I459f38c80846018acbf45538874e95f91dd6b195
This commit is contained in:
Sean Keely
2017-10-20 07:12:04 -05:00
parent 0c7dde2d1f
commit f312a7386e
13 changed files with 181 additions and 162 deletions
@@ -63,10 +63,6 @@ class QueueWrapper : public Queue {
std::unique_ptr<Queue> wrapped;
explicit QueueWrapper(std::unique_ptr<Queue> queue) : Queue(), wrapped(std::move(queue)) {
if (Queue::Shared::shared_object() == NULL) {
return;
}
memcpy(&amd_queue_, &wrapped->amd_queue_, sizeof(amd_queue_t));
wrapped->set_public_handle(wrapped.get(), public_handle_);
}
@@ -226,6 +222,9 @@ class InterceptQueue : public QueueProxy, private LocalSignal, public Signal {
// Indicates queue active/inactive state.
std::atomic<bool> active_;
// Proxy packet buffer
SharedArray<AqlPacket, 4096> buffer_;
static const hsa_signal_value_t DOORBELL_MAX = 0xFFFFFFFFFFFFFFFFull;
static bool HandleAsyncDoorbell(hsa_signal_value_t value, void* arg);