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