Skip to content

Commit

Permalink
Use ZE_STRUCTURE_TYPE_MUTABLE_GRAPH_ARGUMENT_EXP_DESC from level zero (
Browse files Browse the repository at this point in the history
…openvinotoolkit#27645)

### Details:
- *Use ZE_STRUCTURE_TYPE_MUTABLE_GRAPH_ARGUMENT_EXP_DESC from level
zero*

Signed-off-by: Bogdan Pereanu <[email protected]>
  • Loading branch information
pereanub authored Nov 21, 2024
1 parent 477722d commit 9f7ad50
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ class ZeroInitStructsHolder final {
inline uint32_t getMutableCommandListVersion() const {
return mutable_command_list_version;
}
inline ze_api_version_t getZeDrvApiVersion() const {
return ze_drv_api_version;
}
// Helper function to check if extension with <ext_name> exists and its newer than <version>
inline bool isExtensionSupported(std::string ext_name, uint32_t version) const {
auto iter = driver_extension_properties.find(ext_name);
Expand All @@ -78,6 +81,8 @@ class ZeroInitStructsHolder final {

ze_driver_properties_t driver_properties = {};
uint32_t mutable_command_list_version = 0;

ze_api_version_t ze_drv_api_version = {};
};

} // namespace intel_npu
1 change: 0 additions & 1 deletion src/plugins/intel_npu/src/utils/src/zero/zero_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ ZeroInitStructsHolder::ZeroInitStructsHolder() : log("NPUZeroInitStructsHolder",
}

// Check L0 API version
ze_api_version_t ze_drv_api_version = {};
THROW_ON_FAIL_FOR_LEVELZERO("zeDriverGetApiVersion", zeDriverGetApiVersion(driver_handle, &ze_drv_api_version));

if (ZE_MAJOR_VERSION(ZE_API_VERSION_CURRENT) != ZE_MAJOR_VERSION(ze_drv_api_version)) {
Expand Down
6 changes: 5 additions & 1 deletion src/plugins/intel_npu/src/utils/src/zero/zero_wrappers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ CommandList::~CommandList() {
}
void CommandList::updateMutableCommandList(uint32_t arg_index, const void* arg_value) const {
ze_mutable_graph_argument_exp_desc_t desc = {
static_cast<ze_structure_type_t>(ZE_STRUCTURE_TYPE_MUTABLE_GRAPH_ARGUMENT_EXP_DESC_DEPRECATED),
(ZE_MAJOR_VERSION(_initStructs->getZeDrvApiVersion()) > 1 ||
(ZE_MAJOR_VERSION(_initStructs->getZeDrvApiVersion()) == 1 &&
ZE_MINOR_VERSION(_initStructs->getZeDrvApiVersion()) >= 11))
? ZE_STRUCTURE_TYPE_MUTABLE_GRAPH_ARGUMENT_EXP_DESC
: static_cast<ze_structure_type_t>(ZE_STRUCTURE_TYPE_MUTABLE_GRAPH_ARGUMENT_EXP_DESC_DEPRECATED),
nullptr,
_command_id,
arg_index,
Expand Down

0 comments on commit 9f7ad50

Please sign in to comment.