JCublasJava/src/main/java/jcuda/jcublas/JCublas.java
public static int cublasGetVector (int n, Pointer x, int incx, cuComplex y[], int offsety, int incy)
    {
        ByteBuffer byteBuffery = ByteBuffer.allocateDirect(y.length * 4 * 2);
        byteBuffery.order(ByteOrder.nativeOrder());
        FloatBuffer floatBuffery = byteBuffery.asFloatBuffer();
        int status = cublasGetVectorNative(n, 8, x, incx, Pointer.to(floatBuffery).withByteOffset(offsety * 4 * 2), incy);
        if (status == cublasStatus.CUBLAS_STATUS_SUCCESS)
        {
            floatBuffery.rewind();
            int indexy = offsety;
            for (int i=0; i<n; i++, indexy+=incy)
            {
                y[indexy].x = floatBuffery.get(indexy*2+0);
                y[indexy].y = floatBuffery.get(indexy*2+1);
            }
        }
        return checkResult(status);
    }
public static int cublasGetVector (int n, Pointer x, int incx, cuComplex y[], int offsety, int incy)
    {
        ByteBuffer byteBuffery = ByteBuffer.allocateDirect(y.length * 4 * 2);
        byteBuffery.order(ByteOrder.nativeOrder());
        FloatBuffer floatBuffery = byteBuffery.asFloatBuffer();
        int status = cublasGetVectorNative(n, 8, x, incx, Pointer.to(floatBuffery).withByteOffset(offsety * 4 * 2), incy);
        if (status == cublasStatus.CUBLAS_STATUS_SUCCESS)
        {
            floatBuffery.rewind();
            int indexy = offsety;
            for (int i=0; i<n; i++, indexy+=incy)
            {
                y[indexy].x = floatBuffery.get(indexy*2+0);
                y[indexy].y = floatBuffery.get(indexy*2+1);
            }
        }
        return checkResult(status);
    }
Extended wrapper for arrays of cuComplex values. Note that this method
only exists for convenience and compatibility with native C code. It
is much more efficient to provide a Pointer to a float array that may
store the complex numbers, where each pair of consecutive numbers in
the array describes the real- and imaginary part of one complex number.

@see JCublas#cublasGetVector(int, int, Pointer, int, Pointer, int)