未验证 提交 337cc2ca 编写于 作者: G Galaxy1458 提交者: GitHub

remove some [-Wunused-paramter] warning (#52924)

上级 31fc763a
...@@ -80,7 +80,7 @@ inline std::string str_join(std::map<std::string, bool> const& elements, ...@@ -80,7 +80,7 @@ inline std::string str_join(std::map<std::string, bool> const& elements,
const std::string& delimiter = ",") { const std::string& delimiter = ",") {
std::string str; std::string str;
for (const auto& item : elements) { for (const auto& item : elements) {
str += item.first + ": " + std::to_string(item.second) + ","; str += item.first + ": " + std::to_string(item.second) + delimiter;
} }
return str.substr(0, str.size() - 1); return str.substr(0, str.size() - 1);
} }
......
...@@ -33,6 +33,7 @@ limitations under the License. */ ...@@ -33,6 +33,7 @@ limitations under the License. */
#include "paddle/fluid/imperative/dygraph_grad_maker.h" #include "paddle/fluid/imperative/dygraph_grad_maker.h"
#include "paddle/fluid/imperative/type_defs.h" #include "paddle/fluid/imperative/type_defs.h"
#include "paddle/fluid/prim/utils/static/composite_grad_desc_maker.h" #include "paddle/fluid/prim/utils/static/composite_grad_desc_maker.h"
#include "paddle/phi/core/macros.h"
namespace paddle { namespace paddle {
namespace framework { namespace framework {
...@@ -161,7 +162,7 @@ class OperatorRegistrarRecursive<I, false, ARGS...> { ...@@ -161,7 +162,7 @@ class OperatorRegistrarRecursive<I, false, ARGS...> {
template <size_t I, typename... ARGS> template <size_t I, typename... ARGS>
class OperatorRegistrarRecursive<I, true, ARGS...> { class OperatorRegistrarRecursive<I, true, ARGS...> {
public: public:
OperatorRegistrarRecursive(const char* op_type, OpInfo* info) {} OperatorRegistrarRecursive(const char* op_type UNUSED, OpInfo* info UNUSED) {}
}; };
template <typename T> template <typename T>
......
...@@ -162,7 +162,9 @@ class Allocator : public phi::Allocator { ...@@ -162,7 +162,9 @@ class Allocator : public phi::Allocator {
protected: protected:
virtual phi::Allocation* AllocateImpl(size_t size) = 0; virtual phi::Allocation* AllocateImpl(size_t size) = 0;
virtual void FreeImpl(phi::Allocation* allocation); virtual void FreeImpl(phi::Allocation* allocation);
virtual uint64_t ReleaseImpl(const platform::Place& place) { return 0; } virtual uint64_t ReleaseImpl(const platform::Place& place UNUSED) {
return 0;
}
}; };
inline size_t AlignedSize(size_t size, size_t alignment) { inline size_t AlignedSize(size_t size, size_t alignment) {
......
...@@ -18,7 +18,7 @@ limitations under the License. */ ...@@ -18,7 +18,7 @@ limitations under the License. */
#include <unordered_map> #include <unordered_map>
#include "paddle/phi/api/include/dll_decl.h" #include "paddle/phi/api/include/dll_decl.h"
#include "paddle/phi/core/macros.h"
namespace paddle { namespace paddle {
enum class PlaceType; enum class PlaceType;
} }
...@@ -132,7 +132,7 @@ class CPUPlace : public Place { ...@@ -132,7 +132,7 @@ class CPUPlace : public Place {
CPUPlace() : Place(AllocationType::CPU) {} CPUPlace() : Place(AllocationType::CPU) {}
CPUPlace(const CPUPlace&) = default; CPUPlace(const CPUPlace&) = default;
CPUPlace(const Place& place) : Place(AllocationType::CPU) {} // NOLINT CPUPlace(const Place& place UNUSED) : Place(AllocationType::CPU) {} // NOLINT
}; };
class GPUPlace : public Place { class GPUPlace : public Place {
...@@ -150,7 +150,7 @@ class GPUPinnedPlace : public Place { ...@@ -150,7 +150,7 @@ class GPUPinnedPlace : public Place {
GPUPinnedPlace() : Place(AllocationType::GPUPINNED) {} GPUPinnedPlace() : Place(AllocationType::GPUPINNED) {}
GPUPinnedPlace(const GPUPinnedPlace&) = default; GPUPinnedPlace(const GPUPinnedPlace&) = default;
GPUPinnedPlace(const Place& place) // NOLINT GPUPinnedPlace(const Place& place UNUSED) // NOLINT
: Place(AllocationType::GPUPINNED) {} : Place(AllocationType::GPUPINNED) {}
}; };
...@@ -179,7 +179,7 @@ class NPUPinnedPlace : public Place { ...@@ -179,7 +179,7 @@ class NPUPinnedPlace : public Place {
NPUPinnedPlace() : Place(AllocationType::NPUPINNED) {} NPUPinnedPlace() : Place(AllocationType::NPUPINNED) {}
NPUPinnedPlace(const NPUPinnedPlace&) = default; NPUPinnedPlace(const NPUPinnedPlace&) = default;
NPUPinnedPlace(const Place& place) // NOLINT NPUPinnedPlace(const Place& place UNUSED) // NOLINT
: Place(AllocationType::NPUPINNED) {} : Place(AllocationType::NPUPINNED) {}
}; };
......
...@@ -82,7 +82,7 @@ struct Transform<phi::CPUContext> { ...@@ -82,7 +82,7 @@ struct Transform<phi::CPUContext> {
typename InputIter2, typename InputIter2,
typename OutputIter, typename OutputIter,
typename BinaryOperation> typename BinaryOperation>
void operator()(const phi::CPUContext& context, void operator()(const phi::CPUContext& context UNUSED,
InputIter1 first1, InputIter1 first1,
InputIter1 last1, InputIter1 last1,
InputIter2 first2, InputIter2 first2,
......
...@@ -332,7 +332,9 @@ struct KernelImpl<Return (*)(DevCtx, Args...), kernel_fn> { ...@@ -332,7 +332,9 @@ struct KernelImpl<Return (*)(DevCtx, Args...), kernel_fn> {
template <typename T> template <typename T>
struct KernelCallHelper<TypeTag<T>> { struct KernelCallHelper<TypeTag<T>> {
template <int dev_ctx_idx, int in_idx, int attr_idx, int out_idx> template <int dev_ctx_idx, int in_idx, int attr_idx, int out_idx>
static void Compute(KernelContext* ctx, DevCtx dev_ctx, Args&... args) { static void Compute(KernelContext* ctx UNUSED,
DevCtx dev_ctx,
Args&... args) {
static_assert(dev_ctx_idx > 0, static_assert(dev_ctx_idx > 0,
"Kernel should pass DeviceContext as argument."); "Kernel should pass DeviceContext as argument.");
return kernel_fn(dev_ctx, args...); return kernel_fn(dev_ctx, args...);
......
...@@ -84,7 +84,7 @@ inline std::ostream& operator<<(std::ostream& os, const Dim<D>& d) { ...@@ -84,7 +84,7 @@ inline std::ostream& operator<<(std::ostream& os, const Dim<D>& d) {
return os; return os;
} }
inline std::ostream& operator<<(std::ostream& os, const Dim<0>& d) { inline std::ostream& operator<<(std::ostream& os, const Dim<0>& d UNUSED) {
return os; return os;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册