diff --git a/paddle/fluid/operators/distributed/parameter_prefetch.cc b/paddle/fluid/operators/distributed/parameter_prefetch.cc index d2b514b7b48665a1ef25674bfffe5b8a0b0d57c9..13fc0bc0cd8afb5c5574486386efb3f4557e919f 100644 --- a/paddle/fluid/operators/distributed/parameter_prefetch.cc +++ b/paddle/fluid/operators/distributed/parameter_prefetch.cc @@ -37,9 +37,7 @@ using LoDTensor = framework::LoDTensor; using SelectedRows = framework::SelectedRows; using DDim = framework::DDim; -constexpr int64_t kNoPadding = -1; - -inline size_t GetSectionIndex(int64_t id, +static size_t GetSectionIndex(int64_t id, const std::vector& abs_sections) { for (size_t i = 1; i < abs_sections.size(); ++i) { if (id < abs_sections[i]) { @@ -49,7 +47,7 @@ inline size_t GetSectionIndex(int64_t id, return abs_sections.size() - 1; } -inline std::vector ToAbsoluteSection( +static std::vector ToAbsoluteSection( const std::vector& height_sections) { std::vector abs_sections; abs_sections.resize(height_sections.size()); @@ -60,7 +58,7 @@ inline std::vector ToAbsoluteSection( return abs_sections; } -inline std::vector> SplitIds( +static std::vector> SplitIds( const std::string& id_name, const std::vector& height_section, framework::Scope* scope) { auto& id_tensor = scope->FindVar(id_name)->Get(); @@ -79,7 +77,7 @@ inline std::vector> SplitIds( return splited_ids; } -inline void SplitIdsIntoMultipleVarsBySection( +static void SplitIdsIntoMultipleVarsBySection( const std::string& id_name, const std::vector& in_var_names, const std::vector& height_section, const std::vector>& splited_ids, @@ -100,7 +98,7 @@ inline void SplitIdsIntoMultipleVarsBySection( } } -inline void MergeMultipleVarsIntoOneBySection( +static void MergeMultipleVarsIntoOneBySection( const std::string& id_name, const std::string& out_name, const std::vector& out_var_names, const std::vector& height_section,