/** * Wrapper for CUBLAS function.<br /> * <br /> * cublasStatus<br /> * cublasSetVector (int n, int elemSize, const void *x, int incx, * void *y, int incy)<br /> *<br /> * copies n elements from a vector x in CPU memory space to a vector y * in GPU memory space. Elements in both vectors are assumed to have a * size of elemSize bytes. Storage spacing between consecutive elements * is incx for the source vector x and incy for the destination vector * y. In general, y points to an object, or part of an object, allocated * via cublasAlloc(). Column major format for two-dimensional matrices * is assumed throughout CUBLAS. Therefore, if the increment for a vector * is equal to 1, this access a column vector while using an increment * equal to the leading dimension of the respective matrix accesses a * row vector.<br /> *<br /> * Return Values<br /> * -------------<br /> * CUBLAS_STATUS_NOT_INITIALIZED if CUBLAS library not been initialized<br /> * CUBLAS_STATUS_INVALID_VALUE if incx, incy, or elemSize <= 0<br /> * CUBLAS_STATUS_MAPPING_ERROR if an error occurred accessing GPU memory<br /> * CUBLAS_STATUS_SUCCESS if the operation completed successfully<br /> */ public static int cublasSetVector(int n, int elemSize, Pointer x, int incx, Pointer y, int incy) { return checkResult(cublasSetVectorNative(n, elemSize, x, incx, y, incy)); }
/** * Wrapper for CUBLAS function.<br /> * <br /> * cublasStatus<br /> * cublasSetVector (int n, int elemSize, const void *x, int incx, * void *y, int incy)<br /> *<br /> * copies n elements from a vector x in CPU memory space to a vector y * in GPU memory space. Elements in both vectors are assumed to have a * size of elemSize bytes. Storage spacing between consecutive elements * is incx for the source vector x and incy for the destination vector * y. In general, y points to an object, or part of an object, allocated * via cublasAlloc(). Column major format for two-dimensional matrices * is assumed throughout CUBLAS. Therefore, if the increment for a vector * is equal to 1, this access a column vector while using an increment * equal to the leading dimension of the respective matrix accesses a * row vector.<br /> *<br /> * Return Values<br /> * -------------<br /> * CUBLAS_STATUS_NOT_INITIALIZED if CUBLAS library not been initialized<br /> * CUBLAS_STATUS_INVALID_VALUE if incx, incy, or elemSize <= 0<br /> * CUBLAS_STATUS_MAPPING_ERROR if an error occurred accessing GPU memory<br /> * CUBLAS_STATUS_SUCCESS if the operation completed successfully<br /> */ public static int cublasSetVector(int n, int elemSize, Pointer x, int incx, Pointer y, int incy) { return checkResult(cublasSetVectorNative(n, elemSize, x, incx, y, incy)); }
/** * Wrapper for CUBLAS function.<br /> * <br /> * cublasStatus<br /> * cublasSetVector (int n, int elemSize, const void *x, int incx, * void *y, int incy)<br /> *<br /> * copies n elements from a vector x in CPU memory space to a vector y * in GPU memory space. Elements in both vectors are assumed to have a * size of elemSize bytes. Storage spacing between consecutive elements * is incx for the source vector x and incy for the destination vector * y. In general, y points to an object, or part of an object, allocated * via cublasAlloc(). Column major format for two-dimensional matrices * is assumed throughout CUBLAS. Therefore, if the increment for a vector * is equal to 1, this access a column vector while using an increment * equal to the leading dimension of the respective matrix accesses a * row vector.<br /> *<br /> * Return Values<br /> * -------------<br /> * CUBLAS_STATUS_NOT_INITIALIZED if CUBLAS library not been initialized<br /> * CUBLAS_STATUS_INVALID_VALUE if incx, incy, or elemSize <= 0<br /> * CUBLAS_STATUS_MAPPING_ERROR if an error occurred accessing GPU memory<br /> * CUBLAS_STATUS_SUCCESS if the operation completed successfully<br /> */ public static int cublasSetVector(int n, int elemSize, Pointer x, int incx, Pointer y, int incy) { return checkResult(cublasSetVectorNative(n, elemSize, x, incx, y, incy)); }
/** * Wrapper for CUBLAS function.<br /> * <br /> * cublasStatus<br /> * cublasSetVector (int n, int elemSize, const void *x, int incx, * void *y, int incy)<br /> *<br /> * copies n elements from a vector x in CPU memory space to a vector y * in GPU memory space. Elements in both vectors are assumed to have a * size of elemSize bytes. Storage spacing between consecutive elements * is incx for the source vector x and incy for the destination vector * y. In general, y points to an object, or part of an object, allocated * via cublasAlloc(). Column major format for two-dimensional matrices * is assumed throughout CUBLAS. Therefore, if the increment for a vector * is equal to 1, this access a column vector while using an increment * equal to the leading dimension of the respective matrix accesses a * row vector.<br /> *<br /> * Return Values<br /> * -------------<br /> * CUBLAS_STATUS_NOT_INITIALIZED if CUBLAS library not been initialized<br /> * CUBLAS_STATUS_INVALID_VALUE if incx, incy, or elemSize <= 0<br /> * CUBLAS_STATUS_MAPPING_ERROR if an error occurred accessing GPU memory<br /> * CUBLAS_STATUS_SUCCESS if the operation completed successfully<br /> */ public static int cublasSetVector(int n, int elemSize, Pointer x, int incx, Pointer y, int incy) { return checkResult(cublasSetVectorNative(n, elemSize, x, incx, y, incy)); }
/** * Wrapper for CUBLAS function.<br /> * <br /> * cublasStatus<br /> * cublasSetVector (int n, int elemSize, const void *x, int incx, * void *y, int incy)<br /> *<br /> * copies n elements from a vector x in CPU memory space to a vector y * in GPU memory space. Elements in both vectors are assumed to have a * size of elemSize bytes. Storage spacing between consecutive elements * is incx for the source vector x and incy for the destination vector * y. In general, y points to an object, or part of an object, allocated * via cublasAlloc(). Column major format for two-dimensional matrices * is assumed throughout CUBLAS. Therefore, if the increment for a vector * is equal to 1, this access a column vector while using an increment * equal to the leading dimension of the respective matrix accesses a * row vector.<br /> *<br /> * Return Values<br /> * -------------<br /> * CUBLAS_STATUS_NOT_INITIALIZED if CUBLAS library not been initialized<br /> * CUBLAS_STATUS_INVALID_VALUE if incx, incy, or elemSize <= 0<br /> * CUBLAS_STATUS_MAPPING_ERROR if an error occurred accessing GPU memory<br /> * CUBLAS_STATUS_SUCCESS if the operation completed successfully<br /> */ public static int cublasSetVector(int n, int elemSize, Pointer x, int incx, Pointer y, int incy) { return checkResult(cublasSetVectorNative(n, elemSize, x, incx, y, incy)); }
/** * Wrapper for CUBLAS function.<br /> * <br /> * cublasStatus<br /> * cublasSetVector (int n, int elemSize, const void *x, int incx, * void *y, int incy)<br /> *<br /> * copies n elements from a vector x in CPU memory space to a vector y * in GPU memory space. Elements in both vectors are assumed to have a * size of elemSize bytes. Storage spacing between consecutive elements * is incx for the source vector x and incy for the destination vector * y. In general, y points to an object, or part of an object, allocated * via cublasAlloc(). Column major format for two-dimensional matrices * is assumed throughout CUBLAS. Therefore, if the increment for a vector * is equal to 1, this access a column vector while using an increment * equal to the leading dimension of the respective matrix accesses a * row vector.<br /> *<br /> * Return Values<br /> * -------------<br /> * CUBLAS_STATUS_NOT_INITIALIZED if CUBLAS library not been initialized<br /> * CUBLAS_STATUS_INVALID_VALUE if incx, incy, or elemSize <= 0<br /> * CUBLAS_STATUS_MAPPING_ERROR if an error occurred accessing GPU memory<br /> * CUBLAS_STATUS_SUCCESS if the operation completed successfully<br /> */ public static int cublasSetVector(int n, int elemSize, Pointer x, int incx, Pointer y, int incy) { return checkResult(cublasSetVectorNative(n, elemSize, x, 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) */ 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) */ 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 jcuda.jcublas.JCublas#cublasSetVector(int, int, jcuda.Pointer, int, jcuda.Pointer, int) */ 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) */ 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) */ 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) */ 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 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) */ 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) */ 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) */ 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) */ 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 jcuda.jcublas.JCublas#cublasSetVector(int, int, jcuda.Pointer, int, jcuda.Pointer, int) */ 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) */ 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)); }