From e05f123e3fd2552638a5bc4a7b09b1f9c8d995de Mon Sep 17 00:00:00 2001 From: Bogdan Pereanu Date: Wed, 6 Nov 2024 14:17:17 +0200 Subject: [PATCH] [NPU] Fix compiler clang build (#27405) ### Details: - *Change from define to constexpr and remove unused code* - *Fix clang build* ### Tickets: - *EISW-146067* --------- Signed-off-by: Bogdan Pereanu --- .../intel_npu/src/al/include/intel_npu/prefix.hpp | 10 +++------- .../src/compiler_adapter/src/ze_graph_ext_wrappers.cpp | 1 - .../utils/include/intel_npu/utils/zero/zero_types.hpp | 4 ++-- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/plugins/intel_npu/src/al/include/intel_npu/prefix.hpp b/src/plugins/intel_npu/src/al/include/intel_npu/prefix.hpp index 9be19d67454d82..f80390ef61ca7e 100644 --- a/src/plugins/intel_npu/src/al/include/intel_npu/prefix.hpp +++ b/src/plugins/intel_npu/src/al/include/intel_npu/prefix.hpp @@ -11,9 +11,9 @@ namespace intel_npu { // // Prefix for ReadValue and Assign operations in compiler. // -#define READVALUE_PREFIX std::string("vpux_ie_read_value_") -#define ASSIGN_PREFIX std::string("vpux_ie_assign_") -#define SHAPE_TENSOR_PREFIX std::string("vpux_ie_shape_") +constexpr std::string_view READVALUE_PREFIX = "vpux_ie_read_value_"; +constexpr std::string_view ASSIGN_PREFIX = "vpux_ie_assign_"; +constexpr std::string_view SHAPE_TENSOR_PREFIX = "vpux_ie_shape_"; inline bool isStateInputName(const std::string& name) { return !name.compare(0, READVALUE_PREFIX.length(), READVALUE_PREFIX); @@ -25,8 +25,4 @@ inline bool isShapeTensorName(const std::string& name) { return !name.compare(0, SHAPE_TENSOR_PREFIX.length(), SHAPE_TENSOR_PREFIX); } -inline std::string stateOutputToStateInputName(const std::string& name) { - return READVALUE_PREFIX + name.substr(ASSIGN_PREFIX.length()); -} - } // namespace intel_npu diff --git a/src/plugins/intel_npu/src/compiler_adapter/src/ze_graph_ext_wrappers.cpp b/src/plugins/intel_npu/src/compiler_adapter/src/ze_graph_ext_wrappers.cpp index c094838cc22ef0..095f470e15e02f 100644 --- a/src/plugins/intel_npu/src/compiler_adapter/src/ze_graph_ext_wrappers.cpp +++ b/src/plugins/intel_npu/src/compiler_adapter/src/ze_graph_ext_wrappers.cpp @@ -396,7 +396,6 @@ ze_graph_handle_t ZeGraphExtWrappers::getGraphHandle( const uint32_t& flags) const { ze_graph_handle_t graphHandle; - _logger.info("compileIR Using extension version: %s", typeid(TableExtension).name()); createGraph(std::move(serializedIR), buildFlags, flags, &graphHandle); return graphHandle; diff --git a/src/plugins/intel_npu/src/utils/include/intel_npu/utils/zero/zero_types.hpp b/src/plugins/intel_npu/src/utils/include/intel_npu/utils/zero/zero_types.hpp index 032dd867306004..188da886f5d9e4 100644 --- a/src/plugins/intel_npu/src/utils/include/intel_npu/utils/zero/zero_types.hpp +++ b/src/plugins/intel_npu/src/utils/include/intel_npu/utils/zero/zero_types.hpp @@ -70,7 +70,7 @@ struct ze_graph_dditable_ext_decorator final { } ~ze_graph_dditable_ext_decorator() = default; - inline const uint32_t version() const { + inline uint32_t version() const { return _driverExtVersion; } @@ -202,7 +202,7 @@ struct ze_command_queue_npu_dditable_ext_decorator final { _commandQueueExtVersion(commandQueueExtVersion) {} ~ze_command_queue_npu_dditable_ext_decorator() = default; - inline const uint32_t version() const { + inline uint32_t version() const { return _commandQueueExtVersion; }