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

Need an efficient way to get CUDADeviceContext #4187

Closed
typhoonzero opened this issue Sep 19, 2017 · 0 comments
Closed

Need an efficient way to get CUDADeviceContext #4187

typhoonzero opened this issue Sep 19, 2017 · 0 comments
Assignees

Comments

@typhoonzero
Copy link
Contributor

In an operator kernel, we usually got a framework::ExecutionContext object, and if we are implement GPU kernel, we often need to get CUDADeviceContext out from ExecutionContext. Currently we have to do sevaral cast to get it, need to simplify this.

Current sample:

auto* device_context =
        const_cast<platform::DeviceContext*>(context.device_context_);
auto cuda_ctx = 
         reinterpret_cast<platform::CUDADeviceContext*>(device_context);
@typhoonzero typhoonzero changed the title An efficient way to get CUDADeviceContext Need an efficient way to get CUDADeviceContext Sep 19, 2017
@typhoonzero typhoonzero self-assigned this Sep 19, 2017
@typhoonzero typhoonzero mentioned this issue Sep 19, 2017
3 tasks
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

No branches or pull requests

1 participant