Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP]refactor: use static init instead of call_once. #672

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

deeply
Copy link
Collaborator

@deeply deeply commented Sep 30, 2022

Static var initialization is guaranteed to be called once by c++11 standard. Maybe we can remove some call_once usages for simplicity (and maybe small perf gain).

return white_list;
}
// clang-format off

const std::unordered_set<std::string> &GetTorchMlirWhiteList() {
static std::unordered_set<std::string> white_list = CreateTorchMlirWhiteList();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Could you please link the c++ 11 standard doc reference?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please refer to this SO answer or C++11 standard 6.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants