未验证 提交 77dd0d97 编写于 作者: W wangchaochaohu 提交者: GitHub

use enum class to replace the usage of enum in some condition test=develop (#22464)

上级 44b45b9f
...@@ -75,7 +75,7 @@ enum class PoolingMode { ...@@ -75,7 +75,7 @@ enum class PoolingMode {
kAverageInclusive, kAverageInclusive,
}; };
enum ActivationMode { enum class ActivationMode {
kNone, // activation identity kNone, // activation identity
kSigmoid, kSigmoid,
kRelu, kRelu,
......
...@@ -23,7 +23,7 @@ limitations under the License. */ ...@@ -23,7 +23,7 @@ limitations under the License. */
namespace paddle { namespace paddle {
namespace platform { namespace platform {
enum EventType { kMark, kPushRange, kPopRange }; enum class EventType { kMark, kPushRange, kPopRange };
class Event { class Event {
public: public:
......
...@@ -340,8 +340,7 @@ void PrintProfiler(const std::vector<std::vector<EventItem>> &events_table, ...@@ -340,8 +340,7 @@ void PrintProfiler(const std::vector<std::vector<EventItem>> &events_table,
} else { } else {
PADDLE_THROW(platform::errors::InvalidArgument( PADDLE_THROW(platform::errors::InvalidArgument(
"Except profiler state must to be one of ['CPU', 'GPU' 'ALL'], but " "Except profiler state must to be one of ['CPU', 'GPU' 'ALL'], but "
"received Invalid profiler state %s", "received Invalid profiler state"));
g_state));
} }
if (merge_thread) { if (merge_thread) {
......
...@@ -32,7 +32,7 @@ limitations under the License. */ ...@@ -32,7 +32,7 @@ limitations under the License. */
namespace paddle { namespace paddle {
namespace platform { namespace platform {
enum ProfilerState { enum class ProfilerState {
kDisabled, // disabled state kDisabled, // disabled state
kCPU, // CPU profiling state kCPU, // CPU profiling state
kCUDA, // GPU profiling state kCUDA, // GPU profiling state
...@@ -116,7 +116,7 @@ struct RecordBlock { ...@@ -116,7 +116,7 @@ struct RecordBlock {
std::vector<std::vector<Event>> GetAllEvents(); std::vector<std::vector<Event>> GetAllEvents();
// Candidate keys to sort the profiling report // Candidate keys to sort the profiling report
enum EventSortingKey { enum class EventSortingKey {
kDefault, kDefault,
kCalls, kCalls,
kTotal, kTotal,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册