Tabnine Logo
JCublas.cublasGetMatrixNative
Code IndexAdd Tabnine to your IDE (free)

How to use
cublasGetMatrixNative
method
in
jcuda.jcublas.JCublas

Best Java code snippets using jcuda.jcublas.JCublas.cublasGetMatrixNative (Showing top 18 results out of 315)

origin: org.nd4j/jcublas-windows64

/**
 * Wrapper for CUBLAS function.<br />
 * <br />
 * cublasStatus
 * cublasGetMatrix (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 GPU memory
 * space to a matrix B in CPU 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, A 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, cols, eleSize, 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 cublasGetMatrix (int rows, int cols, int elemSize, Pointer A, int lda, Pointer B, int ldb)
{
  return checkResult(cublasGetMatrixNative(rows, cols, elemSize, A, lda, B, ldb));
}
origin: org.jcuda/jcublas

/**
 * Wrapper for CUBLAS function.<br />
 * <br />
 * cublasStatus
 * cublasGetMatrix (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 GPU memory
 * space to a matrix B in CPU 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, A 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, cols, eleSize, 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 cublasGetMatrix (int rows, int cols, int elemSize, Pointer A, int lda, Pointer B, int ldb)
{
  return checkResult(cublasGetMatrixNative(rows, cols, elemSize, A, lda, B, ldb));
}
origin: org.nd4j/jcublas

/**
 * Wrapper for CUBLAS function.<br />
 * <br />
 * cublasStatus
 * cublasGetMatrix (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 GPU memory
 * space to a matrix B in CPU 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, A 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, cols, eleSize, 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 cublasGetMatrix (int rows, int cols, int elemSize, Pointer A, int lda, Pointer B, int ldb)
{
  return checkResult(cublasGetMatrixNative(rows, cols, elemSize, A, lda, B, ldb));
}
origin: org.scalanlp/jcublas

/**
 * Wrapper for CUBLAS function.<br />
 * <br />
 * cublasStatus
 * cublasGetMatrix (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 GPU memory
 * space to a matrix B in CPU 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, A 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, cols, eleSize, 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 cublasGetMatrix (int rows, int cols, int elemSize, Pointer A, int lda, Pointer B, int ldb)
{
 return checkResult(cublasGetMatrixNative(rows, cols, elemSize, A, lda, B, ldb));
}
origin: org.nd4j/nd4j-jcublas-common

/**
 * Wrapper for CUBLAS function.<br />
 * <br />
 * cublasStatus
 * cublasGetMatrix (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 GPU memory
 * space to a matrix B in CPU 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, A 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, cols, eleSize, 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 cublasGetMatrix (int rows, int cols, int elemSize, Pointer A, int lda, Pointer B, int ldb)
{
  return checkResult(cublasGetMatrixNative(rows, cols, elemSize, A, lda, B, ldb));
}
origin: org.nd4j/jcublas-osx

/**
 * Wrapper for CUBLAS function.<br />
 * <br />
 * cublasStatus
 * cublasGetMatrix (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 GPU memory
 * space to a matrix B in CPU 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, A 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, cols, eleSize, 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 cublasGetMatrix (int rows, int cols, int elemSize, Pointer A, int lda, Pointer B, int ldb)
{
  return checkResult(cublasGetMatrixNative(rows, cols, elemSize, A, lda, B, ldb));
}
origin: org.scalanlp/jcublas

/**
 * 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 that may
 * store the complex numbers, where each pair of consecutive numbers in
 * the array describes the real- and imaginary part of one complex number.
 *
 * @see JCublas#cublasGetMatrix(int, int, int, Pointer, int, Pointer, int)
 */
