diff --git a/cmake/flags.cmake b/cmake/flags.cmake index 261b5596cdd78cd8912045a9da339abec9601ed3..c1dc26e101f9ee8a41375087b6b380fe013f058f 100644 --- a/cmake/flags.cmake +++ b/cmake/flags.cmake @@ -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 diff --git a/paddle/fluid/framework/dlpack_tensor.cc b/paddle/fluid/framework/dlpack_tensor.cc index 6b2ab9b3b846290ced5f7a59dcffc10fe3cc51b6..46b917cda740af7828267dc9cdc69ca3bfebb7f0 100644 --- a/paddle/fluid/framework/dlpack_tensor.cc +++ b/paddle/fluid/framework/dlpack_tensor.cc @@ -70,8 +70,9 @@ static DLDataType GetDLDataTypeFromTypeIndex(proto::VarType::Type type) { #undef REG_DL_DATA_TYPE } -struct DLDeviceVisitor - : public std::unary_function { +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; diff --git a/paddle/fluid/memory/allocation/naive_best_fit_allocator.cc b/paddle/fluid/memory/allocation/naive_best_fit_allocator.cc index 29ac488e9c52ba3a56bb65e8f87d31c78cb3292e..136f9d63a318840cdc9b7c9c91209da92c4081f0 100644 --- a/paddle/fluid/memory/allocation/naive_best_fit_allocator.cc +++ b/paddle/fluid/memory/allocation/naive_best_fit_allocator.cc @@ -555,7 +555,9 @@ size_t Used(const platform::CustomPlace &place) { #endif } -struct AllocVisitor : std::unary_function { +struct AllocVisitor { + using argument_type = const Place; + using result_type = void *; inline explicit AllocVisitor(size_t size) : size_(size) {} template @@ -567,7 +569,9 @@ struct AllocVisitor : std::unary_function { size_t size_; }; -struct FreeVisitor : public std::unary_function { +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 { size_t size_; }; -struct ReleaseVisitor : std::unary_function { +struct ReleaseVisitor { + using argument_type = const Place; + using result_type = uint64_t; template inline uint64_t operator()(const Place &place) const { return Release(place); diff --git a/paddle/fluid/operators/array_to_lod_tensor_op.cc b/paddle/fluid/operators/array_to_lod_tensor_op.cc index ebf64a92746e85c278fb5a1d25803a3002373cd4..d1dc7d8986bec96e41c6c8fe8695f457c18e71c3 100644 --- a/paddle/fluid/operators/array_to_lod_tensor_op.cc +++ b/paddle/fluid/operators/array_to_lod_tensor_op.cc @@ -43,7 +43,9 @@ struct ArrayToLoDFunctorImpl { void apply(); }; -struct ArrayToLoDFunctor : public std::unary_function { +struct ArrayToLoDFunctor { + using argument_type = platform::Place; + using result_type = void; std::vector in; mutable phi::DenseTensor *out; diff --git a/paddle/fluid/operators/lod_tensor_to_array_op.cc b/paddle/fluid/operators/lod_tensor_to_array_op.cc index a736385a1401e35ccab6718ef4b646678cce399f..94b03197291174a142762e483fe877ae05e528df 100644 --- a/paddle/fluid/operators/lod_tensor_to_array_op.cc +++ b/paddle/fluid/operators/lod_tensor_to_array_op.cc @@ -44,8 +44,9 @@ struct LoDTensorToArrayFunctorImpl { void apply(); }; -struct LoDTensorToArrayFunctor - : public std::unary_function { +struct LoDTensorToArrayFunctor { + using argument_type = platform::Place; + using result_type = void; std::vector ref_inputs_; mutable std::vector outputs_; const phi::DenseTensor &input_; diff --git a/paddle/phi/kernels/funcs/math_function.cc b/paddle/phi/kernels/funcs/math_function.cc index 2247c74011440585fd92608ae9290d25df150714..b339a0ee5ac0a06c4803db77712b363ebcfd91ea 100644 --- a/paddle/phi/kernels/funcs/math_function.cc +++ b/paddle/phi/kernels/funcs/math_function.cc @@ -196,8 +196,9 @@ void set_constant_with_place( phi::VisitDataType(tensor->dtype(), TensorSetConstantCPU(tensor, value)); } -struct TensorSetConstantWithPlace - : public std::unary_function { +struct TensorSetConstantWithPlace { + using argument_type = phi::Place; + using result_type = void; TensorSetConstantWithPlace(const phi::DeviceContext& context, phi::DenseTensor* tensor, float value) diff --git a/paddle/utils/optional.h b/paddle/utils/optional.h index 0b5189b70f1ef556b59aebd76d1939162a3888a0..3323495c9c5b33ee43245dd361675d90c6af0da5 100644 --- a/paddle/utils/optional.h +++ b/paddle/utils/optional.h @@ -61,8 +61,10 @@ inline bool equal_pointees(OptionalPointee const& x, OptionalPointee const& y) { } template -struct equal_pointees_t - : std::binary_function { +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 -struct less_pointees_t - : std::binary_function { +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); } diff --git a/test/legacy_test/CMakeLists.txt b/test/legacy_test/CMakeLists.txt index 452386f635215d48769376428d118d2069387ddf..8bf2f9abb9898524dfd89df068139b3dddba17f7 100644 --- a/test/legacy_test/CMakeLists.txt +++ b/test/legacy_test/CMakeLists.txt @@ -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})