JCublasJava/src/main/java/jcuda/jcublas/JCublas.java
public static int cublasSetVector (int n, cuDoubleComplex x[], int offsetx, int incx, Pointer y, int incy)
    {
        ByteBuffer byteBufferx = ByteBuffer.allocateDirect(x.length * 8 * 2);
        byteBufferx.order(ByteOrder.nativeOrder());
        DoubleBuffer doubleBufferx = byteBufferx.asDoubleBuffer();

        int indexx = offsetx;
        for (int i=0; i<n; i++, indexx+=incx)
        {
            doubleBufferx.put(indexx*2+0, x[indexx].x);
            doubleBufferx.put(indexx*2+1, x[indexx].y);
        }
        return checkResult(cublasSetVectorNative(n, 16, Pointer.to(doubleBufferx).withByteOffset(offsetx * 8 * 2), incx, y, incy));
    }
public static int cublasSetVector (int n, cuDoubleComplex x[], int offsetx, int incx, Pointer y, int incy)
    {
        ByteBuffer byteBufferx = ByteBuffer.allocateDirect(x.length * 8 * 2);
        byteBufferx.order(ByteOrder.nativeOrder());
        DoubleBuffer doubleBufferx = byteBufferx.asDoubleBuffer();

        int indexx = offsetx;
        for (int i=0; i<n; i++, indexx+=incx)
        {
            doubleBufferx.put(indexx*2+0, x[indexx].x);
            doubleBufferx.put(indexx*2+1, x[indexx].y);
        }
        return checkResult(cublasSetVectorNative(n, 16, Pointer.to(doubleBufferx).withByteOffset(offsetx * 8 * 2), incx, y, incy));
    }
Extended wrapper for arrays of cuDoubleComplex 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 double array containing
the complex numbers, where each pair of consecutive numbers in the array
describes the real- and imaginary part of one complex number.

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