Changeset 44e9eeb5 for src/fvec.c


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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.