JCublasJava/src/main/java/jcuda/jcublas/JCublas.java
public static int cublasSetMatrix (int rows, int cols, cuDoubleComplex A[], int offsetA, int lda, Pointer B, int ldb)
    {
        ByteBuffer byteBufferA = ByteBuffer.allocateDirect(A.length * 8 * 2);
        byteBufferA.order(ByteOrder.nativeOrder());
        DoubleBuffer doubleBufferA = byteBufferA.asDoubleBuffer();
        for (int i=0; i<A.length; i++)
        {
            doubleBufferA.put(A[i].x);
            doubleBufferA.put(A[i].y);
        }
        return checkResult(cublasSetMatrixNative(rows, cols, 16, Pointer.to(doubleBufferA).withByteOffset(offsetA * 8 * 2), lda, B, ldb));
    }
public static int cublasSetMatrix (int rows, int cols, cuDoubleComplex A[], int offsetA, int lda, Pointer B, int ldb)
    {
        ByteBuffer byteBufferA = ByteBuffer.allocateDirect(A.length * 8 * 2);
        byteBufferA.order(ByteOrder.nativeOrder());
        DoubleBuffer doubleBufferA = byteBufferA.asDoubleBuffer();
        for (int i=0; i<A.length; i++)
        {
            doubleBufferA.put(A[i].x);
            doubleBufferA.put(A[i].y);
        }
        return checkResult(cublasSetMatrixNative(rows, cols, 16, Pointer.to(doubleBufferA).withByteOffset(offsetA * 8 * 2), lda, B, ldb));
    }
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#cublasSetMatrix(int, int, int, Pointer, int, Pointer, int)