-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Expose CUDAPinnedPlace to Python #9648
Expose CUDAPinnedPlace to Python #9648
Conversation
a90b1af
to
52439db
Compare
52439db
to
8e4e155
Compare
… feature/expose_CUDAPinnedPlace_to_python
paddle/fluid/framework/tensor_impl.h
Outdated
#ifndef PADDLE_WITH_CUDA | ||
PADDLE_THROW("'CUDAPlace' is not supported in CPU only device."); | ||
PADDLE_THROW( | ||
"'CUDAPlace' or 'CUDAPinnedPlace' is not supported in CPU only " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"CUDAPlace or CUDAPinnedPlace is not supported in CPU-only mode"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
std::memcpy(dst, array.data(), sizeof(T) * array.size()); | ||
} | ||
|
||
template <> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need a comment explaining the reason that we need this specialization:
// This following specialization maps uint16_t in the parameter type to platform::float16.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! done
c15f793
to
4ff237f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM++
fix #9658