Vector Optimized Library of Kernels  3.0.0
Architecture-tuned implementations of math kernels

Overview

Accumulates the values in the input buffer.

Dispatcher Prototype

void volk_32fc_accumulator_s32fc(lv_32fc_t* result, const lv_32fc_t* inputBuffer,
unsigned int num_points)
float complex lv_32fc_t
Definition: volk_complex.h:74

Inputs

  • inputBuffer: The buffer of data to be accumulated
  • num_points: The number of data points.

Outputs

  • result: The accumulated result.

Example Calculate the sum of numbers 0 through 99

int N = 100;
unsigned int alignment = volk_get_alignment();
lv_32fc_t* vec = (lv_32fc_t*) volk_malloc(sizeof(lv_32fc_t)*N, alignment);
lv_32fc_t* out = (lv_32fc_t*) volk_malloc(sizeof(lv_32fc_t), alignment);
for(unsigned int ii = 0; ii < N; ++ii){
vec[ii] = lv_cmake( (float) ii, (float) -ii );
}
volk_32fc_accumulator_s32fc(out, vec, N);
printf("sum(0..99)+1j*sum(0..-99) = %1.2f %1.2f \n", lv_creal(*out) , lv_cimag(*out)
);
volk_free(vec);
volk_free(out);
size_t volk_get_alignment(void)
Get the machine alignment in bytes.
Definition: volk.tmpl.c:90
#define lv_cimag(x)
Definition: volk_complex.h:98
#define lv_cmake(r, i)
Definition: volk_complex.h:77
#define lv_creal(x)
Definition: volk_complex.h:96
__VOLK_DECL_BEGIN VOLK_API void * volk_malloc(size_t size, size_t alignment)
Allocate size bytes of data aligned to alignment.
Definition: volk_malloc.c:38
VOLK_API void volk_free(void *aptr)
Free's memory allocated by volk_malloc.
Definition: volk_malloc.c:80