Skip to content

Commit

Permalink
Use std::make_unique
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Paramuzov <[email protected]>
  • Loading branch information
vladimir-paramuzov committed Jan 24, 2025
1 parent 1086e2d commit 0ddf21c
Show file tree
Hide file tree
Showing 55 changed files with 108 additions and 113 deletions.
5 changes: 0 additions & 5 deletions src/plugins/intel_gpu/include/intel_gpu/runtime/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,6 @@ constexpr auto round_up_to(T1 val, T2 rounding)
return static_cast<RetT>(ceil_div(val, rounding) * static_cast<UT2>(rounding));
}

template <typename T, typename... Args>
std::unique_ptr<T> make_unique(Args&& ... args) {
return std::unique_ptr<T>( new T(std::forward<Args>(args)...) );
}

template <typename derived_type, typename base_type, typename std::enable_if<std::is_base_of<base_type, derived_type>::value, int>::type = 0>
inline derived_type* downcast(base_type* base) {
if (auto casted = dynamic_cast<derived_type*>(base))
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/intel_gpu/src/graph/compilation_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class CompilationContext : public ICompilationContext {
};

std::shared_ptr<ICompilationContext> ICompilationContext::create(ov::threading::IStreamsExecutor::Config task_executor_config) {
return cldnn::make_unique<CompilationContext>(task_executor_config);
return std::make_unique<CompilationContext>(task_executor_config);
}

} // namespace cldnn
4 changes: 2 additions & 2 deletions src/plugins/intel_gpu/src/graph/impls/common/condition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct condition_impl : typed_primitive_impl<condition> {
DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::common::condition_impl)

std::unique_ptr<primitive_impl> clone() const override {
return make_unique<condition_impl>(*this);
return std::make_unique<condition_impl>(*this);
}

condition_impl() : parent() {}
Expand Down Expand Up @@ -146,7 +146,7 @@ struct condition_impl : typed_primitive_impl<condition> {
}

static std::unique_ptr<primitive_impl> create(const condition_node& arg, const kernel_impl_params&) {
return make_unique<condition_impl>(arg);
return std::make_unique<condition_impl>(arg);
}

void init_kernels(const kernels_cache& , const kernel_impl_params&) override {}
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/intel_gpu/src/graph/impls/common/loop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ struct loop_impl : typed_primitive_impl<loop> {
DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::common::loop_impl)

std::unique_ptr<primitive_impl> clone() const override {
return make_unique<loop_impl>(*this);
return std::make_unique<loop_impl>(*this);
}

void init_kernels(const kernels_cache& , const kernel_impl_params&) override {}
Expand Down Expand Up @@ -287,7 +287,7 @@ struct loop_impl : typed_primitive_impl<loop> {
}

static std::unique_ptr<primitive_impl> create(const loop_node& arg, const kernel_impl_params&) {
return make_unique<loop_impl>(arg);
return std::make_unique<loop_impl>(arg);
}

void save(BinaryOutputBuffer& ob) const override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class wait_for_events_impl : public primitive_impl {
DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::common::wait_for_events_impl)

std::unique_ptr<primitive_impl> clone() const override {
return make_unique<wait_for_events_impl>(*this);
return std::make_unique<wait_for_events_impl>(*this);
}

void init_kernels(const kernels_cache&, const kernel_impl_params&) override {}
Expand All @@ -41,11 +41,11 @@ class wait_for_events_impl : public primitive_impl {
}

static std::unique_ptr<primitive_impl> create_data(const data_node& data, const kernel_impl_params&) {
return make_unique<wait_for_events_impl>(data);
return std::make_unique<wait_for_events_impl>(data);
}

static std::unique_ptr<primitive_impl> create_input_layout(const input_layout_node& input, const kernel_impl_params&) {
return make_unique<wait_for_events_impl>(input);
return std::make_unique<wait_for_events_impl>(input);
}

void update(primitive_inst& inst, const kernel_impl_params& impl_param) override { }
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/intel_gpu/src/graph/impls/cpu/activation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ struct activation_impl : public typed_primitive_impl<activation> {
DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::cpu::activation_impl)

