diff --git a/paddle/fluid/framework/hogwild_worker.cc b/paddle/fluid/framework/hogwild_worker.cc index 85823031fa40ff..72039145e426dc 100644 --- a/paddle/fluid/framework/hogwild_worker.cc +++ b/paddle/fluid/framework/hogwild_worker.cc @@ -127,7 +127,7 @@ class GPUParallelCopyer { ++copy_count_; } } - void Wait(void) { + void Wait() { if (copy_count_ == 0) { return; } @@ -142,7 +142,7 @@ class GPUParallelCopyer { } copy_count_ = 0; } - void SyncDevStream(void) { platform::GpuStreamSync(dev_stream_); } + void SyncDevStream() { platform::GpuStreamSync(dev_stream_); } private: phi::gpuStream_t dev_stream_ = nullptr; diff --git a/paddle/fluid/framework/multi_trainer.cc b/paddle/fluid/framework/multi_trainer.cc index b1f8bd4233f0db..9d7f065fcde46b 100644 --- a/paddle/fluid/framework/multi_trainer.cc +++ b/paddle/fluid/framework/multi_trainer.cc @@ -288,7 +288,7 @@ void MultiTrainer::MergeToRootScope(phi::DenseTensor* root_tensor, } TensorCopy(tmp_root, platform::CPUPlace(), root_tensor); } -void MultiTrainer::MergeWorkerVars(void) { +void MultiTrainer::MergeWorkerVars() { for (size_t i = 0; i < need_merge_var_names_.size(); i++) { Variable* root_var = root_scope_->FindVar(need_merge_var_names_[i]); if (root_var == nullptr) { diff --git a/paddle/fluid/pybind/eager_functions.cc b/paddle/fluid/pybind/eager_functions.cc index 009abb8d749ce9..70e7f2d5a2733e 100644 --- a/paddle/fluid/pybind/eager_functions.cc +++ b/paddle/fluid/pybind/eager_functions.cc @@ -1380,8 +1380,8 @@ PyMethodDef variable_functions[] = { // NOLINT METH_VARARGS | METH_KEYWORDS, nullptr}, {"_get_custom_operator_inplace_map", - (PyCFunction)(void (*)( - void))eager_api__get_custom_operator_inplace_reverse_idx, + (PyCFunction)(void (*)()) + eager_api__get_custom_operator_inplace_reverse_idx, METH_VARARGS | METH_KEYWORDS, nullptr}, {"_run_custom_op", diff --git a/paddle/fluid/pybind/eager_method.cc b/paddle/fluid/pybind/eager_method.cc index d096119235b4ce..5bb707346a38a5 100644 --- a/paddle/fluid/pybind/eager_method.cc +++ b/paddle/fluid/pybind/eager_method.cc @@ -3233,8 +3233,7 @@ PyMethodDef variable_methods[] = { // NOLINT METH_VARARGS | METH_KEYWORDS, nullptr}, {"_is_dense_tensor_hold_allocation", - (PyCFunction)(void (*)( - void))tensor_method__is_dense_tensor_hold_allocation, + (PyCFunction)(void (*)())tensor_method__is_dense_tensor_hold_allocation, METH_VARARGS | METH_KEYWORDS, nullptr}, {"_copy_to", @@ -3298,7 +3297,7 @@ PyMethodDef variable_methods[] = { // NOLINT METH_VARARGS | METH_KEYWORDS, tensor_method_detach__doc__}, {"detach_", - (PyCFunction)(void (*)(void))tensor_method_detach_, + (PyCFunction)(void (*)())tensor_method_detach_, METH_VARARGS | METH_KEYWORDS, tensor_method_detach___doc__}, {"get_tensor", @@ -3481,19 +3480,19 @@ PyMethodDef variable_methods[] = { // NOLINT METH_VARARGS | METH_KEYWORDS, nullptr}, {"contiguous", - (PyCFunction)(void (*)(void))tensor_contiguous, + (PyCFunction)(void (*)())tensor_contiguous, METH_VARARGS | METH_KEYWORDS, tensor_contiguous__doc__}, {"is_contiguous", - (PyCFunction)(void (*)(void))tensor_is_contiguous, + (PyCFunction)(void (*)())tensor_is_contiguous, METH_VARARGS | METH_KEYWORDS, tensor_is_contiguous__doc__}, {"get_strides", - (PyCFunction)(void (*)(void))tensor_method_strides, + (PyCFunction)(void (*)())tensor_method_strides, METH_VARARGS | METH_KEYWORDS, tensor_get_strides__doc__}, {"_set_impl", - (PyCFunction)(void (*)(void))tensor_method__set_impl, + (PyCFunction)(void (*)())tensor_method__set_impl, METH_VARARGS | METH_KEYWORDS, nullptr}, #if defined(PADDLE_WITH_CUDA) @@ -3516,8 +3515,7 @@ PyMethodDef string_tensor_variable_methods[] = { METH_VARARGS | METH_KEYWORDS, nullptr}, {"_is_string_tensor_hold_allocation", - (PyCFunction)(void (*)( - void))tensor_method__is_string_tensor_hold_allocation, + (PyCFunction)(void (*)())tensor_method__is_string_tensor_hold_allocation, METH_VARARGS | METH_KEYWORDS, nullptr}, // TODO(zhoushunjie): Need to add _copy_to, copy_ for StringTensor. diff --git a/paddle/fluid/pybind/eager_utils.cc b/paddle/fluid/pybind/eager_utils.cc index 2d1ff58e79b3b2..859fad84b4b1e3 100644 --- a/paddle/fluid/pybind/eager_utils.cc +++ b/paddle/fluid/pybind/eager_utils.cc @@ -2803,11 +2803,11 @@ void DistTensorConverter::operator()(paddle::optional>* x) { static PyMethodDef EagerUtilMethods[] = { {"create_empty_tensors_with_var_descs", - (PyCFunction)(void (*)(void))GetEmptyTensorsWithVarDesc, + (PyCFunction)(void (*)())GetEmptyTensorsWithVarDesc, METH_VARARGS, "GetEmptyTensorsWithVarDesc"}, {"create_empty_tensors_with_values", - (PyCFunction)(void (*)(void))GetEmptyTensorsWithValue, + (PyCFunction)(void (*)())GetEmptyTensorsWithValue, METH_VARARGS, "GetEmptyTensorsWithValue."}, {"set_static_op_arg_pre_cast_hook",