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

"change device context to pointer" #3289

Merged
merged 1 commit into from
Aug 7, 2017

Conversation

dzhwinter
Copy link
Contributor

change const platform::DeviceContext to pointer instead of reference in ExecutionContext.
Because our DeviceContext is a base class, to achieve polymorphism, it should not be a reference.

Copy link
Contributor

@typhoonzero typhoonzero 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
Copy link
Member

QiJune commented Aug 7, 2017

Polymorphism can also be achieved by reference. But I think that it's better to use pointer as a member actually. Please refer to https://stackoverflow.com/questions/892133/should-i-prefer-pointers-or-references-in-member-data.

Copy link
Member

@QiJune QiJune left a comment

Choose a reason for hiding this comment

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

LGTM

@dzhwinter dzhwinter merged commit 2f71f82 into PaddlePaddle:develop Aug 7, 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.

3 participants