Skip to content

Commit

Permalink
Fix CS issue (openvinotoolkit#23102)
Browse files Browse the repository at this point in the history
### 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 <[email protected]>
  • Loading branch information
zhaixuejun1993 authored Feb 28, 2024
1 parent 093a282 commit 050e967
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugins/intel_cpu/src/graph_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class GraphContext {
WeightsSharing::Ptr w_cache,
bool isGraphQuantized)
: config(config),
weightsCache(w_cache),
weightsCache(std::move(w_cache)),
isGraphQuantizedFlag(isGraphQuantized) {
rtParamsCache = std::make_shared<MultiCache>(config.rtCacheCapacity);
rtScratchPad = std::make_shared<DnnlScratchPad>(getEngine());
Expand Down

0 comments on commit 050e967

Please sign in to comment.