Changeset 4aa18e3 for src


Ignore:
Timestamp:
Sep 6, 2015, 9:45:22 AM (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:
50961b9
Parents:
c59e693 (diff), b8c50c3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'develop' into accelerate

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/aubio_priv.h

    rc59e693 r4aa18e3  
    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#if !HAVE_AUBIO_DOUBLE
     80#define aubio_vDSP_mmov       vDSP_mmov
     81#define aubio_vDSP_vmul       vDSP_vmul
     82#define aubio_vDSP_vfill      vDSP_vfill
     83#else /* HAVE_AUBIO_DOUBLE */
     84#define aubio_vDSP_mmov       vDSP_mmovD
     85#define aubio_vDSP_vmul       vDSP_vmulD
     86#define aubio_vDSP_vfill      vDSP_vfillD
     87#endif /* HAVE_AUBIO_DOUBLE */
     88#endif /* HAVE_ACCELERATE */
     89
     90#ifdef HAVE_ATLAS
     91#if !HAVE_AUBIO_DOUBLE
     92#define aubio_catlas_set      catlas_sset
     93#define aubio_cblas_copy      cblas_scopy
     94#else /* HAVE_AUBIO_DOUBLE */
     95#define aubio_catlas_set      catlas_dset
     96#define aubio_cblas_copy      cblas_dcopy
     97#endif /* HAVE_AUBIO_DOUBLE */
     98#endif /* HAVE_ATLAS */
     99
     100#if !defined(HAVE_MEMCPY_HACKS) && !defined(HAVE_ACCELERATE) && !defined(HAVE_ATLAS)
     101#define HAVE_NOOPT 1
     102#else
     103#undef HAVE_NOOPT
    65104#endif
    66105
  • src/fvec.c

    rc59e693 r4aa18e3  
    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 #define aubio_catlas_set      catlas_sset
    31 #else /* HAVE_AUBIO_DOUBLE */
    32 #define aubio_vDSP_mmov       vDSP_mmovD
    33 #define aubio_vDSP_vmul       vDSP_vmulD
    34 #define aubio_vDSP_vfill      vDSP_vfillD
    35 #define aubio_catlas_set      catlas_dset
    36 #endif /* HAVE_AUBIO_DOUBLE */
    37 #endif
    3823
    3924fvec_t * new_fvec( uint_t length) {
     
    7661
    7762void fvec_set_all (fvec_t *s, smpl_t val) {
    78 #ifndef HAVE_ACCELERATE
     63#if !defined(HAVE_ACCELERATE) && !defined(HAVE_ATLAS)
    7964  uint_t j;
    8065  for (j=0; j< s->length; j++) {
    8166    s->data[j] = val;
    8267  }
    83 #else
    84   //aubio_catlas_set(s->length, val, s->data, 1);
     68#elif defined(HAVE_ATLAS)
     69  aubio_catlas_set(s->length, val, s->data, 1);
     70#elif defined(HAVE_ACCELERATE)
    8571  aubio_vDSP_vfill(&val, s->data, 1, s->length);
    8672#endif
     
    140126    return;
    141127  }
    142 #if !defined(HAVE_MEMCPY_HACKS) && !defined(HAVE_ACCELERATE)
     128#if HAVE_NOOPT
    143129  uint_t j;
    144130  for (j=0; j< t->length; j++) {
    145131    t->data[j] = s->data[j];
    146132  }
    147 #else
    148 #if defined(HAVE_MEMCPY_HACKS)
     133#elif defined(HAVE_MEMCPY_HACKS)
    149134  memcpy(t->data, s->data, t->length * sizeof(smpl_t));
    150 #else
     135#elif defined(HAVE_ATLAS)
     136  aubio_cblas_copy(s->length, s->data, 1, t->data, 1);
     137#elif defined(HAVE_ACCELERATE)
    151138  aubio_vDSP_mmov(s->data, t->data, 1, s->length, 1, 1);
    152139#endif
    153 #endif
    154140}
Note: See TracChangeset for help on using the changeset viewer.