Skip to content

rename mkldnn set/get_cur_thread_id() to set/get_cur_mkldnn_session_id()#18453

Merged
luotao1 merged 3 commits intoPaddlePaddle:developfrom
LeoZhao-Intel:rename_mkldnn_api
Jul 2, 2019
Merged

rename mkldnn set/get_cur_thread_id() to set/get_cur_mkldnn_session_id()#18453
luotao1 merged 3 commits intoPaddlePaddle:developfrom
LeoZhao-Intel:rename_mkldnn_api

Conversation

@LeoZhao-Intel
Copy link
Contributor

Refine api and const variable name to make it sense.

test=develop

@LeoZhao-Intel
Copy link
Contributor Author

@luotao1 @jianhang-liu @jczaja for code review. as discussed with luotao, refine api name

@luotao1 luotao1 requested review from a user and jczaja July 2, 2019 07:22
Copy link
Contributor

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

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

LGTM

@luotao1 luotao1 added the Intel label Jul 2, 2019
ss << tid;
key_ = key_common_ + "-t:" + ss.str();
if (platform::get_cur_thread_id() == -1) {
if (platform::get_cur_mkldnn_session_id() !=
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please explain this condition eg. why we ignore TID for SessionID -1 or anything else than default?

Copy link
Contributor Author

@LeoZhao-Intel LeoZhao-Intel Jul 2, 2019

Choose a reason for hiding this comment

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

in original PR, -1 is used to indicate a special mode for cache clearing, and only this mode works in the case that not uses thread id in key. But I re-think it, -1 means nothing but cache clearing, so if user sets thread id, it will isolate primitives with first key naturally, not need insert thread id into key. That's the initiative for this code change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants