Skip to content

Commit ae67aa4

Browse files
authored
【Hackathon 6th Fundable Projects 2 No.29】 Fix modernize-concat-nested-namespaces-part-1 (#64755)
1 parent 922ae73 commit ae67aa4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+163
-241
lines changed

paddle/fluid/distributed/index_dataset/index_sampler.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616

1717
#include "paddle/fluid/framework/data_feed.h"
1818

19-
namespace paddle {
20-
namespace distributed {
19+
namespace paddle::distributed {
2120

2221
std::vector<std::vector<uint64_t>> LayerWiseSampler::sample(
2322
const std::vector<std::vector<uint64_t>>& user_inputs,
@@ -134,5 +133,4 @@ std::vector<uint64_t> float2int(std::vector<double> tmp) {
134133
return tmp_int;
135134
}
136135

137-
} // end namespace distributed
138-
} // end namespace paddle
136+
} // namespace paddle::distributed

paddle/fluid/distributed/index_dataset/index_sampler.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,5 +134,5 @@ class LayerWiseSampler : public IndexSampler {
134134
std::vector<std::vector<IndexNode>> layer_ids_;
135135
};
136136

137-
} // end namespace distributed
138-
} // end namespace paddle
137+
} // namespace distributed
138+
} // namespace paddle

paddle/fluid/distributed/index_dataset/index_wrapper.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ limitations under the License. */
2020

2121
#include "paddle/fluid/framework/io/fs.h"
2222

23-
namespace paddle {
24-
namespace distributed {
23+
namespace paddle::distributed {
2524

2625
std::shared_ptr<IndexWrapper> IndexWrapper::s_instance_(nullptr);
2726

@@ -198,5 +197,4 @@ std::vector<IndexNode> TreeIndex::GetAllLeafs() {
198197
return res;
199198
}
200199

201-
} // end namespace distributed
202-
} // end namespace paddle
200+
} // namespace paddle::distributed

paddle/fluid/distributed/index_dataset/index_wrapper.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,5 +121,5 @@ class IndexWrapper {
121121
std::unordered_map<std::string, TreePtr> tree_map;
122122
};
123123

124-
} // end namespace distributed
125-
} // end namespace paddle
124+
} // namespace distributed
125+
} // namespace paddle

paddle/fluid/distributed/ps/service/heter_client.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
#include "paddle/fluid/framework/convert_utils.h"
1818
#include "paddle/phi/core/platform/profiler.h"
1919

20-
namespace paddle {
21-
namespace distributed {
20+
namespace paddle::distributed {
2221
PD_DEFINE_int32(heter_world_size, 100, "group size"); // group max size
2322
PD_DEFINE_int32(switch_send_recv_timeout_s, 600, "switch_send_recv_timeout_s");
2423

@@ -422,5 +421,4 @@ int HeterClient::Recv(int group_id,
422421
VLOG(4) << "Recv done";
423422
return 0;
424423
}
425-
} // namespace distributed
426-
} // end namespace paddle
424+
} // namespace paddle::distributed

paddle/fluid/distributed/ps/service/heter_client.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,5 +253,5 @@ class HeterClient {
253253
int trainer_id_;
254254
};
255255

256-
} // end namespace distributed
257-
} // end namespace paddle
256+
} // namespace distributed
257+
} // namespace paddle

paddle/fluid/distributed/ps/service/heter_server.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616

1717
#include "paddle/utils/string/split.h"
1818

19-
namespace paddle {
20-
namespace distributed {
19+
namespace paddle::distributed {
2120
// PD_DEFINE_string(cert_path, "./cert.pem", "cert.pem path");
2221
// PD_DEFINE_string(key_path, "./key.pem", "key.pem path");
2322
std::shared_ptr<HeterServer> HeterServer::s_instance_ = nullptr;
@@ -258,5 +257,4 @@ int SendAndRecvVariableHandler::QueryInSwitchWithScope(
258257
VLOG(4) << "heter server QueryInSwitchWithScope done";
259258
return 0;
260259
}
261-
} // end namespace distributed
262-
} // namespace paddle
260+
} // namespace paddle::distributed

