Use correct queue id for gws assignment.

Change-Id: I9157951abce65b60dfe0e1db5819510a7703547f
This commit is contained in:
Sean Keely
2020-06-24 17:04:43 -05:00
committad av Ramesh Errabolu
förälder 91cb98dab6
incheckning cc7a197ff8
3 ändrade filer med 14 tillägg och 5 borttagningar
@@ -196,6 +196,9 @@ class AqlQueue : public core::Queue, private core::LocalSignal, public core::Doo
/// @brief Update signal value using Release semantics
void StoreRelease(hsa_signal_value_t value) override;
/// @brief Enable use of GWS from this queue.
hsa_status_t EnableGWS(int gws_slot_count);
protected:
bool _IsA(Queue::rtti_t id) const override { return id == &rtti_id_; }
@@ -1119,5 +1119,14 @@ void AqlQueue::InitScratchSRD() {
amd_queue_.compute_tmpring_size = tmpring_size.u32All;
return;
}
hsa_status_t AqlQueue::EnableGWS(int gws_slot_count) {
uint32_t discard;
auto status = hsaKmtAllocQueueGWS(queue_id_, gws_slot_count, &discard);
if (status != HSAKMT_STATUS_SUCCESS) return HSA_STATUS_ERROR_OUT_OF_RESOURCES;
amd_queue_.hsa_queue.type = HSA_QUEUE_TYPE_COOPERATIVE;
return HSA_STATUS_SUCCESS;
}
} // namespace amd
} // namespace rocr
@@ -605,12 +605,9 @@ void GpuAgent::InitGWS() {
throw AMD::hsa_exception(HSA_STATUS_ERROR_OUT_OF_RESOURCES,
"Internal queue creation failed.");
uint32_t discard;
auto status = hsaKmtAllocQueueGWS(queue->amd_queue_.hsa_queue.id, 1, &discard);
if (status != HSAKMT_STATUS_SUCCESS)
throw AMD::hsa_exception(HSA_STATUS_ERROR_OUT_OF_RESOURCES, "GWS allocation failed.");
auto err = static_cast<AqlQueue*>(queue.get())->EnableGWS(1);
if (err != HSA_STATUS_SUCCESS) throw AMD::hsa_exception(err, "GWS allocation failed.");
queue->amd_queue_.hsa_queue.type = HSA_QUEUE_TYPE_COOPERATIVE;
gws_queue_.ref_ct_ = 0;
return queue.release();
});