std::unique_ptr<primitive_impl> clone() const override {
return make_unique<activation_impl>(*this);
return std::make_unique<activation_impl>(*this);
}

activation_impl() : parent("activation_cpu_impl") {}
Expand Down Expand Up @@ -287,7 +287,7 @@ struct activation_impl : public typed_primitive_impl<activation> {

public:
static std::unique_ptr<primitive_impl> create(const activation_node& arg, const kernel_impl_params& impl_param) {
return make_unique<activation_impl>();
return std::make_unique<activation_impl>();
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/intel_gpu/src/graph/impls/cpu/assign.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct assign_impl : public typed_primitive_impl<assign> {
DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::cpu::assign_impl)

std::unique_ptr<primitive_impl> clone() const override {
return make_unique<assign_impl>(*this);
return std::make_unique<assign_impl>(*this);
}

assign_impl() : parent() {}
Expand Down Expand Up @@ -64,7 +64,7 @@ struct assign_impl : public typed_primitive_impl<assign> {

public:
static std::unique_ptr<primitive_impl> create(const assign_node& arg, const kernel_impl_params& impl_param) {
return make_unique<assign_impl>();
return std::make_unique<assign_impl>();
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/intel_gpu/src/graph/impls/cpu/broadcast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct broadcast_impl : public typed_primitive_impl<broadcast> {
DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::cpu::broadcast_impl)

std::unique_ptr<primitive_impl> clone() const override {
return make_unique<broadcast_impl>(*this);
return std::make_unique<broadcast_impl>(*this);
}

broadcast_impl() : parent("broadcast_cpu_impl") {}
Expand Down Expand Up @@ -121,7 +121,7 @@ struct broadcast_impl : public typed_primitive_impl<broadcast> {

public:
static std::unique_ptr<primitive_impl> create(const broadcast_node& arg, const kernel_impl_params& impl_param) {
return make_unique<broadcast_impl>();
return std::make_unique<broadcast_impl>();
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/intel_gpu/src/graph/impls/cpu/concat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct concatenation_impl : public typed_primitive_impl<concatenation> {
DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::cpu::concatenation_impl)

std::unique_ptr<primitive_impl> clone() const override {
return make_unique<concatenation_impl>(*this);
return std::make_unique<concatenation_impl>(*this);
}

concatenation_impl() : parent("concatenation_cpu_impl") {}
Expand Down Expand Up @@ -108,7 +108,7 @@ struct concatenation_impl : public typed_primitive_impl<concatenation> {

public:
static std::unique_ptr<primitive_impl> create(const concatenation_node& arg, const kernel_impl_params& impl_param) {
return make_unique<concatenation_impl>();
return std::make_unique<concatenation_impl>();
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/intel_gpu/src/graph/impls/cpu/crop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct crop_impl : public typed_primitive_impl<crop> {
DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::cpu::crop_impl)

std::unique_ptr<primitive_impl> clone() const override {
return make_unique<crop_impl>(*this);
return std::make_unique<crop_impl>(*this);
}

crop_impl() : parent("crop_cpu_impl") {}
Expand Down Expand Up @@ -108,7 +108,7 @@ struct crop_impl : public typed_primitive_impl<crop> {

public:
static std::unique_ptr<primitive_impl> create(const crop_node& arg, const kernel_impl_params& impl_param) {
return make_unique<crop_impl>();
return std::make_unique<crop_impl>();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct detection_output_impl : typed_primitive_impl<detection_output> {
DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::cpu::detection_output_impl)

std::unique_ptr<primitive_impl> clone() const override {
return make_unique<detection_output_impl>(*this);
return std::make_unique<detection_output_impl>(*this);
}

detection_output_impl() : parent() {}
Expand Down Expand Up @@ -858,7 +858,7 @@ struct detection_output_impl : typed_primitive_impl<detection_output> {
void init_kernels(const kernels_cache& , const kernel_impl_params&) override {}

static std::unique_ptr<primitive_impl> create(const detection_output_node& arg, const kernel_impl_params&) {
return make_unique<detection_output_impl>(arg);
return std::make_unique<detection_output_impl>(arg);
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/intel_gpu/src/graph/impls/cpu/eltwise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct eltwise_impl : public typed_primitive_impl<eltwise> {
DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::cpu::eltwise_impl)

std::unique_ptr<primitive_impl> clone() const override {
return make_unique<eltwise_impl>(*this);
return std::make_unique<eltwise_impl>(*this);
}

eltwise_impl() : parent("eltwise_cpu_impl") {}
Expand Down Expand Up @@ -221,7 +221,7 @@ struct eltwise_impl : public typed_primitive_impl<eltwise> {

public:
static std::unique_ptr<primitive_impl> create(const eltwise_node& arg, const kernel_impl_params& impl_param) {
return make_unique<eltwise_impl>();
return std::make_unique<eltwise_impl>();
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/intel_gpu/src/graph/impls/cpu/fake_convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct fake_convert_impl : public typed_primitive_impl<fake_convert> {
DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::cpu::fake_convert_impl)

std::unique_ptr<primitive_impl> clone() const override {
return make_unique<fake_convert_impl>(*this);
return std::make_unique<fake_convert_impl>(*this);
}

fake_convert_impl() : parent("fake_convert_cpu_impl") {}
Expand Down Expand Up @@ -97,7 +97,7 @@ struct fake_convert_impl : public typed_primitive_impl<fake_convert> {

public:
static std::unique_ptr<primitive_impl> create(const fake_convert_node& arg, const kernel_impl_params& impl_param) {
return make_unique<fake_convert_impl>();
return std::make_unique<fake_convert_impl>();
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/intel_gpu/src/graph/impls/cpu/gather.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct gather_impl : public typed_primitive_impl<gather> {
DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::cpu::gather_impl)

std::unique_ptr<primitive_impl> clone() const override {
return make_unique<gather_impl>(*this);
return std::make_unique<gather_impl>(*this);
}

gather_impl() : parent("gather_cpu_impl") {}
Expand Down Expand Up @@ -111,7 +111,7 @@ struct gather_impl : public typed_primitive_impl<gather> {

public:
static std::unique_ptr<primitive_impl> create(const gather_node& arg, const kernel_impl_params& impl_param) {
return make_unique<gather_impl>();
return std::make_unique<gather_impl>();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ struct non_max_suppression_impl : typed_primitive_impl<non_max_suppression> {
DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::cpu::non_max_suppression_impl)

std::unique_ptr<primitive_impl> clone() const override {
return make_unique<non_max_suppression_impl>(*this);
return std::make_unique<non_max_suppression_impl>(*this);
}

non_max_suppression_impl() : parent("non_max_suppression_impl") {}
Expand All @@ -420,7 +420,7 @@ struct non_max_suppression_impl : typed_primitive_impl<non_max_suppression> {
}

static std::unique_ptr<primitive_impl> create(const non_max_suppression_node&, const kernel_impl_params&) {
return make_unique<non_max_suppression_impl>();
return std::make_unique<non_max_suppression_impl>();
}
void init_kernels(const kernels_cache&, const kernel_impl_params&) override {}
};
Expand All @@ -442,7 +442,7 @@ struct non_max_suppression_gather_impl : typed_primitive_impl<non_max_suppressio
DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::cpu::non_max_suppression_gather_impl)

std::unique_ptr<primitive_impl> clone() const override {
return make_unique<non_max_suppression_gather_impl>(*this);
return std::make_unique<non_max_suppression_gather_impl>(*this);
}

non_max_suppression_gather_impl() : parent("non_max_suppression_gather_impl") {}
Expand All @@ -464,7 +464,7 @@ struct non_max_suppression_gather_impl : typed_primitive_impl<non_max_suppressio
}

static std::unique_ptr<primitive_impl> create(const non_max_suppression_gather_node&, const kernel_impl_params&) {
return make_unique<non_max_suppression_gather_impl>();
return std::make_unique<non_max_suppression_gather_impl>();
}
void init_kernels(const kernels_cache&, const kernel_impl_params&) override {}
};
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/intel_gpu/src/graph/impls/cpu/proposal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ struct proposal_impl : typed_primitive_impl<proposal> {
DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::cpu::proposal_impl)

std::unique_ptr<primitive_impl> clone() const override {
return make_unique<proposal_impl>(*this);
return std::make_unique<proposal_impl>(*this);
}

template <typename dtype>
Expand Down Expand Up @@ -453,7 +453,7 @@ struct proposal_impl : typed_primitive_impl<proposal> {
OPENVINO_ASSERT(one_of(count, {3, 4, 6}), arg.id(), "image_info must have either 3, 4 or 6 items");
}

return make_unique<proposal_impl>(arg);
return std::make_unique<proposal_impl>(arg);
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/intel_gpu/src/graph/impls/cpu/range.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct range_impl : public typed_primitive_impl<range> {
DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::cpu::range_impl)

std::unique_ptr<primitive_impl> clone() const override {
return make_unique<range_impl>(*this);
return std::make_unique<range_impl>(*this);
}

range_impl() : parent("range_cpu_impl") {}
Expand Down Expand Up @@ -88,7 +88,7 @@ struct range_impl : public typed_primitive_impl<range> {

public:
static std::unique_ptr<primitive_impl> create(const range_node& arg, const kernel_impl_params& impl_param) {
return make_unique<range_impl>();
return std::make_unique<range_impl>();
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/intel_gpu/src/graph/impls/cpu/read_value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct read_value_impl : public typed_primitive_impl<read_value> {
DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::cpu::read_value_impl)

std::unique_ptr<primitive_impl> clone() const override {
return make_unique<read_value_impl>(*this);
return std::make_unique<read_value_impl>(*this);
}

read_value_impl() : parent() {}
Expand Down Expand Up @@ -97,7 +97,7 @@ struct read_value_impl : public typed_primitive_impl<read_value> {

public:
static std::unique_ptr<primitive_impl> create(const read_value_node& arg, const kernel_impl_params& impl_param) {
return make_unique<read_value_impl>(arg);
return std::make_unique<read_value_impl>(arg);
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/intel_gpu/src/graph/impls/cpu/reduce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct reduce_impl : public typed_primitive_impl<reduce> {
DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::cpu::reduce_impl)

std::unique_ptr<primitive_impl> clone() const override {
return make_unique<reduce_impl>(*this);
return std::make_unique<reduce_impl>(*this);
}

reduce_impl() : parent("reduce_cpu_impl") {}
Expand Down Expand Up @@ -148,7 +148,7 @@ struct reduce_impl : public typed_primitive_impl<reduce> {

public:
static std::unique_ptr<primitive_impl> create(const reduce_node& arg, const kernel_impl_params& impl_param) {
return make_unique<reduce_impl>();
return std::make_unique<reduce_impl>();
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/intel_gpu/src/graph/impls/cpu/reorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct reorder_impl : public typed_primitive_impl<reorder> {
DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::cpu::reorder_impl)

std::unique_ptr<primitive_impl> clone() const override {
return make_unique<reorder_impl>(*this);
return std::make_unique<reorder_impl>(*this);
}

reorder_impl() : parent("reorder_cpu_impl") {}
Expand Down Expand Up @@ -81,7 +81,7 @@ struct reorder_impl : public typed_primitive_impl<reorder> {

public:
static std::unique_ptr<primitive_impl> create(const reorder_node& arg, const kernel_impl_params& impl_param) {
return make_unique<reorder_impl>();
return std::make_unique<reorder_impl>();
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/intel_gpu/src/graph/impls/cpu/scatter_update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct scatter_update_impl : public typed_primitive_impl<scatter_update> {
DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::cpu::scatter_update_impl)

std::unique_ptr<primitive_impl> clone() const override {
return make_unique<scatter_update_impl>(*this);
return std::make_unique<scatter_update_impl>(*this);
}

scatter_update_impl() : parent("scatter_update_cpu_impl") {}
Expand Down Expand Up @@ -103,7 +103,7 @@ struct scatter_update_impl : public typed_primitive_impl<scatter_update> {

public:
static std::unique_ptr<primitive_impl> create(const scatter_update_node& arg, const kernel_impl_params& impl_param) {
return make_unique<scatter_update_impl>();
return std::make_unique<scatter_update_impl>();
}
};

Expand Down
Loading

0 comments on commit 0ddf21c

Please sign in to comment.