Skip to content

Commit 7f04509

Browse files
Rahul ManochaJeniferC99
Rahul Manocha
authored andcommitted
SWDEV-478921 - Destroy Queue created by Coop Launch
Change-Id: I7f31ce05421479ff1de138cae26aafa071e956e2
1 parent 95ed002 commit 7f04509

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

rocclr/device/rocm/rocdevice.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3199,7 +3199,7 @@ hsa_queue_t* Device::acquireQueue(uint32_t queue_size_hint, bool coop_queue,
31993199
return queue;
32003200
}
32013201

3202-
void Device::releaseQueue(hsa_queue_t* queue, const std::vector<uint32_t>& cuMask) {
3202+
void Device::releaseQueue(hsa_queue_t* queue, const std::vector<uint32_t>& cuMask, bool coop_queue) {
32033203
for (auto& it : cuMask.size() == 0 ? queuePool_ : queueWithCUMaskPool_) {
32043204
auto qIter = it.find(queue);
32053205
if (qIter != it.end()) {
@@ -3210,6 +3210,12 @@ void Device::releaseQueue(hsa_queue_t* queue, const std::vector<uint32_t>& cuMas
32103210
qIter->first->base_address, qIter->second.refCount);
32113211
}
32123212
}
3213+
if(coop_queue) { // cooperative queue
3214+
ClPrint(amd::LOG_INFO, amd::LOG_QUEUE, "Deleting CG enabled hardware queue %p ",
3215+
queue->base_address);
3216+
hsa_queue_destroy(queue);
3217+
}
3218+
32133219
}
32143220

32153221
void* Device::getOrCreateHostcallBuffer(hsa_queue_t* queue, bool coop_queue,

rocclr/device/rocm/rocdevice.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ class Device : public NullDevice {
556556
amd::CommandQueue::Priority priority = amd::CommandQueue::Priority::Normal);
557557

558558
//! Release HSA queue
559-
void releaseQueue(hsa_queue_t*, const std::vector<uint32_t>& cuMask = {});
559+
void releaseQueue(hsa_queue_t*, const std::vector<uint32_t>& cuMask = {}, bool coop_queue = false);
560560

561561
//! For the given HSA queue, return an existing hostcall buffer or create a
562562
//! new one. queuePool_ keeps a mapping from HSA queue to hostcall buffer.

rocclr/device/rocm/rocvirtual.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1316,7 +1316,7 @@ VirtualGPU::~VirtualGPU() {
13161316
}
13171317

13181318
if (gpu_queue_) {
1319-
roc_device_.releaseQueue(gpu_queue_, cuMask_);
1319+
roc_device_.releaseQueue(gpu_queue_, cuMask_, cooperative_);
13201320
}
13211321
}
13221322

0 commit comments

Comments
 (0)