Skip to content

Commit

Permalink
delete void args
Browse files Browse the repository at this point in the history
  • Loading branch information
walkalone20 committed Apr 23, 2024
1 parent 64c1dcd commit f4ef949
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 17 deletions.
4 changes: 2 additions & 2 deletions paddle/fluid/framework/hogwild_worker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class GPUParallelCopyer {
++copy_count_;
}
}
void Wait(void) {
void Wait() {
if (copy_count_ == 0) {
return;
}
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/framework/multi_trainer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,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) {
Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/pybind/eager_functions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1381,8 +1381,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",
Expand Down
16 changes: 7 additions & 9 deletions paddle/fluid/pybind/eager_method.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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)
Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/pybind/eager_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2742,11 +2742,11 @@ void DistTensorConverter::operator()(paddle::optional<std::vector<Tensor>>* 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",
Expand Down
2 changes: 1 addition & 1 deletion third_party/pybind
Submodule pybind updated 139 files

0 comments on commit f4ef949

Please sign in to comment.