MCPcopy Create free account
hub / github.com/BoevaLab/FREEC / vadd

Method vadd

src/ap.cpp:520–545  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

518}
519
520void ap::vadd(double *vdst, int stride_dst, const double *vsrc, int stride_src, int n)
521{
522 int i;
523 if( stride_dst!=1 || stride_src!=1 )
524 {
525 //
526 // general unoptimized case
527 //
528 for(i=0; i<n; i++, vdst+=stride_dst, vsrc+=stride_src)
529 *vdst += *vsrc;
530 }
531 else
532 {
533 //
534 // highly optimized case
535 //
536 int n2 = n/2;
537 for(i=0; i<n2; i++, vdst+=2, vsrc+=2)
538 {
539 vdst[0] += vsrc[0];
540 vdst[1] += vsrc[1];
541 }
542 if( n%2!=0 )
543 vdst[0] += vsrc[0];
544 }
545}
546
547void ap::vadd(ap::complex *vdst, int stride_dst, const ap::complex *vsrc, int stride_src, const char *conj_src, int n)
548{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected