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

remove calling initialize automatically #7

Open
pluskid opened this issue Oct 30, 2014 · 1 comment
Open

remove calling initialize automatically #7

pluskid opened this issue Oct 30, 2014 · 1 comment

Comments

@pluskid
Copy link

pluskid commented Oct 30, 2014

Hi, I noticed that initialize is automatically called when the CUDA module is imported. I think it's better to let the user to make that call explicitly: the users will need to setup device and context explicitly any way.

My problem here is that I'm writing a module that could either use GPU or CPU to carry out computation. The GPU code will be called only when the user explicitly choose to do it. However, currently I need to import CUDA module in order to define my functions, which uses some functions and types in the CUDA library. The problem is, since the CUDA driver is initialized upon importing the module, even the user is not intended to use GPU. What's worse is, when the user run it on a node without a GPU device, the code will simply fail upon importing.

@pluskid
Copy link
Author

pluskid commented Oct 30, 2014

I can prepare a pull request if needed: removing the initialize call in base, and fix the example code by calling initialize explicitly.

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