Skip to content

Commit

Permalink
Destroy pipeline even when use count is 0
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Pereanu <bogdan.pereanu@intel.com>
  • Loading branch information
pereanub committed Jan 29, 2025
1 parent 135da9a commit ad75cf1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,11 @@ class CommandQueueManager {

static CommandQueueManager& getInstance();

const std::shared_ptr<CommandQueue>& getCommandQueue(
const std::shared_ptr<ZeroInitStructsHolder>& init_structs,
const ze_command_queue_priority_t& priority,
const std::optional<ze_command_queue_workload_type_t>& workload_type,
const uint32_t& group_ordinal,
bool turbo);
std::shared_ptr<CommandQueue> getCommandQueue(const std::shared_ptr<ZeroInitStructsHolder>& init_structs,
const ze_command_queue_priority_t& priority,
const std::optional<ze_command_queue_workload_type_t>& workload_type,
const uint32_t& group_ordinal,
bool turbo);

void freeCommandQueue(const ze_command_queue_priority_t& priority,
const std::optional<ze_command_queue_workload_type_t>& workload_type,
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/intel_npu/src/utils/src/zero/zero_wrappers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ CommandQueueManager& CommandQueueManager::getInstance() {
static CommandQueueManager instance;
return instance;
}
const std::shared_ptr<CommandQueue>& CommandQueueManager::getCommandQueue(
std::shared_ptr<CommandQueue> CommandQueueManager::getCommandQueue(
const std::shared_ptr<ZeroInitStructsHolder>& init_structs,
const ze_command_queue_priority_t& priority,
const std::optional<ze_command_queue_workload_type_t>& workload_type,
Expand Down Expand Up @@ -255,7 +255,7 @@ void CommandQueueManager::freeCommandQueue(const ze_command_queue_priority_t& pr

if (_gloabal_command_queues[zeroUtils::toPriorityEnum(priority)][zeroUtils::toTurboEnum(turbo)]
[zeroUtils::toWorkloadEnum(workload_type)]
.use_count() == 1) {
.use_count() <= 1) {
_log.debug("Destroy command queue");
_gloabal_command_queues[zeroUtils::toPriorityEnum(priority)][zeroUtils::toTurboEnum(turbo)]
[zeroUtils::toWorkloadEnum(workload_type)]
Expand Down

0 comments on commit ad75cf1

Please sign in to comment.