/** * Wrapper for CUBLAS function.<br /> * <br /> * cublasStatus * cublasSetMatrix (int rows, int cols, int elemSize, const void *A, * int lda, void *B, int ldb)<br /> *<br /> * copies a tile of rows x cols elements from a matrix A in CPU memory * space to a matrix B in GPU memory space. Each element requires storage * of elemSize bytes. Both matrices are assumed to be stored in column * major format, with the leading dimension (i.e. number of rows) of * source matrix A provided in lda, and the leading dimension of matrix B * provided in ldb. In general, B points to an object, or part of an * object, that was allocated via cublasAlloc().<br /> *<br /> * Return Values<br /> * -------------<br /> * CUBLAS_STATUS_NOT_INITIALIZED if CUBLAS library has not been initialized<br /> * CUBLAS_STATUS_INVALID_VALUE if rows or cols < 0, or elemSize, lda, or * ldb <= 0<br /> * CUBLAS_STATUS_MAPPING_ERROR if error occurred accessing GPU memory<br /> * CUBLAS_STATUS_SUCCESS if the operation completed successfully<br /> */ public static int cublasSetMatrix (int rows, int cols, int elemSize, Pointer A, int lda, Pointer B, int ldb) { return checkResult(cublasSetMatrixNative(rows, elemSize, cols, A, lda, B, ldb)); }
/** * Wrapper for CUBLAS function.<br /> * <br /> * cublasStatus * cublasSetMatrix (int rows, int cols, int elemSize, const void *A, * int lda, void *B, int ldb)<br /> *<br /> * copies a tile of rows x cols elements from a matrix A in CPU memory * space to a matrix B in GPU memory space. Each element requires storage * of elemSize bytes. Both matrices are assumed to be stored in column * major format, with the leading dimension (i.e. number of rows) of * source matrix A provided in lda, and the leading dimension of matrix B * provided in ldb. In general, B points to an object, or part of an * object, that was allocated via cublasAlloc().<br /> *<br /> * Return Values<br /> * -------------<br /> * CUBLAS_STATUS_NOT_INITIALIZED if CUBLAS library has not been initialized<br /> * CUBLAS_STATUS_INVALID_VALUE if rows or cols < 0, or elemSize, lda, or * ldb <= 0<br /> * CUBLAS_STATUS_MAPPING_ERROR if error occurred accessing GPU memory<br /> * CUBLAS_STATUS_SUCCESS if the operation completed successfully<br /> */ public static int cublasSetMatrix (int rows, int cols, int elemSize, Pointer A, int lda, Pointer B, int ldb) { return checkResult(cublasSetMatrixNative(rows, elemSize, cols, A, lda, B, ldb)); }
/** * Wrapper for CUBLAS function.<br /> * <br /> * cublasStatus * cublasSetMatrix (int rows, int cols, int elemSize, const void *A, * int lda, void *B, int ldb)<br /> *<br /> * copies a tile of rows x cols elements from a matrix A in CPU memory * space to a matrix B in GPU memory space. Each element requires storage * of elemSize bytes. Both matrices are assumed to be stored in column * major format, with the leading dimension (i.e. number of rows) of * source matrix A provided in lda, and the leading dimension of matrix B * provided in ldb. In general, B points to an object, or part of an * object, that was allocated via cublasAlloc().<br /> *<br /> * Return Values<br /> * -------------<br /> * CUBLAS_STATUS_NOT_INITIALIZED if CUBLAS library has not been initialized<br /> * CUBLAS_STATUS_INVALID_VALUE if rows or cols < 0, or elemSize, lda, or * ldb <= 0<br /> * CUBLAS_STATUS_MAPPING_ERROR if error occurred accessing GPU memory<br /> * CUBLAS_STATUS_SUCCESS if the operation completed successfully<br /> */ public static int cublasSetMatrix (int rows, int cols, int elemSize, Pointer A, int lda, Pointer B, int ldb) { return checkResult(cublasSetMatrixNative(rows, elemSize, cols, A, lda, B, ldb)); }
/** * Wrapper for CUBLAS function.<br /> * <br /> * cublasStatus * cublasSetMatrix (int rows, int cols, int elemSize, const void *A, * int lda, void *B, int ldb)<br /> *<br /> * copies a tile of rows x cols elements from a matrix A in CPU memory * space to a matrix B in GPU memory space. Each element requires storage * of elemSize bytes. Both matrices are assumed to be stored in column * major format, with the leading dimension (i.e. number of rows) of * source matrix A provided in lda, and the leading dimension of matrix B * provided in ldb. In general, B points to an object, or part of an * object, that was allocated via cublasAlloc().<br /> *<br /> * Return Values<br /> * -------------<br /> * CUBLAS_STATUS_NOT_INITIALIZED if CUBLAS library has not been initialized<br /> * CUBLAS_STATUS_INVALID_VALUE if rows or cols < 0, or elemSize, lda, or * ldb <= 0<br /> * CUBLAS_STATUS_MAPPING_ERROR if error occurred accessing GPU memory<br /> * CUBLAS_STATUS_SUCCESS if the operation completed successfully<br /> */ public static int cublasSetMatrix (int rows, int cols, int elemSize, Pointer A, int lda, Pointer B, int ldb) { return checkResult(cublasSetMatrixNative(rows, elemSize, cols, A, lda, B, ldb)); }
/** * Wrapper for CUBLAS function.<br /> * <br /> * cublasStatus * cublasSetMatrix (int rows, int cols, int elemSize, const void *A, * int lda, void *B, int ldb)<br /> *<br /> * copies a tile of rows x cols elements from a matrix A in CPU memory * space to a matrix B in GPU memory space. Each element requires storage * of elemSize bytes. Both matrices are assumed to be stored in column * major format, with the leading dimension (i.e. number of rows) of * source matrix A provided in lda, and the leading dimension of matrix B * provided in ldb. In general, B points to an object, or part of an * object, that was allocated via cublasAlloc().<br /> *<br /> * Return Values<br /> * -------------<br /> * CUBLAS_STATUS_NOT_INITIALIZED if CUBLAS library has not been initialized<br /> * CUBLAS_STATUS_INVALID_VALUE if rows or cols < 0, or elemSize, lda, or * ldb <= 0<br /> * CUBLAS_STATUS_MAPPING_ERROR if error occurred accessing GPU memory<br /> * CUBLAS_STATUS_SUCCESS if the operation completed successfully<br /> */ public static int cublasSetMatrix (int rows, int cols, int elemSize, Pointer A, int lda, Pointer B, int ldb) { return checkResult(cublasSetMatrixNative(rows, elemSize, cols, A, lda, B, ldb)); }
/** * Wrapper for CUBLAS function.<br /> * <br /> * cublasStatus * cublasSetMatrix (int rows, int cols, int elemSize, const void *A, * int lda, void *B, int ldb)<br /> *<br /> * copies a tile of rows x cols elements from a matrix A in CPU memory * space to a matrix B in GPU memory space. Each element requires storage * of elemSize bytes. Both matrices are assumed to be stored in column * major format, with the leading dimension (i.e. number of rows) of * source matrix A provided in lda, and the leading dimension of matrix B * provided in ldb. In general, B points to an object, or part of an * object, that was allocated via cublasAlloc().<br /> *<br /> * Return Values<br /> * -------------<br /> * CUBLAS_STATUS_NOT_INITIALIZED if CUBLAS library has not been initialized<br /> * CUBLAS_STATUS_INVALID_VALUE if rows or cols < 0, or elemSize, lda, or * ldb <= 0<br /> * CUBLAS_STATUS_MAPPING_ERROR if error occurred accessing GPU memory<br /> * CUBLAS_STATUS_SUCCESS if the operation completed successfully<br /> */ public static int cublasSetMatrix (int rows, int cols, int elemSize, Pointer A, int lda, Pointer B, int ldb) { return checkResult(cublasSetMatrixNative(rows, elemSize, cols, A, lda, B, ldb)); }
/** * 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#cublasSetMatrix(int, int, int, Pointer, int, Pointer, int) */ public static int cublasSetMatrix (int rows, int cols, cuComplex A[], int offsetA, int lda, Pointer B, int ldb) { ByteBuffer byteBufferA = ByteBuffer.allocateDirect(A.length * 4 * 2); byteBufferA.order(ByteOrder.nativeOrder()); FloatBuffer floatBufferA = byteBufferA.asFloatBuffer(); for (int i=0; i<A.length; i++) { floatBufferA.put(A[i].x); floatBufferA.put(A[i].y); } return checkResult(cublasSetMatrixNative(rows, cols, 8, Pointer.to(floatBufferA).withByteOffset(offsetA * 4 * 2), lda, B, ldb)); }
/** * 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#cublasSetMatrix(int, int, int, Pointer, int, Pointer, int) */ public static int cublasSetMatrix (int rows, int cols, cuComplex A[], int offsetA, int lda, Pointer B, int ldb) { ByteBuffer byteBufferA = ByteBuffer.allocateDirect(A.length * 4 * 2); byteBufferA.order(ByteOrder.nativeOrder()); FloatBuffer floatBufferA = byteBufferA.asFloatBuffer(); for (int i=0; i<A.length; i++) { floatBufferA.put(A[i].x); floatBufferA.put(A[i].y); } return checkResult(cublasSetMatrixNative(rows, cols, 8, Pointer.to(floatBufferA).withByteOffset(offsetA * 4 * 2), lda, B, ldb)); }
/** * 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 jcuda.jcublas.JCublas#cublasSetMatrix(int, int, int, jcuda.Pointer, int, jcuda.Pointer, int) */ public static int cublasSetMatrix (int rows, int cols, cuComplex A[], int offsetA, int lda, Pointer B, int ldb) { ByteBuffer byteBufferA = ByteBuffer.allocateDirect(A.length * 4 * 2); byteBufferA.order(ByteOrder.nativeOrder()); FloatBuffer floatBufferA = byteBufferA.asFloatBuffer(); for (int i=0; i<A.length; i++) { floatBufferA.put(A[i].x); floatBufferA.put(A[i].y); } return checkResult(cublasSetMatrixNative(rows, cols, 8, Pointer.to(floatBufferA).withByteOffset(offsetA * 4 * 2), lda, B, ldb)); }
/** * 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#cublasSetMatrix(int, int, int, Pointer, int, Pointer, int) */ public static int cublasSetMatrix (int rows, int cols, cuComplex A[], int offsetA, int lda, Pointer B, int ldb) { ByteBuffer byteBufferA = ByteBuffer.allocateDirect(A.length * 4 * 2); byteBufferA.order(ByteOrder.nativeOrder()); FloatBuffer floatBufferA = byteBufferA.asFloatBuffer(); for (int i=0; i<A.length; i++) { floatBufferA.put(A[i].x); floatBufferA.put(A[i].y); } return checkResult(cublasSetMatrixNative(rows, cols, 8, Pointer.to(floatBufferA).withByteOffset(offsetA * 4 * 2), lda, B, ldb)); }
/** * 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#cublasSetMatrix(int, int, int, Pointer, int, Pointer, int) */ public static int cublasSetMatrix (int rows, int cols, cuComplex A[], int offsetA, int lda, Pointer B, int ldb) { ByteBuffer byteBufferA = ByteBuffer.allocateDirect(A.length * 4 * 2); byteBufferA.order(ByteOrder.nativeOrder()); FloatBuffer floatBufferA = byteBufferA.asFloatBuffer(); for (int i=0; i<A.length; i++) { floatBufferA.put(A[i].x); floatBufferA.put(A[i].y); } return checkResult(cublasSetMatrixNative(rows, cols, 8, Pointer.to(floatBufferA).withByteOffset(offsetA * 4 * 2), lda, B, ldb)); }
/** * 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#cublasSetMatrix(int, int, int, Pointer, int, Pointer, int) */ public static int cublasSetMatrix (int rows, int cols, cuComplex A[], int offsetA, int lda, Pointer B, int ldb) { ByteBuffer byteBufferA = ByteBuffer.allocateDirect(A.length * 4 * 2); byteBufferA.order(ByteOrder.nativeOrder()); FloatBuffer floatBufferA = byteBufferA.asFloatBuffer(); for (int i=0; i<A.length; i++) { floatBufferA.put(A[i].x); floatBufferA.put(A[i].y); } return checkResult(cublasSetMatrixNative(rows, cols, 8, Pointer.to(floatBufferA).withByteOffset(offsetA * 4 * 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) */ 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) */ 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) */ 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 jcuda.jcublas.JCublas#cublasSetMatrix(int, int, int, jcuda.Pointer, int, jcuda.Pointer, int) */ 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) */ 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) */ 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)); }