rename mkldnn set/get_cur_thread_id() to set/get_cur_mkldnn_session_id()#18453
Merged
luotao1 merged 3 commits intoPaddlePaddle:developfrom Jul 2, 2019
Merged
rename mkldnn set/get_cur_thread_id() to set/get_cur_mkldnn_session_id()#18453luotao1 merged 3 commits intoPaddlePaddle:developfrom
luotao1 merged 3 commits intoPaddlePaddle:developfrom
Conversation
Contributor
Author
luotao1
reviewed
Jul 2, 2019
luotao1
reviewed
Jul 2, 2019
luotao1
reviewed
Jul 2, 2019
jczaja
reviewed
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() != |
Contributor
There was a problem hiding this comment.
Could you please explain this condition eg. why we ignore TID for SessionID -1 or anything else than default?
Contributor
Author
There was a problem hiding this comment.
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.
jczaja
approved these changes
Jul 2, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refine api and const variable name to make it sense.
test=develop