Some of the practices described in this HOWTO are considered to be illegal as they often break internal corporate policies. Anything you do, you do at your own risk.
This file contains 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
# Many Python libraries provide low-level CUDA support, but when it comes to interoperability | |
# things get complicated. This script shows a simple example on converting a CUDA stream | |
# created from CuPy's API to one that is compatible with Numba. | |
from numba import cuda | |
import cupy as cp | |
def stream_cupy_to_numba(cp_stream): |
This file contains 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
from __future__ import print_function | |
import threading | |
from joblib import Parallel, delayed | |
import Queue | |
import os | |
# Fix print | |
_print = print | |
_rlock = threading.RLock() | |
def print(*args, **kwargs): |