Do more. Code less. Free software for GPU computing.
<scroll to top>

dla.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------//
00002 //   Copyright (c) AccelerEyes LLC. All rights reserved.                 //
00003 //   See http://www.accelereyes.com/eula for details.                    //
00004 //   This software is distributed WITHOUT ANY WARRANTY; without even     //
00005 //   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR //
00006 //   PURPOSE.  See the above copyright notices for more information.     //
00007 //-----------------------------------------------------------------------//
00008 #ifndef __AF_DLA_H
00009 #define __AF_DLA_H
00010 
00011 #include <cuComplex.h>
00012 #include "defines.h"
00013 namespace af {
00014 
00015 class array;
00016 
00019 
00025 AFAPI array lu(const array& in);
00026 
00033 AFAPI void lu(array& lower, array& upper, const array& in);
00034 
00042 AFAPI void lu(array& lower, array& upper, array& pivot, const array& in);
00043 
00049 AFAPI array qr(const array& in);
00050 
00057 AFAPI void qr(array& q, array& r, const array& in);
00058 
00066 AFAPI void qr(array& q, array& r, array& tau, const array& in);
00067 
00078 AFAPI array cholesky(unsigned& info, const array& X, bool is_upper=true);
00079 
00087 AFAPI array hessenberg(const array& in);
00088 
00100 AFAPI void hessenberg(array& h, array& q, const array& in);
00101 
00111 AFAPI array eigen(const array& in, bool is_diag=false);
00112 
00122 AFAPI void eigen(array& values, array& vectors, const array& in);
00123 
00133 AFAPI array svd(const array& in, bool is_diag=false);
00134 
00143 AFAPI void svd(array& s, array& u, array& v, const array& in);
00144 
00145 // factor_mat
00147 
00148 
00149 
00150 
00153 
00162 AFAPI array inv(const array& in);
00163 
00173 AFAPI array pinv(const array& in);
00174 
00184 AFAPI array mpow(const array& base, double exponent);
00185 
00197 AFAPI unsigned rank(const array& in, double tolerance=1e-5);
00198 
00208 template<typename T> T det(const array& in);
00209 
00210 // matops_mat
00212 
00213 
00214 
00217 typedef enum {
00218     af_solve_none = 0,
00219     af_solve_posdef = 1, 
00220     af_solve_nonposdef = 2, 
00221     af_solve_gaussian = 3, 
00222     af_solve_pseudo = 4, 
00223     af_solve_ctrans = 256, 
00224     af_solve_trans = 512, 
00225     af_solve_uppertri = 1024, 
00226     af_solve_lowertri = 2048, 
00227 } afSolve;
00228 
00241 AFAPI array solve(const array& A, const array& B, afSolve options=af_solve_none);
00242 
00243 // linsolve_mat
00245 } // namespace af
00246 
00247 
00248 #ifdef __cplusplus
00249 extern "C" {
00250 #endif
00251 
00269 
00270 AFAPI afError af_lu_S(int *d_piv, float *d_U,
00271                       float *d_L,
00272                       unsigned m, unsigned n, unsigned batch);
00274 AFAPI afError af_lu_C(int *d_piv, cuComplex *d_U,
00275                       cuComplex *d_L,
00276                       unsigned m, unsigned n, unsigned batch);
00278 AFAPI afError af_lu_D(int *d_piv, double *d_U,
00279                       double *d_L,
00280                       unsigned m, unsigned n, unsigned batch);
00282 AFAPI afError af_lu_Z(int *d_piv, cuDoubleComplex *d_U,
00283                       cuDoubleComplex *d_L,
00284                       unsigned m, unsigned n, unsigned batch);
00287 
00309 
00310 
00311 AFAPI afError af_qr_S(float *d_tau, float *d_R,
00312                       float *d_Q,
00313                       unsigned m, unsigned n, unsigned k,
00314                       unsigned batch);
00316 AFAPI afError af_qr_C(cuComplex *d_tau, cuComplex *d_R,
00317                       cuComplex *d_Q,
00318                       unsigned m, unsigned n, unsigned k,
00319                       unsigned batch);
00321 AFAPI afError af_qr_D(double *d_tau, double *d_R,
00322                       double *d_Q,
00323                       unsigned m, unsigned n, unsigned k,
00324                       unsigned batch);
00326 AFAPI afError af_qr_Z(cuDoubleComplex *d_tau, cuDoubleComplex *d_R,
00327                       cuDoubleComplex *d_Q,
00328                       unsigned m, unsigned n, unsigned k,
00329                       unsigned batch);
00332 
00349 
00350 AFAPI afError af_cholesky_S(float *d_R, unsigned *info,
00351                             unsigned n, const float *d_A,
00352                             bool is_upper, unsigned batch);
00354 AFAPI afError af_cholesky_C(cuComplex *d_R, unsigned *info,
00355                             unsigned n, const cuComplex *d_A,
00356                             bool is_upper, unsigned batch);
00358 AFAPI afError af_cholesky_D(double *d_R, unsigned *info,
00359                             unsigned n, const double *d_A,
00360                             bool is_upper, unsigned batch);
00362 AFAPI afError af_cholesky_Z(cuDoubleComplex *d_R, unsigned *info,
00363                             unsigned n, const cuDoubleComplex *d_A,
00364                             bool is_upper, unsigned batch);
00367 
00379 
00380 
00381 AFAPI afError af_hessenberg_S(float *d_H, float *d_Q,
00382                               unsigned n, const float *d_A,
00383                               unsigned batch);
00386 AFAPI afError af_hessenberg_C(cuComplex *d_H, cuComplex *d_Q,
00387                               unsigned n, const cuComplex *d_A,
00388                               unsigned batch);
00391 AFAPI afError af_hessenberg_D(double *d_H, double *d_Q,
00392                               unsigned n, const double *d_A,
00393                               unsigned batch);
00396 AFAPI afError af_hessenberg_Z(cuDoubleComplex *d_H, cuDoubleComplex *d_Q,
00397                               unsigned n, const cuDoubleComplex *d_A,
00398                               unsigned batch);
00401 
00435 
00436 
00437 AFAPI afError af_eigen_S(void **d_Val, void **d_Vec, bool *is_imag,
00438                             unsigned n, const float *d_A,
00439                             bool is_diag, unsigned batch);
00442 AFAPI afError af_eigen_D(void **d_Val, void **d_Vec, bool *is_imag,
00443                             unsigned n, const double *d_A,
00444                             bool is_diag, unsigned batch);
00447 AFAPI afError af_eigen_C(void **d_Val, cuComplex *d_Vec, bool *is_imag,
00448                             unsigned n, const cuComplex *d_A,
00449                             bool is_diag, unsigned batch);
00452 AFAPI afError af_eigen_Z(void **d_Val, cuDoubleComplex *d_Vec, bool *is_imag,
00453                             unsigned n, const cuDoubleComplex *d_A,
00454                             bool is_diag, unsigned batch);
00457 
00480 
00481 
00482 AFAPI afError af_svd_S(float *d_S, float *d_U, float *d_V,
00483                             char jobU, char jobV,
00484                             unsigned m, unsigned n, const float *d_A,
00485                             unsigned m_, unsigned n_,
00486                             bool is_diag, unsigned batch);
00489 AFAPI afError af_svd_C(float *d_S,
00490                             cuComplex *d_U, cuComplex *d_V,
00491                             char jobU, char jobV,
00492                             unsigned m, unsigned n,
00493                             const cuComplex *d_A,
00494                             unsigned m_, unsigned n_,
00495                             bool is_diag, unsigned batch);
00498 AFAPI afError af_svd_D(double *d_S, double *d_U, double *d_V,
00499                             char jobU, char jobV,
00500                             unsigned m, unsigned n, const double *d_A,
00501                             unsigned m_, unsigned n_,
00502                             bool is_diag, unsigned batch);
00505 AFAPI afError af_svd_Z(double *d_S,
00506                             cuDoubleComplex *d_U, cuDoubleComplex *d_V,
00507                             char jobU, char jobV,
00508                             unsigned m, unsigned n,
00509                             const cuDoubleComplex *d_A,
00510                             unsigned m_, unsigned n_,
00511                             bool is_diag, unsigned batch);
00514 
00528 
00529 AFAPI afError af_inv_S(float *out, unsigned n,
00530                             float *d_in, unsigned batch);
00532 AFAPI afError af_inv_C(cuComplex *out, unsigned n,
00533                             cuComplex *d_in, unsigned batch);
00535 AFAPI afError af_inv_D(double *out, unsigned n,
00536                             double *d_in, unsigned batch);
00538 AFAPI afError af_inv_Z(cuDoubleComplex *out, unsigned n,
00539                             cuDoubleComplex *d_in, unsigned batch);
00542 
00555 
00556 AFAPI afError af_det_S(float *res,
00557                             unsigned n, float *d_X,
00558                             bool inplace, unsigned batch);
00560 AFAPI afError af_det_C(cuComplex *res,
00561                             unsigned n, cuComplex *d_X,
00562                             bool inplace, unsigned batch);
00564 AFAPI afError af_det_D(double *res,
00565                             unsigned n, double *d_X,
00566                             bool inplace, unsigned batch);
00568 AFAPI afError af_det_Z(cuDoubleComplex *res,
00569                             unsigned n, cuDoubleComplex *d_X,
00570                             bool inplace, unsigned batch);
00573 
00588 
00589 
00590 AFAPI afError af_matrixPower_S(void **d_out,
00591                                     unsigned n, const float  *d_in,
00592                                     float power, unsigned batch, bool *is_cplx);
00594 AFAPI afError af_matrixPower_C(void **d_out,
00595                                     unsigned n, const cuComplex  *d_in,
00596                                     float power, unsigned batch, bool *is_cplx);
00598 AFAPI afError af_matrixPower_D(void **d_out,
00599                                     unsigned n, const double  *d_in,
00600                                     double power, unsigned batch, bool *is_cplx);
00602 AFAPI afError af_matrixPower_Z(void **d_out,
00603                                     unsigned n, const cuDoubleComplex  *d_in,
00604                                     double power, unsigned batch, bool *is_cplx);
00607 
00634 
00635 AFAPI afError af_linearSolve_SS(float *d_X,
00636                                      unsigned m, unsigned n,
00637                                      const float *d_A, unsigned batch_A,
00638                                      unsigned k,
00639                                      const float *d_B, unsigned batch_B,
00640                                      unsigned opts);
00642 AFAPI afError af_linearSolve_CC(cuComplex *d_X,
00643                                      unsigned m, unsigned n,
00644                                      const cuComplex *d_A,
00645                                      unsigned batch_A,
00646                                      unsigned k,
00647                                      const cuComplex *d_B,
00648                                      unsigned batch_B,
00649                                      unsigned opts);
00651 AFAPI afError af_linearSolve_DD(double *d_X,
00652                                      unsigned m, unsigned n,
00653                                      const double *d_A, unsigned batch_A,
00654                                      unsigned k,
00655                                      const double *d_B, unsigned batch_B,
00656                                      unsigned opts);
00658 AFAPI afError af_linearSolve_ZZ(cuDoubleComplex *d_X,
00659                                      unsigned m, unsigned n,
00660                                      const cuDoubleComplex *d_A,
00661                                      unsigned batch_A,
00662                                      unsigned k,
00663                                      const cuDoubleComplex *d_B,
00664                                      unsigned batch_B,
00665                                      unsigned opts);
00668 
00681 AFAPI afError af_piv_final_I(int *d_out,
00682                                   unsigned m, unsigned k, const int *d_piv,
00683                                   unsigned batch);
00684 AFAPI afError af_piv_final_U(unsigned *d_out,
00685                                   unsigned m, unsigned k, const int *d_piv,
00686                                   unsigned batch);
00687 AFAPI afError af_piv_final_S(float *d_out,
00688                                   unsigned m, unsigned k, const int *d_piv,
00689                                   unsigned batch);
00690 AFAPI afError af_piv_final_D(double *d_out,
00691                                   unsigned m, unsigned k, const int *d_piv,
00692                                   unsigned batch);
00695 #ifdef __cplusplus
00696 }
00697 #endif
00698 
00699 #endif  // __AF_DLA_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines