Skip to content

Commit

Permalink
Speedup dumpOnArgLevel by using lazy initialization (DeepLink-org#524)
Browse files Browse the repository at this point in the history
  • Loading branch information
lljbash authored and brianlcy123 committed Dec 21, 2023
1 parent e9d098a commit 11893e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dipu/torch_dipu/csrc_dipu/aten/ops/OpUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ inline void synchronizeIfEnable() {
}

inline int dumpOpArgLevel() {
const char* env_ptr = std::getenv("DIPU_DUMP_OP_ARGS");
int level = env_ptr ? std::atoi(env_ptr) : 0;
static const char* env_ptr = std::getenv("DIPU_DUMP_OP_ARGS");
static int level = env_ptr ? std::atoi(env_ptr) : 0;
return level;
}

Expand Down

0 comments on commit 11893e8

Please sign in to comment.