Library/ManagedCuda/CudaBlas/CudaBlasHandler.cs
/// <summary>
/// This function find the least squares solution of a batch of overdetermined systems.
/// On exit, each Aarray[i] is overwritten with their QR factorization and each Carray[i] is overwritten with the least square solution
/// GelsBatched supports only the non-transpose operation and only solves overdetermined
/// systems (m >= n).<para/>
/// GelsBatched only supports compute capability 2.0 or above.<para/>
/// This function is intended to be used for matrices of small sizes where the launch
/// overhead is a significant factor.
/// </summary>
/// <param name="trans">operation op(Aarray[i]) that is non- or (conj.) transpose. Only non-transpose operation is currently supported.</param>
/// <param name="m">number of rows Aarray[i].</param>
/// <param name="n">number of columns of each Aarray[i] and rows of each Carray[i].</param>
/// <param name="nrhs">number of columns of each Carray[i].</param>
/// <param name="Aarray">array of pointers to device array, with each array of dim. m x n with lda&gt;=max(1,m). The array size determines the number of batches.</param>
/// <param name="lda">leading dimension of two-dimensional array used to store each matrix Aarray[i]</param>
/// <param name="Carray">array of pointers to device array, with each array of dim. m x n with ldc&gt;=max(1,m).</param>
/// <param name="ldc">leading dimension of two-dimensional array used to store each matrix Carray[i].</param>
/// <param name="devInfoArray">null or optional array of integers of dimension batchsize.</param>
/// <returns>0, if the parameters passed to the function are valid, &lt;0, if the parameter in postion -value is invalid</returns>
This function find the least squares solution of a batch of overdetermined systems.
On exit, each Aarray[i] is overwritten with their QR factorization and each Carray[i] is overwritten with the least square solution
GelsBatched supports only the non-transpose operation and only solves overdetermined
systems (m >= n).
GelsBatched only supports compute capability 2.0 or above.
This function is intended to be used for matrices of small sizes where the launch
overhead is a significant factor.
This function find the least squares solution of a batch of overdetermined systems . On exit each Aarray [ i ] is overwritten with their QR factorization and each Carray [ i ] is overwritten with the least square solution GelsBatched supports only the non - transpose operation and only solves overdetermined systems ( m > = n ) . GelsBatched only supports compute capability 2 . 0 or above . This function is intended to be used for matrices of small sizes where the launch overhead is a significant factor .
public int GelsBatchedZ(Operation trans, int m, int n, int nrhs, CudaDeviceVariable<CUdeviceptr> Aarray, int lda, CudaDeviceVariable<CUdeviceptr> Carray, int ldc, CudaDeviceVariable<int> devInfoArray)
		{
			int info = 0;
			CUdeviceptr _devInfoArray = devInfoArray == null ? new CUdeviceptr(0) : devInfoArray.DevicePointer;
			_status = CudaBlasNativeMethods.cublasZgelsBatched(_blasHandle, trans, m, n, nrhs, Aarray.DevicePointer, lda, Carray.DevicePointer, ldc, ref info, _devInfoArray, Aarray.Size);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cublasZgelsBatched", _status));
			if (_status != CublasStatus.Success) throw new CudaBlasException(_status);
			return info;
		}
public int GelsBatchedZ ( Operation trans , int m , int n , int nrhs , CudaDeviceVariable < CUdeviceptr > Aarray , int lda , CudaDeviceVariable < CUdeviceptr > Carray , int ldc , CudaDeviceVariable < int > devInfoArray ) { int info = 0 ; CUdeviceptr _devInfoArray = devInfoArray == null ? new CUdeviceptr ( 0 ) : devInfoArray . DevicePointer ; _status = CudaBlasNativeMethods . cublasZgelsBatched ( _blasHandle , trans , m , n , nrhs , Aarray . DevicePointer , lda , Carray . DevicePointer , ldc , ref info , _devInfoArray , Aarray . Size ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , _status ) ) ; if ( _status != CublasStatus . Success ) throw new CudaBlasException ( _status ) ; return info ; }
This function find the least squares solution of a batch of overdetermined systems.
This function find the least squares solution of a batch of overdetermined systems .
0, if the parameters passed to the function are valid, <0, if the parameter in postion -value is invalid
0 if the parameters passed to the function are valid <0 if the parameter in postion - value is invalid
trans
Operation
operation op(Aarray[i]) that is non- or (conj.) transpose. Only non-transpose operation is currently supported.
operation op ( Aarray [ i ] ) that is non - or ( conj . ) transpose . Only non - transpose operation is currently supported .
m
int
number of rows Aarray[i].
number of rows Aarray [ i ] .
n
int
number of columns of each Aarray[i] and rows of each Carray[i].
number of columns of each Aarray [ i ] and rows of each Carray [ i ] .
nrhs
int
number of columns of each Carray[i].
number of columns of each Carray [ i ] .
Aarray
CudaDeviceVariable<CUdeviceptr>
array of pointers to device array, with each array of dim. m x n with lda>=max(1,m). The array size determines the number of batches.
array of pointers to device array with each array of dim . m x n with lda > = max ( 1 m ) . The array size determines the number of batches .
lda
int
leading dimension of two-dimensional array used to store each matrix Aarray[i]
leading dimension of two - dimensional array used to store each matrix Aarray [ i ]
Carray
CudaDeviceVariable<CUdeviceptr>
array of pointers to device array, with each array of dim. m x n with ldc>=max(1,m).
array of pointers to device array with each array of dim . m x n with ldc > = max ( 1 m ) .
ldc
int
leading dimension of two-dimensional array used to store each matrix Carray[i].
leading dimension of two - dimensional array used to store each matrix Carray [ i ] .
devInfoArray
CudaDeviceVariable<int>
null or optional array of integers of dimension batchsize.
null or optional array of integers of dimension batchsize .