scikits.cuda.linalg.conj

scikits.cuda.linalg.conj(x_gpu, overwrite=True)[source]

Complex conjugate.

Compute the complex conjugate of the array in device memory.

Parameters:

x_gpu : pycuda.gpuarray.GPUArray

Input array of shape (m, n).

overwrite : bool

If true (default), save the result in the specified array. If false, return the result in a newly allocated array.

Returns:

xc_gpu : pycuda.gpuarray.GPUArray

Conjugate of the input array. If overwrite is true, the returned matrix is the same as the input array.

Examples

>>> import pycuda.driver as drv
>>> import pycuda.gpuarray as gpuarray
>>> import pycuda.autoinit
>>> import numpy as np
>>> import linalg
>>> linalg.init()
>>> x = np.array([[1+1j, 2-2j, 3+3j, 4-4j], [5+5j, 6-6j, 7+7j, 8-8j]], np.complex64)
>>> x_gpu = gpuarray.to_gpu(x)
>>> y_gpu = linalg.conj(x_gpu)
>>> np.all(x == np.conj(y_gpu.get()))
True