Changeset 4b943729 for src


Ignore:
Timestamp:
Oct 1, 2017, 3:30:10 PM (2 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master
Children:
0ad2e17
Parents:
95f5c83
Message:

src/aubio_priv.h: define ipp aliases for single/double precision, use them in cvec and fvec

Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/aubio_priv.h

    r95f5c83 r4b943729  
    128128#include <ippvm.h>
    129129#include <ipps.h>
     130#ifndef HAVE_AUBIO_DOUBLE
     131#define aubio_ippsSet         ippsSet_32f
     132#define aubio_ippsZero        ippsZero_32f
     133#define aubio_ippsCopy        ippsCopy_32f
     134#define aubio_ippsMul         ippsMul_32f
     135#define aubio_ippsMulC        ippsMulC_32f
     136#define aubio_ippsAddC        ippsAddC_32f
     137#define aubio_ippsLn          ippsLn_32f_A21
     138#define aubio_ippsMean        ippsMean_32f
     139#define aubio_ippsSum         ippsSum_32f
     140#define aubio_ippsMax         ippsMax_32f
     141#define aubio_ippsMin         ippsMin_32f
     142#else /* HAVE_AUBIO_DOUBLE */
     143#define aubio_ippsSet         ippsSet_64f
     144#define aubio_ippsZero        ippsZero_64f
     145#define aubio_ippsCopy        ippsCopy_64f
     146#define aubio_ippsMul         ippsMul_64f
     147#define aubio_ippsMulC        ippsMulC_64f
     148#define aubio_ippsAddC        ippsAddC_64f
     149#define aubio_ippsLn          ippsLn_64f_A26
     150#define aubio_ippsMean        ippsMean_64f
     151#define aubio_ippsSum         ippsSum_64f
     152#define aubio_ippsMax         ippsMax_64f
     153#define aubio_ippsMin         ippsMin_64f
     154#endif /* HAVE_AUBIO_DOUBLE */
    130155#endif
    131156
  • src/cvec.c

    r95f5c83 r4b943729  
    8787  }
    8888#if defined(HAVE_INTEL_IPP)
    89   #if HAVE_AUBIO_DOUBLE
    90     ippsCopy_64f(s->phas, t->phas, (int)s->length);
    91     ippsCopy_64f(s->norm, t->norm, (int)s->length);
    92   #else
    93     ippsCopy_32f(s->phas, t->phas, (int)s->length);
    94     ippsCopy_32f(s->norm, t->norm, (int)s->length);
    95   #endif
     89  aubio_ippsCopy(s->phas, t->phas, (int)s->length);
     90  aubio_ippsCopy(s->norm, t->norm, (int)s->length);
    9691#elif defined(HAVE_MEMCPY_HACKS)
    9792  memcpy(t->norm, s->norm, t->length * sizeof(smpl_t));
     
    108103void cvec_norm_set_all(cvec_t *s, smpl_t val) {
    109104#if defined(HAVE_INTEL_IPP)
    110   #if HAVE_AUBIO_DOUBLE
    111     ippsSet_64f(val, s->norm, (int)s->length);
    112   #else
    113     ippsSet_32f(val, s->norm, (int)s->length);
    114   #endif
     105  aubio_ippsSet(val, s->norm, (int)s->length);
    115106#else
    116107  uint_t j;
     
    123114void cvec_norm_zeros(cvec_t *s) {
    124115#if defined(HAVE_INTEL_IPP)
    125   #if HAVE_AUBIO_DOUBLE
    126     ippsZero_64f(s->norm, (int)s->length);
    127   #else
    128     ippsZero_32f(s->norm, (int)s->length);
    129   #endif
     116  aubio_ippsZero(s->norm, (int)s->length);
    130117#elif defined(HAVE_MEMCPY_HACKS)
    131118  memset(s->norm, 0, s->length * sizeof(smpl_t));
     
    141128void cvec_phas_set_all (cvec_t *s, smpl_t val) {
    142129#if defined(HAVE_INTEL_IPP)
    143   #if HAVE_AUBIO_DOUBLE
    144     ippsSet_64f(val, s->phas, (int)s->length);
    145   #else
    146     ippsSet_32f(val, s->phas, (int)s->length);
    147   #endif
     130  aubio_ippsSet(val, s->phas, (int)s->length);
    148131#else
    149132  uint_t j;
     
    156139void cvec_phas_zeros(cvec_t *s) {
    157140#if defined(HAVE_INTEL_IPP)
    158   #if HAVE_AUBIO_DOUBLE
    159     ippsZero_64f(s->phas, (int)s->length);
    160   #else
    161     ippsZero_32f(s->phas, (int)s->length);
    162   #endif
     141  aubio_ippsZero(s->phas, (int)s->length);
    163142#elif defined(HAVE_MEMCPY_HACKS)
    164143  memset(s->phas, 0, s->length * sizeof(smpl_t));
     
    179158void cvec_logmag(cvec_t *s, smpl_t lambda) {
    180159  #if defined(HAVE_INTEL_IPP)
    181     #if HAVE_AUBIO_DOUBLE
    182       ippsMulC_64f(s->norm, lambda, s->norm, (int)s->length);
    183       ippsAddC_64f(s->norm, 1.0, s->norm, (int)s->length);
    184       ippsLn_64f_A26(s->norm, s->norm, (int)s->length);
    185     #else
    186       ippsMulC_32f(s->norm, lambda, s->norm, (int)s->length);
    187       ippsAddC_32f(s->norm, 1.0, s->norm, (int)s->length);
    188       ippsLn_32f_A21(s->norm, s->norm, (int)s->length);
    189     #endif
     160    aubio_ippsMulC(s->norm, lambda, s->norm, (int)s->length);
     161    aubio_ippsAddC(s->norm, 1.0, s->norm, (int)s->length);
     162    aubio_ippsLn(s->norm, s->norm, (int)s->length);
    190163  #else
    191164    uint_t j;
  • src/fvec.c

    r95f5c83 r4b943729  
    6262void fvec_set_all (fvec_t *s, smpl_t val) {
    6363#if defined(HAVE_INTEL_IPP)
    64   #if HAVE_AUBIO_DOUBLE
    65     ippsSet_64f(val, s->data, (int)s->length);
    66   #else
    67     ippsSet_32f(val, s->data, (int)s->length);
    68   #endif
     64  aubio_ippsSet(val, s->data, (int)s->length);
    6965#elif defined(HAVE_ATLAS)
    7066  aubio_catlas_set(s->length, val, s->data, 1);
     
    8278void fvec_zeros(fvec_t *s) {
    8379#if defined(HAVE_INTEL_IPP)
    84   #if HAVE_AUBIO_DOUBLE
    85     ippsZero_64f(s->data, (int)s->length);
    86   #else
    87     ippsZero_32f(s->data, (int)s->length);
    88   #endif
     80  aubio_ippsZero(s->data, (int)s->length);
    8981#elif defined(HAVE_ACCELERATE)
    9082  aubio_vDSP_vclr(s->data, 1, s->length);
     
    110102  uint_t length = MIN(s->length, weight->length);
    111103#if defined(HAVE_INTEL_IPP)
    112   #if HAVE_AUBIO_DOUBLE
    113     ippsMul_64f(s->data, weight->data, s->data, (int)length);
    114   #else
    115     ippsMul_32f(s->data, weight->data, s->data, (int)length);
    116   #endif
     104  aubio_ippsMul(s->data, weight->data, s->data, (int)length);
    117105#elif defined(HAVE_ACCELERATE)
    118106  aubio_vDSP_vmul( s->data, 1, weight->data, 1, s->data, 1, length );
     
    128116  uint_t length = MIN(in->length, MIN(out->length, weight->length));
    129117#if defined(HAVE_INTEL_IPP)
    130   #if HAVE_AUBIO_DOUBLE
    131     ippsMul_64f(in->data, weight->data, out->data, (int)length);
    132   #else
    133     ippsMul_32f(in->data, weight->data, out->data, (int)length);
    134   #endif
     118  aubio_ippsMul(in->data, weight->data, out->data, (int)length);
    135119#elif defined(HAVE_ACCELERATE)
    136120  aubio_vDSP_vmul(in->data, 1, weight->data, 1, out->data, 1, length);
     
    150134  }
    151135#if defined(HAVE_INTEL_IPP)
    152   #if HAVE_AUBIO_DOUBLE
    153     ippsCopy_64f(s->data, t->data, (int)s->length);
    154   #else
    155     ippsCopy_32f(s->data, t->data, (int)s->length);
    156   #endif
     136  aubio_ippsCopy(s->data, t->data, (int)s->length);
    157137#elif defined(HAVE_ATLAS)
    158138  aubio_cblas_copy(s->length, s->data, 1, t->data, 1);
  • src/mathutils.c

    r95f5c83 r4b943729  
    161161  smpl_t tmp = 0.0;
    162162#if defined(HAVE_INTEL_IPP)
    163   #if HAVE_AUBIO_DOUBLE
    164     ippsMean_64f(s->data, (int)s->length, &tmp);
    165   #else
    166     ippsMean_32f(s->data, (int)s->length, &tmp, ippAlgHintFast);
    167   #endif
    168     return tmp;
     163  aubio_ippsMean(s->data, (int)s->length, &tmp, ippAlgHintFast);
     164  return tmp;
    169165#elif defined(HAVE_ACCELERATE)
    170166  aubio_vDSP_meanv(s->data, 1, &tmp, s->length);
     
    184180  smpl_t tmp = 0.0;
    185181#if defined(HAVE_INTEL_IPP)
    186   #if HAVE_AUBIO_DOUBLE
    187     ippsSum_64f(s->data, (int)s->length, &tmp);
    188   #else
    189     ippsSum_32f(s->data, (int)s->length, &tmp, ippAlgHintFast);
    190   #endif
     182  aubio_ippsSum(s->data, (int)s->length, &tmp, ippAlgHintFast);
    191183#elif defined(HAVE_ACCELERATE)
    192184  aubio_vDSP_sve(s->data, 1, &tmp, s->length);
     
    205197#if defined(HAVE_INTEL_IPP)
    206198  smpl_t tmp = 0.;
    207   #if HAVE_AUBIO_DOUBLE
    208     ippsMax_64f( s->data, (int)s->length, &tmp);
    209   #else
    210     ippsMax_32f( s->data, (int)s->length, &tmp);
    211 #endif
     199  aubio_ippsMax( s->data, (int)s->length, &tmp);
    212200#elif defined(HAVE_ACCELERATE)
    213201  smpl_t tmp = 0.;
     
    228216#if defined(HAVE_INTEL_IPP)
    229217  smpl_t tmp = 0.;
    230   #if HAVE_AUBIO_DOUBLE
    231     ippsMin_64f(s->data, (int)s->length, &tmp);
    232   #else
    233     ippsMin_32f(s->data, (int)s->length, &tmp);
    234 #endif
     218  aubio_ippsMin(s->data, (int)s->length, &tmp);
    235219#elif defined(HAVE_ACCELERATE)
    236220  smpl_t tmp = 0.;
Note: See TracChangeset for help on using the changeset viewer.