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