skcuda.cublas.cublasZcopy

skcuda.cublas.cublasZcopy(handle, n, x, incx, y, incy)[source]

Vector copy (double precision complex)

Copies a double precision complex vector to another double precision complex vector.

Parameters:
  • handle (int) – CUBLAS context.
  • n (int) – Number of elements in input vectors.
  • x (ctypes.c_void_p) – Pointer to double precision complex input vector.
  • incx (int) – Storage spacing between elements of x.
  • y (ctypes.c_void_p) – Pointer to double precision complex output vector.
  • incy (int) – Storage spacing between elements of y.

Examples

>>> import pycuda.autoinit
>>> import pycuda.gpuarray as gpuarray
>>> import numpy as np
>>> x = (np.random.rand(5)+np.random.rand(5)).astype(np.complex128)
>>> x_gpu = gpuarray.to_gpu(x)
>>> y_gpu = gpuarray.zeros_like(x_gpu)
>>> h = cublasCreate()
>>> cublasZcopy(h, x_gpu.size, x_gpu.gpudata, 1, y_gpu.gpudata, 1)
>>> cublasDestroy(h)
>>> np.allclose(y_gpu.get(), x_gpu.get())
True

Notes

Both x and y must contain n elements.

References

cublas<t>copy