paddle/fluid/distributed/ps/service/heter_server.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -682,5 +682,5 @@ class HeterServer {
682682
int ready_;
683683
};
684684

685-
} // end namespace distributed
686-
} // end namespace paddle
685+
} // namespace distributed
686+
} // namespace paddle

paddle/fluid/distributed/ps/wrapper/fleet.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ limitations under the License. */
1919
#include "paddle/fluid/distributed/ps/service/communicator/communicator.h"
2020
#include "paddle/fluid/distributed/ps/table/table.h"
2121

22-
namespace paddle {
23-
namespace distributed {
22+
namespace paddle::distributed {
2423

2524
using framework::ProgramDesc;
2625
using framework::VarDesc;
@@ -1055,5 +1054,4 @@ void FleetWrapper::SetDate(const uint64_t table_id, const std::string& date) {
10551054
#endif
10561055
}
10571056

1058-
} // end namespace distributed
1059-
} // end namespace paddle
1057+
} // namespace paddle::distributed

paddle/fluid/distributed/ps/wrapper/fleet.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,5 +348,5 @@ class FleetWrapper {
348348
DISABLE_COPY_AND_ASSIGN(FleetWrapper);
349349
};
350350

351-
} // end namespace distributed
352-
} // end namespace paddle
351+
} // namespace distributed
352+
} // namespace paddle

paddle/fluid/distributed/ps/wrapper/ps_wrapper.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,5 @@ class PSWrapper {
7979
virtual void Save(WrapperContext& context) = 0; // NOLINT
8080
};
8181

82-
} // end namespace distributed
83-
} // end namespace paddle
82+
} // namespace distributed
83+
} // namespace paddle

paddle/fluid/framework/data_set.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ COMMON_DECLARE_int32(gpugraph_storage_mode);
4343
COMMON_DECLARE_string(graph_edges_split_mode);
4444
COMMON_DECLARE_bool(query_dest_rank_by_multi_node);
4545

46-
namespace paddle {
47-
namespace framework {
46+
namespace paddle::framework {
4847

4948
// constructor
5049
template <typename T>
@@ -2196,5 +2195,4 @@ void SlotRecordDataset::DynamicAdjustReadersNum(int thread_num) {
21962195
PrepareTrain();
21972196
}
21982197

2199-
} // end namespace framework
2200-
} // end namespace paddle
2198+
} // namespace paddle::framework

paddle/fluid/framework/data_set.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,5 +445,5 @@ class SlotRecordDataset : public DatasetImpl<SlotRecord> {
445445
bool enable_heterps_ = true;
446446
};
447447

448-
} // end namespace framework
449-
} // end namespace paddle
448+
} // namespace framework
449+
} // namespace paddle

paddle/fluid/framework/downpour_lite_worker.cc

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,16 @@ namespace phi {
2323
class DenseTensor;
2424
} // namespace phi
2525

26-
namespace paddle {
27-
namespace framework {
26+
namespace paddle::framework {
2827
class Variable;
29-
} // namespace framework
30-
} // namespace paddle
28+
} // namespace paddle::framework
3129

3230
#if defined _WIN32 || defined __APPLE__
3331
#else
3432
#define _LINUX
3533
#endif
3634

