未验证 提交 727fa27d 编写于 作者: G Galaxy1458 提交者: GitHub

remove some [-Wunused-parameter]warning and WITH_DISTRIBUTE flag (#53532)

* test,test=develop

* test,test=develop
上级 e4bf1a8e
...@@ -511,7 +511,7 @@ class GraphTable : public Table { ...@@ -511,7 +511,7 @@ class GraphTable : public Table {
} }
virtual ~GraphTable(); virtual ~GraphTable();
virtual void *GetShard(size_t shard_idx) { return 0; } virtual void *GetShard(size_t shard_idx UNUSED) { return 0; }
static int32_t sparse_local_shard_num(uint32_t shard_num, static int32_t sparse_local_shard_num(uint32_t shard_num,
uint32_t server_num) { uint32_t server_num) {
...@@ -624,15 +624,16 @@ class GraphTable : public Table { ...@@ -624,15 +624,16 @@ class GraphTable : public Table {
Node *find_node(GraphTableType table_type, int idx, uint64_t id); Node *find_node(GraphTableType table_type, int idx, uint64_t id);
Node *find_node(GraphTableType table_type, uint64_t id); Node *find_node(GraphTableType table_type, uint64_t id);
virtual int32_t Pull(TableContext &context) { return 0; } // NOLINT virtual int32_t Pull(TableContext &context UNUSED) { return 0; } // NOLINT
virtual int32_t Push(TableContext &context) { return 0; } // NOLINT virtual int32_t Push(TableContext &context UNUSED) { return 0; } // NOLINT
virtual int32_t clear_nodes(GraphTableType table_type, int idx); virtual int32_t clear_nodes(GraphTableType table_type, int idx);
virtual void Clear() {} virtual void Clear() {}
virtual int32_t Flush() { return 0; } virtual int32_t Flush() { return 0; }
virtual int32_t Shrink(const std::string &param) { return 0; } virtual int32_t Shrink(const std::string &param UNUSED) { return 0; }
// 指定保存路径 // 指定保存路径
virtual int32_t Save(const std::string &path, const std::string &converter) { virtual int32_t Save(const std::string &path UNUSED,
const std::string &converter UNUSED) {
return 0; return 0;
} }
virtual int32_t InitializeShard() { return 0; } virtual int32_t InitializeShard() { return 0; }
......
...@@ -928,9 +928,7 @@ if(WITH_DISTRIBUTE) ...@@ -928,9 +928,7 @@ if(WITH_DISTRIBUTE)
fleet_executor) fleet_executor)
endif() endif()
elseif(WITH_PSLIB) elseif(WITH_PSLIB)
set(DISTRIBUTE_COMPILE_FLAGS set(DISTRIBUTE_COMPILE_FLAGS "")
"-Wno-non-virtual-dtor -Wno-error=non-virtual-dtor -Wno-error=delete-non-virtual-dtor"
)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
set(DISTRIBUTE_COMPILE_FLAGS "${DISTRIBUTE_COMPILE_FLAGS} -faligned-new") set(DISTRIBUTE_COMPILE_FLAGS "${DISTRIBUTE_COMPILE_FLAGS} -faligned-new")
endif() endif()
......
...@@ -1178,7 +1178,7 @@ class ReductionOneDNNHandler ...@@ -1178,7 +1178,7 @@ class ReductionOneDNNHandler
const dnnl::engine engine, const dnnl::engine engine,
Place cpu_place, Place cpu_place,
const DenseTensor* x, const DenseTensor* x,
const DenseTensor* out, const DenseTensor* out UNUSED,
std::vector<int64_t> out_tz, std::vector<int64_t> out_tz,
const dnnl::primitive_attr& attrs = NULL) const dnnl::primitive_attr& attrs = NULL)
: OneDNNHandlerNoCachingT<T, dnnl::reduction>(engine, cpu_place) { : OneDNNHandlerNoCachingT<T, dnnl::reduction>(engine, cpu_place) {
......
...@@ -87,7 +87,8 @@ struct UnrollCompare { ...@@ -87,7 +87,8 @@ struct UnrollCompare {
template <size_t kStart, size_t kEnd> template <size_t kStart, size_t kEnd>
struct UnrollCompare<kStart, kEnd, true> { struct UnrollCompare<kStart, kEnd, true> {
template <typename T> template <typename T>
HOSTDEVICE inline constexpr static bool Run(const T *d1, const T *d2) { HOSTDEVICE inline constexpr static bool Run(const T *d1 UNUSED,
const T *d2 UNUSED) {
return true; return true;
} }
}; };
...@@ -104,7 +105,7 @@ struct UnrollProduct { ...@@ -104,7 +105,7 @@ struct UnrollProduct {
template <size_t kStart, size_t kEnd> template <size_t kStart, size_t kEnd>
struct UnrollProduct<kStart, kEnd, true> { struct UnrollProduct<kStart, kEnd, true> {
template <typename T> template <typename T>
HOSTDEVICE inline constexpr static T Run(const T *d) { HOSTDEVICE inline constexpr static T Run(const T *d UNUSED) {
return 1; return 1;
} }
}; };
......
...@@ -58,7 +58,7 @@ template < ...@@ -58,7 +58,7 @@ template <
std::enable_if_t<!std::is_same<T, phi::dtype::complex<float>>::value && std::enable_if_t<!std::is_same<T, phi::dtype::complex<float>>::value &&
!std::is_same<T, phi::dtype::complex<double>>::value, !std::is_same<T, phi::dtype::complex<double>>::value,
bool> = true> bool> = true>
DenseTensor Conj(const Context& dev_ctx, const DenseTensor& x) { DenseTensor Conj(const Context& dev_ctx UNUSED, const DenseTensor& x) {
return x; return x;
} }
......
...@@ -30,7 +30,7 @@ void CrossEntropyWithSoftmaxGradCPUKernel(const CPUContext& dev_ctx, ...@@ -30,7 +30,7 @@ void CrossEntropyWithSoftmaxGradCPUKernel(const CPUContext& dev_ctx,
const DenseTensor& loss_grad, const DenseTensor& loss_grad,
bool soft_label, bool soft_label,
bool use_softmax, bool use_softmax,
bool numeric_stable_mode, bool numeric_stable_mode UNUSED,
int ignore_index, int ignore_index,
int axis, int axis,
DenseTensor* logits_grad) { DenseTensor* logits_grad) {
......
...@@ -32,7 +32,7 @@ template <typename T, typename Context> ...@@ -32,7 +32,7 @@ template <typename T, typename Context>
void FullKernel(const Context& dev_ctx, void FullKernel(const Context& dev_ctx,
const IntArray& shape, const IntArray& shape,
const Scalar& val, const Scalar& val,
DataType dtype, DataType dtype UNUSED,
DenseTensor* out) { DenseTensor* out) {
out->Resize(phi::make_ddim(shape.GetData())); out->Resize(phi::make_ddim(shape.GetData()));
FullValue<T>(dev_ctx, out, val.to<T>()); FullValue<T>(dev_ctx, out, val.to<T>());
...@@ -40,9 +40,9 @@ void FullKernel(const Context& dev_ctx, ...@@ -40,9 +40,9 @@ void FullKernel(const Context& dev_ctx,
template <typename T, typename Context> template <typename T, typename Context>
void FullLikeKernel(const Context& dev_ctx, void FullLikeKernel(const Context& dev_ctx,
const DenseTensor& x, const DenseTensor& x UNUSED,
const Scalar& val, const Scalar& val,
DataType dtype, DataType dtype UNUSED,
DenseTensor* out) { DenseTensor* out) {
auto value = val.to<double>(); auto value = val.to<double>();
using CommonType = typename std::common_type< using CommonType = typename std::common_type<
......
...@@ -25,7 +25,7 @@ namespace phi { ...@@ -25,7 +25,7 @@ namespace phi {
template <typename T> template <typename T>
struct GraphSendRecvSumFunctor { struct GraphSendRecvSumFunctor {
void operator()(const bool& first_flag, void operator()(const bool& first_flag UNUSED,
const DenseTensor& src_slice, const DenseTensor& src_slice,
DenseTensor* dst_slice) { DenseTensor* dst_slice) {
auto eigen_src = phi::EigenVector<T>::Flatten(src_slice); auto eigen_src = phi::EigenVector<T>::Flatten(src_slice);
......
...@@ -21,7 +21,7 @@ namespace phi { ...@@ -21,7 +21,7 @@ namespace phi {
template <typename T, typename Context> template <typename T, typename Context>
void FullBatchSizeLikeKernel(const Context& dev_ctx, void FullBatchSizeLikeKernel(const Context& dev_ctx,
const DenseTensor& x, const DenseTensor& x,
const std::vector<int>& shape, const std::vector<int>& shape UNUSED,
const Scalar& val, const Scalar& val,
DataType dtype, DataType dtype,
int x_batch_size_dim, int x_batch_size_dim,
......
...@@ -181,11 +181,11 @@ void cpu_scatter_mul_kernel(phi::DenseTensor self, ...@@ -181,11 +181,11 @@ void cpu_scatter_mul_kernel(phi::DenseTensor self,
} }
template <typename tensor_t, typename index_t> template <typename tensor_t, typename index_t>
void cpu_scatter_input_grad_kernel(phi::DenseTensor self, void cpu_scatter_input_grad_kernel(phi::DenseTensor self UNUSED,
int dim, int dim,
const phi::DenseTensor& index, const phi::DenseTensor& index,
phi::DenseTensor output, phi::DenseTensor output,
const phi::DeviceContext& ctx) { const phi::DeviceContext& ctx UNUSED) {
auto* index_data = index.data<index_t>(); auto* index_data = index.data<index_t>();
auto* output_data = output.data<tensor_t>(); auto* output_data = output.data<tensor_t>();
......
...@@ -92,7 +92,7 @@ DEFINE_CPU_TRANS(6); ...@@ -92,7 +92,7 @@ DEFINE_CPU_TRANS(6);
template <typename DeviceContext, typename T> template <typename DeviceContext, typename T>
void TransposeNormal<DeviceContext, T>::operator()( void TransposeNormal<DeviceContext, T>::operator()(
const DeviceContext& context, const DeviceContext& context UNUSED,
const phi::DenseTensor& in, const phi::DenseTensor& in,
phi::DenseTensor* out, phi::DenseTensor* out,
const std::vector<int>& axis) { const std::vector<int>& axis) {
......
...@@ -41,7 +41,7 @@ struct FrobeniusNormGradFunctor { ...@@ -41,7 +41,7 @@ struct FrobeniusNormGradFunctor {
DX* dx, DX* dx,
DY* dy, DY* dy,
const Dim& dim, const Dim& dim,
int size) { int size UNUSED) {
dx->device(place) = y->broadcast(dim); dx->device(place) = y->broadcast(dim);
dx->device(place) = *dx + dx->constant(1e-12f); dx->device(place) = *dx + dx->constant(1e-12f);
dx->device(place) = (*x / *dx) * (dy->broadcast(dim)); dx->device(place) = (*x / *dx) * (dy->broadcast(dim));
......
...@@ -31,7 +31,7 @@ class SegmentPoolFunctor<phi::CPUContext, T, IndexT> { ...@@ -31,7 +31,7 @@ class SegmentPoolFunctor<phi::CPUContext, T, IndexT> {
const DenseTensor& input, const DenseTensor& input,
const DenseTensor& segments, const DenseTensor& segments,
DenseTensor* output, DenseTensor* output,
DenseTensor* index, DenseTensor* index UNUSED,
const std::string pooltype = "SUM") { const std::string pooltype = "SUM") {
const IndexT* segment_ids = segments.data<IndexT>(); const IndexT* segment_ids = segments.data<IndexT>();
auto curent_id = segment_ids[0]; auto curent_id = segment_ids[0];
...@@ -90,7 +90,7 @@ class SegmentPoolGradFunctor<phi::CPUContext, T, IndexT> { ...@@ -90,7 +90,7 @@ class SegmentPoolGradFunctor<phi::CPUContext, T, IndexT> {
const DenseTensor& out_grad, const DenseTensor& out_grad,
const DenseTensor& segments, const DenseTensor& segments,
DenseTensor* in_grad, DenseTensor* in_grad,
const paddle::optional<DenseTensor>& index, const paddle::optional<DenseTensor>& index UNUSED,
const std::string pooltype = "SUM") { const std::string pooltype = "SUM") {
const IndexT* segment_ids = segments.data<IndexT>(); const IndexT* segment_ids = segments.data<IndexT>();
auto& place = *dev_ctx.eigen_device(); auto& place = *dev_ctx.eigen_device();
......
...@@ -190,7 +190,7 @@ static void UniqueFlattendTensor(const Context& context, ...@@ -190,7 +190,7 @@ static void UniqueFlattendTensor(const Context& context,
} }
template <typename Context, typename ForwardIt, typename InT, typename IndexT> template <typename Context, typename ForwardIt, typename InT, typename IndexT>
static ForwardIt UniqueDimImpl(const Context& context, static ForwardIt UniqueDimImpl(const Context& context UNUSED,
ForwardIt first, ForwardIt first,
ForwardIt last, ForwardIt last,
const std::vector<IndexT>& sorted_indices_vec, const std::vector<IndexT>& sorted_indices_vec,
......
...@@ -27,7 +27,7 @@ namespace phi { ...@@ -27,7 +27,7 @@ namespace phi {
template <typename Context, typename T, int64_t Rank> template <typename Context, typename T, int64_t Rank>
struct ArgMaxFunctor { struct ArgMaxFunctor {
void operator()(const Context& ctx, void operator()(const Context& ctx UNUSED,
const DenseTensor& in, const DenseTensor& in,
DenseTensor* index_tensor, DenseTensor* index_tensor,
const int64_t& axis) { const int64_t& axis) {
......
...@@ -21,8 +21,8 @@ namespace phi { ...@@ -21,8 +21,8 @@ namespace phi {
template <typename Context, typename T, size_t D> template <typename Context, typename T, size_t D>
static void LerpGradFunction(const Context& ctx, static void LerpGradFunction(const Context& ctx,
const DenseTensor& x, const DenseTensor& x UNUSED,
const DenseTensor& y, const DenseTensor& y UNUSED,
const DenseTensor& weight, const DenseTensor& weight,
const DenseTensor& out, const DenseTensor& out,
const DenseTensor& out_grad, const DenseTensor& out_grad,
......
...@@ -23,7 +23,7 @@ namespace phi { ...@@ -23,7 +23,7 @@ namespace phi {
template <typename T, typename Context> template <typename T, typename Context>
void ReverseArrayKernel(const Context& dev_ctx, void ReverseArrayKernel(const Context& dev_ctx,
const TensorArray& x, const TensorArray& x,
const IntArray& axis, const IntArray& axis UNUSED,
TensorArray* out) { TensorArray* out) {
PADDLE_ENFORCE_EQ( PADDLE_ENFORCE_EQ(
x.size(), x.size(),
......
...@@ -34,7 +34,7 @@ template <typename T, typename Context> ...@@ -34,7 +34,7 @@ template <typename T, typename Context>
void FullLikeCooKernel(const Context& dev_ctx, void FullLikeCooKernel(const Context& dev_ctx,
const SparseCooTensor& x, const SparseCooTensor& x,
const Scalar& val, const Scalar& val,
DataType dtype, DataType dtype UNUSED,
SparseCooTensor* out) { SparseCooTensor* out) {
phi::Copy<Context>(dev_ctx, phi::Copy<Context>(dev_ctx,
x.non_zero_indices(), x.non_zero_indices(),
......
...@@ -144,14 +144,14 @@ DenseTensor CsrToDense(const Context& dev_ctx, const SparseCsrTensor& x) { ...@@ -144,14 +144,14 @@ DenseTensor CsrToDense(const Context& dev_ctx, const SparseCsrTensor& x) {
} }
template <typename T, typename Context> template <typename T, typename Context>
void ValuesCooKernel(const Context& dev_ctx, void ValuesCooKernel(const Context& dev_ctx UNUSED,
const SparseCooTensor& x, const SparseCooTensor& x,
DenseTensor* out) { DenseTensor* out) {
*out = x.non_zero_elements(); *out = x.non_zero_elements();
} }
template <typename T, typename Context> template <typename T, typename Context>
void ValuesCsrKernel(const Context& dev_ctx, void ValuesCsrKernel(const Context& dev_ctx UNUSED,
const SparseCsrTensor& x, const SparseCsrTensor& x,
DenseTensor* out) { DenseTensor* out) {
*out = x.non_zero_elements(); *out = x.non_zero_elements();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册