未验证 提交 96d530c1 编写于 作者: C chentianyu03 提交者: GitHub

move array_ref_test and small_vector_test into paddle/utils and format header macro define (#39831)

上级 95280a36
......@@ -3,5 +3,3 @@
if(WITH_TESTING)
cc_library(paddle_gtest_main SRCS paddle_gtest_main.cc DEPS init device_context memory gtest gflags)
endif()
cc_test(small_vector_test SRCS small_vector_test.cc DEPS gtest gflags)
cc_test(array_ref_test SRCS array_ref_test.cc DEPS gtest gflags)
add_subdirectory(string)
cc_test(small_vector_test SRCS small_vector_test.cc DEPS gtest gflags)
cc_test(array_ref_test SRCS array_ref_test.cc DEPS gtest gflags)
......@@ -6,8 +6,7 @@
// See http://www.boost.org/libs/any for Documentation.
#ifndef PADDLE_ANY_INCLUDED
#define PADDLE_ANY_INCLUDED
#pragma once
// what: variant type boost::any
// who: contributed by Kevlin Henney,
......@@ -168,12 +167,10 @@ template <typename ValueType>
inline const ValueType *unsafe_any_cast(const any *operand) {
return unsafe_any_cast<ValueType>(const_cast<any *>(operand));
}
}
} // namespace paddle
// Copyright Kevlin Henney, 2000, 2001, 2002. All rights reserved.
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#endif
......@@ -12,8 +12,7 @@
//
//===----------------------------------------------------------------------===//
#ifndef PADDLE_UTILS_ARRAY_REF_H_
#define PADDLE_UTILS_ARRAY_REF_H_
#pragma once
#include <algorithm>
#include <array>
......@@ -332,6 +331,4 @@ inline bool operator!=(SmallVectorImpl<T> &LHS, ArrayRef<T> RHS) {
return !(LHS == RHS);
}
} // end namespace paddle
#endif // PADDLE_UTILS_ARRAY_REF_H_
} // namespace paddle
......@@ -1741,4 +1741,4 @@ struct power_of_two_std_hash : std::hash<T> {
typedef paddle::power_of_two_hash_policy hash_policy;
};
} // end namespace paddle
} // namespace paddle
......@@ -15,8 +15,7 @@
// You are welcome to contact the author at:
// fernando_cacciola@hotmail.com
//
#ifndef PADDLE_NONE_17SEP2003_HPP
#define PADDLE_NONE_17SEP2003_HPP
#pragma once
namespace paddle {
......@@ -26,7 +25,7 @@ struct none_helper {};
typedef int detail::none_helper::*none_t;
} // namespace boost
} // namespace paddle
// NOTE: Borland users have to include this header outside any precompiled
// headers
......@@ -37,6 +36,4 @@ namespace paddle {
none_t const none = ((none_t)0);
} // namespace boost
#endif
} // namespace paddle
......@@ -17,8 +17,7 @@
// You are welcome to contact the author at:
// fernando_cacciola@hotmail.com
//
#ifndef PADDLE_OPTIONAL_OPTIONAL_FLC_19NOV2002_HPP
#define PADDLE_OPTIONAL_OPTIONAL_FLC_19NOV2002_HPP
#pragma once
#include <algorithm>
#include <functional>
......@@ -27,6 +26,8 @@
#include "none.h"
namespace paddle {
// Daniel Wallin discovered that bind/apply.hpp badly interacts with the apply<>
// member template of a factory as used in the optional<> implementation.
// He proposed this simple fix which is to move the call to apply<> outside
......@@ -38,7 +39,6 @@ void construct(Factory const& factory, void* address) {
}
}
namespace paddle {
template <typename T>
class optional;
......@@ -865,5 +865,3 @@ inline void optional_swap(optional<T>& x, optional<T>& y) {
} // namespace optional_detail
} // namespace paddle
#endif
......@@ -18,8 +18,7 @@
//
//===----------------------------------------------------------------------===//
#ifndef PADDLE_UTILS_SMALL_VECTOR_H_
#define PADDLE_UTILS_SMALL_VECTOR_H_
#pragma once
#include <algorithm>
#include <cassert>
......@@ -1461,7 +1460,7 @@ static_assert(sizeof(SmallVectorSizeType<char>) == sizeof(uint32_t),
"Expected SmallVectorBase<uint32_t> variant to be in use.");
#endif
} // end namespace paddle
} // namespace paddle
namespace std {
......@@ -1479,6 +1478,4 @@ inline void swap(paddle::SmallVector<T, N> &LHS,
LHS.swap(RHS);
}
} // end namespace std
#endif // PADDLE_UTILS_SMALL_VECTOR_H_
} // namespace std
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册