public static int cublasGetMatrix (int rows, int cols, Pointer A, int lda, cuDoubleComplex B[], int offsetB, int ldb)
{
 ByteBuffer byteBufferB = ByteBuffer.allocateDirect(B.length * 8 * 2);
 byteBufferB.order(ByteOrder.nativeOrder());
 DoubleBuffer doubleBufferB = byteBufferB.asDoubleBuffer();
 int status = cublasGetMatrixNative(rows, cols, 16, A, lda, Pointer.to(doubleBufferB).withByteOffset(offsetB * 8 * 2), ldb);
 if (status == cublasStatus.CUBLAS_STATUS_SUCCESS)
 {
  doubleBufferB.rewind();
  for (int c=0; c<cols; c++)
  {
   for (int r=0; r<rows; r++)
   {
    int index = c * ldb + r + offsetB;
    B[index].x = doubleBufferB.get(index*2+0);
    B[index].y = doubleBufferB.get(index*2+1);
   }
  }
 }
 return checkResult(status);
}
origin: org.nd4j/jcublas

/**
 * 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 that may
 * store the complex numbers, where each pair of consecutive numbers in
 * the array describes the real- and imaginary part of one complex number.
 *
 * @see JCublas#cublasGetMatrix(int, int, int, Pointer, int, Pointer, int)
 */
public static int cublasGetMatrix (int rows, int cols, Pointer A, int lda, cuComplex B[], int offsetB, int ldb)
{
  ByteBuffer byteBufferB = ByteBuffer.allocateDirect(B.length * 4 * 2);
  byteBufferB.order(ByteOrder.nativeOrder());
  FloatBuffer floatBufferB = byteBufferB.asFloatBuffer();
  int status = cublasGetMatrixNative(rows, cols, 8, A, lda, Pointer.to(floatBufferB).withByteOffset(offsetB * 4 * 2), ldb);
  if (status == cublasStatus.CUBLAS_STATUS_SUCCESS)
  {
    floatBufferB.rewind();
    for (int c=0; c<cols; c++)
    {
      for (int r=0; r<rows; r++)
      {
        int index = c * ldb + r + offsetB;
        B[index].x = floatBufferB.get(index*2+0);
        B[index].y = floatBufferB.get(index*2+1);
      }
    }
  }
  return checkResult(status);
}
origin: org.nd4j/jcublas-windows64

/**
 * 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 that may
 * store 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#cublasGetMatrix(int, int, int, jcuda.Pointer, int, jcuda.Pointer, int)
 */
public static int cublasGetMatrix (int rows, int cols, Pointer A, int lda, cuDoubleComplex B[], int offsetB, int ldb)
{
  ByteBuffer byteBufferB = ByteBuffer.allocateDirect(B.length * 8 * 2);
  byteBufferB.order(ByteOrder.nativeOrder());
  DoubleBuffer doubleBufferB = byteBufferB.asDoubleBuffer();
  int status = cublasGetMatrixNative(rows, cols, 16, A, lda, Pointer.to(doubleBufferB).withByteOffset(offsetB * 8 * 2), ldb);
  if (status == cublasStatus.CUBLAS_STATUS_SUCCESS)
  {
    doubleBufferB.rewind();
    for (int c=0; c<cols; c++)
    {
      for (int r=0; r<rows; r++)
      {
        int index = c * ldb + r + offsetB;
        B[index].x = doubleBufferB.get(index*2+0);
        B[index].y = doubleBufferB.get(index*2+1);
      }
    }
  }
  return checkResult(status);
}
origin: org.nd4j/jcublas-osx

/**
 * 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 that may
 * store the complex numbers, where each pair of consecutive numbers in
 * the array describes the real- and imaginary part of one complex number.
 *
 * @see JCublas#cublasGetMatrix(int, int, int, Pointer, int, Pointer, int)
 */
