import pycuda.driver as cuda from decorator import decorator import pycuda._driver as _drv import numpy as np from pycuda.compyte.dtypes import ( # noqa: F401 register_dtype, get_or_register_dtype, _fill_dtype_registry, dtype_to_ctype as base_dtype_to_ctype, ) bitlog2 = _drv.bitlog2 DeviceMemoryPool = _drv.DeviceMemoryPool PageLockedMemoryPool = _drv.PageLockedMemoryPool PageLockedAllocator = _drv.PageLockedAllocator _fill_dtype_registry(respect_windows=True) get_or_register_dtype("pycuda::complex<float>", np.complex64) get_or_register_dtype("pycuda::complex<double>", np.complex128) # {{{ debug memory pool class DebugMemoryPool(DeviceMemoryPool): def __init__(self, interactive=True, logfile=None): DeviceMemoryPool.__init__(self) self.last_free, _ = cuda.mem_get_info() self.interactive = interactive if logfile is None: import sys
from decorator import decorator import pycuda._driver as _drv import numpy as np bitlog2 = _drv.bitlog2 DeviceMemoryPool = _drv.DeviceMemoryPool PageLockedMemoryPool = _drv.PageLockedMemoryPool from pycuda.compyte.dtypes import ( register_dtype, _fill_dtype_registry, dtype_to_ctype) _fill_dtype_registry(respect_windows=True) register_dtype(np.complex64, "pycuda::complex<float>") register_dtype(np.complex128, "pycuda::complex<double>") # {{{ debug memory pool class DebugMemoryPool(DeviceMemoryPool): def __init__(self, interactive=True, logfile=None): DeviceMemoryPool.__init__(self) self.last_free, _ = cuda.mem_get_info() self.interactive = interactive if logfile is None: