skcuda.cublas.cublasCcopy¶
-
skcuda.cublas.
cublasCcopy
(handle, n, x, incx, y, incy)[source]¶ Vector copy (single precision complex)
Copies a single precision complex vector to another single precision complex vector.
Parameters: - handle (int) – CUBLAS context.
- n (int) – Number of elements in input vectors.
- x (ctypes.c_void_p) – Pointer to single precision complex input vector.
- incx (int) – Storage spacing between elements of x.
- y (ctypes.c_void_p) – Pointer to single 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.complex64) >>> x_gpu = gpuarray.to_gpu(x) >>> y_gpu = gpuarray.zeros_like(x_gpu) >>> h = cublasCreate() >>> cublasCcopy(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