diff --git a/src/plugins/intel_npu/src/backend/src/zero_pipeline.cpp b/src/plugins/intel_npu/src/backend/src/zero_pipeline.cpp index 6f6c64f1b89605..de5df0bf403dd7 100644 --- a/src/plugins/intel_npu/src/backend/src/zero_pipeline.cpp +++ b/src/plugins/intel_npu/src/backend/src/zero_pipeline.cpp @@ -32,8 +32,8 @@ Pipeline::Pipeline(const Config& config, _id(_graph->get_unique_id()), _number_of_command_lists(_graph->get_batch_size().has_value() ? *_graph->get_batch_size() : 1), _event_pool{ - std::make_shared(init_structs->getDevice(), - init_structs->getContext(), + std::make_shared(_init_structs->getDevice(), + _init_structs->getContext(), _number_of_command_lists ? static_cast(_number_of_command_lists) : 1)}, _npu_profiling(npu_profiling), _logger("Pipeline", _config.get()), @@ -57,9 +57,9 @@ Pipeline::Pipeline(const Config& config, _logger.debug("Pipeline - emplace_back _event_pool and _command_queue"); for (size_t i = 0; i < _number_of_command_lists; i++) { _command_lists.emplace_back( - std::make_unique(init_structs, + std::make_unique(_init_structs, group_ordinal, - init_structs->getMutableCommandListVersion() ? true : false)); + _init_structs->getMutableCommandListVersion() ? true : false)); _events.emplace_back(std::make_shared(_event_pool, static_cast(i))); } diff --git a/src/plugins/intel_npu/src/utils/include/intel_npu/utils/zero/zero_wrappers.hpp b/src/plugins/intel_npu/src/utils/include/intel_npu/utils/zero/zero_wrappers.hpp index b5a7a92faf37cd..51c3479fb75457 100644 --- a/src/plugins/intel_npu/src/utils/include/intel_npu/utils/zero/zero_wrappers.hpp +++ b/src/plugins/intel_npu/src/utils/include/intel_npu/utils/zero/zero_wrappers.hpp @@ -61,7 +61,7 @@ class CommandList { public: friend class CommandQueue; CommandList() = delete; - CommandList(const std::shared_ptr& initStructs, + CommandList(const std::shared_ptr& init_structs, const uint32_t& group_ordinal, bool mtci_is_supported = false); CommandList(const CommandList&) = delete; @@ -85,7 +85,7 @@ class CommandList { } private: - std::shared_ptr _initStructs; + std::shared_ptr _init_structs; Logger _log; @@ -158,12 +158,12 @@ class CommandQueueFactory { const std::shared_ptr& getCommandQueue( const std::shared_ptr& init_structs, const ze_command_queue_priority_t& priority, - const std::optional& workloadType, + const std::optional& workload_type, const uint32_t& group_ordinal, bool turbo); void freeCommandQueue(const ze_command_queue_priority_t& priority, - const std::optional& workloadType, + const std::optional& workload_type, bool turbo); private: diff --git a/src/plugins/intel_npu/src/utils/src/zero/zero_wrappers.cpp b/src/plugins/intel_npu/src/utils/src/zero/zero_wrappers.cpp index acaf9aad037233..b3eb5546a0c153 100644 --- a/src/plugins/intel_npu/src/utils/src/zero/zero_wrappers.cpp +++ b/src/plugins/intel_npu/src/utils/src/zero/zero_wrappers.cpp @@ -59,16 +59,16 @@ Event::~Event() { _handle = nullptr; } -CommandList::CommandList(const std::shared_ptr& initStructs, +CommandList::CommandList(const std::shared_ptr& init_structs, const uint32_t& group_ordinal, bool mtci_is_supported) - : _initStructs(initStructs), + : _init_structs(init_structs), _log("CommandList", Logger::global().level()) { ze_mutable_command_list_exp_desc_t mutable_desc = {ZE_STRUCTURE_TYPE_MUTABLE_COMMAND_LIST_EXP_DESC, nullptr, 0}; ze_command_list_desc_t desc = {ZE_STRUCTURE_TYPE_COMMAND_LIST_DESC, &mutable_desc, group_ordinal, 0}; THROW_ON_FAIL_FOR_LEVELZERO( "zeCommandListCreate", - zeCommandListCreate(_initStructs->getContext(), _initStructs->getDevice(), &desc, &_handle)); + zeCommandListCreate(_init_structs->getContext(), _init_structs->getDevice(), &desc, &_handle)); if (mtci_is_supported) { ze_mutable_command_id_exp_desc_t mutableCmdIdDesc = {ZE_STRUCTURE_TYPE_MUTABLE_COMMAND_ID_EXP_DESC, @@ -87,14 +87,14 @@ void CommandList::appendMemoryCopy(void* dst, const void* src, const std::size_t } void CommandList::appendGraphInitialize(const ze_graph_handle_t& graph_handle) const { ze_result_t result = - _initStructs->getGraphDdiTable().pfnAppendGraphInitialize(_handle, graph_handle, nullptr, 0, nullptr); - THROW_ON_FAIL_FOR_LEVELZERO_EXT("pfnAppendGraphInitialize", result, _initStructs->getGraphDdiTable()); + _init_structs->getGraphDdiTable().pfnAppendGraphInitialize(_handle, graph_handle, nullptr, 0, nullptr); + THROW_ON_FAIL_FOR_LEVELZERO_EXT("pfnAppendGraphInitialize", result, _init_structs->getGraphDdiTable()); } void CommandList::appendGraphExecute(const ze_graph_handle_t& graph_handle, const ze_graph_profiling_query_handle_t& profiling_query_handle) const { - ze_result_t result = _initStructs->getGraphDdiTable() + ze_result_t result = _init_structs->getGraphDdiTable() .pfnAppendGraphExecute(_handle, graph_handle, profiling_query_handle, nullptr, 0, nullptr); - THROW_ON_FAIL_FOR_LEVELZERO_EXT("pfnAppendGraphExecute", result, _initStructs->getGraphDdiTable()); + THROW_ON_FAIL_FOR_LEVELZERO_EXT("pfnAppendGraphExecute", result, _init_structs->getGraphDdiTable()); } void CommandList::appendNpuTimestamp(uint64_t* timestamp_buff) const { THROW_ON_FAIL_FOR_LEVELZERO("zeCommandListAppendWriteGlobalTimestamp", @@ -116,9 +116,9 @@ CommandList::~CommandList() { } void CommandList::updateMutableCommandList(uint32_t arg_index, const void* arg_value) const { ze_mutable_graph_argument_exp_desc_t desc = { - (ZE_MAJOR_VERSION(_initStructs->getZeDrvApiVersion()) > 1 || - (ZE_MAJOR_VERSION(_initStructs->getZeDrvApiVersion()) == 1 && - ZE_MINOR_VERSION(_initStructs->getZeDrvApiVersion()) >= 11)) + (ZE_MAJOR_VERSION(_init_structs->getZeDrvApiVersion()) > 1 || + (ZE_MAJOR_VERSION(_init_structs->getZeDrvApiVersion()) == 1 && + ZE_MINOR_VERSION(_init_structs->getZeDrvApiVersion()) >= 11)) ? ZE_STRUCTURE_TYPE_MUTABLE_GRAPH_ARGUMENT_EXP_DESC : static_cast(ZE_STRUCTURE_TYPE_MUTABLE_GRAPH_ARGUMENT_EXP_DESC_DEPRECATED), nullptr, @@ -207,26 +207,26 @@ CommandQueueFactory::CommandQueueFactory() : _log("CommandQueue", Logger::global const std::shared_ptr& CommandQueueFactory::getCommandQueue( const std::shared_ptr& init_structs, const ze_command_queue_priority_t& priority, - const std::optional& workloadType, + const std::optional& workload_type, const uint32_t& group_ordinal, bool turbo) { if (_gloabal_command_queues[zeroUtils::toPriorityEnum(priority)][zeroUtils::toTurboEnum(turbo)] - [zeroUtils::toWorkloadEnum(workloadType)] == nullptr) { + [zeroUtils::toWorkloadEnum(workload_type)] == nullptr) { _log.debug("Create new command queue"); _gloabal_command_queues[zeroUtils::toPriorityEnum(priority)][zeroUtils::toTurboEnum(turbo)] - [zeroUtils::toWorkloadEnum(workloadType)] = + [zeroUtils::toWorkloadEnum(workload_type)] = std::make_shared(init_structs, priority, group_ordinal, turbo); - if (zeroUtils::toWorkloadEnum(workloadType) != workload::NOT_SET) { + if (zeroUtils::toWorkloadEnum(workload_type) != workload::NOT_SET) { try { _log.debug("Set workload type"); _gloabal_command_queues[zeroUtils::toPriorityEnum(priority)][zeroUtils::toTurboEnum(turbo)] - [zeroUtils::toWorkloadEnum(workloadType)] - ->setWorkloadType(*workloadType); + [zeroUtils::toWorkloadEnum(workload_type)] + ->setWorkloadType(*workload_type); } catch (const std::exception& ex) { _log.debug("Destroy pipeline if workload type is not supported!"); _gloabal_command_queues[zeroUtils::toPriorityEnum(priority)][zeroUtils::toTurboEnum(turbo)] - [zeroUtils::toWorkloadEnum(workloadType)] + [zeroUtils::toWorkloadEnum(workload_type)] .reset(); OPENVINO_THROW(ex.what()); } @@ -234,18 +234,18 @@ const std::shared_ptr& CommandQueueFactory::getCommandQueue( } return _gloabal_command_queues[zeroUtils::toPriorityEnum(priority)][zeroUtils::toTurboEnum(turbo)] - [zeroUtils::toWorkloadEnum(workloadType)]; + [zeroUtils::toWorkloadEnum(workload_type)]; } void CommandQueueFactory::freeCommandQueue(const ze_command_queue_priority_t& priority, - const std::optional& workloadType, + const std::optional& workload_type, bool turbo) { if (_gloabal_command_queues[zeroUtils::toPriorityEnum(priority)][zeroUtils::toTurboEnum(turbo)] - [zeroUtils::toWorkloadEnum(workloadType)] + [zeroUtils::toWorkloadEnum(workload_type)] .use_count() == 1) { _log.debug("Destroy command queue"); _gloabal_command_queues[zeroUtils::toPriorityEnum(priority)][zeroUtils::toTurboEnum(turbo)] - [zeroUtils::toWorkloadEnum(workloadType)] + [zeroUtils::toWorkloadEnum(workload_type)] .reset(); } }