Changeset 44e9eeb5 for src


Ignore:
Timestamp:
Sep 5, 2015, 9:14:47 PM (9 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
b8c50c3
Parents:
f45dd12
Message:

src/fvec.c: move alias to aubio_priv.h, add cblas copy

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/aubio_priv.h

    rf45dd12 r44e9eeb5  
    6363#ifdef HAVE_LIMITS_H
    6464#include <limits.h> // for CHAR_BIT, in C99 standard
     65#endif
     66
     67#ifdef HAVE_ACCELERATE
     68#define HAVE_ATLAS 1
     69#include <Accelerate/Accelerate.h>
     70#elif HAVE_ATLAS_CBLAS_H
     71#define HAVE_ATLAS 1
     72#include <atlas/cblas.h>
     73#else
     74#undef HAVE_ATLAS
     75#endif
     76
     77#ifdef HAVE_ACCELERATE
     78#include <Accelerate/Accelerate.h>
     79#define aubio_vDSP_mmov       vDSP_mmov
     80#define aubio_vDSP_vmul       vDSP_vmul
     81#define aubio_vDSP_vfill      vDSP_vfill
     82#else /* HAVE_AUBIO_DOUBLE */
     83#define aubio_vDSP_mmov       vDSP_mmovD
     84#define aubio_vDSP_vmul       vDSP_vmulD
     85#define aubio_vDSP_vfill      vDSP_vfillD
     86#endif /* HAVE_AUBIO_DOUBLE */
     87#endif
     88
     89#ifdef HAVE_ATLAS
     90#if !HAVE_AUBIO_DOUBLE
     91#define aubio_catlas_set      catlas_sset
     92#define aubio_cblas_copy      cblas_scopy
     93#else /* HAVE_AUBIO_DOUBLE */
     94#define aubio_catlas_set      catlas_dset
     95#define aubio_cblas_copy      cblas_dcopy
     96#endif /* HAVE_AUBIO_DOUBLE */
     97
     98#if !defined(HAVE_MEMCPY_HACKS) && !defined(HAVE_ACCELERATE) && !defined(HAVE_ATLAS)
     99#define HAVE_NOOPT 1
     100#else
     101#undef HAVE_NOOPT
    65102#endif
    66103
  • src/fvec.c

    rf45dd12 r44e9eeb5  
    2121#include "aubio_priv.h"
    2222#include "fvec.h"
    23 
    24 #ifdef HAVE_ACCELERATE
    25 #include <Accelerate/Accelerate.h>
    26 #if !HAVE_AUBIO_DOUBLE
    27 #define aubio_vDSP_mmov       vDSP_mmov
    28 #define aubio_vDSP_vmul       vDSP_vmul
    29 #define aubio_vDSP_vfill      vDSP_vfill
    30 #else /* HAVE_AUBIO_DOUBLE */
    31 #define aubio_vDSP_mmov       vDSP_mmovD
    32 #define aubio_vDSP_vmul       vDSP_vmulD
    33 #define aubio_vDSP_vfill      vDSP_vfillD
    34 #endif /* HAVE_AUBIO_DOUBLE */
    35 #endif
    3623
    3724fvec_t * new_fvec( uint_t length) {
     
    7461
    7562void fvec_set_all (fvec_t *s, smpl_t val) {
    76 #ifndef HAVE_ACCELERATE
     63#if !defined(HAVE_ACCELERATE) && !defined(HAVE_ATLAS)
    7764  uint_t j;
    7865  for (j=0; j< s->length; j++) {
    7966    s->data[j] = val;
    8067  }
    81 #else
     68#elif defined(HAVE_ATLAS)
     69  aubio_catlas_set(s->length, val, s->data, 1);
     70#elif defined(HAVE_ACCELERATE)
    8271  aubio_vDSP_vfill(&val, s->data, 1, s->length);
    8372#endif
     
    125114    return;
    126115  }
    127 #if !defined(HAVE_MEMCPY_HACKS) && !defined(HAVE_ACCELERATE)
     116#if HAVE_NOOPT
    128117  uint_t j;
    129118  for (j=0; j< t->length; j++) {
    130119    t->data[j] = s->data[j];
    131120  }
    132 #else
    133 #if defined(HAVE_MEMCPY_HACKS)
     121#elif defined(HAVE_MEMCPY_HACKS)
    134122  memcpy(t->data, s->data, t->length * sizeof(smpl_t));
    135 #else
     123#elif defined(HAVE_ATLAS)
     124  aubio_cblas_copy(s->length, s->data, 1, t->data, 1);
     125#elif defined(HAVE_ACCELERATE)
    136126  aubio_vDSP_mmov(s->data, t->data, 1, s->length, 1, 1);
    137127#endif
    138 #endif
    139128}
Note: See TracChangeset for help on using the changeset viewer.