未验证 提交 6e043202 编写于 作者: R risemeup1 提交者: GitHub

update_c++14_to_c++17_on_windows (#53958)

* update_c++14_to_c++17_on_windows

* disable test_audio_logmel_feature and test_audio_mel_feature
上级 56947361
......@@ -37,7 +37,7 @@ checkcompilercxx14flag()
if(NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
else()
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
endif()
# safe_set_flag
......
......@@ -70,8 +70,9 @@ static DLDataType GetDLDataTypeFromTypeIndex(proto::VarType::Type type) {
#undef REG_DL_DATA_TYPE
}
struct DLDeviceVisitor
: public std::unary_function<const platform::Place &, ::DLDevice> {
struct DLDeviceVisitor {
using argument_type = const platform::Place &;
using result_type = ::DLDevice;
inline ::DLDevice operator()(const platform::CPUPlace &place) const {
::DLDevice device;
device.device_type = kDLCPU;
......
......@@ -555,7 +555,9 @@ size_t Used<platform::CustomPlace>(const platform::CustomPlace &place) {
#endif
}
struct AllocVisitor : std::unary_function<const Place, void *> {
struct AllocVisitor {
using argument_type = const Place;
using result_type = void *;
inline explicit AllocVisitor(size_t size) : size_(size) {}
template <typename Place>
......@@ -567,7 +569,9 @@ struct AllocVisitor : std::unary_function<const Place, void *> {
size_t size_;
};
struct FreeVisitor : public std::unary_function<const Place, void> {
struct FreeVisitor {
using argument_type = const Place;
using result_type = void;
inline explicit FreeVisitor(void *ptr, size_t size)
: ptr_(ptr), size_(size) {}
......@@ -581,7 +585,9 @@ struct FreeVisitor : public std::unary_function<const Place, void> {
size_t size_;
};
struct ReleaseVisitor : std::unary_function<const Place, uint64_t> {
struct ReleaseVisitor {
using argument_type = const Place;
using result_type = uint64_t;
template <typename Place>
inline uint64_t operator()(const Place &place) const {
return Release<Place>(place);
......
......@@ -43,7 +43,9 @@ struct ArrayToLoDFunctorImpl {
void apply();
};
struct ArrayToLoDFunctor : public std::unary_function<platform::Place, void> {
struct ArrayToLoDFunctor {
using argument_type = platform::Place;
using result_type = void;
std::vector<phi::DenseTensor> in;
mutable phi::DenseTensor *out;
......
......@@ -44,8 +44,9 @@ struct LoDTensorToArrayFunctorImpl {
void apply();
};
struct LoDTensorToArrayFunctor
: public std::unary_function<platform::Place, void> {
struct LoDTensorToArrayFunctor {
using argument_type = platform::Place;
using result_type = void;
std::vector<const phi::DenseTensor *> ref_inputs_;
mutable std::vector<phi::DenseTensor *> outputs_;
const phi::DenseTensor &input_;
......
......@@ -196,8 +196,9 @@ void set_constant_with_place<phi::GPUPinnedPlace>(
phi::VisitDataType(tensor->dtype(), TensorSetConstantCPU(tensor, value));
}
struct TensorSetConstantWithPlace
: public std::unary_function<phi::Place, void> {
struct TensorSetConstantWithPlace {
using argument_type = phi::Place;
using result_type = void;
TensorSetConstantWithPlace(const phi::DeviceContext& context,
phi::DenseTensor* tensor,
float value)
......
......@@ -61,8 +61,10 @@ inline bool equal_pointees(OptionalPointee const& x, OptionalPointee const& y) {
}
template <class OptionalPointee>
struct equal_pointees_t
: std::binary_function<OptionalPointee, OptionalPointee, bool> {
struct equal_pointees_t {
using first_argument_type = OptionalPointee;
using second_argument_type = OptionalPointee;
using result_type = bool;
bool operator()(OptionalPointee const& x, OptionalPointee const& y) const {
return equal_pointees(x, y);
}
......@@ -83,8 +85,10 @@ inline bool less_pointees(OptionalPointee const& x, OptionalPointee const& y) {
}
template <class OptionalPointee>
struct less_pointees_t
: std::binary_function<OptionalPointee, OptionalPointee, bool> {
struct less_pointees_t {
using first_argument_type = OptionalPointee;
using second_argument_type = OptionalPointee;
using result_type = bool;
bool operator()(OptionalPointee const& x, OptionalPointee const& y) const {
return less_pointees(x, y);
}
......
......@@ -19,7 +19,8 @@ if(NOT WITH_COVERAGE)
endif()
if(NOT WITH_GPU)
list(REMOVE_ITEM TEST_OPS test_async_read_write)
list(REMOVE_ITEM TEST_OPS test_async_read_write test_audio_logmel_feature
test_audio_mel_feature)
endif()
foreach(src ${TEST_OPS})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册