Created
November 16, 2021 21:14
-
-
Save 4OH4/96b7ca209129e5d6017f53707ba5a22d to your computer and use it in GitHub Desktop.
Checking if PyCUDA is available
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check if PyCuda is installed | |
package_name = 'pycuda' | |
use_cuda = importlib.util.find_spec(package_name) is not None | |
if use_cuda: | |
import pycuda.driver as cuda | |
import pycuda.autoinit | |
from pycuda.compiler import SourceModule |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment