Changeset 70afae1 for src


Ignore:
Timestamp:
Dec 29, 2021, 5:51:47 PM (3 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/cnn, feature/crepe
Children:
1f13e29
Parents:
3fa8d95
git-author:
Paul Brossier <piem@piem.org> (01/07/19 22:55:27)
git-committer:
Paul Brossier <piem@piem.org> (12/29/21 17:51:47)
Message:

[fmat] use gemv in fmat_vecmul

This is possible since we use contiguous memory from 1fcd3928f.

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/aubio_priv.h

    r3fa8d95 r70afae1  
    134134#define aubio_cblas_swap      cblas_sswap
    135135#define aubio_cblas_dot       cblas_sdot
     136#define aubio_cblas__gemv     cblas_sgemv
    136137#else /* HAVE_AUBIO_DOUBLE */
    137138#ifdef HAVE_ATLAS
     
    141142#define aubio_cblas_swap      cblas_dswap
    142143#define aubio_cblas_dot       cblas_ddot
     144#define aubio_cblas__gemv     cblas_dgemv
    143145#endif /* HAVE_AUBIO_DOUBLE */
    144146#endif /* HAVE_BLAS */
  • src/fmat.c

    r3fa8d95 r70afae1  
    154154
    155155void fmat_vecmul(const fmat_t *s, const fvec_t *scale, fvec_t *output) {
    156   uint_t k;
    157 #if 0
    158   assert(s->height == output->length);
    159   assert(s->length == scale->length);
    160 #endif
    161156#if !defined(HAVE_ACCELERATE) && !defined(HAVE_BLAS)
    162   uint_t j;
     157  uint_t j, k;
     158  AUBIO_ASSERT(s->height == output->length);
     159  AUBIO_ASSERT(s->length == scale->length);
    163160  fvec_zeros(output);
    164161  for (j = 0; j < s->length; j++) {
    165162    for (k = 0; k < s->height; k++) {
    166       output->data[k] += scale->data[j]
    167           * s->data[k][j];
     163      output->data[k] += scale->data[j] * s->data[k][j];
    168164    }
    169165  }
    170166#elif defined(HAVE_BLAS)
     167#if 0
    171168  for (k = 0; k < s->height; k++) {
    172169    output->data[k] = aubio_cblas_dot( s->length, scale->data, 1, s->data[k], 1);
    173170  }
     171#else
     172  aubio_cblas__gemv(CblasColMajor, CblasTrans,
     173      s->length, s->height, 1.,
     174      s->data[0], s->length,
     175      scale->data, 1, 0.,
     176      output->data, 1);
     177#endif
    174178#elif defined(HAVE_ACCELERATE)
    175179#if 0
     
    177181  vDSP_mmul (s->data[0], 1, scale->data, 1, output->data, 1, s->height, 1, s->length);
    178182#else
     183  uint_t k;
    179184  for (k = 0; k < s->height; k++) {
    180185    aubio_vDSP_dotpr( scale->data, 1, s->data[k], 1, &(output->data[k]), s->length);
     
    182187#endif
    183188#endif
     189  }
     190#endif
     191#endif
    184192}
Note: See TracChangeset for help on using the changeset viewer.