skcuda.linalg.conj

skcuda.linalg.conj(x_gpu, overwrite=False)[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 (default: False)) – If true, save the result in the specified array. If false, return the result in a newly allocated array.
Returns:

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

Return type:

pycuda.gpuarray.GPUArray

Examples

>>> import pycuda.driver as drv
>>> import pycuda.gpuarray as gpuarray
>>> import pycuda.autoinit
>>> import numpy as np
>>> import skcuda.linalg as 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