Vector addition (double-precision complex).
Computes the sum of a double-precision complex vector scaled by a double-precision complex scalar and another double-precision complex vector.
Parameters: | handle : int
n : int
alpha : numpy.complex128
x : ctypes.c_void_p
incx : int
y : ctypes.c_void_p
incy : int
|
---|
Notes
Both x and y must contain n elements.
Examples
>>> import pycuda.autoinit
>>> import pycuda.gpuarray as gpuarray
>>> import numpy as np
>>> alpha = np.complex128(np.random.rand()+1j*np.random.rand())
>>> x = (np.random.rand(5)+1j*np.random.rand(5)).astype(np.complex128)
>>> y = (np.random.rand(5)+1j*np.random.rand(5)).astype(np.complex128)
>>> x_gpu = gpuarray.to_gpu(x)
>>> y_gpu = gpuarray.to_gpu(y)
>>> h = cublasCreate()
>>> cublasZaxpy(h, x_gpu.size, alpha, x_gpu.gpudata, 1, y_gpu.gpudata, 1)
>>> cublasDestroy(h)
>>> np.allclose(y_gpu.get(), alpha*x+y)
True