[CPU] fix coverity in cpu plugin (#23830)

### Details:
 - *fix coverity in cpu plugin*

### Tickets:
 - *ticket-id*
This commit is contained in:
Xiuchuan Zhai 2024-04-03 22:03:23 +08:00 committed by GitHub
parent 762c6d8735
commit 0f52eacd7b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 6 additions and 6 deletions

View File

@ -17,7 +17,7 @@ class DnnlScratchPad {
dnnl::engine eng;
public:
DnnlScratchPad(dnnl::engine eng, int numa_node = -1) : eng(eng) {
DnnlScratchPad(const dnnl::engine& eng, int numa_node = -1) : eng(eng) {
mgrPtr = std::make_shared<DnnlMemoryMngr>(make_unique<MemoryMngrWithReuse>(numa_node));
}

View File

@ -23,7 +23,7 @@ public:
bool isGraphQuantized,
ov::threading::IStreamsExecutor::Ptr streamExecutor = nullptr)
: config(config),
weightsCache(w_cache),
weightsCache(std::move(w_cache)),
isGraphQuantizedFlag(isGraphQuantized),
streamExecutor(streamExecutor) {
rtParamsCache = std::make_shared<MultiCache>(config.rtCacheCapacity);

View File

@ -913,8 +913,7 @@ void Node::toNumaNode(int numaNodeID) {
// create scratch pad from specified numa node
if (scratchpadMem) {
scratchpadMem = context->getScratchPad(numaNodeID)->createScratchPadMem(scratchpadMem->getDescPtr());
auto mem = scratchpadMem->getPrimitive();
primArgs[DNNL_ARG_SCRATCHPAD] = mem;
primArgs[DNNL_ARG_SCRATCHPAD] = scratchpadMem->getPrimitive();
}
// mbind constant prim args to numa nodes

View File

@ -43,7 +43,7 @@ private:
void exec1DCase();
std::vector<VectorDims> inputStrides;
std::vector<size_t> nelemToCopy; // byte moved in each iter
size_t nelemTotal;
size_t nelemTotal = 0;
std::vector<size_t> dstOffset; // dst offset for each input
std::vector<const uint8_t*> srcPtrs;
bool hasOuterLoop = false;

View File

@ -41,6 +41,7 @@ ov::intel_cpu::SplitFC::SplitFC(int sub_stream_num) {
// needn't to split fc when the dim is 0.
const auto& wgt_shape = fc_weight_node->get_shape();
// weight shape size 660000 is a trade-off value, which is summarized and verified by LLMs.
if (wgt_shape[split_dim] <= 1 || ov::shape_size(wgt_shape) < 6600000) {
return false;
}
@ -185,7 +186,7 @@ ov::intel_cpu::SplitFC::SplitFC(int sub_stream_num) {
}
// concat all small fc for result.
ov::NodeVector concat_args(fc_node_vec);
ov::NodeVector concat_args(std::move(fc_node_vec));
// concat happens on the latest dimension.
constexpr size_t concat_dim = -1;
auto concat_node = std::make_shared<ov::op::v0::Concat>(concat_args, concat_dim);