Loading...
Searching...
No Matches
volk_32f_accumulator_s32f

Overview

Accumulates the values in the input buffer.

Dispatcher Prototype

void volk_32f_accumulator_s32f(float* result, const float* inputBuffer, unsigned int
num_points)

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();
float* increasing = (float*)volk_malloc(sizeof(float)*N, alignment);
float* out = (float*)volk_malloc(sizeof(float), alignment);
for(unsigned int ii = 0; ii < N; ++ii){
increasing[ii] = (float)ii;
}
volk_32f_accumulator_s32f(out, increasing, N);
printf("sum(1..100) = %1.2f\n", out[0]);
volk_free(increasing);
volk_free(out);