Skip to content

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.

@dzhwinter dzhwinter requested review from QiJune and reyoung August 7, 2017 02:05
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