这是代码:
import pycuda.autoinit
import pycuda.gpuarray as gpuarray
import pycuda.driver as drv
import numpy as np
import scikits.cuda.linalg as culinalg
import scikits.cuda.misc as cumisc
culinalg.init()
ag = gpuarray.to_gpu(np.random.rand(1000,1000))
bg = gpuarray.to_gpu(np.zeros((1000,1000))
bg[:,:] = ag
我收到以下错误:
TypeError: 'GPUArray' object does not support item assignment
那么有什么方法可以将矩阵分配给 pycuda/scikits.cuda 中的另一个现有矩阵?