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

Fix memory deps on device context #3018

Merged

Conversation

wangkuiyi
Copy link
Collaborator

@wangkuiyi wangkuiyi commented Jul 22, 2017

Fixes #3020

Copy link
Contributor

@helinwang helinwang left a comment

Choose a reason for hiding this comment

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

LGTM++

@@ -1,14 +1,16 @@
add_subdirectory(detail)

cc_library(memory SRCS memory.cc)
cc_library(memcpy SRCS memcpy.cc)
cc_library(memcpy SRCS memcpy.cc DEPS device_context)
Copy link
Contributor

@gangliao gangliao Jul 23, 2017

Choose a reason for hiding this comment

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

I don't think GPUPlaceGuard and CPUPlaceGuard are necessary here. We don't need to roll back the previous device id after usage. Because we still need to set device id when we want to use it. The explicitly set device id is a good option.

@gangliao gangliao merged commit d1dbf2c into PaddlePaddle:develop Jul 24, 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.

None yet

3 participants