Source Code Docstrings

class cula.CULARTAllocation(data, pitch)

Depricated.

Custom PyCULA allocation Object for mixed kernel/runtime code. See culart_gpuarray.

cula.check_pitch(Ary_)

Checks pitch of array on device and returns pitch if pitched, and False if unpitched.

cula.culaDbdsqr(uplo, n, ncvt, nru, ncc, D, E, VT, ldvt, U, ldu, C, ldc)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDbdsqr(uplo, n, ncvt, nru, ncc, D, E, VT, ldvt, U, ldu, C, ldc)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDgebrd(m, n, a, lda, d, e, tauq, taup)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDgeev(jobvl, jobvr, n, a, lda, wr, wi, w, vl, ldvl, vr, ldvr)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDgehrd(N, ILO, IHI, A, LDA, TAU)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDgelqf(m, n, a, lda, tau)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDgels(trans, m, n, nrhs, a, lda, b, ldb)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDgeqlf(m, n, a, lda, tau)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDgeqrf(m, n, a, lda, tau)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDgeqrs(m, n, nrhs, a, lda, tau, b, ldb)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDgerqf(m, n, a, lda, tau)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDgesv(n, nrhs, a, lda, ipiv, b, ldb)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDgesvd(jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDgetrf(m, n, a, lda, ipiv)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDgetri(n, a, lda, ipiv)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDgetrs(trans, n, nrhs, a, lda, ipiv, b, ldb)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDgglse(m, n, p, A, lda, B, ldb, C, D, X)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDggrqf(m, p, n, A, lda, TAUA, B, ldb, TAUB)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDorgbr(vect, m, n, k, A, lda, TAU)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDorghr(n, ilo, ihi, A, lda, TAU)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDorglq(m, n, k, A, lda, TAU)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDorgql(m, n, k, A, lda, TAU)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDorgqr(m, n, k, A, lda, TAU)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDormlq(side, trans, m, n, k, A, lda, TAU, C, ldc)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDormql(side, trans, m, n, k, A, lda, TAU, C, ldc)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDormqr(side, trans, m, n, k, A, lda, TAU, C, ldc)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDormrq(side, trans, m, n, k, A, lda, TAU, C, ldc)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDposv(uplo, n, nrhs, A, lda, B, ldb)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDpotrf(uplo, n, A, lda)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDpotrs(uplo, n, nrhs, A, lda, B, ldb)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDsgesv(n, nrhs, a, lda, ipiv, b, ldb, X, ldx, it)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDstebz(computerange, order, n, vl, vu, il, iu, abstol, D, E, m, nsplit, W, IBLOCK, ISPLIT)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDsteqr(compz, n, D, E, Z, ldz)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDsyev(jobz, uplo, n, A, lda, W)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDsyevx(jobz, evrange, uplo, n, A, lda, vl, vu, il, iu, abstol, m, W, Z, ldz, ifail)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDsyrdb(jobz, uplo, n, kd, A, lda, D, E, TAU, Z, ldz)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDtrtri(uplo, diag, n, A, lda)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceDtrtrs(uplo, trans, diag, n, nrhs, A, lda, B, ldb)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceFree(mem)

Takes pointer to memory location of CULA GPU array, frees memory, and returns 0 is successful

cula.culaDeviceMalloc(mem, pitch, rows, cols, elesize)

Allocates memory on CULA GPU device.

Keyword arguments: mem – pointer to memory location of array pitch – pointer to pitch value of array rows – number of rows in array cols – number of columns in array elesize – bytesize of individual element of array

cula.culaDeviceSbdsqr(uplo, n, ncvt, nru, ncc, D, E, VT, ldvt, U, ldu, C, ldc)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSgebrd(m, n, a, lda, d, e, tauq, taup)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSgeev(jobvl, jobvr, n, a, lda, wr, wi, w, vl, ldvl, vr, ldvr)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSgehrd(N, ILO, IHI, A, LDA, TAU)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSgelqf(m, n, a, lda, tau)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSgels(trans, m, n, nrhs, a, lda, b, ldb)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSgeqlf(m, n, a, lda, tau)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSgeqrf(m, n, a, lda, tau)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSgeqrs(m, n, nrhs, a, lda, tau, b, ldb)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSgerqf(m, n, a, lda, tau)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSgesv(n, nrhs, a, lda, ipiv, b, ldb)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSgesvd(jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSgetrf(m, n, a, lda, ipiv)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSgetri(n, a, lda, ipiv)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSgetrs(trans, n, nrhs, a, lda, ipiv, b, ldb)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSgglse(m, n, p, A, lda, B, ldb, C, D, X)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSggrqf(m, p, n, A, lda, TAUA, B, ldb, TAUB)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSorgbr(vect, m, n, k, A, lda, TAU)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSorghr(n, ilo, ihi, A, lda, TAU)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSorglq(m, n, k, A, lda, TAU)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSorgql(m, n, k, A, lda, TAU)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSorgqr(m, n, k, A, lda, TAU)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSormlq(side, trans, m, n, k, A, lda, TAU, C, ldc)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSormql(side, trans, m, n, k, A, lda, TAU, C, ldc)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSormqr(side, trans, m, n, k, A, lda, TAU, C, ldc)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSormrq(side, trans, m, n, k, A, lda, TAU, C, ldc)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSposv(uplo, n, nrhs, A, lda, B, ldb)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSpotrf(uplo, n, A, lda)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSpotrs(uplo, n, nrhs, A, lda, B, ldb)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSstebz(computerange, order, n, vl, vu, il, iu, abstol, D, E, m, nsplit, W, IBLOCK, ISPLIT)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSsteqr(compz, n, D, E, Z, ldz)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSsyev(jobz, uplo, n, A, lda, W)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSsyevx(jobz, evrange, uplo, n, A, lda, vl, vu, il, iu, abstol, m, W, Z, ldz, ifail)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceSsyrdb(jobz, uplo, n, kd, A, lda, D, E, TAU, Z, ldz)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceStrtri(uplo, diag, n, A, lda)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDeviceStrtrs(uplo, trans, diag, n, nrhs, A, lda, B, ldb)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDgebrd(m, n, a, lda, d, e, tauq, taup)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDgeev(jobvl, jobvr, n, a, lda, wr, wi, w, vl, ldvl, vr, ldvr)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDgehrd(N, ILO, IHI, A, LDA, TAU)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDgelqf(m, n, a, lda, tau)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDgels(trans, m, n, nrhs, a, lda, b, ldb)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDgeqlf(m, n, a, lda, tau)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDgeqrf(m, n, a, lda, tau)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDgeqrs(m, n, nrhs, a, lda, tau, b, ldb)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDgerqf(m, n, a, lda, tau)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDgesv(n, nrhs, a, lda, ipiv, b, ldb)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDgesvd(jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDgetrf(m, n, a, lda, ipiv)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDgetri(n, a, lda, ipiv)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDgetrs(trans, n, nrhs, a, lda, ipiv, b, ldb)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDgglse(m, n, p, A, lda, B, ldb, C, D, X)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDggrqf(m, p, n, A, lda, TAUA, B, ldb, TAUB)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDorgbr(vect, m, n, k, A, lda, TAU)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDorghr(n, ilo, ihi, A, lda, TAU)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDorglq(m, n, k, A, lda, TAU)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDorgql(m, n, k, A, lda, TAU)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDorgqr(m, n, k, A, lda, TAU)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDormlq(side, trans, m, n, k, A, lda, TAU, C, ldc)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDormql(side, trans, m, n, k, A, lda, TAU, C, ldc)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDormqr(side, trans, m, n, k, A, lda, TAU, C, ldc)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDormrq(side, trans, m, n, k, A, lda, TAU, C, ldc)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDposv(uplo, n, nrhs, A, lda, B, ldb)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDpotrf(uplo, n, A, lda)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDpotrs(uplo, n, nrhs, A, lda, B, ldb)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDsgesv(n, nrhs, a, lda, ipiv, b, ldb, X, ldx, it)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDstebz(computerange, order, n, vl, vu, il, iu, abstol, D, E, m, nsplit, W, IBLOCK, ISPLIT)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDsteqr(compz, n, D, E, Z, ldz)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDsyev(jobz, uplo, n, A, lda, W)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDsyevx(jobz, evrange, uplo, n, A, lda, vl, vu, il, iu, abstol, m, W, Z, ldz, ifail)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDsyrdb(jobz, uplo, n, kd, A, lda, D, E, TAU, Z, ldz)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDtrtri(uplo, diag, n, A, lda)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaDtrtrs(uplo, trans, diag, n, nrhs, A, lda, B, ldb)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaFreeBuffers()

Frees internal CULA memory buffers

cula.culaGetDeviceCount()

Returns number of GPU devices recognized by CULA

cula.culaGetDeviceInfo(dev)

Takes GPU dev number, and returns device Info.

cula.culaGetErrorInfo()

Returns c_int representing a CULA error.

cula.culaGetExecutingDevice()

Returns dev number of GPU device being used by CULA

cula.culaGetLastStatus()

Returns last status of CULA GPU device (default device 0).

cula.culaGetOptimalPitch(rows, cols, elesize)

Takes integer rows,cols,elementsize and returns CULA Optimal Pitch

cula.culaGetStatusString(code)

Takes CULA error code and returns corresponding CULA string

cula.culaInitialize()

“Initialize CULA on current device (default 0) and returns 0 if successful.

cula.culaSbdsqr(uplo, n, ncvt, nru, ncc, D, E, VT, ldvt, U, ldu, C, ldc)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSelectDevice(n)

Selects CULA GPU device.

cula.culaSgebrd(m, n, a, lda, d, e, tauq, taup)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSgeev(jobvl, jobvr, n, a, lda, wr, wi, w, vl, ldvl, vr, ldvr)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSgehrd(N, ILO, IHI, A, LDA, TAU)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSgelqf(m, n, a, lda, tau)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSgels(trans, m, n, nrhs, a, lda, b, ldb)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSgeqlf(m, n, a, lda, tau)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSgeqrf(m, n, a, lda, tau)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSgeqrs(m, n, nrhs, a, lda, tau, b, ldb)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSgerqf(m, n, a, lda, tau)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSgesv(n, nrhs, a, lda, ipiv, b, ldb)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSgesvd(jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSgetrf(m, n, a, lda, ipiv)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSgetri(n, a, lda, ipiv)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSgetrs(trans, n, nrhs, a, lda, ipiv, b, ldb)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSgglse(m, n, p, A, lda, B, ldb, C, D, X)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSggrqf(m, p, n, A, lda, TAUA, B, ldb, TAUB)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaShutdown()

Shutdown CULA on current device (default 0) and returns 0 if successful.

cula.culaSorgbr(vect, m, n, k, A, lda, TAU)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSorghr(n, ilo, ihi, A, lda, TAU)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSorglq(m, n, k, A, lda, TAU)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSorgql(m, n, k, A, lda, TAU)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSorgqr(m, n, k, A, lda, TAU)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSormlq(side, trans, m, n, k, A, lda, TAU, C, ldc)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSormql(side, trans, m, n, k, A, lda, TAU, C, ldc)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSormqr(side, trans, m, n, k, A, lda, TAU, C, ldc)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSormrq(side, trans, m, n, k, A, lda, TAU, C, ldc)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSposv(uplo, n, nrhs, A, lda, B, ldb)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSpotrf(uplo, n, A, lda)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSpotrs(uplo, n, nrhs, A, lda, B, ldb)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSstebz(computerange, order, n, vl, vu, il, iu, abstol, D, E, m, nsplit, W, IBLOCK, ISPLIT)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSsteqr(compz, n, D, E, Z, ldz)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSsyev(jobz, uplo, n, A, lda, W)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSsyevx(jobz, evrange, uplo, n, A, lda, vl, vu, il, iu, abstol, m, W, Z, ldz, ifail)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaSsyrdb(jobz, uplo, n, kd, A, lda, D, E, TAU, Z, ldz)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaStrtri(uplo, diag, n, A, lda)

A ctype wrapped CULA function; Refer to CULA docs.

cula.culaStrtrs(uplo, trans, diag, n, nrhs, A, lda, B, ldb)

A ctype wrapped CULA function; Refer to CULA docs.

cula.cula_Fpitched_gpuarray_like(In)

Takes a numpy array, allocates memory and copies data, returning a cula_gpuarray in pitched column major (Fortran) storage for CULA.

cula.cula_Fpitched_ones_like(In)

Creates cula_Fpitched_gpuarray with In.shape and In.dtype, loaded with ones and padded with zeros.

cula.cula_Fpitched_zeros_like(In)

Creates cula_Fpitched_gpuarray with In.shape and In.dtype, loaded with zeros.

cula.cula_gpuarray(shape, dtype)

Takes desired shape and dtype of array, allocates on GPU using pycuda.GPUarray objects with extensions for CULA.

cula.cula_gpuarray_like(A)

Takes a numpy array, allocates memory and copies data, returning a cula_gpuarray. Non-pitched.

cula.cula_ones(shape, dtype=<type 'numpy.float32'>)

Takes tuple representing shape, and returns a cula_gpuarray filled with ones. Non-pitched.

Keyword arguments: shape – tuple representing shape of array,

eg. n for vector, or (m,n) for array

dtype – numpy dtype of array (default is numpy.float32)

cula.cula_pitch(Ary)

Takes a numpy/gpuarray and returns optimal CULA pitch.

cula.cula_zeros(shape, dtype=<type 'numpy.float32'>)

Takes tuple representing shape, and returns a cula_gpuarray filled with zeros. Non-pitched.

Keyword arguments: shape – tuple representing shape of array, eg. n for vector, or (m,n) for array dtype – numpy dtype of array (default is numpy.float32)

cula.culart_gpuarray(shape, dtype)

Depricated.

Included solely for completeness and debugging.

Takes desired shape and dtype of array, allocates on GPU using modified GPUarray, and returns CULARTAllocation object.

Use the pycuda based cula_gpuarray.

cula.fix_shape(A)

Takes shape of a 2 axis array, and returns shape in form (m,n)

cula.get_lda(Ary_)

Takes Ary_ on device, and returns leading dimension, or ldAry_ for use with CULA routines expecting pitched arrays.

cula.gpu_bdsqr(D, E, n, uplo='U')

Finds SVD of bidiagonal matrix B using the implicit zero-shift QR algorithm.

Returns numpy array of singular values.

Wraps CULA/LAPACK bdsqr routine. See CULA and LAPACK docs.

Keyword arguments: D – diagonal elements of B as numpy array E – off diagonal elements of bidiagonal matrix B as numpy array n – order of matrix B C – optionally computes Q_transposed*C, see CULA docs uplo – ‘U’ for upper bidiagonal, ‘L’ for lower (default == ‘U’)

cula.gpu_bdsqr_U(D, E, n, C, U, nru, uplo='U')

Finds SVD of bidiagonal matrix B using the implicit zero-shift QR algorithm.

Returns tuple of numpy arrays. (D, U*Q)

Wraps CULA/LAPACK bdsqr routine. See CULA and LAPACK docs.

Keyword arguments: D – diagonal elements of B as numpy array E – off diagonal elements of bidiagonal matrix B as numpy array n – order of matrix B U – matrix U as numpy array, see CULA docs nru – number of rows of U uplo – ‘U’ for upper bidiagonal, ‘L’ for lower (default == ‘U’)

cula.gpu_bdsqr_VT(D, E, n, C, VT, U, nru, uplo='U')

Finds SVD of bidiagonal matrix B using the implicit zero-shift QR algorithm.

Returns tuple of numpy arrays. (D, P^T * VT)

Wraps CULA/LAPACK bdsqr routine. See CULA and LAPACK docs.

Keyword arguments: D – diagonal elements of B as numpy array E – off diagonal elements of bidiagonal matrix B as numpy array n – order of matrix B C – optionally computes Q_transposed*C, see CULA docs VT – matrix VT as numpy array, see CULA docs uplo – ‘U’ for upper bidiagonal, ‘L’ for lower (default == ‘U’)

cula.gpu_bdsqr_VT_U(D, E, n, C, VT, U, nru, uplo='U')

Finds SVD of bidiagonal matrix B using the implicit zero-shift QR algorithm.

Returns tuple of numpy arrays. (D, P^T * VT, U*Q)

Wraps CULA/LAPACK bdsqr routine. See CULA and LAPACK docs.

Keyword arguments: D – diagonal elements of B as numpy array E – off diagonal elements of bidiagonal matrix B as numpy array n – order of matrix B C – optionally computes Q_transposed*C, see CULA docs VT – matrix VT as numpy array, see CULA docs U – matrix U as numpy array, see CULA docs nru – number of rows of U uplo – ‘U’ for upper bidiagonal, ‘L’ for lower (default == ‘U’)

cula.gpu_devbdsqr(D_, E_, n, C_, uplo='U')

Finds SVD of bidiagonal matrix B using the implicit zero-shift QR algorithm.

dev wrapper takes GPUarrays, returns numpy array of singular values.

Wraps CULA/LAPACK bdsqr routine. See CULA and LAPACK docs.

Keyword arguments: D – diagonal elements of B as GPUarray E – off diagonal elements of bidiagonal matrix B as GPUarray n – order of matrix B C – optionally computes Q_transposed*C, see CULA docs uplo – ‘U’ for upper bidiagonal, ‘L’ for lower (default == ‘U’)

cula.gpu_devbdsqr_U(D_, E_, n, C_, U_, nru, uplo='U')

Finds SVD of bidiagonal matrix B using the implicit zero-shift QR algorithm.

Returns tuple of numpy arrays. (D, U*Q)

Wraps CULA/LAPACK bdsqr routine. See CULA and LAPACK docs.

Keyword arguments: D – diagonal elements of B as GPUarray E – off diagonal elements of bidiagonal matrix B as GPUarray n – order of matrix B C – optionally computes Q_transposed*C, see CULA docs U – matrix U as GPUarray, see CULA docs nru – number of rows of U uplo – ‘U’ for upper bidiagonal, ‘L’ for lower (default == ‘U’)

cula.gpu_devbdsqr_VT(D_, E_, n, C_, VT_, nru, uplo='U')

Finds SVD of bidiagonal matrix B using the implicit zero-shift QR algorithm.

Returns tuple of numpy arrays. (D, P^T * VT)

Wraps CULA/LAPACK bdsqr routine. See CULA and LAPACK docs.

Keyword arguments: D – diagonal elements of B as GPUarray E – off diagonal elements of bidiagonal matrix B as GPUarray n – order of matrix B C – optionally computes Q_transposed*C, see CULA docs VT – matrix VT as GPUarray, see CULA docs uplo – ‘U’ for upper bidiagonal, ‘L’ for lower (default == ‘U’)

cula.gpu_devbdsqr_VT_U(D_, E_, n, C_, VT_, U_, nru, uplo='U')

Finds SVD of bidiagonal matrix B using the implicit zero-shift QR algorithm.

Returns tuple of numpy arrays. (D, P^T * VT, U*Q)

Wraps CULA/LAPACK bdsqr routine. See CULA and LAPACK docs.

Keyword arguments: D – diagonal elements of B as GPUarray E – off diagonal elements of bidiagonal matrix B as GPUarray n – order of matrix B C – optionally computes Q_transposed*C, see CULA docs VT – matrix VT as GPUarray, see CULA docs U – matrix U as GPUarray, see CULA docs nru – number of rows of U uplo – ‘U’ for upper bidiagonal, ‘L’ for lower (default == ‘U’)

cula.gpu_devdevbdsqr(D_, E_, n, C_, uplo='U')

Finds SVD of bidiagonal matrix B using the implicit zero-shift QR algorithm.

devdev wrapper takes GPUarrays, returns GPUarray of singular values.

Wraps CULA/LAPACK bdsqr routine. See CULA and LAPACK docs.

Keyword arguments: D – diagonal elements of B as GPUarray E – off diagonal elements of bidiagonal matrix B as GPUarray n – order of matrix B C – optionally computes Q_transposed*C, see CULA docs uplo – ‘U’ for upper bidiagonal, ‘L’ for lower (default == ‘U’)

cula.gpu_devdevbdsqr_U(D_, E_, n, C_, U_, nru, uplo='U')

Finds SVD of bidiagonal matrix B using the implicit zero-shift QR algorithm.

Returns tuple of numpy arrays. (D, U*Q)

Wraps CULA/LAPACK bdsqr routine. See CULA and LAPACK docs.

Keyword arguments: D – diagonal elements of B as GPUarray E – off diagonal elements of bidiagonal matrix B as GPUarray n – order of matrix B C – optionally computes Q_transposed*C, see CULA docs U – matrix U as GPUarray, see CULA docs nru – number of rows of U uplo – ‘U’ for upper bidiagonal, ‘L’ for lower (default == ‘U’)

cula.gpu_devdevbdsqr_VT(D_, E_, n, C_, VT_, nru, uplo='U')

Finds SVD of bidiagonal matrix B using the implicit zero-shift QR algorithm.

Returns tuple of GPUarrays. (D, P^T * VT)

Wraps CULA/LAPACK bdsqr routine. See CULA and LAPACK docs.

Keyword arguments: D – diagonal elements of B as GPUarray E – off diagonal elements of bidiagonal matrix B as GPUarray n – order of matrix B C – optionally computes Q_transposed*C, see CULA docs VT – matrix VT as GPUarray, see CULA docs uplo – ‘U’ for upper bidiagonal, ‘L’ for lower (default == ‘U’)

cula.gpu_devdevbdsqr_VT_U(D_, E_, n, C_, VT_, U_, nru, uplo='U')

Finds SVD of bidiagonal matrix B using the implicit zero-shift QR algorithm.

Returns tuple of GPUarrays. (D, P^T * VT, U*Q)

Wraps CULA/LAPACK bdsqr routine. See CULA and LAPACK docs.

Keyword arguments: D – diagonal elements of B as GPUarray E – off diagonal elements of bidiagonal matrix B as GPUarray n – order of matrix B C – optionally computes Q_transposed*C, see CULA docs VT – matrix VT as GPUarray, see CULA docs U – matrix U as GPUarray, see CULA docs nru – number of rows of U uplo – ‘U’ for upper bidiagonal, ‘L’ for lower (default == ‘U’)

cula.gpu_devdeveigenvalues(A_gpu, left_vectors=False, right_vectors=False)

Takes general matrix A as GPUarray and returns eigenvalues of A as GPUarray.

Optionally, finds left or right eigenvectors.

Keyword arguments: left_vectors – find left eigenvectors (default == False) right_vectors – find right eigenvectors (default == False)

Refer to CULA docs regarding geev.

cula.gpu_devdevgebrd(A_gpu)

Takes a general real matrix A as GPUarray and reduces to upper or lower bidiagonal form, returning GPUarray.

Refer to CULA docs regarding gebrd.

cula.gpu_devdevgeev(A_gpu, left_vectors=False, right_vectors=False)

Takes general matrix A as GPUarray and returns eigenvalues of A as GPUarray.

Optionally, finds left or right eigenvectors.

Keyword arguments: left_vectors – find left eigenvectors (default == False) right_vectors – find right eigenvectors (default == False)

Refer to CULA docs regarding geev.

cula.gpu_devdevgehrd(A_gpu, ilo_in=False, ihi_in=False)

Takes general matrix A as GPUarray and reduces to upper Hessenberg form H, returning GPUarray.

Keyword arguments: ilo_in – if not already upper triangular, ilo ihi_in – if not already upper triangular, ihi

Refer to CULA docs regarding gehrd for specific application if ilo and ihi if neccessary.

cula.gpu_devdevgelqf(A_gpu)

Takes general matrix A as GPUarray and returns LQ factorization as GPUarrays.

Refer to CULA docs regarding gelqf for specific application.

cula.gpu_devdevgels(A_gpu, B_gpu, trans='N')

Takes matrices A, B as GPUarrays and solves under/over-determined real linear systems returning GPUarray.

Keyword arguments: A – input matrix A B – input solution matrix B trans – transpose, ‘T’ for transpose, default is ‘N’

Refer to CULA docs regard gels for specific application.

cula.gpu_devdevgeqlf(A_gpu)

Takes GPUarray A and returns QL factorization as GPUarray.

Refer to CULA docs regarding geqlf for specific application.

cula.gpu_devdevgeqrf(A_gpu)

Takes matrix A as GPUArray and returns QR factorization as GPUarrays.

Refer to CULA docs regarding geqrf for specific application.

cula.gpu_devdevgeqrs(A_gpu, B_gpu)

Takes general matrix A, B and solvesn least squares problem min||A*X-B||.

Keyword arguments: A – input matrix A as numpy.array B – input matrix B as numpy.array

Refer to CULA docs regarding geqrs for specific application.

cula.gpu_devdevgerqf(A_gpu)

Takes matrix A as GPUarray and returns RQ factorization as GPUarrays.

Refer to CULA docs regarding gerqf for specific application.

cula.gpu_devdevgesv(A_gpu, B_gpu)

Takes GPUarrays A, B and solves system A*X=B, returning tuple of GPUarrays (LUfactors,Pivots,X).

Refer to CULA docs regarding gesv for specific application.

cula.gpu_devdevgesvd(A, left_vectors=False, right_vectors=False)

See gpu_devdevsvd.

cula.gpu_devdevgetrf(A_gpu)

Takes a general matrix A as GPUarray, computes LU factorization and returns GPUarray.

Refer to CULA docs regarding getrf for specific application.

cula.gpu_devdevgetri(A_gpu)

Takes general matrix A as GPUarray and returns the inverse and pivot matrix as GPUarray using LU factorization.

Refer to CULA docs regarding getri for specific application and alternative routine recomendations.

cula.gpu_devdevgetrs(A_gpu, B_gpu, trans='N')

Takes GPUarray A and B from system A*X=B and solves using LU factorization.

Returns a tuple of (factors, Pivot matrix, Solution matrix X) as GPUarrays

Keyword arguments: A – input matrix A representing left hand side of system A*X=B B – input matrix B representing right hand side of system A*X=B trans – default == ‘N’; ‘T’ for transpose; ‘C’ for conjugate transpose

Refer to CULA docs regarding getrs for specific application.

cula.gpu_devdevgglse(A_, B_, C_, D_)

Solves linear equality constrained least squares system:

minimize ||c-A*X||^2 subject to system B*X=D

given conditions for A an m by n matrix:

Rank(B)<=Rank(A)<=m+Rank(B)

Which imply existence and uniqueness to RQ factorization given by:

B = (0 R)*Q, A = Z*T*Q.

Keyword arguments: A – input array A as GPUarray B – input array B as GPUarray C – input array C as GPUarray D – input array D as GPUarray

Returns tuple (T, R, C, X) as np.arrays

T – output array as GPUarray contains the upper trapazoidal matrix T R – output array as GPUarray contains the upper triangular matrix R C – output array as GPUarray contains the residual sum of squares of input vector C X – output array as GPUarray is the solution matrix X

Refer to CULA docs regarding gglse for specific application. ...or LAPACK for more information regarding the algortithm

cula.gpu_devdevggrqf(A_, B_, m=False, p=False)

Computes a generalized RQ factorization for input matrices A, B given as GPUarrays.

Keyword arguments: A – input m x n matrix as GPUarray B – input p x n matrix as GPUarray

Returns a tuple (A,TAUA,B,TAUB): A – output contains upper triangular matrix R as GPUarray TAUA – output contains scalar factors of elementary reflectors of Q, as GPUarray B – output contains upper trapazoidal matrix T as GPUarray TAUB – output contains scalar factors of elementary reflectors of Z, AS GPUarray

Refer to CULA docs regarding ggrqf for specific applications.

cula.gpu_devdevorgbr(A_, vect, m, k)

Computes an orthogonal/unitary matrix Q or P^T.

Keyword arguments: A_ – input vectors returned by GEBRD as GPUarray vect – specifies required matrix

‘Q’ generate Q ‘P’ generate P^T

m – number of rows to be returned k – number or rows/columns in the original matrix when vect==’Q’/’P’ respectively

Returns: the matrix Q or P^T as GPUarray

See CULA docs regarding orgbr for specific application.

cula.gpu_devdevorghr(A_, ilo, ihi, TAU_)

Computes a orthogoanl/unitary matrix Q following a call to GEHRD.

Keyword arguments: A_ – vectors which define the elementary reflectors, returned by GEHRD, as GPUarray ilo – ilo from call to GEHRD ihi – ihi from call to GEHRD TAU_ – respective scalar factors of elementary reflectors as returned by GEHRD, as GPUarray

Returns unitary matrix Q as GPUarray

See CULA docs regarding orghr for specific application.

cula.gpu_devdevorglq(A_, m, TAU_)

Computes a real matrix Q with orthonormal rows following a call to GELQF.

Keyword arguments: A_ – input martix, as returned by GELQF, as GPUarray m – number of rows of Q TAU_ – scalar factors of elementary reflectors returned by GELQF, as GPUarray

Returns matrix Q_ as GPUarray

See CULA docs regarding orglq for specific application.

cula.gpu_devdevorgql(A_, m, TAU_)

Computes a real/complex matrix Q with orthonormal columns following a call to GELQF.

Keyword arguments: A_ – input martix, as returned by GELQF, as GPUarray m – number of rows of Q TAU_ – scalar factors of elementary reflectors returned by GELQF, as GPUarray

Returns matrix Q_ as GPUarray

See CULA docs regarding orgql for specific application.

cula.gpu_devdevorgqr(A_, m, TAU_)

Computes a real/complex matrix Q with orthonormal columns following a call to GEQRF.

Keyword arguments: A_ – input martix, as returned by GEQRF, as GPUarray m – number of rows of Q TAU_ – scalar factors of elementary reflectors returned by GEQRF, as GPUarray

Returns matrix Q_ as GPUarray

See CULA docs regarding orgqr for specific application.

cula.gpu_devdevormlq(side, A_, TAU_, C_, trans='N')

Computes an orthogonal/unitary matrix from a general matrix returned by GELQF.

Keyword arguments: side – which side to apply transformation; ‘L’ left; ‘R’ right A_ – input matrix as returned by GELQF, as GPUarray TAU_ – TAU matrix as returned by GELQF, as GPUarray C_ – input matrix C, as GPUarray trans – transpose (default ==’N’)

‘N’ for no transpose ‘T’ for transpose
Returns: matrix as GPUarray
SIDE = ‘L’ SIDE = ‘R’

TRANS = ‘N’ Q*C C*Q TRANS = ‘T’ QT * C C * QT

See CULA docs regarding ormlq for specific application.

cula.gpu_devdevormql(side, A_, TAU_, C_, trans='N')

Computes an orthogonal/unitary matrix from a general matrix returned by GELQF.

Keyword arguments: side – which side to apply transformation; ‘L’ left; ‘R’ right A_ – input matrix as returned by GELQF, as GPUarray TAU_ – TAU matrix as returned by GELQF, as GPUarray C_ – input matrix C, as GPUarray trans – transpose (default ==’N’)

‘N’ for no transpose, apply Q ‘C’ for transpose, apply Q**H
Returns: matrix as GPUarray
SIDE = ‘L’ SIDE = ‘R’

TRANS = ‘N’ Q*C C*Q TRANS = ‘C’ Q**H*C C * Q**H

See CULA docs regarding ormql for specific application.

cula.gpu_devdevormqr(side, A_, TAU_, C_, trans='N')

Computes an orthogonal/unitary matrix from a general matrix returned by GEQRF.

Keyword arguments: side – which side to apply transformation; ‘L’ left; ‘R’ right A_ – input matrix as returned by GEQRF, as GPUarray TAU_ – TAU matrix as returned by GEQRF, as GPUarray C_ – input matrix C, as GPUarray trans – transpose (default ==’N’)

‘N’ for no transpose, apply Q ‘T’ for transpose, apply Q^T
Returns: matrix as GPUarray
SIDE = ‘L’ SIDE = ‘R’

TRANS = ‘N’ Q*C C*Q TRANS = ‘T’ Q^T * C C * Q^T

See CULA docs regarding ormqr for specific application.

cula.gpu_devdevormrq(side, A_, TAU_, C_, trans='N')

Computes an orthogonal/unitary matrix from a general matrix returned by GEQRF.

Keyword arguments: side – which side to apply transformation; ‘L’ left; ‘R’ right A_ – input matrix as returned by GEQRF, as GPUarray TAU_ – TAU matrix as returned by GEQRF, as GPUarray C_ – input matrix C, as GPUarray trans – transpose (default ==’N’)

‘N’ for no transpose, apply Q ‘T’ for transpose, apply Q^T
Returns: matrix as GPUarray
SIDE = ‘L’ SIDE = ‘R’

TRANS = ‘N’ Q*C C*Q TRANS = ‘T’ Q^T * C C * Q^T

See CULA docs regarding ormrq for specific application.

cula.gpu_devdevposv(A_, B_, uplo='U')

Computes solution to system of linear equations A*X=B where A is symmetric positive definite.

Keyword arguments: A – input matrix A, symmetric postive definite, as GPUarray B – input matrix B, right hand side of system, as GPUarray uplo – refers to whether A is upper or lower half; default ==’U’ for Upper; use ‘L’ for Lower

Returns tuple (A,X): A – output matrix U or L from Cholesky factorization as GPUarray X – solution matrix X as GPUarray

Note: B may contain multiple solution matrices, giving it shape of n by nrhs where A is n by n.
In this case X will be n by nrhs, yielding respective solutions to input B.

Refer to CULA docs regarding posv for specific application.

cula.gpu_devdevpotrf(A_, uplo='U')

Takes real symmetric positive definite matrix A as GPUarray, and returns Cholesky factorization as GPUarray.

Keyword arguments: A – input matrix A, symmetric positive definite, as GPUarray uplo – refers to whether upper or lower half of A contains data.

default == ‘U’ for upper; use ‘L’ for lower

Refer to CULA docs regarding potrf for specific application.

cula.gpu_devdevpotrs(A_, B_, uplo='U')

Computes solution to system A*X=B, where A is symmetric positive definite.

Keyword arguments: A – input matrix A, symmetric positive definite, as GPUarray B – input matrix B, solution matrix to the system of equations, as GPUarray uplo – refers to whether upper or lower half of A contains data.

default == ‘U’ for upper; use ‘L’ for lower

Returns tuple (A,X): A – output matrix U or L from Cholesky factorization as GPUarray X – solution matrix X as GPUarray

Note: B may contain multiple solution matrices,
giving it shape of n by nrhs where A is n by n. In this case X will be n by nrhs, yielding respective solutions to input B.

Refer to CULA docs regarding potrs for specific application.

cula.gpu_devdevsgesv(A_, X_, B_)

Takes GPUarrays A, X, B and solves system A*X=B, using iteratively refined method.

Keyword argurements: A_ – input matrix A, GPUarray, np.float64 X_ – input matrix X, GPUarray, np.float64 B_ – input matrix B, GPUarray, np.float64

Returns tuple of four GPUarrays and an int (LUfactors,Pivots, B, X, it).

Refer to CULA docs regarding sgesv for specific application.

cula.gpu_devdevsteqr(D_, E_, Z_, compz='N')

Computes eigenvalues (optionally eigenvectors) of a symmetric tridiagonal matrix A using implicit QL or QR method.

Keyword arguments: D – diagonal elements of A as GPUarray E – subdiagonal elements of A as GPUarray Z – used in conjuction with compz, see compz compz – job descriptor, takes ‘N’,’I’,’V’,

‘N’ – default, only compute eigenvalues,
Z not referenced
‘V’ – compute eigenvalues and eigenvectors when A is a symmetric/Hermetian matrix,
Z is unitary matrix used to reduce A to tridiagonal form, as GPUarray
‘I’ – compute eigenvalues and eigenvectors of a tridiagonal matrix A,
Z is identity matrix as GPUarray
Returns eigenvalues as GPUarray if compz==’N’,
else returns tuple (eigenvalues, eigenvectors) as GPUarray

Refer to CULA docs regarding steqr for specific application.

cula.gpu_devdevsvd(A_gpu, left_vectors=False, right_vectors=False)

Takes GPUarray A and computes the SVD, returns Singular Values (optionally left/right vectors) as GPUarray.

Keyword arguments: A – input matrix left_vectors – default == False; computes left singular vectors right_vectors – default == False; computes right singular vectors

Refer to CULA docs regarding gesvd for specific application.

cula.gpu_devdevsyev(A_, vectors=False, uplo='U')

Takes symetric matrix as GPUarray and returns eigenvalues (optionally eigenvectors) as GPUarray.

Keyword arguments: A – input matrix as GPUarray, symmetric vectors – default == False; use ‘True’ to compute vectors. uplo – Defines whether input array has data in Upper or Lower half using ‘U’ or ‘L’ respectively

default==’U’
Note: When vectors==False, gpu_syev returns only the eigenvalues.
When vectors==True, gpu_syev returns tuple (eigenvalues,eigenvectors)
cula.gpu_devdevsyevx_all(A_, abstol=0, vectors=False, uplo='U')

Find all eigenvalues of symmetric matrix using iterative numerical method.

Keyword arguments: A – input matrix, symmetric, as GPUarray abstol – the tolerance of the eigenvalues, default==0

Note: for accuracy, set to twice the underflow threshhold.

vectors – default==False; use ‘True’ to compute and return tuple of (eigenvalues, eigenvectors) uplo – which half of matrix A contains data, default==’U’

Returns: vectors==False – eigenvalues as GPUarray vectors==True – tuple of (eigenvalues, eigenvectors) as GPUarrays

Refer to CULA docs regarding syevx for specific usage.

cula.gpu_devdevsyevx_index(A_, il=1, iu=1, abstol=0, vectors=False, uplo='U')

Find eigenvalues with specified indices of a symmetric matrix using iterative numerical method.

Keyword arguments: A – input matrix, symmetric, as GPUarray il – lower index of desired eigenavlues; default=1 iu – upper index of desired eigenvalues; default=1 abstol – the tolerance of the eigenvalues, default==0

Note: for accuracy, set to twice the underflow threshhold.

vectors – default==False; use ‘True’ to compute and return tuple of (eigenvalues, eigenvectors) uplo – which half of matrix A contains data, default==’U’

Returns: vectors==False – eigenvalues as GPUarray vectors==True – tuple of (eigenvalues, eigenvectors) as GPUarrays

Refer to CULA docs regarding syevx for specific usage.

cula.gpu_devdevsyevx_range(A_, vl=-1, vu=1, abstol=0, vectors=False, uplo='U')

Find eigenvalues in specified Range of symmetric matrix using iterative numerical method.

Keyword arguments: A – input matrix, symmetric, as GPUarray vl – lower range of desired eigenavlues; default=-1 vu – upper range of desired eigenvalues; default=1 abstol – the tolerance of the eigenvalues, default==0

Note: for accuracy, set to twice the underflow threshhold.

vectors – default==False; use ‘True’ to compute and return tuple of (eigenvalues, eigenvectors) uplo – which half of matrix A contains data, default==’U’

Returns: vectors==False – eigenvalues as GPUarray vectors==True – tuple of (eigenvalues, eigenvectors) as GPUarrays

Refer to CULA docs regarding syevx for specific usage.

cula.gpu_devdevsyrdb(jobz, A_, kd, Z_=False, uplo='U')

Takes symmetric/hermetian matrix A and reduces to a symmetric tridiagonal form.

Keyword arguments: jobz – specifies computation and output

‘N’ – forms symmetrix tridiagonal matrix T,
outputs banded matrix B and info needed to construct QsubB
‘V’ – forms symmetric tridiagonal matrix T,
outputs Q
‘U’ – forms the symmetric tridiagonal matrix T,
outputs banded matrix B, info needed to construct QsubB as A, and overwrites Z with Z*Q

A_ – input matrix, symmetric/Hermitian, as GPUarray kd – bandwidth of output matrix B Z_ – optional matrix as GPUarray, default==’False’;

Z is used with jobz==’U’, and outputs Z*Q

uplo – which half of input A_ contains data; default==’U’ for Upper; use ‘L’ for Lower

Returns: jobz==’U’ – Returns tuple (diagonal elements, offdiagonal elements, A, (Z*Q) ) as GPUarray jobz==’N’ – Returns tuple (diagonal elements, offdiagonal elements, B ) as GPUarray Jobz==’V’ – Returns tuple (diagonal elements, offdiagonal elements, Q ) as GPUarray

See CULA docs regarding syrdb for specific application.

cula.gpu_devdevtrtri(diag, A_, uplo='U')

Computes the invervse of a triangular matrix A given as GPUarray.

Keyword arguments: diag – ‘N’ for A non-unit triangular

‘U’ for A unit triangular

A – triangular input matrix as GPUarray uplo – which half of A contains data;

‘U’ upper (default) ‘L’ lower

Returns: inverse of A as GPUarray

Refer to CULA docs regarding trtri for specific application.

cula.gpu_devdevtrtrs(diag, A_, B_, uplo='U', trans='N')

Computes soltution to system A*X=B where A is triangular.

Keyword arguments: diag – ‘N’ for A non-unit triangular

‘U’ for A unit triangular

A – input triangular matrix as GPUarray B – right hand side matrix(s) B as GPUarray uplo – which half of A contains data;

‘U’ upper (default) ‘L’ lower
trans – specifies whether A is transposed
‘N’ = A is not transposed ‘T’ = A is transposed ‘C’ = A is conjugate transpose

Returns solution matrix X as GPUarray.

Note: May be used to solve multiple systems by inputing B where each column of B represents the righthand side of a system.

See CULA docs regarding trtrs for specific application.

cula.gpu_deveigenvalues(A_gpu, left_vectors=False, right_vectors=False)

Takes general matrix A as GPUarray and returns eigenvalues of A as numpy.array.

Optionally, finds left or right eigenvectors.

Keyword arguments: left_vectors – find left eigenvectors (default == False) right_vectors – find right eigenvectors (default == False)

Refer to CULA docs regarding geev.

cula.gpu_devgebrd(A_gpu)

Takes a general real matrix A as GPUarray and reduces to upper or lower bidiagonal form, returning numpy.array.

Refer to CULA docs regarding gebrd.

cula.gpu_devgeev(A_gpu, left_vectors=False, right_vectors=False)

Takes general matrix A as GPUarray and returns eigenvalues of A as numpy.array.

Optionally, finds left or right eigenvectors.

Keyword arguments: left_vectors – find left eigenvectors (default == False) right_vectors – find right eigenvectors (default == False)

Refer to CULA docs regarding geev.

cula.gpu_devgehrd(A_gpu, ilo_in=False, ihi_in=False)

Takes general matrix A as GPUarray and reduces to upper Hessenberg form H, returning numpy.array.

Keyword arguments: ilo_in – if not already upper triangular, ilo ihi_in – if not already upper triangular, ihi

Refer to CULA docs regarding gehrd for specific application if ilo and ihi if neccessary.

cula.gpu_devgelqf(A_gpu)

Takes general matrix A as GPUarray and returns LQ factorization as numpy.arrays.

Refer to CULA docs regarding gelqf for specific application.

cula.gpu_devgels(A_gpu, B_gpu, trans='N')

Takes matrices A, B as GPUarrays and solves under/over-determined real linear systems returning numpy.array.

Keyword arguments: A – input matrix A B – input solution matrix B trans – transpose, ‘T’ for transpose, default is ‘N’

Refer to CULA docs regard gels for specific application.

cula.gpu_devgeqlf(A_gpu)

Takes GPUarray A and returns QL factorization as numpy.array.

Refer to CULA docs regarding geqlf for specific application.

cula.gpu_devgeqrf(A_gpu)

Takes matrix A as GPUarray and returns QR factorization as numpy.arrays.

Refer to CULA docs regarding geqrf for specific application.

cula.gpu_devgeqrs(A_gpu, B_gpu)

Takes general matrix A, B and solvesn least squares problem min||A*X-B||.

Keyword arguments: A – input matrix A as numpy.array B – input matrix B as numpy.array

Refer to CULA docs regarding geqrs for specific application.

cula.gpu_devgerqf(A_gpu)

Takes matrix A as GPUarray and returns RQ factorization as numpy.arrays.

Refer to CULA docs regarding gerqf for specific application.

cula.gpu_devgesv(A_gpu, B_gpu)

Takes GPUarrays A, B and solves system A*X=B, returning tuple of np.arrays (LUfactors,Pivots,X).

Refer to CULA docs regarding gesv for specific application.

cula.gpu_devgesvd(A, left_vectors=False, right_vectors=False)

See gpu_devsvd.

cula.gpu_devgetrf(A_gpu)

Takes a general matrix A as GPUarray computes, LU factorization and returns np.array.

Refer to CULA docs regarding getrf for specific application.

cula.gpu_devgetri(A_gpu)

Takes general matrix A as GPUarray and returns the inverse and pivot matrix as np.array using LU factorization.

Refer to CULA docs regarding getri for specific application and alternative routine recomendations.

cula.gpu_devgetrs(A_gpu, B_gpu, trans='N')

Takes GPUarrays A and B from system A*X=B and solves using LU factorization.

Returns a tuple of (factors, Pivot matrix, Solution matrix X) as np.arrays

Keyword arguments: A – input matrix A representing left hand side of system A*X=B B – input matrix B representing right hand side of system A*X=B trans – default == ‘N’; ‘T’ for transpose; ‘C’ for conjugate transpose

Refer to CULA docs regarding getrs for specific application.

cula.gpu_devgglse(A_, B_, C_, D_)

Solves linear equality constrained least squares system:

minimize ||c-A*X||^2 subject to system B*X=D

given conditions for A an m by n matrix:

Rank(B)<=Rank(A)<=m+Rank(B)

Which imply existence and uniqueness to RQ factorization given by:

B = (0 R)*Q, A = Z*T*Q.

Keyword arguments: A – input array A as GPUarray B – input array B as GPUarray C – input array C as GPUarray D – input array D as GPUarray

Returns tuple (T, R, C, X) as np.arrays

T – output array as np.array contains the upper trapazoidal matrix T R – output array as np.array contains the upper triangular matrix R C – output array as np.array contains the residual sum of squares of input vector C X – output array as np.array is the solution matrix X

Refer to CULA docs regarding gglse for specific application. ...or LAPACK for more information regarding the algortithm

cula.gpu_devggrqf(A_, B_, m=False, p=False)

Computes a generalized RQ factorization for input matrices A, B given as GPUarrays.

Keyword arguments: A – input m x n matrix as GPUarray B – input p x n matrix as GPUarray

Returns a tuple (A,TAUA,B,TAUB): A – output contains upper triangular matrix R as np.array TAUA – output contains scalar factors of elementary reflectors of Q, as np.array B – output contains upper trapazoidal matrix T as np.array TAUB – output contains scalar factors of elementary reflectors of Z, as np.array

Refer to CULA docs regarding ggrqf for specific applications.

cula.gpu_devorgbr(A_, vect, m, k)

Computes an orthogonal/unitary matrix Q or P^T.

Keyword arguments: A_ – input vectors returned by GEBRD as GPUarray vect – specifies required matrix

‘Q’ generate Q ‘P’ generate P^T

m – number of rows to be returned k – number or rows/columns in the original matrix when vect==’Q’/’P’ respectively

Returns: the matrix Q or P^T as np.array

See CULA docs regarding orgbr for specific application.

cula.gpu_devorghr(A_, ilo, ihi, TAU_)

Computes a orthogoanl/unitary matrix Q following a call to GEHRD.

Keyword arguments: A_ – vectors which define the elementary reflectors, returned by GEHRD, as GPUarray ilo – ilo from call to GEHRD ihi – ihi from call to GEHRD TAU_ – respective scalar factors of elementary reflectors as returned by GEHRD, as GPUarray

Returns unitary matrix Q as np.array

See CULA docs regarding orghr for specific application.

cula.gpu_devorglq(A_, m, TAU_)

Computes a real matrix Q with orthonormal rows following a call to GELQF.

Keyword arguments: A_ – input martix, as returned by GELQF, as GPUarray m – number of rows of Q TAU_ – scalar factors of elementary reflectors returned by GELQF, as GPUarray

Returns matrix Q as np.array

See CULA docs regarding orglq for specific application.

cula.gpu_devorgql(A_, m, TAU_)

Computes a real/complex matrix Q with orthonormal columns following a call to GELQF.

Keyword arguments: A_ – input martix, as returned by GELQF, as GPUarray m – number of rows of Q TAU_ – scalar factors of elementary reflectors returned by GELQF, as GPUarray

Returns matrix Q as np.array

See CULA docs regarding orgql for specific application.

cula.gpu_devorgqr(A_, m, TAU_)

Computes a real/complex matrix Q with orthonormal columns following a call to GEQRF.

Keyword arguments: A_ – input martix, as returned by GEQRF, as GPUarray m – number of rows of Q TAU_ – scalar factors of elementary reflectors returned by GEQRF, as GPUarray

Returns matrix Q as np.array

See CULA docs regarding orgqr for specific application.

cula.gpu_devormlq(side, A_, TAU_, C_, trans='N')

Computes an orthogonal/unitary matrix from a general matrix returned by GELQF.

Keyword arguments: side – which side to apply transformation; ‘L’ left; ‘R’ right A_ – input matrix as returned by GELQF, as GPUarray TAU_ – TAU matrix as returned by GELQF, as GPUarray C_ – input matrix C, as GPUarray trans – transpose (default ==’N’)

‘N’ for no transpose ‘T’ for transpose
Returns: matrix as np.array
SIDE = ‘L’ SIDE = ‘R’

TRANS = ‘N’ Q*C C*Q TRANS = ‘T’ QT * C C * QT

See CULA docs regarding ormlq for specific application.

cula.gpu_devormql(side, A_, TAU_, C_, trans='N')

Computes an orthogonal/unitary matrix from a general matrix returned by GELQF.

Keyword arguments: side – which side to apply transformation; ‘L’ left; ‘R’ right A_ – input matrix as returned by GELQF, as GPUarray TAU_ – TAU matrix as returned by GELQF, as GPUarray C_ – input matrix C, as GPUarray trans – transpose (default ==’N’)

‘N’ for no transpose, apply Q ‘C’ for transpose, apply Q**H
Returns: matrix as np.array
SIDE = ‘L’ SIDE = ‘R’

TRANS = ‘N’ Q*C C*Q TRANS = ‘C’ Q**H*C C * Q**H

See CULA docs regarding ormql for specific application.

cula.gpu_devormqr(side, A_, TAU_, C_, trans='N')

Computes an orthogonal/unitary matrix from a general matrix returned by GEQRF.

Keyword arguments: side – which side to apply transformation; ‘L’ left; ‘R’ right A_ – input matrix as returned by GEQRF, as GPUarray TAU_ – TAU matrix as returned by GEQRF, as GPUarray C_ – input matrix C, as GPUarray trans – transpose (default ==’N’)

‘N’ for no transpose, apply Q ‘T’ for transpose, apply Q^T
Returns: matrix as np.array
SIDE = ‘L’ SIDE = ‘R’

TRANS = ‘N’ Q*C C*Q TRANS = ‘T’ Q^T * C C * Q^T

See CULA docs regarding ormqr for specific application.

cula.gpu_devormrq(side, A_, TAU_, C_, trans='N')

Computes an orthogonal/unitary matrix from a general matrix returned by GEQRF.

Keyword arguments: side – which side to apply transformation; ‘L’ left; ‘R’ right A_ – input matrix as returned by GEQRF, as GPUarray TAU_ – TAU matrix as returned by GEQRF, as GPUarray C_ – input matrix C, as GPUarray trans – transpose (default ==’N’)

‘N’ for no transpose, apply Q ‘T’ for transpose, apply Q^T
Returns: matrix as np.array
SIDE = ‘L’ SIDE = ‘R’

TRANS = ‘N’ Q*C C*Q TRANS = ‘T’ Q^T * C C * Q^T

See CULA docs regarding ormrq for specific application.

cula.gpu_devposv(A_, B_, uplo='U')

Computes solution to system of linear equations A*X=B where A is symmetric positive definite.

Keyword arguments: A – input matrix A, symmetric postive definite, as GPUarray B – input matrix B, right hand side of system, as GPUarray uplo – refers to whether A is upper or lower half; default ==’U’ for Upper; use ‘L’ for Lower

Returns tuple (A,X): A – output matrix U or L from Cholesky factorization as np.array X – solution matrix X as np.array

Note: B may contain multiple solution matrices, giving it shape of n by nrhs where A is n by n.
In this case X will be n by nrhs, yielding respective solutions to input B.

Refer to CULA docs regarding posv for specific application.

cula.gpu_devpotrf(A_, uplo='U')

Takes real symmetric positive definite matrix A as GPUarray, and returns Cholesky factorization as np.array.

Keyword arguments: A – input matrix A, symmetric positive definite, as GPUarray uplo – refers to whether upper or lower half of A contains data.

default == ‘U’ for upper; use ‘L’ for lower

Refer to CULA docs regarding potrf for specific application.

cula.gpu_devpotrs(A_, B_, uplo='U')

Computes solution to system A*X=B, where A is symmetric positive definite.

Keyword arguments: A – input matrix A, symmetric positive definite, as GPUarray B – input matrix B, solution matrix to the system of equations, as GPUarray uplo – refers to whether upper or lower half of A contains data.

default == ‘U’ for upper; use ‘L’ for lower

Returns tuple (A,X): A – output matrix U or L from Cholesky factorization as np.array X – solution matrix X as GPUarray

Note: B may contain multiple solution matrices,
giving it shape of n by nrhs where A is n by n. In this case X will be n by nrhs, yielding respective solutions to input B.

Refer to CULA docs regarding potrs for specific application.

cula.gpu_devsgesv(A_, X_, B_)

Takes GPUarrays A, X, B and solves system A*X=B, using iteratively refined method.

Keyword argurements: A_ – input matrix A, GPUarray, np.float64 X_ – input matrix X, GPUarray, np.float64 B_ – input matrix B, GPUarray, np.float64

Returns tuple of four np.arrays and an int (LUfactors,Pivots, B, X, it).

Refer to CULA docs regarding sgesv for specific application.

cula.gpu_devsteqr(D_, E_, Z_, compz='N')

Computes eigenvalues (optionally eigenvectors) of a symmetric tridiagonal matrix A using implicit QL or QR method.

Keyword arguments: D – diagonal elements of A as GPUarray E – subdiagonal elements of A as GPUarray Z – used in conjuction with compz, see compz compz – job descriptor, takes ‘N’,’I’,’V’,

‘N’ – default, only compute eigenvalues,
Z not referenced
‘V’ – compute eigenvalues and eigenvectors when A is a symmetric/Hermetian matrix,
Z is unitary matrix used to reduce A to tridiagonal form, as GPUarray
‘I’ – compute eigenvalues and eigenvectors of a tridiagonal matrix A,
Z is identity matrix as GPUarray
Returns eigenvalues as np.array if compz==’N’,
else returns tuple (eigenvalues, eigenvectors) as np.array

Refer to CULA docs regarding steqr for specific application.

cula.gpu_devsvd(A_gpu, left_vectors=False, right_vectors=False)

Takes GPUarray A and computes the SVD, returns Singular Values (optionally left/right vectors) as np.arrays.

Keyword arguments: A – input matrix left_vectors – default == False; computes left singular vectors right_vectors – default == False; computes right singular vectors

Refer to CULA docs regarding gesvd for specific application.

cula.gpu_devsyev(A_, vectors=False, uplo='U')

Takes symetric matrix as GPUarray and returns eigenvalues (optionally eigenvectors) as np.array.

Keyword arguments: A – input matrix as GPUarray, symmetric vectors – default == False; use ‘True’ to compute vectors. uplo – Defines whether input array has data in Upper or Lower half using ‘U’ or ‘L’ respectively

default==’U’
Note: When vectors==False, gpu_syev returns only the eigenvalues.
When vectors==True, gpu_syev returns tuple (eigenvalues,eigenvectors)
cula.gpu_devsyevx_all(A_, abstol=0, vectors=False, uplo='U')

Find all eigenvalues of symmetric matrix using iterative numerical method.

Keyword arguments: A – input matrix, symmetric, as GPUarray abstol – the tolerance of the eigenvalues, default==0

Note: for accuracy, set to twice the underflow threshhold.

vectors – default==False; use ‘True’ to compute and return tuple of (eigenvalues, eigenvectors) uplo – which half of matrix A contains data, default==’U’

Returns: vectors==False – eigenvalues as np.array vectors==True – tuple of (eigenvalues, eigenvectors) as np.arrays

Refer to CULA docs regarding syevx for specific usage.

cula.gpu_devsyevx_index(A_, il=1, iu=1, abstol=0, vectors=False, uplo='U')

Find eigenvalues with specified indices of a symmetric matrix using iterative numerical method.

Keyword arguments: A – input matrix, symmetric, as GPUarray il – lower index of desired eigenavlues; default=1 iu – upper index of desired eigenvalues; default=1 abstol – the tolerance of the eigenvalues, default==0

Note: for accuracy, set to twice the underflow threshhold.

vectors – default==False; use ‘True’ to compute and return tuple of (eigenvalues, eigenvectors) uplo – which half of matrix A contains data, default==’U’

Returns: vectors==False – eigenvalues as np.array vectors==True – tuple of (eigenvalues, eigenvectors) as np.arrays

Refer to CULA docs regarding syevx for specific usage.

cula.gpu_devsyevx_range(A_, vl=-1, vu=1, abstol=0, vectors=False, uplo='U')

Find eigenvalues in specified Range of symmetric matrix using iterative numerical method.

Keyword arguments: A – input matrix, symmetric, as GPUarray vl – lower range of desired eigenavlues; default=-1 vu – upper range of desired eigenvalues; default=1 abstol – the tolerance of the eigenvalues, default==0

Note: for accuracy, set to twice the underflow threshhold.

vectors – default==False; use ‘True’ to compute and return tuple of (eigenvalues, eigenvectors) uplo – which half of matrix A contains data, default==’U’

Returns: vectors==False – eigenvalues as np.array vectors==True – tuple of (eigenvalues, eigenvectors) as np.arrays

Refer to CULA docs regarding syevx for specific usage.

cula.gpu_devsyrdb(jobz, A_, kd, Z_=False, uplo='U')

Takes symmetric/hermetian matrix A and reduces to a symmetric tridiagonal form.

Keyword arguments: jobz – specifies computation and output

‘N’ – forms symmetrix tridiagonal matrix T,
outputs banded matrix B and info needed to construct QsubB
‘V’ – forms symmetric tridiagonal matrix T,
outputs Q
‘U’ – forms the symmetric tridiagonal matrix T,
outputs banded matrix B, info needed to construct QsubB as A, and overwrites Z with Z*Q

A_ – input matrix, symmetric/Hermitian, as GPUarray kd – bandwidth of output matrix B Z_ – optional matrix as GPUarray, default==’False’;

Z is used with jobz==’U’, and outputs Z*Q

uplo – which half of input A_ contains data; default==’U’ for Upper; use ‘L’ for Lower

Returns: jobz==’U’ – Returns tuple (diagonal elements, offdiagonal elements, A, (Z*Q) ) as np.array jobz==’N’ – Returns tuple (diagonal elements, offdiagonal elements, B ) as np.array Jobz==’V’ – Returns tuple (diagonal elements, offdiagonal elements, Q ) as np.array

See CULA docs regarding syrdb for specific application.

cula.gpu_devtrtri(diag, A_, uplo='U')

Computes the invervse of a triangular matrix A given as GPUarray.

Keyword arguments: diag – ‘N’ for A non-unit triangular

‘U’ for A unit triangular

A – triangular input matrix as GPUarray uplo – which half of A contains data;

‘U’ upper (default) ‘L’ lower

Returns: inverse of A as np.array

Refer to CULA docs regarding trtri for specific application.

cula.gpu_devtrtrs(diag, A_, B_, uplo='U', trans='N')

Computes soltution to system A*X=B where A is triangular.

Keyword arguments: diag – ‘N’ for A non-unit triangular

‘U’ for A unit triangular

A – input triangular matrix as GPUarray B – right hand side matrix(s) B as GPUarray uplo – which half of A contains data;

‘U’ upper (default) ‘L’ lower
trans – specifies whether A is transposed
‘N’ = A is not transposed ‘T’ = A is transposed ‘C’ = A is conjugate transpose

Returns solution matrix X as np.array.

Note: May be used to solve multiple systems by inputing B where each column of B represents the righthand side of a system.

See CULA docs regarding trtrs for specific application.

cula.gpu_eigenvalues(A, left_vectors=False, right_vectors=False)

Takes general matrix A as numpy.array and returns eigenvalues of A as numpy.array.

Optionally, finds left or right eigenvectors.

Keyword arguments: left_vectors – find left eigenvectors (default == False) right_vectors – find right eigenvectors (default == False)

Refer to CULA docs regarding geev.

cula.gpu_gebrd(A)

Takes a general real matrix A as numpy.array and reduces to upper or lower bidiagonal form, returning numpy.array.

Refer to CULA docs regarding gebrd.

cula.gpu_geev(A, left_vectors=False, right_vectors=False)

Takes general matrix A as numpy.array and returns eigenvalues of A as numpy.array.

Optionally, finds left or right eigenvectors.

Keyword arguments: left_vectors – find left eigenvectors (default == False) right_vectors – find right eigenvectors (default == False)

Refer to CULA docs regarding geev.

cula.gpu_gehrd(A, ilo_in=False, ihi_in=False)

Takes general matrix A as numpy.array and reduces to upper Hessenberg form H, returning numpy.array.

Keyword arguments: ilo_in – if not already upper triangular, ilo ihi_in – if not already upper triangular, ihi

Refer to CULA docs regarding gehrd for specific application if ilo and ihi if neccessary.

cula.gpu_gelqf(A)

Takes general matrix A as numpy.array and returns LQ factorization as numpy.arrays.

Refer to CULA docs regarding gelqf for specific application.

cula.gpu_gels(A, B, trans='N')

Takes matrices A, B as numpy.arrays and solves under/over-determined real linear systems returning numpy.array.

Keyword arguments: A – input matrix A B – input solution matrix B trans – transpose, ‘T’ for transpose, default is ‘N’

Refer to CULA docs regard gels for specific application.

cula.gpu_geqlf(A)

Takes numpy.array A and returns QL factorization as numpy.array.

Refer to CULA docs regarding geqlf for specific application.

cula.gpu_geqrf(A)

Takes matrix A as numpy.array and returns QR factorization as numpy.arrays.

Refer to CULA docs regarding geqrf for specific application.

cula.gpu_geqrs(A, B)

Takes general matrix A, B and solvesn least squares problem min||A*X-B||.

Keyword arguments: A – input matrix A as numpy.array B – input matrix B as numpy.array

Refer to CULA docs regarding geqrs for specific application.

cula.gpu_gerqf(A)

Takes matrix A as numpy.array and returns RQ factorization as numpy.arrays.

Refer to CULA docs regarding gerqf for specific application.

cula.gpu_gesv(A, B)

Takes numpy.arrays A, B and solves system A*X=B, returning tuple of np.arrays (LUfactors,Pivots,X).

Refer to CULA docs regarding gesv for specific application.

cula.gpu_gesvd(A, left_vectors=False, right_vectors=False)

See gpu_svd.

cula.gpu_getrf(A)

Takes a general matrix A as np.array computes, LU factorization and returns np.array.

Refer to CULA docs regarding getrf for specific application.

cula.gpu_getri(A)

Takes general matrix A as np.array and returns the inverse and pivot matrix as np.array using LU factorization.

Refer to CULA docs regarding getri for specific application and alternative routine recomendations.

cula.gpu_getrs(A, B, trans='N')

Takes np.arrays A and B from system A*X=B and solves using LU factorization.

Returns a tuple of (factors, Pivot matrix, Solution matrix X) as np.arrays

Keyword arguments: A – input matrix A representing left hand side of system A*X=B B – input matrix B representing right hand side of system A*X=B trans – default == ‘N’; ‘T’ for transpose; ‘C’ for conjugate transpose

Refer to CULA docs regarding getrs for specific application.

cula.gpu_gglse(A, B, C, D)

Solves linear equality constrained least squares system:

minimize ||c-A*X||^2 subject to system B*X=D

given conditions for A an m by n matrix:

Rank(B)<=Rank(A)<=m+Rank(B)

Which imply existence and uniqueness to RQ factorization given by:

B = (0 R)*Q, A = Z*T*Q.

Keyword arguments: A – input array A as np.array B – input array B as np.array C – input array C as np.array D – input array D as np.array

Returns tuple (T, R, C, X) as np.arrays

T – output array as np.array contains the upper trapazoidal matrix T R – output array as np.array contains the upper triangular matrix R C – output array as np.array contains the residual sum of squares of input vector C X – output array as np.array is the solution matrix X

Refer to CULA docs regarding gglse for specific application. ...or LAPACK for more information regarding the algortithm

cula.gpu_ggrqf(A, B)

Computes a generalized RQ factorization for input matrices A, B given as np.arrays.

Keyword arguments: A – input m x n matrix as np.array B – input p x n matrix as np.array

Returns a tuple (A,TAUA,B,TAUB): A – output contains upper triangular matrix R as np.array TAUA – output contains scalar factors of elementary reflectors of Q, as np.array B – output contains upper trapazoidal matrix T as np.array TAUB – output contains scalar factors of elementary reflectors of Z, as np.array

Refer to CULA docs regarding ggrqf for specific applications.

cula.gpu_orgbr(A, vect, m, k)

Computes an orthogonal/unitary matrix Q or P^T.

Keyword arguments: A – input vectors returned by GEBRD as np.array vect – specifies required matrix

‘Q’ generate Q ‘P’ generate P^T

m – number of rows to be returned k – number or rows/columns in the original matrix when vect==’Q’/’P’ respectively

Returns: the matrix Q or P^T as np.array

See CULA docs regarding orgbr for specific application.

cula.gpu_orghr(A, ilo, ihi, TAU)

Computes a orthogoanl/unitary matrix Q following a call to GEHRD.

Keyword arguments: A – vectors which define the elementary reflectors, returned by GEHRD, as np.array ilo – ilo from call to GEHRD ihi – ihi from call to GEHRD TAU – respective scalar factors of elementary reflectors as returned by GEHRD, as np.array

Returns unitary matrix Q as np.array

See CULA docs regarding orghr for specific application.

cula.gpu_orglq(A, m, TAU)

Computes a real matrix Q with orthonormal rows following a call to GELQF.

Keyword arguments: A – input martix, as returned by GELQF, as np.array m – number of rows of Q TAU – scalar factors of elementary reflectors returned by GELQF, as np.array

Returns matrix Q as np.array

See CULA docs regarding orglq for specific application.

cula.gpu_orgql(A, m, TAU)

Computes a real/complex matrix Q with orthonormal columns following a call to GELQF.

Keyword arguments: A – input martix, as returned by GELQF, as np.array m – number of rows of Q TAU – scalar factors of elementary reflectors returned by GELQF, as np.array

Returns matrix Q as np.array

See CULA docs regarding orgql for specific application.

cula.gpu_orgqr(A, m, TAU)

Computes a real/complex matrix Q with orthonormal columns following a call to GEQRF.

Keyword arguments: A – input martix, as returned by GEQRF, as np.array m – number of rows of Q TAU – scalar factors of elementary reflectors returned by GEQRF, as np.array

Returns matrix Q as np.array

See CULA docs regarding orgqr for specific application.

cula.gpu_ormlq(side, A, TAU, C, trans='N')

Computes an orthogonal/unitary matrix from a general matrix returned by GELQF.

Keyword arguments: side – which side to apply transformation; ‘L’ left; ‘R’ right A – input matrix as returned by GELQF, as np.array TAU – TAU matrix as returned by GELQF, as np.array C – input matrix C, as np.array trans – transpose (default ==’N’)

‘N’ for no transpose ‘T’ for transpose
Returns: matrix as np.array
SIDE = ‘L’ SIDE = ‘R’

TRANS = ‘N’ Q*C C*Q TRANS = ‘T’ QT * C C * QT

See CULA docs regarding ormlq for specific application.

cula.gpu_ormql(side, A, TAU, C, trans='N')

Computes an orthogonal/unitary matrix from a general matrix returned by GELQF.

Keyword arguments: side – which side to apply transformation; ‘L’ left; ‘R’ right A – input matrix as returned by GELQF, as np.array TAU – TAU matrix as returned by GELQF, as np.array C – input matrix C, as np.array trans – transpose (default ==’N’)

‘N’ for no transpose, apply Q ‘C’ for transpose, apply Q**H
Returns: matrix as np.array
SIDE = ‘L’ SIDE = ‘R’

TRANS = ‘N’ Q*C C*Q TRANS = ‘C’ Q**H*C C * Q**H

See CULA docs regarding ormql for specific application.

cula.gpu_ormqr(side, A, TAU, C, trans='N')

Computes an orthogonal/unitary matrix from a general matrix returned by GEQRF.

Keyword arguments: side – which side to apply transformation; ‘L’ left; ‘R’ right A – input matrix as returned by GEQRF, as np.array TAU – TAU matrix as returned by GEQRF, as np.array C – input matrix C, as np.array trans – transpose (default ==’N’)

‘N’ for no transpose, apply Q ‘T’ for transpose, apply Q^T
Returns: matrix as np.array
SIDE = ‘L’ SIDE = ‘R’

TRANS = ‘N’ Q*C C*Q TRANS = ‘T’ Q^T * C C * Q^T

See CULA docs regarding ormqr for specific application.

cula.gpu_ormrq(side, A, TAU, C, trans='N')

Computes an orthogonal/unitary matrix from a general matrix returned by GEQRF.

Keyword arguments: side – which side to apply transformation; ‘L’ left; ‘R’ right A – input matrix as returned by GEQRF, as np.array TAU – TAU matrix as returned by GEQRF, as np.array C – input matrix C, as np.array trans – transpose (default ==’N’)

‘N’ for no transpose, apply Q ‘T’ for transpose, apply Q^T
Returns: matrix as np.array
SIDE = ‘L’ SIDE = ‘R’

TRANS = ‘N’ Q*C C*Q TRANS = ‘T’ Q^T * C C * Q^T

See CULA docs regarding ormrq for specific application.

cula.gpu_posv(A, B, uplo='U')

Computes solution to system of linear equations A*X=B where A is symmetric positive definite.

Keyword arguments: A – input matrix A, symmetric postive definite, as np.array B – input matrix B, right hand side of system, as np.array uplo – refers to whether A is upper or lower half; default ==’U’ for Upper; use ‘L’ for Lower

Returns tuple (A,X): A – output matrix U or L from Cholesky factorization as np.array X – solution matrix X as np.array

Note: B may contain multiple solution matrices, giving it shape of n by nrhs where A is n by n.
In this case X will be n by nrhs, yielding respective solutions to input B.

Refer to CULA docs regarding posv for specific application.

cula.gpu_potrf(A, uplo='U')

Takes real symmetric positive definite matrix A as np.array, and returns Cholesky factorization as np.array.

Keyword arguments: A – input matrix A, symmetric positive definite, as np.array uplo – refers to whether upper or lower half of A contains data.

default == ‘U’ for upper; use ‘L’ for lower

Refer to CULA docs regarding potrf for specific application.

cula.gpu_potrs(A, B, uplo='U')

Computes solution to system A*X=B, where A is symmetric positive definite.

Keyword arguments: A – input matrix A, symmetric positive definite, as np.array B – input matrix B, solution matrix to the system of equations, as np.array uplo – refers to whether upper or lower half of A contains data.

default == ‘U’ for upper; use ‘L’ for lower

Returns tuple (A,X): A – output matrix U or L from Cholesky factorization as np.array X – solution matrix X as np.array

Note: B may contain multiple solution matrices,
giving it shape of n by nrhs where A is n by n. In this case X will be n by nrhs, yielding respective solutions to input B.

Refer to CULA docs regarding potrs for specific application.

cula.gpu_sgesv(A, X, B)

Takes numpy.arrays A, X, B and solves system A*X=B, using iteratively refined method.

Keyword argurements: A – input matrix A, np.array, np.float64 X – input matrix X, np.array, np.float64 B – input matrix B, np.array, np.float64

Returns tuple of four np.arrays and an int (LUfactors,Pivots, B, X, it).

Refer to CULA docs regarding sgesv for specific application.

cula.gpu_stebz_all(D, E, abstol=0)

Computes all the eigenvalues of a symmetric tridiagonal matrix T.

Keyword arguments: D – diagonal elements of T as np.array E – off diagonal elements of T as np.array abstol – absolute tolerance for the eigenvalues; default == 0

Returns Eigenvalues as np.array

Refer to CULA docs regarding stebz for specific application.

cula.gpu_stebz_all_block(D, E, abstol)

Computes all the eigenvalues of a symmetric tridiagonal matrix T using block method.

Keyword arguments: D – diagonal elements of T as np.array E – off diagonal elements of T as np.array abstol – absolute tolerance for the eigenvalues; default == 0

Returns Eigenvalues as np.array

Refer to CULA docs regarding stebz for specific application.

cula.gpu_stebz_index(il, iu, D, E, abstol)

Computes the eigenvalues given specified indices of a symmetric tridiagonal matrix T.

Keyword arguments: il – lower index iu – upper index D – diagonal elements of T as np.array E – off diagonal elements of T as np.array abstol – absolute tolerance for the eigenvalues; default == 0

Returns Eigenvalues as np.array

Refer to CULA docs regarding stebz for specific application.

cula.gpu_stebz_index_block(il, iu, D, E, abstol)

Computes the eigenvalues given specified indices of a symmetric tridiagonal matrix T using block method.

Keyword arguments: il – lower index iu – upper index D – diagonal elements of T as np.array E – off diagonal elements of T as np.array abstol – absolute tolerance for the eigenvalues; default == 0

Returns Eigenvalues as np.array

Refer to CULA docs regarding stebz for specific application.

cula.gpu_stebz_range(vl, vu, D, E, abstol)

Computes the eigenvalues in specified range of a symmetric tridiagonal matrix T.

Keyword arguments: vl – lower value of range vu – upper value of range D – diagonal elements of T as np.array E – off diagonal elements of T as np.array abstol – absolute tolerance for the eigenvalues; default == 0

Returns Eigenvalues as np.array

Refer to CULA docs regarding stebz for specific application.

cula.gpu_stebz_range_block(vl, vu, D, E, abstol)

Computes the eigenvalues in specified range of a symmetric tridiagonal matrix T using block method.

Keyword arguments: vl – lower value of range vu – upper value of range D – diagonal elements of T as np.array E – off diagonal elements of T as np.array abstol – absolute tolerance for the eigenvalues; default == 0

Returns Eigenvalues as np.array

Refer to CULA docs regarding stebz for specific application.

cula.gpu_steqr(D, E, Z=array([ 1.], dtype=float32), compz='N')

Computes eigenvalues (optionally eigenvectors) of a symmetric tridiagonal matrix A using implicit QL or QR method.

Keyword arguments: D – diagonal elements of A as np.array E – subdiagonal elements of A as np.array Z – used in conjuction with compz, see compz compz – job descriptor, takes ‘N’,’I’,’V’,

‘N’ – default, only compute eigenvalues,
Z not referenced
‘V’ – compute eigenvalues and eigenvectors when A is a symmetric/Hermetian matrix,
Z is unitary matrix used to reduce A to tridiagonal form, as np.array
‘I’ – compute eigenvalues and eigenvectors of a tridiagonal matrix A,
Z is identity matrix as np.array
Returns eigenvalues as np.array if compz==’N’,
else returns tuple (eigenvalues, eigenvectors) as np.array

Refer to CULA docs regarding steqr for specific application.

cula.gpu_svd(A, left_vectors=False, right_vectors=False)

Takes numpy.array A and computes the SVD, returns Singular Values (optionally left/right vectors) as np.arrays.

Keyword arguments: A – input matrix left_vectors – default == False; computes left singular vectors right_vectors – default == False; computes right singular vectors

Refer to CULA docs regarding gesvd for specific application.

cula.gpu_syev(A, vectors=False, uplo='U')

Takes symetric matrix as np.array and returns eigenvalues (optionally eigenvectors) as np.array.

Keyword arguments: A – input matrix as np.array, symmetric vectors – default == False; use ‘True’ to compute vectors. uplo – Defines whether input array has data in Upper or Lower half using ‘U’ or ‘L’ respectively

default==’U’
Note: When vectors==False, gpu_syev returns only the eigenvalues.
When vectors==True, gpu_syev returns tuple (eigenvalues,eigenvectors)
cula.gpu_syevx_all(A, abstol=0, vectors=False, uplo='U')

Find all eigenvalues of symmetric matrix using iterative numerical method.

Keyword arguments: A – input matrix, symmetric, as np.array abstol – the tolerance of the eigenvalues, default==0

Note: for accuracy, set to twice the underflow threshhold.

vectors – default==False; use ‘True’ to compute and return tuple of (eigenvalues, eigenvectors) uplo – which half of matrix A contains data, default==’U’

Returns: vectors==False – eigenvalues as np.array vectors==True – tuple of (eigenvalues, eigenvectors) as np.arrays

Refer to CULA docs regarding syevx for specific usage.

cula.gpu_syevx_index(A, il=1, iu=1, abstol=0, vectors=False, uplo='U')

Find eigenvalues with specified indices of a symmetric matrix using iterative numerical method.

Keyword arguments: A – input matrix, symmetric, as np.array il – lower index of desired eigenavlues; default=1 iu – upper index of desired eigenvalues; default=1 abstol – the tolerance of the eigenvalues, default==0

Note: for accuracy, set to twice the underflow threshhold.

vectors – default==False; use ‘True’ to compute and return tuple of (eigenvalues, eigenvectors) uplo – which half of matrix A contains data, default==’U’

Returns: vectors==False – eigenvalues as np.array vectors==True – tuple of (eigenvalues, eigenvectors) as np.arrays

Refer to CULA docs regarding syevx for specific usage.

cula.gpu_syevx_range(A, vl=-1, vu=1, abstol=0, vectors=False, uplo='U')

Find eigenvalues in specified Range of symmetric matrix using iterative numerical method.

Keyword arguments: A – input matrix, symmetric, as np.array vl – lower range of desired eigenavlues; default=-1 vu – upper range of desired eigenvalues; default=1 abstol – the tolerance of the eigenvalues, default==0

Note: for accuracy, set to twice the underflow threshhold.

vectors – default==False; use ‘True’ to compute and return tuple of (eigenvalues, eigenvectors) uplo – which half of matrix A contains data, default==’U’

Returns: vectors==False – eigenvalues as np.array vectors==True – tuple of (eigenvalues, eigenvectors) as np.arrays

Refer to CULA docs regarding syevx for specific usage.

cula.gpu_syrdb(jobz, A, kd, Z=False, uplo='U')

Takes symmetric/hermetian matrix A and reduces to a symmetric tridiagonal form.

Keyword arguments: jobz – specifies computation and output

‘N’ – forms symmetrix tridiagonal matrix T,
outputs banded matrix B and info needed to construct QsubB
‘V’ – forms symmetric tridiagonal matrix T,
outputs Q
‘U’ – forms the symmetric tridiagonal matrix T,
outputs banded matrix B, info needed to construct QsubB as A, and overwrites Z with Z*Q

A – input matrix, symmetric/Hermitian, as np.array kd – bandwidth of output matrix B Z – optional matrix as np.array, default==’False’;

Z is used with jobz==’U’, and outputs Z*Q

uplo – which half of input A contains data; default==’U’ for Upper; use ‘L’ for Lower

Returns: jobz==’U’ – Returns tuple (diagonal elements, offdiagonal elements, A, (Z*Q) ) as np.array jobz==’N’ – Returns tuple (diagonal elements, offdiagonal elements, B ) as np.array Jobz==’V’ – Returns tuple (diagonal elements, offdiagonal elements, Q ) as np.array

See CULA docs regarding syrdb for specific application.

cula.gpu_trtri(diag, A, uplo='U')

Computes the invervse of a triangular matrix A given as np.array.

Keyword arguments: diag – ‘N’ for A non-unit triangular

‘U’ for A unit triangular

A – triangular input matrix as np.array uplo – which half of A contains data;

‘U’ upper (default) ‘L’ lower

Returns: inverse of A as np.array

Refer to CULA docs regarding trtri for specific application.

cula.gpu_trtrs(diag, A, B, uplo='U', trans='N')

Computes soltution to system A*X=B where A is triangular.

Keyword arguments: diag – ‘N’ for A non-unit triangular

‘U’ for A unit triangular

A – input triangular matrix as np.array B – right hand side matrix(s) B as np.array uplo – which half of A contains data;

‘U’ upper (default) ‘L’ lower
trans – specifies whether A is transposed
‘N’ = A is not transposed ‘T’ = A is transposed ‘C’ = A is conjugate transpose

Returns solution matrix X as np.array.

Note: May be used to solve multiple systems by inputing B where each column of B represents the righthand side of a system.

See CULA docs regarding trtrs for specific application.

cula.trans_sq_naive(Ary)

Takes a square GPUarray on device and transposes in place using a naive elementwise kernel.

cula.transpose(A_gpu)

Takes square GPUarray on device and transposes in place, returning GPUarray on device.

my_init.cula_init_check_on_Dev()

Checks whether CULA is initialized on devive number ‘dev’, and if not, initializes

my_init.mixed_init()

Inits driver and runtime libs for transperant mixed mode cuda enviornment.

my_init.pycuda_init()

Initializes PyCUDA and handles context.

my_init.pycuda_init_once()

Checks if PyCUDA is initiliazed, and initilizes if needed.

Previous topic

Mixing PyCULA - Expert

This Page