public static int cublasGetMatrix (int rows, int cols, Pointer A, int lda, cuDoubleComplex B[], int offsetB, int ldb)
{
  ByteBuffer byteBufferB = ByteBuffer.allocateDirect(B.length * 8 * 2);
  byteBufferB.order(ByteOrder.nativeOrder());
  DoubleBuffer doubleBufferB = byteBufferB.asDoubleBuffer();
  int status = cublasGetMatrixNative(rows, cols, 16, A, lda, Pointer.to(doubleBufferB).withByteOffset(offsetB * 8 * 2), ldb);
  if (status == cublasStatus.CUBLAS_STATUS_SUCCESS)
  {
    doubleBufferB.rewind();
    for (int c=0; c<cols; c++)
    {
      for (int r=0; r<rows; r++)
      {
        int index = c * ldb + r + offsetB;
        B[index].x = doubleBufferB.get(index*2+0);
        B[index].y = doubleBufferB.get(index*2+1);
      }
    }
  }
  return checkResult(status);
}
origin: org.scalanlp/jcublas

/**
 * 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 that may
 * store the complex numbers, where each pair of consecutive numbers in
 * the array describes the real- and imaginary part of one complex number.
 *
 * @see JCublas#cublasGetMatrix(int, int, int, Pointer, int, Pointer, int)
 */
public static int cublasGetMatrix (int rows, int cols, Pointer A, int lda, cuComplex B[], int offsetB, int ldb)
{
 ByteBuffer byteBufferB = ByteBuffer.allocateDirect(B.length * 4 * 2);
 byteBufferB.order(ByteOrder.nativeOrder());
 FloatBuffer floatBufferB = byteBufferB.asFloatBuffer();
 int status = cublasGetMatrixNative(rows, cols, 8, A, lda, Pointer.to(floatBufferB).withByteOffset(offsetB * 4 * 2), ldb);
 if (status == cublasStatus.CUBLAS_STATUS_SUCCESS)
 {
  floatBufferB.rewind();
  for (int c=0; c<cols; c++)
  {
   for (int r=0; r<rows; r++)
   {
    int index = c * ldb + r + offsetB;
    B[index].x = floatBufferB.get(index*2+0);
    B[index].y = floatBufferB.get(index*2+1);
   }
  }
 }
 return checkResult(status);
}
origin: org.nd4j/nd4j-jcublas-common

/**
 * 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 that may
 * store the complex numbers, where each pair of consecutive numbers in
 * the array describes the real- and imaginary part of one complex number.
 *
 * @see JCublas#cublasGetMatrix(int, int, int, Pointer, int, Pointer, int)
 */
public static int cublasGetMatrix (int rows, int cols, Pointer A, int lda, cuComplex B[], int offsetB, int ldb)
{
  ByteBuffer byteBufferB = ByteBuffer.allocateDirect(B.length * 4 * 2);
  byteBufferB.order(ByteOrder.nativeOrder());
  FloatBuffer floatBufferB = byteBufferB.asFloatBuffer();
  int status = cublasGetMatrixNative(rows, cols, 8, A, lda, Pointer.to(floatBufferB).withByteOffset(offsetB * 4 * 2), ldb);
  if (status == cublasStatus.CUBLAS_STATUS_SUCCESS)
  {
    floatBufferB.rewind();
    for (int c=0; c<cols; c++)
    {
      for (int r=0; r<rows; r++)
      {
        int index = c * ldb + r + offsetB;
        B[index].x = floatBufferB.get(index*2+0);
        B[index].y = floatBufferB.get(index*2+1);
      }
    }
  }
  return checkResult(status);
}
origin: org.jcuda/jcublas

/**
 * 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 that may
 * store the complex numbers, where each pair of consecutive numbers in
 * the array describes the real- and imaginary part of one complex number.
 *
 * @see JCublas#cublasGetMatrix(int, int, int, Pointer, int, Pointer, int)
 */
public static int cublasGetMatrix (int rows, int cols, Pointer A, int lda, cuComplex B[], int offsetB, int ldb)
{
  ByteBuffer byteBufferB = ByteBuffer.allocateDirect(B.length * 4 * 2);
  byteBufferB.order(ByteOrder.nativeOrder());
  FloatBuffer floatBufferB = byteBufferB.asFloatBuffer();
  int status = cublasGetMatrixNative(rows, cols, 8, A, lda, Pointer.to(floatBufferB).withByteOffset(offsetB * 4 * 2), ldb);
  if (status == cublasStatus.CUBLAS_STATUS_SUCCESS)
  {
    floatBufferB.rewind();
    for (int c=0; c<cols; c++)
    {
      for (int r=0; r<rows; r++)
      {
        int index = c * ldb + r + offsetB;
        B[index].x = floatBufferB.get(index*2+0);
        B[index].y = floatBufferB.get(index*2+1);
      }
    }
  }
  return checkResult(status);
}
origin: org.jcuda/jcublas

