Skip to content

Commit

Permalink
remove unused flag
Browse files Browse the repository at this point in the history
  • Loading branch information
cyber-pioneer committed Jan 2, 2024
1 parent ff4ec98 commit 93c02ba
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions paddle/fluid/prim/utils/utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@
#include "paddle/fluid/prim/utils/static/static_global_utils.h"

PADDLE_DEFINE_EXPORTED_bool(prim_enabled, false, "enable_prim or not");
PADDLE_DEFINE_EXPORTED_string(prim_blacklist, "", "prim ops blacklist");
PADDLE_DEFINE_EXPORTED_bool(prim_all, false, "enable prim_all or not");
PADDLE_DEFINE_EXPORTED_bool(prim_forward, false, "enable prim_forward or not");
PADDLE_DEFINE_EXPORTED_bool(prim_backward, false, "enable prim_backward not");

namespace paddle {
namespace prim {

bool PrimCommonUtils::IsBwdPrimEnabled() {
return StaticCompositeContext::Instance().IsBwdPrimEnabled();
bool res = StaticCompositeContext::Instance().IsBwdPrimEnabled();
return res || FLAGS_prim_all || FLAGS_prim_backward;
}

void PrimCommonUtils::SetBwdPrimEnabled(bool enable_prim) {
Expand All @@ -39,16 +41,15 @@ void PrimCommonUtils::SetEagerPrimEnabled(bool enable_prim) {
}

bool PrimCommonUtils::IsFwdPrimEnabled() {
return StaticCompositeContext::Instance().IsFwdPrimEnabled();
bool res = StaticCompositeContext::Instance().IsFwdPrimEnabled();
return res || FLAGS_prim_all || FLAGS_prim_forward;
}

void PrimCommonUtils::SetFwdPrimEnabled(bool enable_prim) {
VLOG(0) << "FLAGS_prim_enabled ====================== " << FLAGS_prim_enabled;
StaticCompositeContext::Instance().SetFwdPrimEnabled(enable_prim);
}

void PrimCommonUtils::SetAllPrimEnabled(bool enable_prim) {
VLOG(0) << "FLAGS_prim_enabled ====================== " << FLAGS_prim_enabled;
StaticCompositeContext::Instance().SetAllPrimEnabled(enable_prim);
}

Expand Down

0 comments on commit 93c02ba

Please sign in to comment.