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

math.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 
00009 #pragma once
00010 
00011 #include <cuComplex.h>
00012 #include "defines.h"
00013 
00014 namespace af {
00015 
00016 class array;
00017 
00020 
00027 AFAPI array diff1(const array& in, int dim=-1);
00028 
00035 AFAPI array diff2(const array& in, int dim=-1);
00036 
00043 AFAPI void grad(array& dx, array& dy, const array& in);
00044 
00045 // grad_mat
00047 } // namespace af
00048 
00049 #ifdef __cplusplus
00050 extern "C" {
00051 #endif
00052 
00068 
00069 AFAPI afError af_diff_S(float *d_out,
00070                              unsigned ndims_in , const unsigned *dims_in ,
00071                              const float *d_in,
00072                              int order, int dim);
00074 AFAPI afError af_diff_D(double *d_out,
00075                              unsigned ndims_in , const unsigned *dims_in ,
00076                              const double *d_in,
00077                              int order, int dim);
00078 
00081 
00096 
00097 AFAPI afError af_grad_B(bool *d_dx, bool *d_dy,
00098                              unsigned nx, unsigned ny, const bool *d_in,
00099                              unsigned batch);
00101 AFAPI afError af_grad_U(unsigned *d_dx, unsigned *d_dy,
00102                              unsigned nx, unsigned ny, const unsigned *d_in,
00103                              unsigned batch);
00105 AFAPI afError af_grad_I(int *d_dx, int *d_dy,
00106                              unsigned nx, unsigned ny, const int *d_in,
00107                              unsigned batch);
00109 AFAPI afError af_grad_S(float *d_dx, float *d_dy,
00110                              unsigned nx, unsigned ny, const float *d_in,
00111                              unsigned batch);
00113 AFAPI afError af_grad_D(double *d_dx, double *d_dy,
00114                              unsigned nx, unsigned ny, const double *d_in,
00115                              unsigned batch);
00118 
00119 // CROSS PRODUCT
00120 
00135 AFAPI afError af_crossProd_SS(float *d_C,
00136                                    unsigned numel, unsigned offset,
00137                                    const float *d_A, unsigned batch_A,
00138                                    const float *d_B, unsigned batch_B);
00139 
00141 AFAPI afError af_crossProd_SC(cuComplex *d_C,
00142                                    unsigned numel, unsigned offset,
00143                                    const float *d_A, unsigned batch_A,
00144                                    const cuComplex *d_B,
00145                                    unsigned batch_B);
00146 
00148 AFAPI afError af_crossProd_CS(cuComplex *d_C,
00149                                    unsigned numel, unsigned offset,
00150                                    const cuComplex *d_A,unsigned batch_A,
00151                                    const float *d_B, unsigned batch_B);
00152 
00154 AFAPI afError af_crossProd_CC(cuComplex *d_C,
00155                                    unsigned numel, unsigned offset,
00156                                    const cuComplex *d_A,unsigned batch_A,
00157                                    const cuComplex *d_B,
00158                                    unsigned batch_B);
00159 
00161 AFAPI afError af_crossProd_SD(float *d_C,
00162                                    unsigned numel, unsigned offset,
00163                                    const float *d_A, unsigned batch_A,
00164                                    const double *d_B, unsigned batch_B);
00165 
00167 AFAPI afError af_crossProd_SZ(cuComplex *d_C,
00168                                    unsigned numel, unsigned offset,
00169                                    const float *d_A, unsigned batch_A,
00170                                    const cuDoubleComplex *d_B,
00171                                    unsigned batch_B);
00172 
00174 AFAPI afError af_crossProd_CD(cuComplex *d_C,
00175                                    unsigned numel, unsigned offset,
00176                                    const cuComplex *d_A,
00177                                    unsigned batch_A,
00178                                    const double *d_B, unsigned batch_B);
00179 
00181 AFAPI afError af_crossProd_CZ(cuComplex *d_C,
00182                                    unsigned numel, unsigned offset,
00183                                    const cuComplex *d_A,
00184                                    unsigned batch_A,
00185                                    const cuDoubleComplex *d_B,
00186                                    unsigned batch_B);
00187 
00189 AFAPI afError af_crossProd_DS(float *d_C,
00190                                    unsigned numel, unsigned offset,
00191                                    const double *d_A, unsigned batch_A,
00192                                    const float *d_B, unsigned batch_B);
00193 
00195 AFAPI afError af_crossProd_DC(cuComplex *d_C,
00196                                    unsigned numel, unsigned offset,
00197                                    const double *d_A, unsigned batch_A,
00198                                    const cuComplex *d_B,
00199                                    unsigned batch_B);
00200 
00202 AFAPI afError af_crossProd_ZS(cuComplex *d_C,
00203                                    unsigned numel, unsigned offset,
00204                                    const cuDoubleComplex *d_A,
00205                                    unsigned batch_A,
00206                                    const float *d_B, unsigned batch_B);
00207 
00209 AFAPI afError af_crossProd_ZC(cuComplex *d_C,
00210                                    unsigned numel, unsigned offset,
00211                                    const cuDoubleComplex *d_A,
00212                                    unsigned batch_A,
00213                                    const cuComplex *d_B,
00214                                    unsigned batch_B);
00215 
00217 AFAPI afError af_crossProd_DD(double *d_C,
00218                                    unsigned numel, unsigned offset,
00219                                    const double *d_A, unsigned batch_A,
00220                                    const double *d_B, unsigned batch_B);
00221 
00223 AFAPI afError af_crossProd_DZ(cuDoubleComplex *d_C,
00224                                    unsigned numel, unsigned offset,
00225                                    const double *d_A, unsigned batch_A,
00226                                    const cuDoubleComplex *d_B,
00227                                    unsigned batch_B);
00228 
00230 AFAPI afError af_crossProd_ZD(cuDoubleComplex *d_C,
00231                                    unsigned numel, unsigned offset,
00232                                    const cuDoubleComplex *d_A,
00233                                    unsigned batch_A,
00234                                    const double *d_B, unsigned batch_B);
00235 
00237 AFAPI afError af_crossProd_ZZ(cuDoubleComplex *d_C,
00238                                    unsigned numel, unsigned offset,
00239                                    const cuDoubleComplex *d_A,
00240                                    unsigned batch_A,
00241                                    const cuDoubleComplex *d_B,
00242                                    unsigned batch_B);
00247 // OUTER product
00265 AFAPI afError af_kronProd_SS(float *d_C,
00266                                   unsigned mA, unsigned nA,
00267                                   const float *d_A, unsigned batch_A,
00268                                   unsigned mB, unsigned nB,
00269                                   const float *d_B, unsigned batch_B);
00270 
00272 AFAPI afError af_kronProd_SC(cuComplex *d_C,
00273                                   unsigned mA, unsigned nA,
00274                                   const float *d_A, unsigned batch_A,
00275                                   unsigned mB, unsigned nB,
00276                                   const cuComplex *d_B,
00277                                   unsigned batch_B);
00278 
00280 AFAPI afError af_kronProd_CS(cuComplex *d_C,
00281                                   unsigned mA, unsigned nA,
00282                                   const cuComplex *d_A, unsigned batch_A,
00283                                   unsigned mB, unsigned nB,
00284                                   const float *d_B, unsigned batch_B);
00285 
00287 AFAPI afError af_kronProd_CC(cuComplex *d_C,
00288                                   unsigned mA, unsigned nA,
00289                                   const cuComplex *d_A, unsigned batch_A,
00290                                   unsigned mB, unsigned nB,
00291                                   const cuComplex *d_B,
00292                                   unsigned batch_B);
00293 
00295 AFAPI afError af_kronProd_SD(float *d_C,
00296                                   unsigned mA, unsigned nA,
00297                                   const float *d_A,  unsigned batch_A,
00298                                   unsigned mB, unsigned nB,
00299                                   const double *d_B, unsigned batch_B);
00300 
00302 AFAPI afError af_kronProd_SZ(cuComplex *d_C,
00303                                   unsigned mA, unsigned nA,
00304                                   const float *d_A, unsigned batch_A,
00305                                   unsigned mB, unsigned nB,
00306                                   const cuDoubleComplex *d_B,
00307                                   unsigned batch_B);
00308 
00310 AFAPI afError af_kronProd_CD(cuComplex *d_C,
00311                                   unsigned mA, unsigned nA,
00312                                   const cuComplex *d_A,
00313                                   unsigned batch_A,
00314                                   unsigned mB, unsigned nB,
00315                                   const double *d_B,
00316                                   unsigned batch_B);
00317 
00319 AFAPI afError af_kronProd_CZ(cuComplex *d_C,
00320                                   unsigned mA, unsigned nA,
00321                                   const cuComplex *d_A,
00322                                   unsigned batch_A,
00323                                   unsigned mB, unsigned nB,
00324                                   const cuDoubleComplex *d_B,
00325                                   unsigned batch_B);
00326 
00328 AFAPI afError af_kronProd_DS(float *d_C,
00329                                   unsigned mA, unsigned nA,
00330                                   const double *d_A, unsigned batch_A,
00331                                   unsigned mB, unsigned nB,
00332                                   const float *d_B,  unsigned batch_B);
00333 
00335 AFAPI afError af_kronProd_DC(cuComplex *d_C,
00336                                   unsigned mA, unsigned nA,
00337                                   const double *d_A, unsigned batch_A,
00338                                   unsigned mB, unsigned nB,
00339                                   const cuComplex *d_B,
00340                                   unsigned batch_B);
00341 
00343 AFAPI afError af_kronProd_ZS(cuComplex *d_C,
00344                                   unsigned mA, unsigned nA,
00345                                   const cuDoubleComplex *d_A,
00346                                   unsigned batch_A,
00347                                   unsigned mB, unsigned nB,
00348                                   const float *d_B, unsigned batch_B);
00349 
00351 AFAPI afError af_kronProd_ZC(cuComplex *d_C,
00352                                   unsigned mA, unsigned nA,
00353                                   const cuDoubleComplex *d_A,
00354                                   unsigned batch_A,
00355                                   unsigned mB, unsigned nB,
00356                                   const cuComplex *d_B,
00357                                   unsigned batch_B);
00358 
00360 AFAPI afError af_kronProd_DD(double *d_C,
00361                                   unsigned mA, unsigned nA,
00362                                   const double *d_A, unsigned batch_A,
00363                                   unsigned mB, unsigned nB,
00364                                   const double *d_B, unsigned batch_B);
00365 
00367 AFAPI afError af_kronProd_DZ(cuDoubleComplex *d_C,
00368                                   unsigned mA, unsigned nA,
00369                                   const double *d_A, unsigned batch_A,
00370                                   unsigned mB, unsigned nB,
00371                                   const cuDoubleComplex *d_B,
00372                                   unsigned batch_B);
00373 
00375 AFAPI afError af_kronProd_ZD(cuDoubleComplex *d_C,
00376                                   unsigned mA, unsigned nA,
00377                                   const cuDoubleComplex *d_A,
00378                                   unsigned batch_A,
00379                                   unsigned mB, unsigned nB,
00380                                   const double *d_B, unsigned batch_B);
00381 
00383 AFAPI afError af_kronProd_ZZ(cuDoubleComplex *d_C,
00384                                   unsigned mA, unsigned nA,
00385                                   const cuDoubleComplex *d_A,
00386                                   unsigned batch_A,
00387                                   unsigned mB, unsigned nB,
00388                                   const cuDoubleComplex *d_B,
00389                                   unsigned batch_B);
00393 // besselh
00394     // k = {1,2}
00395     // nu = [-50 .. 50]
00396 AFAPI afError af_besselh_S(float *d_out, unsigned k, unsigned n, const float *d_in, float nu);
00397 AFAPI afError af_besselh_C(float *d_out, unsigned k, unsigned n, const float *d_in, float nu);
00398 AFAPI afError af_besselh_D(double *d_out, unsigned k, unsigned n, const double *d_in, double nu);
00399 AFAPI afError af_besselh_Z(double *d_out, unsigned k, unsigned n, const double *d_in, double nu);
00400 
00401 // besseli
00402 AFAPI afError af_besseli_S(float *d_out, unsigned n, const float *d_in, float nu);
00403 AFAPI afError af_besseli_C(float *d_out, unsigned n, const float *d_in, float nu);
00404 AFAPI afError af_besseli_D(double *d_out, unsigned n, const double *d_in, double nu);
00405 AFAPI afError af_besseli_Z(double *d_out, unsigned n, const double *d_in, double nu);
00406 
00407 // besselj
00408 AFAPI afError af_besselj_S(float *d_out, unsigned n, const float *d_in, float nu);
00409 AFAPI afError af_besselj_C(cuComplex *d_out, unsigned n, const cuComplex *d_in, float nu);
00410 AFAPI afError af_besselj_D(double *d_out, unsigned n, const double *d_in, double nu);
00411 AFAPI afError af_besselj_Z(cuDoubleComplex *d_out, unsigned n, const cuDoubleComplex *d_in, double nu);
00412 
00413 // besselk
00414 AFAPI afError af_besselk_S(float *d_out, unsigned n, const float *d_in, float nu);
00415 AFAPI afError af_besselk_C(float *d_out, unsigned n, const float *d_in, float nu);
00416 AFAPI afError af_besselk_D(double *d_out, unsigned n, const double *d_in, double nu);
00417 AFAPI afError af_besselk_Z(double *d_out, unsigned n, const double *d_in, double nu);
00418 
00419 // bessely
00420 AFAPI afError af_bessely_S(float *d_out, unsigned n, const float *d_in, float nu);
00421 AFAPI afError af_bessely_C(float *d_out, unsigned n, const float *d_in, float nu);
00422 AFAPI afError af_bessely_D(double *d_out, unsigned n, const double *d_in, double nu);
00423 AFAPI afError af_bessely_Z(double *d_out, unsigned n, const double *d_in, double nu);
00424 
00425 #ifdef __cplusplus
00426 }
00427 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines