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

Expose CUDAPinnedPlace to Python #9648

Conversation

chengduoZH
Copy link
Contributor

@chengduoZH chengduoZH commented Apr 4, 2018

fix #9658

@chengduoZH chengduoZH force-pushed the feature/expose_CUDAPinnedPlace_to_python branch 6 times, most recently from a90b1af to 52439db Compare April 4, 2018 09:49
@chengduoZH chengduoZH force-pushed the feature/expose_CUDAPinnedPlace_to_python branch from 52439db to 8e4e155 Compare April 4, 2018 11:38
@chengduoZH chengduoZH changed the title [WIP] Expose CUDAPinnedPlace to Python Expose CUDAPinnedPlace to Python Apr 4, 2018
… feature/expose_CUDAPinnedPlace_to_python
#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 "
Copy link
Collaborator

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"

Copy link
Contributor Author

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 <>
Copy link
Collaborator

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! done

@chengduoZH chengduoZH force-pushed the feature/expose_CUDAPinnedPlace_to_python branch from c15f793 to 4ff237f Compare April 6, 2018 04:27
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++

@chengduoZH chengduoZH merged commit 3d3e5ae into PaddlePaddle:develop Apr 6, 2018
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.

Expose CUDAPinnedPlace to Python
3 participants