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

revert-22710-feature/integrated_ps_api
wangchaochaohu 5 years ago committed by GitHub
parent 44b45b9f07
commit 77dd0d97bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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,

Loading…
Cancel
Save