Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Coverity] Low issues on GPU Plugin #28269

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace cm {
struct ExampleImplementationManager : public ImplementationManager {
OV_GPU_PRIMITIVE_IMPL("cm::example")
ExampleImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr)
: ImplementationManager(impl_types::cm, shape_type, vf) {}
: ImplementationManager(impl_types::cm, shape_type, std::move(vf)) {}

std::unique_ptr<primitive_impl> create_impl(const program_node& node,
const kernel_impl_params& params) const override;
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/intel_gpu/src/graph/impls/ocl/convolution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ namespace ocl {

struct ConvolutionImplementationManager : public ImplementationManager {
OV_GPU_PRIMITIVE_IMPL("ocl::conv")
ConvolutionImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr) : ImplementationManager(impl_types::ocl, shape_type, vf) {}
ConvolutionImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr)
: ImplementationManager(impl_types::ocl, shape_type, std::move(vf)) {}

std::unique_ptr<primitive_impl> create_impl(const program_node& node, const kernel_impl_params& params) const override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ namespace ocl {

struct DetectionOutputImplementationManager : public ImplementationManager {
OV_GPU_PRIMITIVE_IMPL("ocl::detection_output")
DetectionOutputImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr) : ImplementationManager(impl_types::ocl, shape_type, vf) {}
DetectionOutputImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr)
: ImplementationManager(impl_types::ocl, shape_type, std::move(vf)) {}

std::unique_ptr<primitive_impl> create_impl(const program_node& node, const kernel_impl_params& params) const override;
};
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/intel_gpu/src/graph/impls/ocl/gather_nd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ namespace ocl {

struct GatherNDImplementationManager : public ImplementationManager {
OV_GPU_PRIMITIVE_IMPL("ocl::gather_nd")
GatherNDImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr) : ImplementationManager(impl_types::ocl, shape_type, vf) {}
GatherNDImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr)
: ImplementationManager(impl_types::ocl, shape_type, std::move(vf)) {}
std::unique_ptr<primitive_impl> create_impl(const program_node& node, const kernel_impl_params& params) const override;
bool validate_impl(const program_node& node) const override {
static const std::vector<format> supported_fmts = {
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/intel_gpu/src/graph/impls/ocl/lstm_cell.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ namespace ocl {

struct LSTMCellImplementationManager: public ImplementationManager {
OV_GPU_PRIMITIVE_IMPL("ocl::lstm_cell")
LSTMCellImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr) : ImplementationManager(impl_types::ocl, shape_type, vf) {}
LSTMCellImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr)
: ImplementationManager(impl_types::ocl, shape_type, std::move(vf)) {}

std::unique_ptr<primitive_impl> create_impl(const program_node& node, const kernel_impl_params& params) const override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ namespace ocl {

struct NMSImplementationManager : public ImplementationManager {
OV_GPU_PRIMITIVE_IMPL("NMSImplementationOCL")
NMSImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr) : ImplementationManager(impl_types::ocl, shape_type, vf) {}
NMSImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr)
: ImplementationManager(impl_types::ocl, shape_type, std::move(vf)) {}

std::unique_ptr<primitive_impl> create_impl(const program_node& node, const kernel_impl_params& params) const override;
};
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/intel_gpu/src/graph/impls/ocl/reorder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ namespace ocl {

struct ReorderImplementationManager : public ImplementationManager {
OV_GPU_PRIMITIVE_IMPL("ocl::reorder")
ReorderImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr) : ImplementationManager(impl_types::ocl, shape_type, vf) {}
ReorderImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr)
: ImplementationManager(impl_types::ocl, shape_type, std::move(vf)) {}

std::unique_ptr<primitive_impl> create_impl(const program_node& node, const kernel_impl_params& params) const override;
std::unique_ptr<primitive_impl> create_impl(const kernel_impl_params& params) const override;
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/intel_gpu/src/graph/impls/ocl/rnn_seq.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ namespace ocl {

struct RNNSeqImplementationManager: public ImplementationManager {
OV_GPU_PRIMITIVE_IMPL("ocl::lstm_seq")
RNNSeqImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr) : ImplementationManager(impl_types::ocl, shape_type, vf) {}
RNNSeqImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr)
: ImplementationManager(impl_types::ocl, shape_type, std::move(vf)) {}

std::unique_ptr<primitive_impl> create_impl(const program_node& node, const kernel_impl_params& params) const override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ namespace ocl {

struct ScatterElementsUpdateImplementationManager : public ImplementationManager {
OV_GPU_PRIMITIVE_IMPL("ocl::scatter_elements_update")
ScatterElementsUpdateImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr) : ImplementationManager(impl_types::ocl, shape_type, vf) {}
ScatterElementsUpdateImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr)
: ImplementationManager(impl_types::ocl, shape_type, std::move(vf)) {}
std::unique_ptr<primitive_impl> create_impl(const program_node& node, const kernel_impl_params& params) const override;
bool validate_impl(const program_node& node) const override {
static const std::vector<format> supported_fmts = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ namespace ocl {

struct ScatterUpdateImplementationManager : public ImplementationManager {
OV_GPU_PRIMITIVE_IMPL("ocl::scatter_update")
ScatterUpdateImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr) : ImplementationManager(impl_types::ocl, shape_type, vf) {}
ScatterUpdateImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr)
: ImplementationManager(impl_types::ocl, shape_type, std::move(vf)) {}
std::unique_ptr<primitive_impl> create_impl(const program_node& node, const kernel_impl_params& params) const override;
bool validate_impl(const program_node& node) const override {
static const std::vector<format> supported_dynamic_fmts = {
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/intel_gpu/src/graph/impls/ocl/softmax.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ namespace ocl {

struct SoftmaxImplementationManager : public ImplementationManager {
OV_GPU_PRIMITIVE_IMPL("ocl::softmax")
SoftmaxImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr) : ImplementationManager(impl_types::ocl, shape_type, vf) {}
SoftmaxImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr)
: ImplementationManager(impl_types::ocl, shape_type, std::move(vf)) {}
std::unique_ptr<primitive_impl> create_impl(const program_node& node, const kernel_impl_params& params) const override;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ namespace onednn {

struct ConcatenationImplementationManager : public ImplementationManager {
OV_GPU_PRIMITIVE_IMPL("onednn::concat")
ConcatenationImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr) : ImplementationManager(impl_types::onednn, shape_type, vf) {}
ConcatenationImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr)
: ImplementationManager(impl_types::onednn, shape_type, std::move(vf)) {}

std::unique_ptr<primitive_impl> create_impl(const program_node& node, const kernel_impl_params& params) const override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ namespace onednn {

struct PoolingImplementationManager : public ImplementationManager {
OV_GPU_PRIMITIVE_IMPL("onednn::pool")
PoolingImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr) : ImplementationManager(impl_types::onednn, shape_type, vf) {}
PoolingImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr)
: ImplementationManager(impl_types::onednn, shape_type, std::move(vf)) {}
std::unique_ptr<primitive_impl> create_impl(const program_node& node, const kernel_impl_params& params) const override;

bool validate_impl(const program_node& node) const override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ inline bool is_reduce_blocked_axes(reduce_node const& node) {

struct ReduceImplementationManager : public ImplementationManager {
OV_GPU_PRIMITIVE_IMPL("onednn::reduce")
ReduceImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr) : ImplementationManager(impl_types::onednn, shape_type, vf) {}
ReduceImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr)
: ImplementationManager(impl_types::onednn, shape_type, std::move(vf)) {}
std::unique_ptr<primitive_impl> create_impl(const program_node& node, const kernel_impl_params& params) const override;

bool validate_impl(const program_node& node) const override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ namespace onednn {

struct ReorderImplementationManager : public ImplementationManager {
OV_GPU_PRIMITIVE_IMPL("onednn::reorder")
ReorderImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr) : ImplementationManager(impl_types::onednn, shape_type, vf) {}
ReorderImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr)
: ImplementationManager(impl_types::onednn, shape_type, std::move(vf)) {}
std::unique_ptr<primitive_impl> create_impl(const program_node& node, const kernel_impl_params& params) const override;
std::unique_ptr<primitive_impl> create_impl(const kernel_impl_params& params) const override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ struct ImplementationManager {
virtual bool support_shapes(const kernel_impl_params& param) const { return true; }
virtual in_out_fmts_t query_formats(const program_node& node) const { OPENVINO_NOT_IMPLEMENTED; }

ImplementationManager(impl_types impl_type, shape_types shape_type, ValidateFunc vf = nullptr)
ImplementationManager(impl_types impl_type, shape_types shape_type, ValidateFunc&& vf = nullptr)
: m_impl_type(impl_type)
, m_shape_type(shape_type)
, m_vf(vf) {}
, m_vf(std::move(vf)) {}
virtual ~ImplementationManager() = default;

static shape_types get_shape_type(const program_node& node);
Expand Down Expand Up @@ -112,7 +112,7 @@ struct ImplementationManagerLegacy : public ImplementationManager {
}

ImplementationManagerLegacy(const ImplementationManagerLegacy* other, ValidateFunc vf)
: ImplementationManager(other->m_impl_type, other->m_shape_type, vf)
: ImplementationManager(other->m_impl_type, other->m_shape_type, std::move(vf))
, m_factory(other->m_factory)
, m_keys(other->m_keys) {
add_keys_with_any_layout();
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/intel_gpu/src/graph/primitive_inst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2819,7 +2819,7 @@ std::shared_ptr<primitive_impl> ImplementationsFactory::get_primitive_impl_for_p

// 1.1. Static impl not found - run async compilation
auto& compilation_context = prog.get_compilation_context();
compilation_context.push_task(updated_params, [&inst, &compilation_context, updated_params, find_impl]() {
compilation_context.push_task(updated_params, [&inst, &compilation_context, &updated_params, find_impl]() {
if (compilation_context.is_stopped())
return;
auto& _program = *inst.get_network().get_program();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ struct some_impl : public typed_primitive_impl<some_primitive> {

struct SomeImplementationManager : public ImplementationManager {
OV_GPU_PRIMITIVE_IMPL("test::some_impl")
SomeImplementationManager(shape_types shape_type, ValidateFunc vf) : ImplementationManager(impl_types::onednn, shape_type, vf) {}
SomeImplementationManager(shape_types shape_type, ValidateFunc vf)
: ImplementationManager(impl_types::onednn, shape_type, std::move(vf)) {}
std::unique_ptr<primitive_impl> create_impl(const program_node& node, const kernel_impl_params& params) const override {
return some_impl::create(node, params);
}
Expand All @@ -128,7 +129,8 @@ struct SomeImplementationManager : public ImplementationManager {

struct SomeDynamicImplementationManager : public ImplementationManager {
OV_GPU_PRIMITIVE_IMPL("test::some_dynamic_impl")
SomeDynamicImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr) : ImplementationManager(impl_types::ocl, shape_type, vf) {}
SomeDynamicImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr)
: ImplementationManager(impl_types::ocl, shape_type, std::move(vf)) {}
std::unique_ptr<primitive_impl> create_impl(const program_node& node, const kernel_impl_params& params) const override {
return some_impl::create(node, params);
}
Expand Down
Loading