37-
namespace paddle {
38-
namespace framework {
35+
namespace paddle::framework {
3936
void DownpourLiteWorker::Initialize(const TrainerDesc& desc) {
4037
param_ = desc.downpour_param();
4138
for (int i = 0; i < param_.sparse_table_size(); ++i) {
@@ -597,6 +594,5 @@ void DownpourLiteWorker::TrainFiles() {
597594
}
598595
}
599596

600-
} // end namespace framework
601-
} // end namespace paddle
597+
} // namespace paddle::framework
602598
#endif

paddle/fluid/framework/downpour_worker.cc

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,16 @@ namespace phi {
2121
class DenseTensor;
2222
} // namespace phi
2323

24-
namespace paddle {
25-
namespace framework {
24+
namespace paddle::framework {
2625
class Variable;
27-
} // namespace framework
28-
} // namespace paddle
26+
} // namespace paddle::framework
2927

3028
#if defined _WIN32 || defined __APPLE__
3129
#else
3230
#define _LINUX
3331
#endif
3432

35-
namespace paddle {
36-
namespace framework {
33+
namespace paddle::framework {
3734
void DownpourWorker::Initialize(const TrainerDesc& desc) {
3835
param_ = desc.downpour_param();
3936
for (int i = 0; i < param_.sparse_table_size(); ++i) {
@@ -1108,5 +1105,4 @@ void DownpourWorker::TrainFiles() {
11081105
}
11091106
}
11101107

1111-
} // end namespace framework
1112-
} // end namespace paddle
1108+
} // namespace paddle::framework

paddle/fluid/framework/downpour_worker_opt.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ limitations under the License. */
1616
#include "paddle/fluid/operators/isfinite_op.h"
1717
#include "paddle/phi/core/platform/cpu_helper.h"
1818

19-
namespace paddle {
20-
namespace framework {
19+
namespace paddle::framework {
2120

2221
class OpDesc;
2322
class OperatorBase;
@@ -559,5 +558,4 @@ void DownpourWorkerOpt::TrainFiles() {
559558
}
560559
}
561560

562-
} // end namespace framework
563-
} // end namespace paddle
561+
} // namespace paddle::framework

paddle/fluid/framework/fleet/box_wrapper.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
#include "paddle/fluid/framework/lod_tensor.h"
2424
#include "paddle/phi/core/platform/device/gpu/gpu_info.h"
2525

26-
namespace paddle {
27-
namespace framework {
26+
namespace paddle::framework {
2827

2928
std::shared_ptr<BoxWrapper> BoxWrapper::s_instance_ = nullptr;
3029
gpuStream_t BoxWrapper::stream_list_[8];
@@ -341,6 +340,5 @@ void BoxWrapper::AddReplaceFeasign(boxps::PSAgentBase* p_agent,
341340
VLOG(0) << "End AddReplaceFeasign";
342341
}
343342

344-
} // end namespace framework
345-
} // end namespace paddle
343+
} // namespace paddle::framework
346344
#endif

paddle/fluid/framework/fleet/box_wrapper.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,6 @@ void BoxWrapper::CopyForPush(const phi::Place& place,
365365
#undef EMBEDX_CASE
366366
}
367367

368-
} // end namespace framework
369-
} // end namespace paddle
368+
} // namespace framework
369+
} // namespace paddle
370370
#endif

paddle/fluid/framework/fleet/box_wrapper.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,7 @@ class BoxHelper {
11541154
bool get_random_replace_done_ = false;
11551155
};
11561156

1157-
} // end namespace framework
1158-
} // end namespace paddle
1157+
} // namespace framework
1158+
} // namespace paddle
11591159

11601160
#include "paddle/fluid/framework/fleet/box_wrapper_impl.h"

paddle/fluid/framework/fleet/fleet_wrapper.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ limitations under the License. */
3131
#include "glog/logging.h"
3232
#include "paddle/fluid/framework/op_registry.h"
3333

34-
namespace paddle {
35-
namespace framework {
34+
namespace paddle::framework {
3635

3736
const uint32_t MAX_FEASIGN_NUM = 1024 * 100 * 100;
3837
std::shared_ptr<FleetWrapper> FleetWrapper::s_instance_ = NULL;
@@ -1996,5 +1995,4 @@ size_t FleetWrapper::GetAbsoluteSum(size_t start,
19961995
return ret;
19971996
}
19981997

1999-
} // end namespace framework
2000-
} // end namespace paddle
1998+
} // namespace paddle::framework