/**
 * 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 that may
 * store the complex numbers, where each pair of consecutive numbers in
 * the array describes the real- and imaginary part of one complex number.
 *
 * @see JCublas#cublasGetMatrix(int, int, int, Pointer, int, Pointer, int)
 */
public static int cublasGetMatrix (int rows, int cols, Pointer A, int lda, cuDoubleComplex B[], int offsetB, int ldb)
{
  ByteBuffer byteBufferB = ByteBuffer.allocateDirect(B.length * 8 * 2);
  byteBufferB.order(ByteOrder.nativeOrder());
  DoubleBuffer doubleBufferB = byteBufferB.asDoubleBuffer();
  int status = cublasGetMatrixNative(rows, cols, 16, A, lda, Pointer.to(doubleBufferB).withByteOffset(offsetB * 8 * 2), ldb);
  if (status == cublasStatus.CUBLAS_STATUS_SUCCESS)
  {
    doubleBufferB.rewind();
    for (int c=0; c<cols; c++)
    {
      for (int r=0; r<rows; r++)
      {
        int index = c * ldb + r + offsetB;
        B[index].x = doubleBufferB.get(index*2+0);
        B[index].y = doubleBufferB.get(index*2+1);
      }
    }
  }
  return checkResult(status);
}
origin: org.nd4j/nd4j-jcublas-common

/**
 * 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 that may
 * store the complex numbers, where each pair of consecutive numbers in
 * the array describes the real- and imaginary part of one complex number.
 *
 * @see JCublas#cublasGetMatrix(int, int, int, Pointer, int, Pointer, int)
 */
public static int cublasGetMatrix (int rows, int cols, Pointer A, int lda, cuDoubleComplex B[], int offsetB, int ldb)
{
  ByteBuffer byteBufferB = ByteBuffer.allocateDirect(B.length * 8 * 2);
  byteBufferB.order(ByteOrder.nativeOrder());
  DoubleBuffer doubleBufferB = byteBufferB.asDoubleBuffer();
  int status = cublasGetMatrixNative(rows, cols, 16, A, lda, Pointer.to(doubleBufferB).withByteOffset(offsetB * 8 * 2), ldb);
  if (status == cublasStatus.CUBLAS_STATUS_SUCCESS)
  {
    doubleBufferB.rewind();
    for (int c=0; c<cols; c++)
    {
      for (int r=0; r<rows; r++)
      {
        int index = c * ldb + r + offsetB;
        B[index].x = doubleBufferB.get(index*2+0);
        B[index].y = doubleBufferB.get(index*2+1);
      }
    }
  }
  return checkResult(status);
}
origin: org.nd4j/jcublas

/**
 * 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 that may
 * store the complex numbers, where each pair of consecutive numbers in
 * the array describes the real- and imaginary part of one complex number.
 *
 * @see JCublas#cublasGetMatrix(int, int, int, Pointer, int, Pointer, int)
 */
public static int cublasGetMatrix (int rows, int cols, Pointer A, int lda, cuDoubleComplex B[], int offsetB, int ldb)
{
  ByteBuffer byteBufferB = ByteBuffer.allocateDirect(B.length * 8 * 2);
  byteBufferB.order(ByteOrder.nativeOrder());
  DoubleBuffer doubleBufferB = byteBufferB.asDoubleBuffer();
  int status = cublasGetMatrixNative(rows, cols, 16, A, lda, Pointer.to(doubleBufferB).withByteOffset(offsetB * 8 * 2), ldb);
  if (status == cublasStatus.CUBLAS_STATUS_SUCCESS)
  {
    doubleBufferB.rewind();
    for (int c=0; c<cols; c++)
    {
      for (int r=0; r<rows; r++)
      {
        int index = c * ldb + r + offsetB;
        B[index].x = doubleBufferB.get(index*2+0);
        B[index].y = doubleBufferB.get(index*2+1);
      }
    }
  }
  return checkResult(status);
}
origin: org.nd4j/jcublas-windows64

