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

fix some [-Wunused-function] and [-Wunused-function] warning (#52868)

* test,test=develop

* test,test=develop

* test,test=develop
上级 630d14f5
......@@ -51,7 +51,7 @@ limitations under the License. */
#include <string>
#include <type_traits>
#include <utility>
#include "paddle/phi/core/macros.h"
#if !defined(_WIN32) && !defined(PADDLE_WITH_MUSL)
#include <execinfo.h>
#endif
......@@ -222,7 +222,7 @@ struct BinaryCompareMessageConverter {
template <>
struct BinaryCompareMessageConverter<false> {
template <typename T>
static const char* Convert(const char* expression, const T& value) {
static const char* Convert(const char* expression, const T& value UNUSED) {
return expression;
}
};
......
......@@ -23,6 +23,12 @@ limitations under the License. */
#include "paddle/phi/backends/xpu/xpu_info.h"
#include "paddle/phi/core/enforce.h"
static uint64_t GetRandomSeed() {
std::random_device rd;
// double has 53 bit significant, so limit uint64 to 53 bits
return ((((uint64_t)rd()) << 32) + rd()) & 0x1FFFFFFFFFFFFF;
}
namespace phi {
const std::shared_ptr<Generator>& DefaultXPUGenerator(int64_t device_id) {
......
......@@ -24,11 +24,6 @@ limitations under the License. */
#include <random>
#include <typeinfo>
#include <utility>
static uint64_t GetRandomSeed() {
std::random_device rd;
// double has 53 bit significant, so limit uint64 to 53 bits
return ((((uint64_t)rd()) << 32) + rd()) & 0x1FFFFFFFFFFFFF;
}
namespace phi {
......
......@@ -15,8 +15,8 @@
#pragma once
#include <cstddef>
#include <type_traits>
#include "paddle/phi/core/hostdevice.h"
#include "paddle/phi/core/macros.h"
namespace phi {
namespace detail {
......@@ -47,7 +47,7 @@ struct UnrollAssign {
template <size_t kStart, size_t kEnd>
struct UnrollAssign<kStart, kEnd, true> {
template <typename Tin, typename Tout>
HOSTDEVICE inline static void Run(const Tin *d1, Tout *d2) {}
HOSTDEVICE inline static void Run(const Tin *d1 UNUSED, Tout *d2 UNUSED) {}
};
template <typename T, size_t kStart, size_t kEnd, bool kStop>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册