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

cache memory in local scope #7058

Merged
merged 6 commits into from
Dec 27, 2017
Merged

Conversation

QiJune
Copy link
Member

@QiJune QiJune commented Dec 27, 2017

Fix #7057

Refer to #6991 (comment)

@@ -413,37 +413,51 @@ void OperatorWithKernel::Run(const Scope& scope,
}

if (actual_kernel_key == expected_kernel_key) {
kernel_iter->second->Compute(ctx);
PADDLE_ENFORCE_EQ(actual_kernel_key.place_, expected_kernel_key.place_,
Copy link
Member

Choose a reason for hiding this comment

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

actual_kernel_key == expected_kernel_key

是不是默认包含了

actual_kernel_key.place_ == expected_kernel_key.place_

Copy link
Member Author

Choose a reason for hiding this comment

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

不是的,kernel key重载的相等操作符是判断是同一种place,并不能分辨CUDAPlace0 和 CUDApLace1

Copy link
Member

@jacquesqiao jacquesqiao left a comment

Choose a reason for hiding this comment

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

LGTM!

@QiJune QiJune merged commit 7aed7eb into PaddlePaddle:develop Dec 27, 2017
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