未验证 提交 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,
const std::string& delimiter = ",") {
std::string str;
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);
}
......
......@@ -33,6 +33,7 @@ limitations under the License. */
#include "paddle/fluid/imperative/dygraph_grad_maker.h"
#include "paddle/fluid/imperative/type_defs.h"
#include "paddle/fluid/prim/utils/static/composite_grad_desc_maker.h"
#include "paddle/phi/core/macros.h"
namespace paddle {
namespace framework {
......@@ -161,7 +162,7 @@ class OperatorRegistrarRecursive<I, false, ARGS...> {
template <size_t I, typename... ARGS>
class OperatorRegistrarRecursive<I, true, ARGS...> {
public:
OperatorRegistrarRecursive(const char* op_type, OpInfo* info) {}
OperatorRegistrarRecursive(const char* op_type UNUSED, OpInfo* info UNUSED) {}
};
template <typename T>
......
......@@ -162,7 +162,9 @@ class Allocator : public phi::Allocator {
protected:
virtual phi::Allocation* AllocateImpl(size_t size) = 0;
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) {
......
......@@ -18,7 +18,7 @@ limitations under the License. */
#include <unordered_map>
#include "paddle/phi/api/include/dll_decl.h"
#include "paddle/phi/core/macros.h"
namespace paddle {
enum class PlaceType;
}
......@@ -132,7 +132,7 @@ class CPUPlace : public Place {
CPUPlace() : Place(AllocationType::CPU) {}
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 {
......@@ -150,7 +150,7 @@ class GPUPinnedPlace : public Place {
GPUPinnedPlace() : Place(AllocationType::GPUPINNED) {}
GPUPinnedPlace(const GPUPinnedPlace&) = default;
GPUPinnedPlace(const Place& place) // NOLINT
GPUPinnedPlace(const Place& place UNUSED) // NOLINT
: Place(AllocationType::GPUPINNED) {}
};
......@@ -179,7 +179,7 @@ class NPUPinnedPlace : public Place {
NPUPinnedPlace() : Place(AllocationType::NPUPINNED) {}
NPUPinnedPlace(const NPUPinnedPlace&) = default;
NPUPinnedPlace(const Place& place) // NOLINT
NPUPinnedPlace(const Place& place UNUSED) // NOLINT
: Place(AllocationType::NPUPINNED) {}
};
......
......@@ -82,7 +82,7 @@ struct Transform<phi::CPUContext> {
typename InputIter2,
typename OutputIter,
typename BinaryOperation>
void operator()(const phi::CPUContext& context,
void operator()(const phi::CPUContext& context UNUSED,
InputIter1 first1,
InputIter1 last1,
InputIter2 first2,
......
......@@ -332,7 +332,9 @@ struct KernelImpl<Return (*)(DevCtx, Args...), kernel_fn> {
template <typename T>
struct KernelCallHelper<TypeTag<T>> {
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,
"Kernel should pass DeviceContext as argument.");
return kernel_fn(dev_ctx, args...);
......
......@@ -84,7 +84,7 @@ inline std::ostream& operator<<(std::ostream& os, const Dim<D>& d) {
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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册