def init(): """ Initialize libraries used by scikits.cuda. Notes ----- This function does not initialize PyCUDA; it uses whatever device and context were initialized in the current host thread. """ # CUBLAS uses whatever device is being used by the host thread: cublas.cublasInit() # culaSelectDevice() need not (and, in fact, cannot) be called # here because the host thread has already been bound to a GPU # device: cula.culaInitialize()
def init(): """ Initialize libraries used by scikits.cuda. Initialize the CUBLAS and CULA libraries used by high-level functions provided by scikits.cuda. Notes ----- This function does not initialize PyCUDA; it uses whatever device and context were initialized in the current host thread. """ # CUBLAS uses whatever device is being used by the host thread: global _global_cublas_handle _global_cublas_handle = cublas.cublasCreate() # culaSelectDevice() need not (and, in fact, cannot) be called # here because the host thread has already been bound to a GPU # device: if _has_cula: cula.culaInitialize()
#!/usr/bin/env python """ Autoinitialize CUDA tools. """ import cublas try: import cula _has_cula = True except: _has_cula = False cublas.cublasInit() if _has_cula: cula.culaInitialize()
#!/usr/bin/env python """ Autoinitialize CUDA tools. """ import cublas import cula cublas.cublasInit() cula.culaInitialize()