Skip to content

Commit 050e967

Browse files
Fix CS issue (openvinotoolkit#23102)
### Details: *** CID 1534777: Performance inefficiencies (COPY_INSTEAD_OF_MOVE) /agent/_work/1/openvino/src/plugins/intel_cpu/src/graph_context.h: 24 in ov::intel_cpu::GraphContext::GraphContext(const ov::intel_cpu::Config &, std::shared_ptr<ov::intel_cpu::WeightsSharing>, bool)() 18 typedef std::shared_ptr<const GraphContext> CPtr; 19 20 GraphContext(const Config& config, 21 WeightsSharing::Ptr w_cache, 22 bool isGraphQuantized) 23 : config(config), >>> CID 1534777: Performance inefficiencies (COPY_INSTEAD_OF_MOVE) >>> "w_cache" is copied in call to copy constructor "std::shared_ptr<ov::intel_cpu::WeightsSharing>", when it could be moved instead. 24 weightsCache(w_cache), 25 isGraphQuantizedFlag(isGraphQuantized) { 26 rtParamsCache = std::make_shared<MultiCache>(config.rtCacheCapacity); 27 rtScratchPad = std::make_shared<DnnlScratchPad>(getEngine()); 28 } 29 ### Tickets: - *ticket-id* Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>
1 parent 093a282 commit 050e967

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/plugins/intel_cpu/src/graph_context.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class GraphContext {
2121
WeightsSharing::Ptr w_cache,
2222
bool isGraphQuantized)
2323
: config(config),
24-
weightsCache(w_cache),
24+
weightsCache(std::move(w_cache)),
2525
isGraphQuantizedFlag(isGraphQuantized) {
2626
rtParamsCache = std::make_shared<MultiCache>(config.rtCacheCapacity);
2727
rtScratchPad = std::make_shared<DnnlScratchPad>(getEngine());

0 commit comments

Comments
 (0)