paddle/fluid/framework/fleet/fleet_wrapper.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,5 +436,5 @@ class FleetWrapper {
436436
DISABLE_COPY_AND_ASSIGN(FleetWrapper);
437437
};
438438

439-
} // end namespace framework
440-
} // end namespace paddle
439+
} // namespace framework
440+
} // namespace paddle

paddle/fluid/framework/fleet/heter_context.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,6 @@ class HeterContext {
270270
}
271271
};
272272

273-
} // end namespace framework
274-
} // end namespace paddle
273+
} // namespace framework
274+
} // namespace paddle
275275
#endif

paddle/fluid/framework/fleet/heter_ps/cudf/block_radix_topk.cuh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,5 +342,5 @@ class BlockRadixTopKRegister {
342342
unsigned int top_k_mask_;
343343
};
344344

345-
}; // end namespace framework
346-
}; // end namespace paddle
345+
}; // namespace framework
346+
}; // namespace paddle

paddle/fluid/framework/fleet/heter_ps/feature_value.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,7 @@ class GlobalAccessorFactory {
11921192
VirtualAccessor* accessor_wrapper_ptr_ = nullptr;
11931193
};
11941194

1195-
} // end namespace framework
1196-
} // end namespace paddle
1195+
} // namespace framework
1196+
} // namespace paddle
11971197

11981198
#endif

paddle/fluid/framework/fleet/heter_ps/hashtable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,6 @@ class HashTable {
257257
size_t push_grad_value_size_;
258258
bool infer_mode_ = false;
259259
};
260-
} // end namespace framework
261-
} // end namespace paddle
260+
} // namespace framework
261+
} // namespace paddle
262262
#endif

paddle/fluid/framework/fleet/heter_ps/hashtable_kernel.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,6 @@ template void HashTable<uint64_t, float*>::update<
744744
// cudaStream_t stream);
745745

746746
#endif
747-
} // end namespace framework
748-
} // end namespace paddle
747+
} // namespace framework
748+
} // namespace paddle
749749
#endif

paddle/fluid/framework/fleet/heter_ps/hashtable_kernel.kps

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,6 @@ template void HashTable<unsigned long, paddle::framework::FeatureValue>::update<
369369
// size_t len, XPUStream stream);
370370

371371
#endif
372-
} // end namespace framework
373-
} // end namespace paddle
372+
} // namespace framework
373+
} // namespace paddle
374374
#endif

paddle/fluid/framework/fleet/heter_ps/heter_comm.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -814,8 +814,8 @@ class HeterComm {
814814
bool is_infer_mode_ = false;
815815
};
816816

817-
} // end namespace framework
818-
} // end namespace paddle
817+
} // namespace framework
818+
} // namespace paddle
819819

820820
#include "paddle/fluid/framework/fleet/heter_ps/heter_comm_inl.h"
821821

paddle/fluid/framework/fleet/heter_ps/heter_comm_inl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4223,6 +4223,6 @@ size_t HeterComm<KeyType, ValType, GradType, GPUAccessor>::
42234223
}
42244224
return total_send_recv;
42254225
}
4226-
} // end namespace framework
4227-
} // end namespace paddle
4226+
} // namespace framework
4227+
} // namespace paddle
42284228
#endif

paddle/fluid/framework/fleet/heter_ps/heter_comm_kernel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,6 @@ class HeterCommKernel {
339339
int block_size_{256};
340340
};
341341

342-
} // end namespace framework
343-
} // end namespace paddle
342+
} // namespace framework
343+
} // namespace paddle
344344
#endif

paddle/fluid/framework/fleet/heter_ps/heter_comm_kernel.kps

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,6 @@ template void HeterCommKernel::reduce_by_key<
427427

428428
#endif
429429

430-
} // end namespace framework
431-
} // end namespace paddle
430+
} // namespace framework
431+
} // namespace paddle
432432
#endif

0 commit comments

Comments
 (0)