def finalization(self):
'''
Add sparse matrix multiplication on GPU
Note: use "python-cuda-cffi" generated interface to access cusparse
'''
self.gpu_flag = 0
self.CSR = cuda_cffi.cusparse.CSR.to_CSR(self.st['p'].astype(dtype), )
self.CSRH = cuda_cffi.cusparse.CSR.to_CSR(self.st['p'].getH().tocsr().astype(dtype), )
self.scikit_plan = cu_fft.Plan(self.st['Kd'], dtype, dtype)
# self.pHp = cuda_cffi.cusparse.CSR.to_CSR(
# self.st['pHp'].astype(dtype))
self.gpu_flag = 1
self.sn_gpu = pycuda.gpuarray.to_gpu(self.sn.astype(dtype))
# tmp_array = skcuda.misc.ones((numpy.prod(self.st['Kd']),1),dtype=dtype)
# tmp = cuda_cffi.cusolver.csrlsvqr(self.CSR, tmp_array)
评论列表
文章目录