/**
 * 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 that may
 * store 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#cublasGetMatrix(int, int, int, jcuda.Pointer, int, jcuda.Pointer, int)
 */
public static int cublasGetMatrix (int rows, int cols, Pointer A, int lda, cuComplex B[], int offsetB, int ldb)
{
  ByteBuffer byteBufferB = ByteBuffer.allocateDirect(B.length * 4 * 2);
  byteBufferB.order(ByteOrder.nativeOrder());
  FloatBuffer floatBufferB = byteBufferB.asFloatBuffer();
  int status = cublasGetMatrixNative(rows, cols, 8, A, lda, Pointer.to(floatBufferB).withByteOffset(offsetB * 4 * 2), ldb);
  if (status == cublasStatus.CUBLAS_STATUS_SUCCESS)
  {
    floatBufferB.rewind();
    for (int c=0; c<cols; c++)
    {
      for (int r=0; r<rows; r++)
      {
        int index = c * ldb + r + offsetB;
        B[index].x = floatBufferB.get(index*2+0);
        B[index].y = floatBufferB.get(index*2+1);
      }
    }
  }
  return checkResult(status);
}
origin: org.nd4j/jcublas-osx

/**
 * 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 that may
 * store the complex numbers, where each pair of consecutive numbers in
 * the array describes the real- and imaginary part of one complex number.
 *
 * @see JCublas#cublasGetMatrix(int, int, int, Pointer, int, Pointer, int)
 */
public static int cublasGetMatrix (int rows, int cols, Pointer A, int lda, cuComplex B[], int offsetB, int ldb)
{
  ByteBuffer byteBufferB = ByteBuffer.allocateDirect(B.length * 4 * 2);
  byteBufferB.order(ByteOrder.nativeOrder());
  FloatBuffer floatBufferB = byteBufferB.asFloatBuffer();
  int status = cublasGetMatrixNative(rows, cols, 8, A, lda, Pointer.to(floatBufferB).withByteOffset(offsetB * 4 * 2), ldb);
  if (status == cublasStatus.CUBLAS_STATUS_SUCCESS)
  {
    floatBufferB.rewind();
    for (int c=0; c<cols; c++)
    {
      for (int r=0; r<rows; r++)
      {
        int index = c * ldb + r + offsetB;
        B[index].x = floatBufferB.get(index*2+0);
        B[index].y = floatBufferB.get(index*2+1);
      }
    }
  }
  return checkResult(status);
}
jcuda.jcublasJCublascublasGetMatrixNative

Popular methods of JCublas

  • checkResult
    If the given result is different to cublasStatus.CUBLAS_STATUS_SUCCESS and exceptions have been enab
  • checkResultBLAS
    Obtain the current CUBLAS status by calling cublasGetErrorNative, and store the result as the lastRe
  • cublasAllocNative
  • cublasCaxpyNative
  • cublasCcopyNative
  • cublasCdotcNative
  • cublasCdotuNative
  • cublasCgbmvNative
  • cublasCgemmNative
  • cublasCgemvNative
  • cublasCgercNative
  • cublasCgeruNative
  • cublasCgercNative,
  • cublasCgeruNative,
  • cublasChbmvNative,
  • cublasChemmNative,
  • cublasChemvNative,
  • cublasCher2Native,
  • cublasCher2kNative,
  • cublasCherNative,
  • cublasCherkNative,
  • cublasChpr2Native

Popular in Java

  • Making http post requests using okhttp
  • compareTo (BigDecimal)
  • putExtra (Intent)
  • getSystemService (Context)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • JComboBox (javax.swing)
  • JList (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now