File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 1717#include " paddle/fluid/prim/utils/static/static_global_utils.h"
1818
1919PADDLE_DEFINE_EXPORTED_bool (prim_enabled, false , " enable_prim or not" );
20+ PADDLE_DEFINE_EXPORTED_bool (prim_all, false , " enable prim_all or not" );
21+ PADDLE_DEFINE_EXPORTED_bool (prim_forward, false , " enable prim_forward or not" );
22+ PADDLE_DEFINE_EXPORTED_bool (prim_backward, false , " enable prim_backward not" );
23+
2024namespace paddle {
2125namespace prim {
2226bool PrimCommonUtils::IsBwdPrimEnabled () {
23- return StaticCompositeContext::Instance ().IsBwdPrimEnabled ();
27+ bool res = StaticCompositeContext::Instance ().IsBwdPrimEnabled ();
28+ return res || FLAGS_prim_all || FLAGS_prim_backward;
2429}
2530
2631void PrimCommonUtils::SetBwdPrimEnabled (bool enable_prim) {
@@ -36,7 +41,8 @@ void PrimCommonUtils::SetEagerPrimEnabled(bool enable_prim) {
3641}
3742
3843bool PrimCommonUtils::IsFwdPrimEnabled () {
39- return StaticCompositeContext::Instance ().IsFwdPrimEnabled ();
44+ bool res = StaticCompositeContext::Instance ().IsFwdPrimEnabled ();
45+ return res || FLAGS_prim_all || FLAGS_prim_forward;
4046}
4147
4248void PrimCommonUtils::SetFwdPrimEnabled (bool enable_prim) {
You can’t perform that action at this time.
0 commit comments