JCublasJava/src/main/java/jcuda/jcublas/JCublas.java
public static int cublasSetVector (int n, cuComplex x[], int offsetx, int incx, Pointer y, int incy)
    {
        ByteBuffer byteBufferx = ByteBuffer.allocateDirect(x.length * 4 * 2);
        byteBufferx.order(ByteOrder.nativeOrder());
        FloatBuffer floatBufferx = byteBufferx.asFloatBuffer();

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

        int indexx = offsetx;
        for (int i=0; i<n; i++, indexx+=incx)
        {
            floatBufferx.put(indexx*2+0, x[indexx].x);
            floatBufferx.put(indexx*2+1, x[indexx].y);
        }
        return checkResult(cublasSetVectorNative(n, 8, Pointer.to(floatBufferx).withByteOffset(offsetx * 4 * 2), incx, y, incy));
    }
public static int cublasSetVector ( int n , cuComplex x [ ] , int offsetx , int incx , Pointer y , int incy ) { ByteBuffer byteBufferx = ByteBuffer . allocateDirect ( x . length * 4 * 2 ) ; byteBufferx . order ( ByteOrder . nativeOrder ( ) ) ; FloatBuffer floatBufferx = byteBufferx . asFloatBuffer ( ) ; int indexx = offsetx ; for ( int i = 0 ; i < n ; i ++ , indexx += incx ) { floatBufferx . put ( indexx * 2 + 0 , x [ indexx ] . x ) ; floatBufferx . put ( indexx * 2 + 1 , x [ indexx ] . y ) ; } return checkResult ( cublasSetVectorNative ( n , 8 , Pointer . to ( floatBufferx ) . withByteOffset ( offsetx * 4 * 2 ) , incx , y , incy ) ) ; }
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 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)
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 containing the complex numbers where each pair of consecutive numbers in the array describes the real - and imaginary part of one complex number .